|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 7/9] arm/mem_access: Add long-descriptor based gpt
On 23/06/17 15:23, Sergej Proskurin wrote: Hi Julien, [...] No. You should not return an error here as you would not be compliant with the ARM ARM. I just asked to add a comment explain why you choose 4K, even if it says "We follow the pseudo-code". [...]+ + /* + * 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_mapping(pte)) )If you look at the comment on top of lpae_mapping, it should only be used for L0..L2 ptes. So why are you using it on L3 ptes?
If you look at the ARM ARM (D4.3.1 and D4.3.2 in DDI0487B.a)
* level 0,1,2 will have bit 1 set for table and cleared for mapping.
* level 3 will have bit 1 set for mapping
If you use p2m_table to check it the bit is set, then it mislead
completely the user as this entry is not a table at all.
In any, this is totally wrong to use p2m_table and p2m_mapping here as it would not report correctly the value. So please don't use an helper that does not make sense here. You should just open-code it or introduce a helper (such as lpae_page with appropriate) to properly check the bit. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |