>>> On 20.01.15 at 18:57, <andrew.coop...@citrix.com> 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@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to