[PATCH 2/2] arm64: add software pagetable walker

Caleb Connolly caleb.connolly at linaro.org
Fri Jun 7 22:10:06 CEST 2024



On 07/06/2024 19:00, Tom Rini wrote:
> On Fri, Jun 07, 2024 at 06:51:20PM +0200, Caleb Connolly wrote:
> 
>> Add a basic software implementation of the ARM64 pagetable walker. This
>> can be used for debugging U-Boot's pagetable, as well as dumping the
>> pagetable from the previous bootloader stage if it used one (by reading
>> out the ttbr address).
>>
>> One can either call dump_pagetable() to print the pagetable to the
>> console with the default formatter, or implement their own pagetable
>> handler using walke_pagetable() with a custom pte_walker_cb_t callback.
>>
>> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
>> ---
>>   arch/arm/cpu/armv8/cache_v8.c    | 202 +++++++++++++++++++++++++++++++++++++++
>>   arch/arm/include/asm/armv8/mmu.h |  55 +++++++++++
>>   2 files changed, 257 insertions(+)
> 
> So, I assume that by default, all of this gets discarded as unused code
> and that's why it's not behind a Kconfig. Next, please add something

Yes, a basic "strings" check on the U-Boot binary suggests this is the case.
> under maybe doc/arch/ or doc/develop (I'm honestly not sure which is
> best) that documents all of this. Thanks!

Sure, will try and find a suitable place for it.
> 

-- 
// Caleb (they/them)


More information about the U-Boot mailing list