* [PATCH] i386/PAE: fix pud_page()
@ 2008-10-30 10:37 Jan Beulich
2008-10-30 10:49 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2008-10-30 10:37 UTC (permalink / raw)
To: mingo, tglx, hpa; +Cc: linux-kernel
To the unsuspecting user it is quite annoying that this broken and
inconsistent with x86-64 definition still exists.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
---
arch/x86/include/asm/pgtable-3level.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux-2.6.28-rc2/arch/x86/include/asm/pgtable-3level.h 2008-10-30 11:03:18.000000000 +0100
+++ 2.6.28-rc2-i386-pae-pud_page/arch/x86/include/asm/pgtable-3level.h 2008-10-29 11:35:24.000000000 +0100
@@ -120,13 +120,13 @@ static inline void pud_clear(pud_t *pudp
write_cr3(pgd);
}
-#define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK))
+#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
#define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK))
/* Find an entry in the second-level page table.. */
-#define pmd_offset(pud, address) ((pmd_t *)pud_page(*(pud)) + \
+#define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \
pmd_index(address))
#ifdef CONFIG_SMP
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] i386/PAE: fix pud_page()
2008-10-30 10:37 [PATCH] i386/PAE: fix pud_page() Jan Beulich
@ 2008-10-30 10:49 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2008-10-30 10:49 UTC (permalink / raw)
To: Jan Beulich; +Cc: tglx, hpa, linux-kernel, Jeremy Fitzhardinge
* Jan Beulich <jbeulich@novell.com> wrote:
> To the unsuspecting user it is quite annoying that this broken and
> inconsistent with x86-64 definition still exists.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
>
> ---
> arch/x86/include/asm/pgtable-3level.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
applied, thanks Jan!
> -#define pud_page(pud) ((struct page *) __va(pud_val(pud) & PTE_PFN_MASK))
> +#define pud_page(pud) pfn_to_page(pud_val(pud) >> PAGE_SHIFT)
>
> #define pud_page_vaddr(pud) ((unsigned long) __va(pud_val(pud) & PTE_PFN_MASK))
>
>
> /* Find an entry in the second-level page table.. */
> -#define pmd_offset(pud, address) ((pmd_t *)pud_page(*(pud)) + \
> +#define pmd_offset(pud, address) ((pmd_t *)pud_page_vaddr(*(pud)) + \
> pmd_index(address))
we were quite lucky there. Despite being a cleanup i've put this into
x86/urgent - i agree that it's just too ugly and confusing.
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-10-30 10:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 10:37 [PATCH] i386/PAE: fix pud_page() Jan Beulich
2008-10-30 10:49 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox