Re: [RFC PATCH] KVM: VMX: Always sync CR3 to VMCS in nested_vmx_load_cr3

Sean Christopherson
2019-09-26T18:38:03Z

On Thu, Sep 26, 2019 at 04:05:41PM +0200, Reto Buerki wrote:
> Required to make a Muen system work on KVM nested.
>
> Signed-off-by: Reto Buerki <reet@codelabs.ch>
> ---
> arch/x86/kvm/vmx/nested.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
> index 41abc62c9a8a..101b2c0c8480 100644
> --- a/arch/x86/kvm/vmx/nested.c
> +++ b/arch/x86/kvm/vmx/nested.c
> @@ -1008,6 +1008,8 @@ static int nested_vmx_load_cr3(struct kvm_vcpu *vcpu, unsigned long cr3, bool ne
> }
> }
>
> + vmcs_writel(GUEST_CR3, cr3);

This isn't wrong, but it's not the most precise fix. I've figured out
what's going awry, in the process of determining how best to fix the issue.

> +
> if (!nested_ept)
> kvm_mmu_new_cr3(vcpu, cr3, false);
>
> --
> 2.20.1
>