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

Re: [Xen-devel] [PATCH v2] nested SVM: adjust guest handling of structure mappings



>>> On 11.11.13 at 12:25, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
> On 11/11/13 11:07, Jan Beulich wrote:
>> @@ -360,10 +360,12 @@ static int nsvm_vmrun_permissionmap(stru
>>      svm->ns_iomap_pa = ns_vmcb->_iopm_base_pa;
>>  
>>      ns_viomap = hvm_map_guest_frame_ro(svm->ns_iomap_pa >> PAGE_SHIFT, 0);
>> -    ASSERT(ns_viomap != NULL);
>> -    ioport_80 = test_bit(0x80, ns_viomap);
>> -    ioport_ed = test_bit(0xed, ns_viomap);
>> -    hvm_unmap_guest_frame(ns_viomap, 0);
>> +    if ( ns_viomap )
>> +    {
>> +        ioport_80 = test_bit(0x80, ns_viomap);
>> +        ioport_ed = test_bit(0xed, ns_viomap);
>> +        hvm_unmap_guest_frame(ns_viomap, 0);
>> +    }
> 
> Should we not bail on an error here, similar to the failure of
> hvm_copy_from_guest just out of context above?

It seemed less intrusive (to the guest) to simply disallow (direct)
access to these ports in that case.

>> -    io_bitmap = hvm_map_guest_frame_ro(gfn, 0);
>> -    if (io_bitmap == NULL) {
>> -        gdprintk(XENLOG_ERR,
>> -            "IOIO intercept: mapping of permission map failed\n");
>> -        return NESTEDHVM_VMEXIT_ERROR;
>> +    for ( io_bitmap = hvm_map_guest_frame_ro(gfn, 0); ; )
> 
> This needs further checking for NULL.

Indeed, thanks for spotting.

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