2017-03-12 08:54:08

by Wanpeng Li

[permalink] [raw]
Subject: [PATCH] KVM: nVMX: don't reset kvm mmu twice

From: Wanpeng Li <[email protected]>

kvm mmu is reset once successfully loading CR3 as part of emulating vmentry
in nested_vmx_load_cr3(). We should not reset kvm mmu twice.

Cc: Paolo Bonzini <[email protected]>
Cc: Radim Krčmář <[email protected]>
Signed-off-by: Wanpeng Li <[email protected]>
---
arch/x86/kvm/vmx.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 98e82ee..bca8d7a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -10286,8 +10286,6 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
entry_failure_code))
return 1;

- kvm_mmu_reset_context(vcpu);
-
if (!enable_ept)
vcpu->arch.walk_mmu->inject_page_fault = vmx_inject_page_fault_nested;

--
2.7.4


2017-03-13 08:37:38

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH] KVM: nVMX: don't reset kvm mmu twice

Am 12.03.2017 um 09:53 schrieb Wanpeng Li:
> From: Wanpeng Li <[email protected]>
>
> kvm mmu is reset once successfully loading CR3 as part of emulating vmentry
> in nested_vmx_load_cr3(). We should not reset kvm mmu twice.
>
> Cc: Paolo Bonzini <[email protected]>
> Cc: Radim Krčmář <[email protected]>
> Signed-off-by: Wanpeng Li <[email protected]>
> ---
> arch/x86/kvm/vmx.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 98e82ee..bca8d7a 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -10286,8 +10286,6 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
> entry_failure_code))
> return 1;
>
> - kvm_mmu_reset_context(vcpu);
> -
> if (!enable_ept)
> vcpu->arch.walk_mmu->inject_page_fault = vmx_inject_page_fault_nested;
>
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David

2017-03-14 20:39:18

by Radim Krčmář

[permalink] [raw]
Subject: Re: [PATCH] KVM: nVMX: don't reset kvm mmu twice

2017-03-12 00:53-0800, Wanpeng Li:
> From: Wanpeng Li <[email protected]>
>
> kvm mmu is reset once successfully loading CR3 as part of emulating vmentry
> in nested_vmx_load_cr3(). We should not reset kvm mmu twice.
>
> Cc: Paolo Bonzini <[email protected]>
> Cc: Radim Krčmář <[email protected]>
> Signed-off-by: Wanpeng Li <[email protected]>
> ---

Queued, thanks.

> arch/x86/kvm/vmx.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 98e82ee..bca8d7a 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -10286,8 +10286,6 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
> entry_failure_code))
> return 1;
>
> - kvm_mmu_reset_context(vcpu);
> -
> if (!enable_ept)
> vcpu->arch.walk_mmu->inject_page_fault = vmx_inject_page_fault_nested;
>
> --
> 2.7.4
>