Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1266100

Re: [PATCH] x86/mm: fix regression with huge pages on PAE

From Toshi Kani <toshi.kani@hpe.com>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/mm: fix regression with huge pages on PAE
Date 2015-11-10 01:20 +0100
Message-ID <qt4Pg-61O-17@gated-at.bofh.it> (permalink)
References <qt3Tc-5oe-19@gated-at.bofh.it> <qt4md-5Cw-7@gated-at.bofh.it> <qt4vT-5FQ-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2015-11-10 at 01:57 +0200, Kirill A. Shutemov wrote:
> On Mon, Nov 09, 2015 at 04:43:11PM -0700, Toshi Kani wrote:
> > On Tue, 2015-11-10 at 01:18 +0200, Kirill A. Shutemov wrote:
> > > Recent PAT patchset has caused issue on 32-bit PAE machines:
> >  :
> > > The problem is in pmd_pfn_mask() and pmd_flags_mask(). These helpers use
> > > PMD_PAGE_MASK to calculate resulting mask. PMD_PAGE_MASK is 'unsigned
> > > long', not 'unsigned long long' as physaddr_t. As result upper bits of
> > > resulting mask is truncated.
> > > 
> > > The patch reworks code to use PMD_SHIFT as base of mask calculation
> > > instead of PMD_PAGE_MASK.
> > > 
> > > pud_pfn_mask() and pud_flags_mask() aren't problematic since we don't
> > > have PUD page table level on 32-bit systems, but they reworked too to be
> > > consistent with PMD counterpart.
> > > 
> > > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> > > Reported-and-Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> > > Fixes: f70abb0fc3da ("x86/asm: Fix pud/pmd interfaces to handle large PAT
> > > bit")
> > > Cc: Toshi Kani <toshi.kani@hpe.com>
> > > ---
> > >  arch/x86/include/asm/pgtable_types.h | 14 ++++----------
> > >  1 file changed, 4 insertions(+), 10 deletions(-)
> > > 
> > > diff --git a/arch/x86/include/asm/pgtable_types.h
> > > b/arch/x86/include/asm/pgtable_types.h
> > > index dd5b0aa9dd2f..c1e797266ce9 100644
> > > --- a/arch/x86/include/asm/pgtable_types.h
> > > +++ b/arch/x86/include/asm/pgtable_types.h
> > > @@ -279,17 +279,14 @@ static inline pmdval_t native_pmd_val(pmd_t pmd)
> > >  static inline pudval_t pud_pfn_mask(pud_t pud)
> > >  {
> > >  	if (native_pud_val(pud) & _PAGE_PSE)
> > > -		return PUD_PAGE_MASK & PHYSICAL_PAGE_MASK;
> > > +		return ~((1ULL << PUD_SHIFT) - 1) & PHYSICAL_PAGE_MASK;
> > 
> > Thanks for the fix!  Should we fix the PMD/PUD MASK/SIZE macros, so that we 
> > do not hit the same issue again when they are used?
> 
> I don't this so. PAGE_SIZE is not 'unsigned long long'. And all *PAGE_MASK
> are usually applied to virtual addresses which are 'unsigned long'.
> I think it's safer to leave them as they are.

Thanks for the explanation!  That makes sense.

Reviewed-by: Toshi Kani <toshi.kani@hpe.com>

-Toshi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-11-10 00:20 +0100
  Re: [PATCH] x86/mm: fix regression with huge pages on PAE Toshi Kani <toshi.kani@hpe.com> - 2015-11-10 00:50 +0100
    Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-10 01:00 +0100
      Re: [PATCH] x86/mm: fix regression with huge pages on PAE Toshi Kani <toshi.kani@hpe.com> - 2015-11-10 01:20 +0100
  Re: [PATCH] x86/mm: fix regression with huge pages on PAE Borislav Petkov <bp@alien8.de> - 2015-11-10 13:50 +0100
    Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-10 15:00 +0100
      Re: [PATCH] x86/mm: fix regression with huge pages on PAE Borislav Petkov <bp@alien8.de> - 2015-11-10 15:50 +0100
        Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-10 16:10 +0100
          Re: [PATCH] x86/mm: fix regression with huge pages on PAE Borislav Petkov <bp@alien8.de> - 2015-11-10 18:10 +0100
            Re: [PATCH] x86/mm: fix regression with huge pages on PAE Borislav Petkov <bp@alien8.de> - 2015-11-11 11:00 +0100
              Re: [PATCH] x86/mm: fix regression with huge pages on PAE Ingo Molnar <mingo@kernel.org> - 2015-11-12 08:50 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-12 09:00 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE Ingo Molnar <mingo@kernel.org> - 2015-11-12 09:10 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-11-12 09:50 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE Ingo Molnar <mingo@kernel.org> - 2015-11-12 10:00 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-11-12 10:10 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE Ingo Molnar <mingo@kernel.org> - 2015-11-12 14:40 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE Ingo Molnar <mingo@kernel.org> - 2015-11-12 10:00 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE Linus Torvalds <torvalds@linux-foundation.org> - 2015-11-12 20:30 +0100
                Re: [PATCH] x86/mm: fix regression with huge pages on PAE Dan Williams <dan.j.williams@gmail.com> - 2015-11-13 10:10 +0100

csiph-web