 
	
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v3] nested SVM: adjust guest handling of structure mappings
 On 11/11/13 13:35, Jan Beulich wrote:
>>>> On 11.11.13 at 14:16, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 11/11/13 12:53, Jan Beulich wrote:
>>> +    for ( io_bitmap = hvm_map_guest_frame_ro(gfn, 0); ; )
>>> +    {
>>> +        enabled = io_bitmap && test_bit(port, io_bitmap);
>>> +        if ( !enabled || !--size )
>>> +            break;
>>> +        if ( unlikely(++port == 8 * PAGE_SIZE) )
>>> +        {
>>> +            hvm_unmap_guest_frame(io_bitmap, 0);
>>> +            io_bitmap = hvm_map_guest_frame_ro(++gfn, 0);
>>> +            port -= 8 * PAGE_SIZE;
>>> +        }
>>>      }
>> Ok - this safe now, but I don't understand the reasoning for introducing
>> this loop?
>>
>> The ioio exit value gives us a single port, and the size of access on
>> that specific port.
>>
>> The switch statement tells us exactly which gfn the relevant bit refers
>> to, surely a single hvm_map_guest_frame_ro() is sufficient?
> When the operation spans multiple ports (INW, INL, etc), multiple
> bits need to be looked at. And when the access is misaligned and
> crosses a 32k (port number) boundary, more than one page needs
> looking at.
>
> Jan
>
Ah of course.
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
 
 | 
|  | Lists.xenproject.org is hosted with RackSpace, monitoring our |