* [PATCH] KVM: nVMX: Clear segment cache after switching between L1 and L2
@ 2013-02-23 21:35 Jan Kiszka
2013-02-27 13:41 ` Gleb Natapov
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2013-02-23 21:35 UTC (permalink / raw)
To: Marcelo Tosatti, Gleb Natapov; +Cc: kvm, Nadav Har'El, Nakajima, Jun
From: Jan Kiszka <jan.kiszka@siemens.com>
Switching the VMCS obviously invalidates what may have been cached about
the guest segments.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
Probably, the missing invalidations are harmless ATM, but you never
know.
arch/x86/kvm/vmx.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 94f3b66..d45f0e0 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -7236,6 +7236,8 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
vcpu->cpu = cpu;
put_cpu();
+ vmx_segment_cache_clear(vmx);
+
vmcs12->launch_state = 1;
prepare_vmcs02(vcpu, vmcs12);
@@ -7504,6 +7506,8 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu)
vcpu->cpu = cpu;
put_cpu();
+ vmx_segment_cache_clear(vmx);
+
/* if no vmcs02 cache requested, remove the one we used */
if (VMCS02_POOL_SIZE == 0)
nested_free_vmcs02(vmx, vmx->nested.current_vmptr);
--
1.7.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: nVMX: Clear segment cache after switching between L1 and L2
2013-02-23 21:35 [PATCH] KVM: nVMX: Clear segment cache after switching between L1 and L2 Jan Kiszka
@ 2013-02-27 13:41 ` Gleb Natapov
0 siblings, 0 replies; 2+ messages in thread
From: Gleb Natapov @ 2013-02-27 13:41 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm, Nadav Har'El, Nakajima, Jun
On Sat, Feb 23, 2013 at 10:35:37PM +0100, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> Switching the VMCS obviously invalidates what may have been cached about
> the guest segments.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Applied, thanks.
> ---
>
> Probably, the missing invalidations are harmless ATM, but you never
> know.
>
> arch/x86/kvm/vmx.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 94f3b66..d45f0e0 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -7236,6 +7236,8 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch)
> vcpu->cpu = cpu;
> put_cpu();
>
> + vmx_segment_cache_clear(vmx);
> +
> vmcs12->launch_state = 1;
>
> prepare_vmcs02(vcpu, vmcs12);
> @@ -7504,6 +7506,8 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu)
> vcpu->cpu = cpu;
> put_cpu();
>
> + vmx_segment_cache_clear(vmx);
> +
> /* if no vmcs02 cache requested, remove the one we used */
> if (VMCS02_POOL_SIZE == 0)
> nested_free_vmcs02(vmx, vmx->nested.current_vmptr);
> --
> 1.7.3.4
--
Gleb.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-27 13:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-23 21:35 [PATCH] KVM: nVMX: Clear segment cache after switching between L1 and L2 Jan Kiszka
2013-02-27 13:41 ` Gleb Natapov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox