Thread (24 messages) 24 messages, 8 authors, 2015-11-27

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

From: Borislav Petkov <bp@alien8.de>
Date: 2015-11-10 12:42:48
Also in: lkml

On Tue, Nov 10, 2015 at 01:18:10AM +0200, Kirill A. Shutemov wrote:
quoted hunk ↗ jump to hunk
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 a??pud_pfn_maska??:
./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 a??pmd_pfn_maska??:
./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 a??pud_pfn_maska??:
./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.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help