[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/5] VMX: drop VMCS *_HIGH enumerators



On 20/01/15 11:07, Jan Beulich wrote:
> Most of them have been unused since the dropping of 32-bit support, and
> the few remaining cases are more efficiently dealt with using a generic
> macro (and probably things should have been done that way from the
> beginning).
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> As already mentioned in
> http://lists.xenproject.org/archives/html/xen-devel/2014-10/msg01580.html,
> looking at the changes to vvmx.c here emphasizes the question about the
> inconsistency between nvmx_vcpu_initialise() and nvmx_handle_vmwrite()
> wrt the MSR bitmap handling.
>
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -98,9 +98,9 @@ int nvmx_vcpu_initialise(struct vcpu *v)
>           * Let them vmexit as usual.
>           */
>          set_bit(IO_BITMAP_A, vw);
> -        set_bit(IO_BITMAP_A_HIGH, vw);
> +        set_bit(VMCS_HIGH(IO_BITMAP_A), vw);
>          set_bit(IO_BITMAP_B, vw);
> -        set_bit(IO_BITMAP_B_HIGH, vw);
> +        set_bit(VMCS_HIGH(IO_BITMAP_B), vw);
>  
>          unmap_domain_page(vr);
>          unmap_domain_page(vw);
> @@ -1761,15 +1761,15 @@ int nvmx_handle_vmwrite(struct cpu_user_
>      vmcs_encoding = reg_read(regs, decode.reg2);
>      __set_vvmcs(nvcpu->nv_vvmcx, vmcs_encoding, operand);
>  
> -    switch ( vmcs_encoding )
> +    switch ( vmcs_encoding & ~VMCS_HIGH(0) )

While this is functionally fine, it is quite odd to read.  One option
would be to use

case IO_BITMAP_A: case VMCS_HIGH(IO_BITMAP_A):

but I am not sure whether a compiler could optimise that as well as
masking the bottom bit out and halfing the number of case statements.

~Andrew


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.