public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86_64 add NX mask for PTE entry
@ 2006-10-18  9:15 bibo,mao
  2006-10-18 10:58 ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: bibo,mao @ 2006-10-18  9:15 UTC (permalink / raw)
  To: ak; +Cc: linux-kernel

Hi,
    If function change_page_attr_addr calls revert_page to revert
to original pte value, mk_pte_phys does not mask NX bit. If NX bit
is set on no NX hardware supported x86_64 machine, there is will
be RSVD type page fault and system will crash. This patch adds NX
mask bit for PTE entry.

Signed-off-by: bibo,mao <bibo.mao@intel.com>

diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 6899e77..0555c1c 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -366,6 +366,7 @@ static inline pte_t mk_pte_phys(unsigned
  {
  	pte_t pte;
  	pte_val(pte) = physpage | pgprot_val(pgprot);
+	pte_val(pte) &= __supported_pte_mask;
  	return pte;
  }

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

end of thread, other threads:[~2006-10-19  1:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-18  9:15 [PATCH] x86_64 add NX mask for PTE entry bibo,mao
2006-10-18 10:58 ` Andi Kleen
2006-10-18 11:23   ` bibo,mao
2006-10-18 11:45     ` bibo,mao
2006-10-18 13:15       ` Andi Kleen
2006-10-19  1:35   ` bibo,mao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox