Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/arm64/exception.S
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | .if \el == 0 | ||||
blr x1 | blr x1 | ||||
1: | 1: | ||||
ldr x0, [x18, #PC_CURTHREAD] | ldr x0, [x18, #PC_CURTHREAD] | ||||
bl ptrauth_exit_el0 | bl ptrauth_exit_el0 | ||||
ldr x0, [x18, #(PC_CURTHREAD)] | ldr x0, [x18, #(PC_CURTHREAD)] | ||||
bl dbg_monitor_enter | bl dbg_monitor_enter | ||||
msr daifclr, #DAIF_D /* Enable the debug exception */ | |||||
.endif | /* Unmask debug and SError exceptions */ | ||||
msr daifclr, #(DAIF_D | DAIF_A) | |||||
.else | |||||
/* | /* | ||||
* Unmask debug and SError exceptions. | |||||
* For EL1, debug exceptions are conditionally unmasked in | * For EL1, debug exceptions are conditionally unmasked in | ||||
* do_el1h_sync(). | * do_el1h_sync(). | ||||
*/ | */ | ||||
msr daifclr, #(DAIF_A) | |||||
.endif | |||||
mhorne: Can an SError interrupt be taken from EL1? If so, I think you need to unmask DAIF_A here or in… | |||||
.endm | .endm | ||||
.macro restore_registers el | .macro restore_registers el | ||||
.if \el == 1 | |||||
/* | /* | ||||
* Disable interrupts and debug exceptions, x18 may change in the | * Mask all exceptions, x18 may change in the interrupt exception | ||||
* interrupt exception handler. For EL0 exceptions, do_ast already | * handler. | ||||
* did this. | |||||
*/ | */ | ||||
msr daifset, #(DAIF_D | DAIF_INTR) | msr daifset, #(DAIF_ALL) | ||||
.endif | |||||
.if \el == 0 | .if \el == 0 | ||||
ldr x0, [x18, #PC_CURTHREAD] | ldr x0, [x18, #PC_CURTHREAD] | ||||
mov x1, sp | mov x1, sp | ||||
bl dbg_monitor_exit | bl dbg_monitor_exit | ||||
ldr x0, [x18, #PC_CURTHREAD] | ldr x0, [x18, #PC_CURTHREAD] | ||||
bl ptrauth_enter_el0 | bl ptrauth_enter_el0 | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
.endm | .endm | ||||
.macro do_ast | .macro do_ast | ||||
mrs x19, daif | mrs x19, daif | ||||
/* Make sure the IRQs are enabled before calling ast() */ | /* Make sure the IRQs are enabled before calling ast() */ | ||||
bic x19, x19, #PSR_I | bic x19, x19, #PSR_I | ||||
1: | 1: | ||||
/* Disable interrupts */ | /* | ||||
msr daifset, #(DAIF_D | DAIF_INTR) | * Mask interrupts while checking the ast pending flag | ||||
*/ | |||||
msr daifset, #(DAIF_INTR) | |||||
/* Read the current thread flags */ | /* Read the current thread flags */ | ||||
ldr x1, [x18, #PC_CURTHREAD] /* Load curthread */ | ldr x1, [x18, #PC_CURTHREAD] /* Load curthread */ | ||||
ldr x2, [x1, #TD_FLAGS] | ldr x2, [x1, #TD_FLAGS] | ||||
/* Check if we have either bits set */ | /* Check if we have either bits set */ | ||||
mov x3, #((TDF_ASTPENDING|TDF_NEEDRESCHED) >> 8) | mov x3, #((TDF_ASTPENDING|TDF_NEEDRESCHED) >> 8) | ||||
lsl x3, x3, #8 | lsl x3, x3, #8 | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |
Can an SError interrupt be taken from EL1? If so, I think you need to unmask DAIF_A here or in do_el1h_sync().