lkml.org 
[lkml]   [2022]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/4] x86/hyperv: Move VMCB enlightenment definitions to hyperv-tlfs.h
Date
Sean Christopherson <seanjc@google.com> writes:

> On Thu, Sep 22, 2022, Michael Kelley (LINUX) wrote:
>> From: Sean Christopherson <seanjc@google.com> Sent: Wednesday, September 21, 2022 1:16 PM
>> >
>> > Move Hyper-V's VMCB enlightenment definitions to the TLFS header; the
>> > definitions come directly from the TLFS[*], not from KVM.
>> >
>> > No functional change intended.
>> >
>> > [*] https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/datatypes/hv_svm_enlightened_vmcb_fields>
>> > Signed-off-by: Sean Christopherson <seanjc@google.com>
>> > ---
>> > arch/x86/include/asm/hyperv-tlfs.h | 22 +++++++++++++++++++
>> > arch/x86/kvm/svm/hyperv.h | 35 ------------------------------
>> > arch/x86/kvm/svm/svm_onhyperv.h | 3 ++-
>> > 3 files changed, 24 insertions(+), 36 deletions(-)
>> > delete mode 100644 arch/x86/kvm/svm/hyperv.h
>> >
>> > diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h
>> > index 0a9407dc0859..4c4f81daf5a2 100644
>> > --- a/arch/x86/include/asm/hyperv-tlfs.h
>> > +++ b/arch/x86/include/asm/hyperv-tlfs.h
>> > @@ -584,6 +584,28 @@ struct hv_enlightened_vmcs {
>> >
>> > #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_ALL 0xFFFF
>> >
>> > +/*
>> > + * Hyper-V uses the software reserved 32 bytes in VMCB control area to expose
>> > + * SVM enlightenments to guests.
>> > + */
>> > +struct hv_enlightenments {
>> > + struct __packed hv_enlightenments_control {
>> > + u32 nested_flush_hypercall:1;
>> > + u32 msr_bitmap:1;
>> > + u32 enlightened_npt_tlb: 1;
>> > + u32 reserved:29;
>> > + } __packed hv_enlightenments_control;
>> > + u32 hv_vp_id;
>> > + u64 hv_vm_id;
>> > + u64 partition_assist_page;
>> > + u64 reserved;
>> > +} __packed;
>> > +
>> > +/*
>> > + * Hyper-V uses the software reserved clean bit in VMCB.
>> > + */
>> > +#define VMCB_HV_NESTED_ENLIGHTENMENTS 31
>>
>> Is it feasible to change this identifier so it starts with HV_ like
>> everything else in this source code file, such as
>> HV_VMCB_NESTED_ENLIGHTENMENTS? It doesn't look like it is
>> used in very many places.
>
> Most definitely, IIRC it's used in only one spot.
>

I'll take these 4 patches to the next iteration of my "KVM: x86:
hyper-v: Fine-grained TLB flush + L2 TLB flush features" series and I'll
change VMCB_HV_NESTED_ENLIGHTENMENTS to HV_VMCB_NESTED_ENLIGHTENMENTS.

--
Vitaly

\
 
 \ /
  Last update: 2022-09-27 12:13    [W:0.243 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site