Skip to content

RFC KVM/X86: Introduce a new guest mapping API

KarimAllah Ahmed kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12KVM: Introduce helper functions to map/unmap guest memoryinclude/linux/kvm_host.h virt/kvm/kvm_main.c+80 -00 replies
2/12KVM/VMX: Use the new host mapping API for apic_access_pagearch/x86/kvm/vmx.c+13 -201 reply
3/12KVM/VMX: Use the new host mapping API for virtual_apic_pagearch/x86/kvm/vmx.c+12 -223 replies
4/12KVM/VMX: Use the new host mapping API for pi_desc_pagearch/x86/kvm/vmx.c+18 -220 replies
5/12KVM/VMX: Use the new host mapping API for mapping nested vmptrarch/x86/kvm/vmx.c+6 -82 replies
6/12KVM/VMX: Use the new host mapping API for handle_vmptrldarch/x86/kvm/vmx.c+8 -80 replies
7/12KVM/VMX: Use the new host mapping API for mapping L12 MSR bitmaparch/x86/kvm/vmx.c+5 -60 replies
8/12KVM/VMX: Use the new host mapping API for mapping nested PMLarch/x86/kvm/vmx.c+5 -60 replies
9/12KVM/VMX: Use the new host mapping API for cmpxchg_emulatedarch/x86/kvm/x86.c+5 -70 replies
10/12KVM/VMX: Use the new host mapping API for synic_clear_sint_msg_pendingarch/x86/kvm/hyperv.c+6 -60 replies
11/12KVM/VMX: Use the new host mapping API for synic_deliver_msgarch/x86/kvm/hyperv.c+6 -60 replies
12/12KVM/VMX: Remove kvm_vcpu_gpa_to_page as it is now unusedinclude/linux/kvm_host.h+0 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 00/12] KVM/X86: Introduce a new guest mapping API

Guest memory can either be directly managed by the kernel (i.e. have a "struct page") or they can simply live outside kernel control (i.e. do not have a "struct page"). KVM mostly support these two modes, except in a few places where the code seems to assume that guest memory must have a "struct page".

This patchset introduces a new mapping function to map guest memory into host kernel memory. Ideally I should also get rid of all guest mapping functions that end up converting a guest address to a page, but I decided to get feedback on this first and see if this is an acceptable API.

Most of the offending code paths that has been updated are in the nested code base. Mostly because I stumbled upon this code while looking at the nested MSR bitmap handling for the IBRS patches. There are also offending code paths in SVM code, but I will do that once the interface is accepted.

KarimAllah Ahmed (12):
KVM: Introduce helper functions to map/unmap guest memory KVM/VMX: Use the new host mapping API for apic_access_page KVM/VMX: Use the new host mapping API for virtual_apic_page KVM/VMX: Use the new host mapping API for pi_desc_page KVM/VMX: Use the new host mapping API for mapping nested vmptr KVM/VMX: Use the new host mapping API for handle_vmptrld KVM/VMX: Use the new host mapping API for mapping L12 MSR bitmap KVM/VMX: Use the new host mapping API for mapping nested PML KVM/VMX: Use the new host mapping API for cmpxchg_emulated KVM/VMX: Use the new host mapping API for synic_clear_sint_msg_pending KVM/VMX: Use the new host mapping API for synic_deliver_msg KVM/VMX: Remove kvm_vcpu_gpa_to_page as it is now unused

 arch/x86/kvm/hyperv.c    |  24 +++----
 arch/x86/kvm/vmx.c       | 159 ++++++++++++++++++++---------------------------
 arch/x86/kvm/x86.c       |  12 ++--
 include/linux/kvm_host.h |  18 +++++-
 virt/kvm/kvm_main.c      |  62 ++++++++++++++++++
 5 files changed, 161 insertions(+), 114 deletions(-)
Signature · 1 line
2.7.4