From 05f04ae4ffcc77cfcda86adc4e2c13aa72143c03 Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Tue, 26 Jan 2021 14:48:09 +0100 Subject: KVM: x86: hyper-v: Introduce to_kvm_hv() helper Spelling '&kvm->arch.hyperv' correctly is hard. Also, this makes the code more consistent with vmx/svm where to_kvm_vmx()/to_kvm_svm() are already being used. Opportunistically change kvm_hv_msr_{get,set}_crash_{data,ctl}() and kvm_hv_msr_set_crash_data() to take 'kvm' instead of 'vcpu' as these MSRs are partition wide. No functional change intended. Suggested-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20210126134816.1880136-9-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini --- arch/x86/kvm/hyperv.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/x86/kvm/hyperv.h') diff --git a/arch/x86/kvm/hyperv.h b/arch/x86/kvm/hyperv.h index 220849cc12e5..fdb321ba9c3f 100644 --- a/arch/x86/kvm/hyperv.h +++ b/arch/x86/kvm/hyperv.h @@ -50,6 +50,11 @@ /* Hyper-V HV_X64_MSR_SYNDBG_OPTIONS bits */ #define HV_X64_SYNDBG_OPTION_USE_HCALLS BIT(2) +static inline struct kvm_hv *to_kvm_hv(struct kvm *kvm) +{ + return &kvm->arch.hyperv; +} + static inline struct kvm_vcpu_hv *to_hv_vcpu(struct kvm_vcpu *vcpu) { return &vcpu->arch.hyperv; -- cgit v1.2.3