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

Re: [Xen-devel] [PATCH v2] nested VMX: fix I/O port exit emulation



>>> On 03.12.13 at 15:30, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> @@ -2220,15 +2219,23 @@ int nvmx_n2_vmexit_handler(struct cpu_us
>>          if ( ctrl & CPU_BASED_ACTIVATE_IO_BITMAP )
>>          {
>>              unsigned long qual;
>> -            u16 port;
>> +            u16 port, size;
>>  
>>              __vmread(EXIT_QUALIFICATION, &qual);
>>              port = qual >> 16;
>> -            bitmap = nvmx->iobitmap[port >> 15];
>> -            if ( bitmap[(port & 0x7fff) >> 3] & (1 << (port & 0x7)) )
>> -                nvcpu->nv_vmexit_pending = 1;
>> +            size = (qual & 7) + 1;
> 
> This should be (qual & 3) for the correct size (Bit 3 is the
> direction).

Right - bit 3 is the direction. Bits 0..2 are the size. Hence the
mask ought to be 7.

>  Is it worth also verifying that ((qual & 3) != 2)?

I don't think so - there's no harm to our code here if an undefined
value was there.

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