|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 2/7] xen/arm64: head: Introduce get_table_slot() and use it
On 15/08/2022 15:45, Bertrand Marquis wrote: Hi Julien, Hi Bertrand, On 12 Aug 2022, at 20:24, Julien Grall <julien@xxxxxxx> wrote: From: Julien Grall <jgrall@xxxxxxxxxx> There are a few places in the code that need to find the slot at a given page-table level. So create a new macro get_table_slot() for that. This will reduce the effort to figure out whether the code is doing the right thing. Take the opportunity to use 'ubfx'. The only benefits is reducing the number of instructions from 2 to 1. The new macro is used everywhere we need to compute the slot. This requires to tweak the parameter of create_table_entry() to pass a level rather than shift. Note, for slot 0 the code is currently skipping the masking part. While this is fine, it is safer to mask it as technically slot 0 only covers bit 48 - 39 bit (assuming 4KB page granularity). Take the opportunity to correct the comment when finding the second slot for the identity mapping (we are computing the second slot rather than first). Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx> Thanks!
To me, the name of the macros are self-explaining. So I am not entirely what to write in the comments. Please suggest. Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |