lkml.org 
[lkml]   [2017]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM/VMX: Avoid CR3 VMEXIT during guest real mode when "unrestricted guest" is supported.
2017-08-15 21:58-0400, Lan Tianyu:
> These CR3 VMEXITs was introduced for platform without "unrestricted guest"
> support. This is to set ept identity table to guest CR3 in guest real
> mode because these platforms don't support ept real mode(CR0.PE and CR0.PG
> must be set to 1). But these VMEXITs is redundant for platforms with
> "unrestricted guest" support.
>
> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
> ---
> arch/x86/kvm/vmx.c | 22 +++++++++++++---------
> 1 file changed, 13 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> @@ -4311,7 +4313,9 @@ static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
> }
>
> vmx_flush_tlb(vcpu);
> - vmcs_writel(GUEST_CR3, guest_cr3);
> +
> + if (!enable_unrestricted_guest || !enable_ept)
> + vmcs_writel(GUEST_CR3, guest_cr3);

This looks wrong -- it would prevent update GUEST_CR3 outside of
non-root mode with enable_unrestricted_guest.

\
 
 \ /
  Last update: 2017-08-16 15:27    [W:0.055 / U:2.816 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site