修复aarch64 smp启动失败问题 (#7760)

This commit is contained in:
wangqinglin 2023-07-01 22:46:43 +08:00 committed by GitHub
parent 25072608f5
commit e0b2b8fecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 15 deletions

View File

@ -528,18 +528,18 @@ struct page_table
unsigned long page[512]; unsigned long page[512];
}; };
static struct page_table *__init_page_array; /* */
static unsigned long __page_off = 0UL; static struct page_table __init_page_array[6] rt_align(0x1000);
static unsigned long __page_off = 2UL; /* 0, 1 for ttbr0, ttrb1 */
unsigned long get_ttbrn_base(void)
{
return (unsigned long) __init_page_array;
}
unsigned long get_free_page(void) unsigned long get_free_page(void)
{ {
if (!__init_page_array)
{
extern unsigned char __bss_end;
__init_page_array = (struct page_table *) RT_ALIGN((unsigned long) &__bss_end, 0x1000);
__page_off = 2; /* 0, 1 for ttbr0, ttrb1 */
}
__page_off++; __page_off++;
return (unsigned long)(__init_page_array[__page_off - 1].page); return (unsigned long) (__init_page_array[__page_off - 1].page);
} }
static int _map_single_page_2M(unsigned long *lv0_tbl, unsigned long va, static int _map_single_page_2M(unsigned long *lv0_tbl, unsigned long va,

View File

@ -119,7 +119,7 @@ __start:
.L__jump_to_entry: /* jump to C code, should not return */ .L__jump_to_entry: /* jump to C code, should not return */
bl mmu_tcr_init bl mmu_tcr_init
adr x0, .early_mmu_table /* install early page table */ bl get_ttbrn_base
add x1, x0, #0x1000 add x1, x0, #0x1000
msr ttbr0_el1, x0 msr ttbr0_el1, x0
@ -246,7 +246,7 @@ _secondary_cpu_entry:
bl mmu_tcr_init bl mmu_tcr_init
adr x0, .early_mmu_table /* GET & setup early page table */ bl get_ttbrn_base
add x1, x0, #0x1000 add x1, x0, #0x1000
msr ttbr0_el1, x0 msr ttbr0_el1, x0
@ -293,10 +293,6 @@ after_mmu_enable_cpux:
b rt_hw_secondary_cpu_bsp_start b rt_hw_secondary_cpu_bsp_start
#endif #endif
.align 12
.early_mmu_table:
.space (4096 * 2)
.align 12 .align 12
.el_stack: .el_stack:
.space (8192) .space (8192)