All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] some fixes of hypercall emulation
@ 2021-09-09 11:37 Hou Wenlong
  2021-09-09 11:37 ` [PATCH 1/3] kvm: x86: Introduce hypercall x86 ops for handling hypercall not in cpl0 Hou Wenlong
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Hou Wenlong @ 2021-09-09 11:37 UTC (permalink / raw)
  To: kvm

Currently, use hypercall instruction in guest cpl3 would just skip
the instruction, however, that behaviour could trigger a exception
in Linux host. It is reasonable for hypervisor to inject a exception,
especially in nested guest, L1 guest could behaviour like host.

As for hypercall instruction emulation, hypervisor would replace
the wrong instruction with the right instruction instead of the real
instruction emulation. It's guest's responsibility to use the right
instruction, hypervisor could emulate it but shouldn't modify it
without guest's request. At present, Linux guest could use alternative
to choose right instruction, and hyperv guest could use hypercall to
modify instruction. So just do the real instruction emualtion job
for em_hypercall().

Hou Wenlong (3):
  kvm: x86: Introduce hypercall x86 ops for handling hypercall not in
    cpl0
  kvm: x86: Refactor kvm_emulate_hypercall() to no skip instruction
  kvm: x86: Emulate hypercall instead of fixing hypercall instruction

 arch/x86/include/asm/kvm-x86-ops.h |  1 +
 arch/x86/include/asm/kvm_host.h    |  1 +
 arch/x86/kvm/emulate.c             | 20 +++++------
 arch/x86/kvm/kvm_emulate.h         |  2 +-
 arch/x86/kvm/svm/svm.c             |  5 +++
 arch/x86/kvm/vmx/vmx.c             |  9 +++++
 arch/x86/kvm/x86.c                 | 55 +++++++++++++++++-------------
 7 files changed, 58 insertions(+), 35 deletions(-)

--
2.31.1


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

end of thread, other threads:[~2021-09-16 16:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 11:37 [PATCH 0/3] some fixes of hypercall emulation Hou Wenlong
2021-09-09 11:37 ` [PATCH 1/3] kvm: x86: Introduce hypercall x86 ops for handling hypercall not in cpl0 Hou Wenlong
2021-09-09 11:37 ` [PATCH 2/3] kvm: x86: Refactor kvm_emulate_hypercall() to no skip instruction Hou Wenlong
2021-09-09 11:37 ` [PATCH 3/3] kvm: x86: Emulate hypercall instead of fixing hypercall instruction Hou Wenlong
2021-09-09 11:55 ` [PATCH v2 0/3] kvm: x86: some fixes of hypercall emulation Hou Wenlong
2021-09-09 11:55   ` [PATCH v2 1/3] kvm: x86: Introduce hypercall x86 ops for handling hypercall not in cpl0 Hou Wenlong
2021-09-09 16:39     ` Yu Zhang
2021-09-09 17:09       ` Sean Christopherson
2021-09-10  1:53         ` Yu Zhang
2021-09-09 11:55   ` [PATCH v2 2/3] kvm: x86: Refactor kvm_emulate_hypercall() to no skip instruction Hou Wenlong
2021-09-09 11:55   ` [PATCH v2 3/3] kvm: x86: Emulate hypercall instead of fixing hypercall instruction Hou Wenlong
2021-09-16 16:00     ` Sean Christopherson

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.