mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] x86/kvm/nVMX: fix Enlightened VMCLEAR
@ 2019-06-28 11:23 Vitaly Kuznetsov
  2019-06-28 11:23 ` [PATCH v2 1/2] x86/KVM/nVMX: don't use clean fields data on enlightened VMLAUNCH Vitaly Kuznetsov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vitaly Kuznetsov @ 2019-06-28 11:23 UTC (permalink / raw)
  To: kvm; +Cc: linux-kernel, Paolo Bonzini, Radim Krčmář, Liran Alon

VMCLEAR implementation for Enlightened VMCS is not entirely correct
when something else than the currently active eVMCS on the calling vCPU
is targeted. In case there's no currently active eVMCS on the calling vCPU
we are corrupting the targeted area by writing to the non-existent
launch_state field.

Fix the logic by always treating the targeted area as 'enlightened' in case
Enlightened VMEntry is enabled on the calling vCPU.

Changes since v1:
- 'evmcs_vmptr' -> 'evmcs_gpa' [Paolo Bonzini]
- avoid nested_release_evmcs() in handle_vmclear even for the currently
  active eVMCS on the calling vCPU [Liran Alon], PATCH1 added to support
  the change.

Vitaly Kuznetsov (2):
  x86/KVM/nVMX: don't use clean fields data on enlightened VMLAUNCH
  x86/kvm/nVMX: fix VMCLEAR when Enlightened VMCS is in use

 arch/x86/kvm/vmx/evmcs.c  | 18 ++++++++++++++
 arch/x86/kvm/vmx/evmcs.h  |  1 +
 arch/x86/kvm/vmx/nested.c | 52 ++++++++++++++++++++++-----------------
 3 files changed, 49 insertions(+), 22 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-07-02 16:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 11:23 [PATCH v2 0/2] x86/kvm/nVMX: fix Enlightened VMCLEAR Vitaly Kuznetsov
2019-06-28 11:23 ` [PATCH v2 1/2] x86/KVM/nVMX: don't use clean fields data on enlightened VMLAUNCH Vitaly Kuznetsov
2019-06-28 11:23 ` [PATCH v2 2/2] x86/kvm/nVMX: fix VMCLEAR when Enlightened VMCS is in use Vitaly Kuznetsov
2019-07-02 16:30 ` [PATCH v2 0/2] x86/kvm/nVMX: fix Enlightened VMCLEAR Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®