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


Groups > linux.kernel > #1266518

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

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH] x86/mm: fix regression with huge pages on PAE
Date 2015-11-10 15:00 +0100
Message-ID <qthCP-5MA-21@gated-at.bofh.it> (permalink)
References <qt3Tc-5oe-19@gated-at.bofh.it> <qtgx4-57n-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 10, 2015 at 01:34:29PM +0100, Borislav Petkov wrote:
> On Tue, Nov 10, 2015 at 01:18:10AM +0200, Kirill A. Shutemov wrote:
> > 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;
> 
> In file included from ./arch/x86/include/asm/boot.h:5:0,
>                  from ./arch/x86/boot/boot.h:26,
>                  from arch/x86/realmode/rm/wakemain.c:2:
> ./arch/x86/include/asm/pgtable_types.h: In function ‘pud_pfn_mask’:
> ./arch/x86/include/asm/pgtable_types.h:282:10: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>    return ~((1ULL << PUD_SHIFT) - 1) & PHYSICAL_PAGE_MASK;
>           ^
> ./arch/x86/include/asm/pgtable_types.h: In function ‘pmd_pfn_mask’:
> ./arch/x86/include/asm/pgtable_types.h:300:10: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>    return ~((1ULL << PMD_SHIFT) - 1) & PHYSICAL_PAGE_MASK;
>           ^
> In file included from ./arch/x86/include/asm/boot.h:5:0,
>                  from arch/x86/realmode/rm/../../boot/boot.h:26,
>                  from arch/x86/realmode/rm/../../boot/video-mode.c:18,
>                  from arch/x86/realmode/rm/video-mode.c:1:
> ./arch/x86/include/asm/pgtable_types.h: In function ‘pud_pfn_mask’:
> ./arch/x86/include/asm/pgtable_types.h:282:10: warning: large integer implicitly truncated to unsigned type [-Woverflow]
>    return ~((1ULL << PUD_SHIFT) - 1) & PHYSICAL_PAGE_MASK;
>           ^
> ...
> 
> That's a 64-bit config.

Oh.. pmdval_t/pudval_t is 'unsinged long' on 64 bit. But realmode code
uses -m16 which makes 'unsigned long' 32-bit therefore truncation warning.

These helpers not really used in realmode code. I see few ways out:

 - convert helpers to macros to avoid their translation;

 - wrap the code into not-for-realmode ifdef. (Do we have any?);

 - convert pudval_t/pmdval_t to u64 for 64-bit. I'm not sure what side
   effects would it have.

Any opinions?

-- 
 Kirill A. Shutemov
--
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