linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] x86/hyperv: KVM: VMCB enlightenment cleanups
@ 2022-09-21 20:16 Sean Christopherson
  2022-09-21 20:16 ` [PATCH 1/4] x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h Sean Christopherson
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sean Christopherson @ 2022-09-21 20:16 UTC (permalink / raw)
  To: K. Y. Srinivasan, Haiyang Zhang, Stephen Hemminger, Wei Liu,
	Dexuan Cui, Sean Christopherson, Paolo Bonzini, Vitaly Kuznetsov
  Cc: linux-hyperv, kvm, linux-kernel

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/20220921152436.3673454-1-vkuznets@redhat.com

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
-- 
2.37.3.968.ga6b4b080e4-goog


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

end of thread, other threads:[~2022-09-27 10:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 20:16 [PATCH 0/4] x86/hyperv: KVM: VMCB enlightenment cleanups Sean Christopherson
2022-09-21 20:16 ` [PATCH 1/4] x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h Sean Christopherson
2022-09-22 22:18   ` Michael Kelley (LINUX)
2022-09-22 22:22     ` Sean Christopherson
2022-09-27 10:11       ` Vitaly Kuznetsov
2022-09-21 20:16 ` [PATCH 2/4] KVM: selftests: Move "struct hv_enlightenments" to x86_64/svm.h Sean Christopherson
2022-09-21 20:16 ` [PATCH 3/4] KVM: SVM: Add a proper field for Hyper-V VMCB enlightenments Sean Christopherson
2022-09-21 20:16 ` [PATCH 4/4] x86/hyperv: KVM: Rename "hv_enlightenments" to "hv_vmcb_enlightenments" Sean Christopherson
2022-09-22 22:21   ` Michael Kelley (LINUX)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).