[PATCH v3 14/44] arm64: replace local_daif helpers
Ashok Raj
ashok.raj at oss.qualcomm.com
Wed Dec 2 13:31:43 PST 2026
> int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
> {
> + arm64_exc_hwstates_t hwstate;
> int ret;
>
> - local_daif_mask();
> + hwstate = local_exceptions_save_mask(CRITICAL_CONTEXT);
>
> /*
> * Having IRQs masked via PMR when entering the guest means the GIC
> @@ -683,18 +685,18 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
> * only way to get out will be via guest exceptions.
> * Naturally, we want to avoid this.
> *
> - * local_daif_mask() already sets GIC_PRIO_PSR_I_SET, we just need a
> - * dsb to ensure the redistributor is forwards EL2 IRQs to the CPU.
> + * local_exceptions_save_mask(), via helpers, sets
> + * GIC_PRIO_IRQON along with pmr_sync(), so we can be sure
> + * that redistributor forwards EL2 IRQs to the CPU.
> */
> - pmr_sync();
The comment seems to imply that the helper always sets PMR is IRQON, rather
than implying that it always writes PMR and executes pmr_sync()?
The comment seems to imply the helper is always setting PMR is IRQON
But local_exceptions_save_mask() seems to pass force=false when the current PMR
already matches the target; __arm64_update_exc_hwstate() and skips
the PMR write and pmr_sync(). ?
Cheers,
Ashok
More information about the linux-arm-kernel
mailing list