linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] KVM: x86: Small changes to support VMware guests
@ 2024-10-30  3:34 Zack Rusin
  2024-10-30  3:34 ` [PATCH 1/3] KVM: x86: Allow enabling of the vmware backdoor via a cap Zack Rusin
                   ` (2 more replies)
  0 siblings, 3 replies; 29+ messages in thread
From: Zack Rusin @ 2024-10-30  3:34 UTC (permalink / raw)
  To: kvm
  Cc: Zack Rusin, Doug Covelli, Paolo Bonzini, Jonathan Corbet,
	Sean Christopherson, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Shuah Khan,
	Namhyung Kim, Arnaldo Carvalho de Melo, Isaku Yamahata,
	Joel Stanley, linux-doc, linux-kernel, linux-kselftest

To be able to switch VMware products running on Linux to KVM some minor
changes are required to let KVM run/resume unmodified VMware guests.

First allow enabling of the VMware backdoor via an api. Currently the
setting of the VMware backdoor is limited to kernel boot parameters,
which forces all VM's running on a host to either run with or without
the VMware backdoor. Add a simple cap to allow enabling of the VMware
backdoor on a per VM basis. The default for that setting remains the
kvm.enable_vmware_backdoor boot parameter (which is false by default)
and can be changed on a per-vm basis via the KVM_CAP_X86_VMWARE_BACKDOOR
cap.

Second add a cap to forward hypercalls to userspace. I know that in
general that's frowned upon but VMwre guests send quite a few hypercalls
from userspace and it would be both impractical and largelly impossible
to handle all in the kernel. The change is trivial and I'd be maintaining
this code so I hope it's not a big deal.

The third commit just adds a self-test for the "forward VMware hypercalls
to userspace" functionality.

Cc: Doug Covelli <doug.covelli@broadcom.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Isaku Yamahata <isaku.yamahata@intel.com>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Zack Rusin <zack.rusin@broadcom.com>
Cc: kvm@vger.kernel.org
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org

Zack Rusin (3):
  KVM: x86: Allow enabling of the vmware backdoor via a cap
  KVM: x86: Add support for VMware guest specific hypercalls
  KVM: selftests: x86: Add a test for KVM_CAP_X86_VMWARE_HYPERCALL

 Documentation/virt/kvm/api.rst                |  56 ++++++++-
 arch/x86/include/asm/kvm_host.h               |   2 +
 arch/x86/kvm/emulate.c                        |   5 +-
 arch/x86/kvm/svm/svm.c                        |   6 +-
 arch/x86/kvm/vmx/vmx.c                        |   4 +-
 arch/x86/kvm/x86.c                            |  47 ++++++++
 arch/x86/kvm/x86.h                            |   7 +-
 include/uapi/linux/kvm.h                      |   2 +
 tools/include/uapi/linux/kvm.h                |   2 +
 tools/testing/selftests/kvm/Makefile          |   1 +
 .../kvm/x86_64/vmware_hypercall_test.c        | 108 ++++++++++++++++++
 11 files changed, 227 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/x86_64/vmware_hypercall_test.c

-- 
2.43.0


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

end of thread, other threads:[~2025-02-03 20:35 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30  3:34 [PATCH 0/3] KVM: x86: Small changes to support VMware guests Zack Rusin
2024-10-30  3:34 ` [PATCH 1/3] KVM: x86: Allow enabling of the vmware backdoor via a cap Zack Rusin
2024-10-30  3:34 ` [PATCH 2/3] KVM: x86: Add support for VMware guest specific hypercalls Zack Rusin
2024-11-04 22:13   ` Paolo Bonzini
2024-11-05  4:59     ` Zack Rusin
2024-11-07 22:32       ` Sean Christopherson
2024-11-08  5:03         ` Zack Rusin
2024-11-09 18:20           ` Paolo Bonzini
2024-11-09 21:11             ` Doug Covelli
2024-11-11 18:49               ` Paolo Bonzini
2024-11-11 20:55                 ` Doug Covelli
2024-11-12 17:44                   ` Paolo Bonzini
2024-11-12 20:44                     ` Doug Covelli
     [not found]                       ` <CABgObfZrTyft-3vqMz5w0ZiAhp-v6c32brgftynZGJO8OafrdA@mail.gmail.com>
2024-11-13 16:04                         ` Sean Christopherson
2024-11-13 16:24                         ` Doug Covelli
2024-11-13 17:59                           ` Paolo Bonzini
2024-11-14 15:45                             ` Doug Covelli
2024-12-12 12:19                               ` Doug Covelli
2024-12-18  3:43                                 ` Sean Christopherson
2025-01-07 17:09                                   ` Paolo Bonzini
2025-02-03 16:35                                     ` Doug Covelli
2025-02-03 18:21                                       ` Paolo Bonzini
2025-02-03 18:35                                         ` Doug Covelli
2025-02-03 19:41                                           ` Sean Christopherson
2025-02-03 19:46                                             ` Paolo Bonzini
2025-02-03 19:53                                               ` Sean Christopherson
2025-02-03 20:35                                                 ` Doug Covelli
2024-11-09 16:44         ` Paolo Bonzini
2024-10-30  3:34 ` [PATCH 3/3] KVM: selftests: x86: Add a test for KVM_CAP_X86_VMWARE_HYPERCALL Zack Rusin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).