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

Re: [Xen-devel] [PATCH RFC V2 5/6] xen, libxc: Request page fault injection via libxc



On 17/07/14 13:22, Razvan Cojocaru wrote:
> On 07/11/2014 09:06 PM, Andrew Cooper wrote:
>> On 11/07/14 16:43, Razvan Cojocaru wrote:
>>> +         && !ctxt.pending_event
>>> +         && ctxt.cr3 == d->fault_info.address_space )
>>> +    {
>>> +        /* Cache */
>>> +        uint64_t virtual_address = d->fault_info.virtual_address;
>>> +        uint32_t write_access = d->fault_info.write_access;
>>> +
>>> +        /* Reset */
>>> +        d->fault_info.address_space = 0;
>>> +        d->fault_info.virtual_address = 0;
>>> +        d->fault_info.write_access = 0;
>>> +
>>> +        hvm_inject_page_fault((write_access << 1) | PFEC_user_mode,
>> It is sensible in the slightest to have write_access shifted by 1 with
>> respect to a real pagefault error code?
> I'm not sure I follow this comment. Could you please elaborate a bit more?
>
>
> Thanks,
> Razvan Cojocaru

You have a user supplied integer, which you shift left by 1 bit and use
as a pagefault error code.

If it is supposed to be a boolean for read/write only, then it should be
treated as such.  If it is expected to be a full error code, then it
probably shouldn't be shifted.

~Andrew

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