Skip to content

x86/hyperv: KVM: VMCB enlightenment cleanups

Sean Christopherson kvm linux-hyperv lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.harch/x86/include/asm/hyperv-tlfs.h arch/x86/kvm/svm/hyperv.h arch/x86/kvm/svm/svm_onhyperv.h+24 -363 replies
2/4KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.htools/testing/selftests/kvm/include/x86_64/svm.h tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c+17 -180 replies
3/4KVM: SVM: Add a proper field for Hyper-V VMCB enlightenmentsarch/x86/include/asm/svm.h arch/x86/kvm/svm/nested.c arch/x86/kvm/svm/svm.h +4 more+27 -190 replies
4/4x86/hyperv: KVM: Rename "hv_enlightenments" to "hv_vmcb_enlightenments"arch/x86/include/asm/hyperv-tlfs.h arch/x86/include/asm/svm.h arch/x86/kvm/svm/nested.c +5 more+11 -111 reply

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchMichael Kelley
1/4
2/4
3/4
4/4R-b

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

Read the v1 thread

Cover letter [PATCH 0/4] x86/hyperv: KVM: VMCB enlightenment cleanups

Hyper-V folks, if the changes look ok I'd like to take this through the KVM tree as Vitaly has an in-progress KVM series[*] that conflicts mightily with these changes.

The main goal of this series it to clean up KVM's ugly casting of the VMCB's software reserved field to the Hyper-V enlightenments struct, e.g. replace a bunch of code that does:

	(struct hv_enlightenments *)vmcb->control.reserved_sw;

with:

	&vmcb->control.hv_enlightenments;

That cleanup is complicated slightly due the Hyper-V enlightenments being "KVM private", versus the VMCB struct being "public", but that itself is also a "bug". The enlightenments come directly from the TLFS, i.e. aren't KVM internal. Moving the definition to hyperv-tlfs.h where it belongs has the happy side effect of making the struct visible to asm/svm.h.

Compile tested only, but the resulting kvm-amd.ko binary is identical before and after the series.

[*] https://lore.kernel.org/all/[email protected]

Sean Christopherson (4):
x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h
KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.h
KVM: SVM: Add a proper field for Hyper-V VMCB enlightenments x86/hyperv: KVM: Rename "hv_enlightenments" to
"hv_vmcb_enlightenments"

 arch/x86/include/asm/hyperv-tlfs.h            | 22 ++++++++++++
 arch/x86/include/asm/svm.h                    |  7 +++-
 arch/x86/kvm/svm/hyperv.h                     | 35 -------------------
 arch/x86/kvm/svm/nested.c                     |  9 +++--
 arch/x86/kvm/svm/svm.h                        |  5 ++-
 arch/x86/kvm/svm/svm_onhyperv.c               |  4 +--
 arch/x86/kvm/svm/svm_onhyperv.h               | 18 +++++-----
 .../selftests/kvm/include/x86_64/svm.h        | 22 +++++++++++-
 .../selftests/kvm/x86_64/hyperv_svm_test.c    | 21 +----------
 9 files changed, 69 insertions(+), 74 deletions(-)
 delete mode 100644 arch/x86/kvm/svm/hyperv.h

base-commit: 372d07084593dc7a399bf9bee815711b1fb1bcf2

Signature · 1 line
2.37.3.968.ga6b4b080e4-goog