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

Re: [Xen-devel] [PATCH v5 10/12] arm/mem_access: Add long-descriptor based gpt



Hi Julien,


On 07/04/2017 07:06 PM, Julien Grall wrote:
> Hi Sergej,
>
>
>> +    /*
>> +     * According to to ARM DDI 0487B.a J1-5927, we return an error
>> if the found
>> +     * PTE is invalid or holds a reserved entry (PTE<1:0> == x0)) or
>> if the PTE
>> +     * maps a memory block at level 3 (PTE<1:0> == 01).
>> +     */
>> +    if ( !lpae_valid(pte) || ((level == 3) && !lpae_page(pte, level)) )
>
> NIT: What you want to check here is either the entry is a superpage or
> a page. So the below check would be easier to parse:
>
> if ( !lpae_is_superpage(pte, level) || !lpae_is_page(pte, level) )

Your suggested check is easier to parse, however introduces a bug
because as soon as the pte is not a superpage it will return an -EFAULT
at this point. I have changed the || into an && which makes it fine
again. The next patch series will follow shortly.

Cheers
~Sergej

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.