Skip to content

KVM: Fix and clean up kvm_vcpu_map[_readonly]() usages

Peter Fang kvm linuxppc-dev lkml 2 versions – Applied

Status from this message: Applied patch 1 to kvm-x86 generic. I'm moderately optimistic that the gpc

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 22 repliesApplied
  2. v11 patch 6 repliesSuperseded

Changes in v2 from the cover letter

- Rebased on top of latest kvm.git#master
- As suggested by Yosry, refactor the APIs to reduce boilerplate code at call sites

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: Fix kvm_vcpu_map[_readonly]() function prototypesinclude/linux/kvm_host.h+5 -51 reply
2/3KVM: Move page mapping/unmapping APIs in kvm_host.hinclude/linux/kvm_host.h+23 -231 reply
3/3KVM: Take gpa_t in kvm_vcpu_map[_readonly]()arch/powerpc/kvm/book3s_pr.c arch/x86/kvm/svm/nested.c arch/x86/kvm/svm/sev.c +3 more+17 -1814 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchYosry Ahmed
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] KVM: Fix and clean up kvm_vcpu_map[_readonly]() usages

kvm_vcpu_map() and kvm_vcpu_map_readonly() are declared to take a gpa_t in kvm_host.h when they're supposed to take a gfn_t. First fix the function prototypes, and then refactor them to correctly take a gpa_t, reducing boilerplate gpa->gfn conversions at all call sites.

No actual harm has been done yet as all of the call sites are correctly passing in a gfn.

No functional change intended. All changes are compile-tested on x86 and ppc, which are the current users of these APIs.

---

v1 -> v2:
- Rebased on top of latest kvm.git#master
- As suggested by Yosry, refactor the APIs to reduce boilerplate code at call sites

v1: https://lore.kernel.org/kvm/[email protected]/

Peter Fang (3):
KVM: Fix kvm_vcpu_map[_readonly]() function prototypes
KVM: Move page mapping/unmapping APIs in kvm_host.h
KVM: Take gpa_t in kvm_vcpu_map[_readonly]()

 arch/powerpc/kvm/book3s_pr.c |  2 +-
 arch/x86/kvm/svm/nested.c    |  4 ++--
 arch/x86/kvm/svm/sev.c       |  2 +-
 arch/x86/kvm/svm/svm.c       |  8 +++----
 arch/x86/kvm/vmx/nested.c    | 11 ++++-----
 include/linux/kvm_host.h     | 46 ++++++++++++++++++------------------
 6 files changed, 36 insertions(+), 37 deletions(-)

base-commit: df83746075778958954aa0460cca55f4b3fc9c02

Signature · 1 line
2.53.0