arm64: kexec: Support the case of VA_BITS=39 in trans_pgd_idmap_page()
PATCH v2 1/1 arm64: kexec: Support the case of VA_BITS=39 in trans_pgd_idmap_page()
From: sihao <[email protected]>
fsl64() may get different values due to different physical addresses. Is it possible to confirm the value of max_msb with CONFIG_ARM64_VA_BITS?
---
Changes in V1:
Refer to: https://lore.kernel.org/lkml/[email protected]/
When the values of CONFIG_ARM64_VA_BITS and CONFIG_ARM64_PA_BITS are not equal, the following panic occurs when kexec is executed. This happens because trans_pgd_idmap_page() does not support VA_BITS=39. So the patch supports the case of VA_BITS=39.
arch/arm64/mm/trans_pgd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/trans_pgd.c +1 -1
@@ -232,7 +232,7 @@ int trans_pgd_idmap_page(struct trans_pgd_info *info, phys_addr_t *trans_ttbr0, {phys_addr_t dst_addr =virt_to_phys (page);unsigned long pfn =__phys_to_pfn (dst_addr); -int max_msb = (dst_addr &GENMASK (52 ,48 )) ?51 :47 ; +int max_msb =VA_BITS -1 ;int bits_mapped =PAGE_SHIFT -4 ;unsigned long level_mask, prev_level_entry, *levels[4 ];int this_level, index, level_lsb, level_msb;
Signature · 1 line
2.25.1
Catalin Marinas
maintainerQuoted 8 lines · On Thu, Feb 17, 2022 at 08:37:34AM +0000, [email protected] wrote:
From: sihao <[email protected]>
fsl64()may get different values due to different physical addresses. Is it possible to confirm the value ofmax_msbwithCONFIG_ARM64_VA_BITS?Reported-by sihao <[email protected]>Signed-off-by sihao <[email protected]>Reviewed-by CatalinMarinas <[email protected]>
I have not reviewed this patch yet, so this line shouldn't be here. I'll have a look next week.
Thanks.
Signature · 1 line
Catalin