// Native secondary landing pad. PSCI context is the validated flat CPU ID. // No Rust, stack access, or exclusive atomic operation occurs before the // primary-owned Normal Inner-Shareable identity root is enabled. .section .text.os_product_d5_boot,"ax" .balign 4 .global __os_product_d5_secondary_entry .type __os_product_d5_secondary_entry, %function __os_product_d5_secondary_entry: msr daifset, #0xf msr spsel, #1 cmp x0, #1 b.lo .Ld5_park cmp x0, #3 b.hi .Ld5_park mov x19, x0 adrp x1, __os_product_d5_vectors add x1, x1, :lo12:__os_product_d5_vectors msr vbar_el1, x1 isb mrs x1, CurrentEL cmp x1, #4 b.ne __os_product_d5_fault // A separate 17-page region belongs to each CPU. The lowest page has // already been unmapped by the primary, and both canaries stay untouched. sub x2, x19, #1 mov x3, #0x1000 movk x3, #0x1, lsl #16 mul x2, x2, x3 adrp x1, OS_PRODUCT_D5_STACKS add x1, x1, :lo12:OS_PRODUCT_D5_STACKS add x1, x1, x2 add x1, x1, x3 sub x1, x1, #16 mov sp, x1 mrs x1, cpacr_el1 orr x1, x1, #(3 << 20) msr cpacr_el1, x1 isb adrp x2, OS_PRODUCT_D5_BOOT add x2, x2, :lo12:OS_PRODUCT_D5_BOOT ldp x3, x4, [x2] ldp x5, x6, [x2, #16] msr mair_el1, x5 msr tcr_el1, x4 msr ttbr0_el1, x3 dsb sy isb tlbi vmalle1 dsb sy isb msr sctlr_el1, x6 isb mov x0, x19 bl os_product_d5_secondary .Ld5_park: wfe b .Ld5_park .size __os_product_d5_secondary_entry, .-__os_product_d5_secondary_entry // All exceptions retain raw CPU-owned diagnostic bytes and park. They never // fabricate an ERET, work completion, CPU_OFF, or successful join. .balign 4 __os_product_d5_fault: msr daifset, #0xf mrs x0, MPIDR_EL1 and x0, x0, #0xff cmp x0, #3 b.hi .Ld5_park adrp x4, OS_PRODUCT_D5_FAULTS add x4, x4, :lo12:OS_PRODUCT_D5_FAULTS add x4, x4, x0, lsl #6 mrs x0, ESR_EL1 mrs x1, ELR_EL1 mrs x2, FAR_EL1 mrs x3, MPIDR_EL1 stp x0, x1, [x4] stp x2, x3, [x4, #16] mov x0, #1 str x0, [x4, #32] dsb sy sev b .Ld5_park .section .text.os_product_d5_vectors,"ax" .balign 2048 .global __os_product_d5_vectors .global __os_product_d5_vectors_end .type __os_product_d5_vectors, %object __os_product_d5_vectors: .rept 16 b __os_product_d5_fault .space 124 .endr __os_product_d5_vectors_end: .size __os_product_d5_vectors, .-__os_product_d5_vectors