From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1177204AbdDYJFB (ORCPT ); Tue, 25 Apr 2017 05:05:01 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32806 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1177102AbdDYJCq (ORCPT ); Tue, 25 Apr 2017 05:02:46 -0400 Date: Tue, 25 Apr 2017 12:02:42 +0300 From: "Kirill A. Shutemov" To: Ingo Molnar Cc: "Kirill A. Shutemov" , Dan Williams , dvlasenk@redhat.com, Andy Lutomirski , Andrew Morton , brgerst@gmail.com, Arnd Bergmann , Josh Poimboeuf , Michal Hocko , "H. Peter Anvin" , Dave Hansen , Peter Zijlstra , Thomas Gleixner , Linus Torvalds , Andy Lutomirski , Borislav Petkov , Linux Kernel Mailing List , linux-tip-commits@vger.kernel.org Subject: Re: [tip:x86/mm] x86: Convert the rest of the code to support p4d_t Message-ID: <20170425090242.sgxzammvowv7cezs@node.shutemov.name> References: <20170317185515.8636-7-kirill.shutemov@linux.intel.com> <20170424165757.76g6qdm4yf4a5ggx@node.shutemov.name> <20170425005702.ccvxdavjo432ccdc@black.fi.intel.com> <20170425063842.nwop6meglpylxmoz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170425063842.nwop6meglpylxmoz@gmail.com> User-Agent: NeoMutt/20170306 (1.8.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2017 at 08:38:42AM +0200, Ingo Molnar wrote: > > * Kirill A. Shutemov wrote: > > > On Mon, Apr 24, 2017 at 11:42:34AM -0700, Dan Williams wrote: > > > > > > > > I cannot reproduce the issue. > > > > > > > > Could you share your kernel kernel config? > > > > > > Kernel config available here: > > > https://gist.github.com/djbw/2b99a014396cca9f4406586573be98c0 > > > > Patch below should help. Please check. > > > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > > index a242139df8fe..745e5e183169 100644 > > --- a/arch/x86/mm/init_64.c > > +++ b/arch/x86/mm/init_64.c > > @@ -962,7 +962,7 @@ remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end, > > continue; > > } > > > > - pmd_base = (pmd_t *)pud_page_vaddr(*pud); > > + pmd_base = pmd_offset(pud, 0); > > remove_pmd_table(pmd_base, addr, next, direct); > > free_pmd_table(pmd_base, pud); > > } > > @@ -988,7 +988,7 @@ remove_p4d_table(p4d_t *p4d_start, unsigned long addr, unsigned long end, > > > > BUILD_BUG_ON(p4d_large(*p4d)); > > > > - pud_base = (pud_t *)p4d_page_vaddr(*p4d); > > + pud_base = pud_offset(p4d, 0); > > remove_pud_table(pud_base, addr, next, direct); > > free_pud_table(pud_base, p4d); > > } > > @@ -1013,7 +1013,7 @@ remove_pagetable(unsigned long start, unsigned long end, bool direct) > > if (!pgd_present(*pgd)) > > continue; > > > > - p4d = (p4d_t *)pgd_page_vaddr(*pgd); > > + p4d = p4d_offset(pgd, 0); > > remove_p4d_table(p4d, addr, next, direct); > > } > > Type casts are dangerous, chapter 378. I missed them when applying the patches. > > Could you please double-check all other type casts introduced by the 5-level > paging patches, to make sure it's all using natural type conversions? I looked though at the rest of (p4d_t) and (p4d_t *) casts and they look okay: under pgd_none()/!pgd_preset() or within #if PTRS_PER_P4d > 1. I'll prepare proper patch. -- Kirill A. Shutemov