RE: [PATCH v3 1/2] KVM: VMX: Cleanup VMX basic information defines and usages

Li, Xin3
2024-01-12T09:51:08Z

> >> @@ -6964,7 +6975,7 @@ static void nested_vmx_setup_basic(struct
> nested_vmx_msrs *msrs)
> >> VMCS12_REVISION |
> >> VMX_BASIC_TRUE_CTLS |
> >> ((u64)VMCS12_SIZE << VMX_BASIC_VMCS_SIZE_SHIFT) |
> >> - (VMX_BASIC_MEM_TYPE_WB <<
> VMX_BASIC_MEM_TYPE_SHIFT);
> >> + (MEM_TYPE_WB << VMX_BASIC_MEM_TYPE_SHIFT);
> >>
> >
> > ... here, we can remove the two _SHIFT but define below instead:
> >
> > #define VMX_BASIC_VMCS12_SIZE ((u64)VMCS12_SIZE << 32)
> > #define VMX_BASIC_MEM_TYPE_WB (MEM_TYPE_WB << 50)
>
> I personally don't like such names, unless we can name them in a better way.
>
> >
> > And use above two macros in nested_vmx_setup_basic()?

A second thought on this, I agree this is better. And I will post v4.

Thanks!
Xin