All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86-64: adjust pmd_bad()
@ 2006-11-15 15:06 Jan Beulich
  2006-11-15 16:31 ` [patches] " Andi Kleen
  2006-11-15 17:01 ` Hugh Dickins
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2006-11-15 15:06 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel, patches

Make pmd_bad() symmetrical to pgd_bad() and pud_bad(). At once,
simplify them all.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- linux-2.6.19-rc5/include/asm-x86_64/pgtable.h	2006-11-08 09:25:39.000000000 +0100
+++ 2.6.19-rc5-x86_64-pmd_bad/include/asm-x86_64/pgtable.h	2006-11-14 14:33:20.000000000 +0100
@@ -221,20 +221,19 @@ static inline pte_t ptep_get_and_clear_f
 #define __S110	PAGE_SHARED_EXEC
 #define __S111	PAGE_SHARED_EXEC
 
-static inline unsigned long pgd_bad(pgd_t pgd) 
-{ 
-       unsigned long val = pgd_val(pgd);
-       val &= ~PTE_MASK; 
-       val &= ~(_PAGE_USER | _PAGE_DIRTY); 
-       return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);      
-} 
+static inline unsigned long pgd_bad(pgd_t pgd)
+{
+	return pgd_val(pgd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
+}
 
 static inline unsigned long pud_bad(pud_t pud)
 {
-       unsigned long val = pud_val(pud);
-       val &= ~PTE_MASK;
-       val &= ~(_PAGE_USER | _PAGE_DIRTY);
-       return val & ~(_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED);
+	return pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
+}
+
+static inline unsigned long pmd_bad(pmd_t pmd)
+{
+	return pmd_val(pmd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
 }
 
 #define pte_none(x)	(!pte_val(x))
@@ -347,7 +346,6 @@ static inline int pmd_large(pmd_t pte) {
 #define pmd_none(x)	(!pmd_val(x))
 #define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
 #define pmd_clear(xp)	do { set_pmd(xp, __pmd(0)); } while (0)
-#define	pmd_bad(x)	((pmd_val(x) & (~PTE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE )
 #define pfn_pmd(nr,prot) (__pmd(((nr) << PAGE_SHIFT) | pgprot_val(prot)))
 #define pmd_pfn(x)  ((pmd_val(x) & __PHYSICAL_MASK) >> PAGE_SHIFT)
 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patches] [PATCH] x86-64: adjust pmd_bad()
  2006-11-15 15:06 [PATCH] x86-64: adjust pmd_bad() Jan Beulich
@ 2006-11-15 16:31 ` Andi Kleen
  2006-11-15 17:01 ` Hugh Dickins
  1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2006-11-15 16:31 UTC (permalink / raw)
  To: patches; +Cc: Jan Beulich, linux-kernel

On Wednesday 15 November 2006 16:06, Jan Beulich wrote:
> Make pmd_bad() symmetrical to pgd_bad() and pud_bad(). At once,
> simplify them all.

Got them all, thanks. Including the two i386 patches on l-k.

I didn't include the ACPI warning patch -- that should go via Len Brown's 
tree. Perhaps you resend it to him/linux-acpi to make sure he gets it.

-Andi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86-64: adjust pmd_bad()
  2006-11-15 15:06 [PATCH] x86-64: adjust pmd_bad() Jan Beulich
  2006-11-15 16:31 ` [patches] " Andi Kleen
@ 2006-11-15 17:01 ` Hugh Dickins
  2006-11-15 17:12   ` Jan Beulich
  2006-11-15 17:23   ` [patches] " Andi Kleen
  1 sibling, 2 replies; 5+ messages in thread
From: Hugh Dickins @ 2006-11-15 17:01 UTC (permalink / raw)
  To: Jan Beulich; +Cc: Andi Kleen, linux-kernel, patches

On Wed, 15 Nov 2006, Jan Beulich wrote:

> Make pmd_bad() symmetrical to pgd_bad() and pud_bad(). At once,
> simplify them all.

Symmetrical and simpler, yes, but you're weakening the pmd_bad() test:
no longer requires that all those _KERNPG_TABLE bits be set.  Wouldn't
it be better to go the other way and strengthen pgd_bad, pud_bad?

Hugh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] x86-64: adjust pmd_bad()
  2006-11-15 17:01 ` Hugh Dickins
@ 2006-11-15 17:12   ` Jan Beulich
  2006-11-15 17:23   ` [patches] " Andi Kleen
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2006-11-15 17:12 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: Andi Kleen, linux-kernel, patches

>>> Hugh Dickins <hugh@veritas.com> 15.11.06 18:01 >>>
>On Wed, 15 Nov 2006, Jan Beulich wrote:
>
>> Make pmd_bad() symmetrical to pgd_bad() and pud_bad(). At once,
>> simplify them all.
>
>Symmetrical and simpler, yes, but you're weakening the pmd_bad() test:
>no longer requires that all those _KERNPG_TABLE bits be set.  Wouldn't
>it be better to go the other way and strengthen pgd_bad, pud_bad?

Maybe, but there must have been a reason for not doing so. It could
certainly be a follow-up patch - if it works.

Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patches] Re: [PATCH] x86-64: adjust pmd_bad()
  2006-11-15 17:01 ` Hugh Dickins
  2006-11-15 17:12   ` Jan Beulich
@ 2006-11-15 17:23   ` Andi Kleen
  1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2006-11-15 17:23 UTC (permalink / raw)
  To: patches; +Cc: Hugh Dickins, Jan Beulich, linux-kernel

On Wednesday 15 November 2006 18:01, Hugh Dickins wrote:
> On Wed, 15 Nov 2006, Jan Beulich wrote:
> 
> > Make pmd_bad() symmetrical to pgd_bad() and pud_bad(). At once,
> > simplify them all.
> 
> Symmetrical and simpler, yes, but you're weakening the pmd_bad() test:
> no longer requires that all those _KERNPG_TABLE bits be set.  Wouldn't
> it be better to go the other way and strengthen pgd_bad, pud_bad?

That's a good point. Yes that would be better.  If it works :) 

They can't be completely the same because we don't set large page bits on
PGDs (on PUDs we will eventually with 1GB pages) 

-Andi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-15 17:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-15 15:06 [PATCH] x86-64: adjust pmd_bad() Jan Beulich
2006-11-15 16:31 ` [patches] " Andi Kleen
2006-11-15 17:01 ` Hugh Dickins
2006-11-15 17:12   ` Jan Beulich
2006-11-15 17:23   ` [patches] " Andi Kleen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.