public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] KVM: x86: Add support for VMware backdoor I/O ports & Pseduo-PMCs
@ 2017-12-18  9:45 Liran Alon
  2017-12-18  9:45 ` [PATCH 1/7] KVM: x86: Add module parameter for supporting VMware backdoor Liran Alon
                   ` (7 more replies)
  0 siblings, 8 replies; 15+ messages in thread
From: Liran Alon @ 2017-12-18  9:45 UTC (permalink / raw)
  To: pbonzini, rkrcmar, kvm; +Cc: idan.brown

Hi,

This series aims to complete KVM support of VMware backdoor interface.
This interface is currently partially supported.

Before these commits, KVM forwaded accesses to vmport I/O ports to QEMU
where they were handled correctly.
However, it turns out VMware design allows these I/O ports to also be
accessible to guest when TSS I/O permissions bitmap disallows it.
The way VMware hypervisor does it is to intercept #GP and on #GP intercept
handler run the x86 emulator which was modified to specifically skip
checking TSS I/O permissions bitmap for these magic I/O ports.
This behavior was found to be a must for some VMware workloads.
For example, VMware Tools Windows installer refuse to install as it
cannot access vmport I/O ports from Ring3, therefore assuming it
is not running inside a VM.

Patches 1-6 mimics the above behavior in KVM. It installs a #GP
intercept on both VMX & SVM such that the #GP intercept handler
will call x86 emulator which was modified to always allow access
to these I/O ports.
Because this behavior is not a must for all workloads
and #GP intercept can introduce a slight performance overhead,
a module parameter was added to control whether KVM will do this or not.

Patch 7 finally completes VMware backdoor interface by adding support
for VMware Pseduo-PMCs. VMware defines a couple of PMCs which are made-up
by their hypervisor which returns various PV information
(Such as host's RDTSC). Similar to vmport I/O ports, these Pseduo-PMCs
can be accessed via RDPMC even if executed from Ring3 when CR4.PCE=0.
Therefore, the x86 emulator was modified to mimic this behavior.

Regards,
-Liran Alon

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

end of thread, other threads:[~2017-12-22 15:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18  9:45 [PATCH 0/7] KVM: x86: Add support for VMware backdoor I/O ports & Pseduo-PMCs Liran Alon
2017-12-18  9:45 ` [PATCH 1/7] KVM: x86: Add module parameter for supporting VMware backdoor Liran Alon
2017-12-18  9:45 ` [PATCH 2/7] KVM: x86: Always allow access to VMware backdoor I/O ports Liran Alon
2017-12-18  9:45 ` [PATCH 3/7] KVM: x86: Add emulation_type to not raise #UD on CPL=3 emulation failure Liran Alon
2017-12-21 15:11   ` Paolo Bonzini
2017-12-22  1:11     ` Liran Alon
2017-12-22 15:16       ` Paolo Bonzini
2017-12-22 15:53         ` Liran Alon
2017-12-22 15:59           ` Paolo Bonzini
2017-12-18  9:45 ` [PATCH 4/7] KVM: x86: Emulate only IN/OUT instructions when accessing VMware backdoor Liran Alon
2017-12-18  9:45 ` [PATCH 5/7] KVM: x86: VMX: Intercept #GP to support access to VMware backdoor ports Liran Alon
2017-12-18  9:45 ` [PATCH 6/7] KVM: x86: SVM: " Liran Alon
2017-12-18  9:45 ` [PATCH 7/7] KVM: x86: Add support for VMware backdoor Pseudo-PMCs Liran Alon
2017-12-21 15:15 ` [PATCH 0/7] KVM: x86: Add support for VMware backdoor I/O ports & Pseduo-PMCs Paolo Bonzini
2017-12-22  1:22   ` Liran Alon

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