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


Groups > linux.kernel > #1441795

[PATCH v2 1/5] mmu: extend the is_present check to 32 bits

From Bandan Das <bsd@redhat.com>
Newsgroups linux.kernel
Subject [PATCH v2 1/5] mmu: extend the is_present check to 32 bits
Date 2016-07-13 00:20 +0200
Message-ID <rUec2-2Bd-7@gated-at.bofh.it> (permalink)
References <rUec2-2Bd-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This is safe because this function is called
on host controlled page table and non-present/non-MMIO
sptes never use bits 1..31. For the EPT case, this
ensures that cases where only the execute bit is set
is marked valid.

Signed-off-by: Bandan Das <bsd@redhat.com>
---
 arch/x86/kvm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index def97b3..87b62dc 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -304,7 +304,7 @@ static int is_nx(struct kvm_vcpu *vcpu)
 
 static int is_shadow_present_pte(u64 pte)
 {
-	return pte & PT_PRESENT_MASK && !is_mmio_spte(pte);
+	return (pte & 0xFFFFFFFFull) && !is_mmio_spte(pte);
 }
 
 static int is_large_pte(u64 pte)
-- 
2.5.5

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v2 1/5] mmu: extend the is_present check to 32 bits Bandan Das <bsd@redhat.com> - 2016-07-13 00:20 +0200

csiph-web