All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/4] KVM: nSVM: ondemand nested state allocation
@ 2020-09-22 21:10 Maxim Levitsky
  2020-09-22 21:10 ` [PATCH v6 1/4] KVM: x86: xen_hvm_config: cleanup return values Maxim Levitsky
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Maxim Levitsky @ 2020-09-22 21:10 UTC (permalink / raw)
  To: kvm
  Cc: H. Peter Anvin, Ingo Molnar, Borislav Petkov, Vitaly Kuznetsov,
	Sean Christopherson, Joerg Roedel, Paolo Bonzini, Wanpeng Li,
	Thomas Gleixner, linux-kernel, Jim Mattson,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Maxim Levitsky

This is the next version of this patch series.

In V5 I adopted Sean Christopherson's suggestion to make .set_efer return
a negative error (-ENOMEM in this case) which in most cases in kvm
propagates to the userspace.

I noticed though that wrmsr emulation code doesn't do this and instead
it injects #GP to the guest on _any_ error.

So I fixed the wrmsr code to behave in a similar way to the rest
of the kvm code.
(#GP only on a positive error value, and forward the negative error to
the userspace)

I had to adjust one wrmsr handler (xen_hvm_config) to stop it from returning
negative values	so that new WRMSR emulation behavior doesn't break it.
This patch was only compile tested.

The memory allocation failure was tested by always returning -ENOMEM
from svm_allocate_nested.

The nested allocation itself was tested by countless attempts to run
nested guests, do nested migration on both my AMD and Intel machines.
I wasn't able to break it.

Changes from V5: addressed Sean Christopherson's review feedback.

Best regards,
	Maxim Levitsky

Maxim Levitsky (4):
  KVM: x86: xen_hvm_config: cleanup return values
  KVM: x86: report negative values from wrmsr emulation to userspace
  KVM: x86: allow kvm_x86_ops.set_efer to return an error value
  KVM: nSVM: implement on demand allocation of the nested state

 arch/x86/include/asm/kvm_host.h |  2 +-
 arch/x86/kvm/emulate.c          |  7 ++--
 arch/x86/kvm/svm/nested.c       | 42 ++++++++++++++++++++++++
 arch/x86/kvm/svm/svm.c          | 58 +++++++++++++++++++--------------
 arch/x86/kvm/svm/svm.h          |  8 ++++-
 arch/x86/kvm/vmx/vmx.c          |  6 ++--
 arch/x86/kvm/x86.c              | 37 ++++++++++++---------
 7 files changed, 113 insertions(+), 47 deletions(-)

-- 
2.26.2



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

end of thread, other threads:[~2020-10-29  0:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-22 21:10 [PATCH v6 0/4] KVM: nSVM: ondemand nested state allocation Maxim Levitsky
2020-09-22 21:10 ` [PATCH v6 1/4] KVM: x86: xen_hvm_config: cleanup return values Maxim Levitsky
2020-09-22 21:10 ` [PATCH v6 2/4] KVM: x86: report negative values from wrmsr emulation to userspace Maxim Levitsky
2020-10-26 19:40   ` Qian Cai
2020-10-27 20:31     ` Qian Cai
2020-10-28  8:51       ` Maxim Levitsky
2020-09-22 21:10 ` [PATCH v6 3/4] KVM: x86: allow kvm_x86_ops.set_efer to return an error value Maxim Levitsky
2020-09-29  5:12   ` Sean Christopherson
2020-09-22 21:10 ` [PATCH v6 4/4] KVM: nSVM: implement on demand allocation of the nested state Maxim Levitsky
2020-09-29  5:15   ` Sean Christopherson
2020-09-30 15:35     ` Maxim Levitsky
2020-10-01  0:26       ` Sean Christopherson
2020-09-30 15:36 ` [PATCH v6 0/4] KVM: nSVM: ondemand nested state allocation Maxim Levitsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.