exception: Clean up FIQ state on secondary startup

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2022-07-18 04:26:32 +09:00
parent a010a2fc36
commit 8f945fcdfe
2 changed files with 13 additions and 1 deletions

View file

@ -123,8 +123,21 @@ void exception_initialize(void)
{
msr(VBAR_EL1, _vectors_start);
// Clear FIQ sources
msr(CNTP_CTL_EL0, 7L);
msr(CNTV_CTL_EL0, 7L);
if (in_el2()) {
msr(CNTP_CTL_EL02, 7L);
msr(CNTV_CTL_EL02, 7L);
}
reg_clr(SYS_IMP_APL_PMCR0, PMCR0_IACT | PMCR0_IMODE_MASK);
reg_clr(SYS_IMP_APL_UPMCR0, UPMCR0_IMODE_MASK);
msr(SYS_IMP_APL_IPI_SR_EL1, IPI_SR_PENDING);
if (is_primary_core())
msr(DAIF, 0 << 6); // Enable SError, IRQ and FIQ
else
msr(DAIF, 3 << 6); // Disable IRQ and FIQ
if (in_el2()) {
// Set up a sane HCR_EL2

View file

@ -166,7 +166,6 @@ hv_enter_guest:
str x5, [x6, x7, LSL #3]
mrs x5, daif
msr daifclr, 3
mov x6, #5
orr x5, x5, x6 // EL1h
msr spsr_el2, x5