linux/arch/arm64
Mark Rutland 97d935faac arm64: Unmask Debug + SError in do_notify_resume()
When returning to a user context, the arm64 entry code masks all DAIF
exceptions before handling pending work in exit_to_user_mode_prepare()
and do_notify_resume(), where it will transiently unmask all DAIF
exceptions. This is a holdover from the old entry assembly, which
conservatively masked all DAIF exceptions, and it's only necessary to
mask interrupts at this point during the exception return path, so long
as we subsequently mask all DAIF exceptions before the actual exception
return.

While most DAIF manipulation follows a save...restore sequence, the
manipulation in do_notify_resume() is the other way around, unmasking
all DAIF exceptions before masking them again. This is unfortunate as we
unnecessarily mask Debug and SError exceptions, and it would be nice to
remove this special case to make DAIF manipulation simpler and most
consistent.

This patch changes exit_to_user_mode_prepare() and do_notify_resume() to
only mask interrupts while handling pending work, masking other DAIF
exceptions after this has completed. This removes the unusual DAIF
manipulation and allows Debug and SError exceptions to be taken for a
slightly longer window during the exception return path.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240206123848.1696480-4-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Itaru Kitayama <itaru.kitayama@linux.dev>
2024-02-20 18:12:13 +00:00
..
boot Samsung fixes for v6.8 2024-01-25 18:23:10 +01:00
configs arm64: defconfig reorder config lines 2024-01-11 09:34:42 +01:00
crypto crypto: arm64/sm4 - Remove cfb(sm4) 2023-12-08 11:59:45 +08:00
hyperv arm64/hyperv: Use CPUHP_AP_HYPERV_ONLINE state to fix CPU online sequencing 2023-06-17 23:09:47 +00:00
include arm64: Move do_notify_resume() to entry-common.c 2024-02-20 18:12:13 +00:00
kernel arm64: Unmask Debug + SError in do_notify_resume() 2024-02-20 18:12:13 +00:00
kvm Generic: 2024-01-17 13:03:37 -08:00
lib arm64: Get rid of ARM64_HAS_NO_HW_PREFETCH 2023-12-05 12:02:52 +00:00
mm IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
net bpf: Use arch_bpf_trampoline_size 2023-12-06 17:17:20 -08:00
tools arm64: Rename ARM64_WORKAROUND_2966298 2024-01-12 12:51:33 +00:00
xen
Kbuild
Kconfig arm64 fixes for -rc1 2024-01-19 13:36:15 -08:00
Kconfig.debug
Kconfig.platforms arm64: Add config for AMD Pensando SoC platforms 2023-09-28 09:45:23 +02:00
Makefile arm64: vdso32: Remove unused vdso32-offsets.h 2024-01-30 11:59:17 +00:00