[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 at 18:57, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 20/01/15 11:07, Jan Beulich wrote:
>> @@ -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.

A good compiler certainly could, but I prefer to make such
optimizations explicit (and hence compiler independent) in the
source code.

Jan


_______________________________________________
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®.