* [PATCH] KVM: VMX: Enforce EPT pagetable level checking
@ 2010-06-02 6:05 Sheng Yang
2010-06-02 16:49 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Sheng Yang @ 2010-06-02 6:05 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Sheng Yang
We only support 4 levels EPT pagetable now.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
arch/x86/kvm/vmx.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 99ae513..d400fbb 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -339,6 +339,11 @@ static inline bool cpu_has_vmx_ept_1g_page(void)
return vmx_capability.ept & VMX_EPT_1GB_PAGE_BIT;
}
+static inline bool cpu_has_vmx_ept_4levels(void)
+{
+ return vmx_capability.ept & VMX_EPT_PAGE_WALK_4_BIT;
+}
+
static inline bool cpu_has_vmx_invept_individual_addr(void)
{
return vmx_capability.ept & VMX_EPT_EXTENT_INDIVIDUAL_BIT;
@@ -1567,7 +1572,8 @@ static __init int hardware_setup(void)
if (!cpu_has_vmx_vpid())
enable_vpid = 0;
- if (!cpu_has_vmx_ept()) {
+ if (!cpu_has_vmx_ept() ||
+ !cpu_has_vmx_ept_4levels()) {
enable_ept = 0;
enable_unrestricted_guest = 0;
}
--
1.7.0.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: VMX: Enforce EPT pagetable level checking
2010-06-02 6:05 [PATCH] KVM: VMX: Enforce EPT pagetable level checking Sheng Yang
@ 2010-06-02 16:49 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2010-06-02 16:49 UTC (permalink / raw)
To: Sheng Yang; +Cc: Avi Kivity, kvm
On Wed, Jun 02, 2010 at 02:05:24PM +0800, Sheng Yang wrote:
> We only support 4 levels EPT pagetable now.
>
> Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> ---
> arch/x86/kvm/vmx.c | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-02 17:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 6:05 [PATCH] KVM: VMX: Enforce EPT pagetable level checking Sheng Yang
2010-06-02 16:49 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).