kvm: x86: some fixes of hypercall emulation
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 4 repliesIn review
- v13 patches 0 repliesSuperseded
Changes in v2 from the cover letter
v1 is wrong edition, sent by mistake
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | kvm: x86: Introduce hypercall x86 ops for handling hypercall not in cpl0arch/ arch/ arch/ +2 more | +20 | 3 replies | |
| 2/3 | kvm: x86: Refactor kvm_emulate_hypercall() to no skip instructionarch/ | +23 | 0 replies | |
| 3/3 | kvm: x86: Emulate hypercall instead of fixing hypercall instructionarch/ arch/ arch/ | +18 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] kvm: x86: some fixes of hypercall emulation
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().
change from v1:
v1 is wrong edition, sent by mistake
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 | 6 ++++ arch/x86/kvm/vmx/vmx.c | 9 +++++ arch/x86/kvm/x86.c | 55 +++++++++++++++++------------- 7 files changed, 59 insertions(+), 35 deletions(-)
--
2.31.1