Consolidate the machine_kexec_mask_interrupts implementation into a common...
function located in a new file: kernel/irq/kexec.c. This removes duplicate
implementations from architecture-specific files in arch/arm, arch/arm64,
arch/powerpc, and arch/riscv, reducing code duplication and improving
maintainability.
The new implementation retains architecture-specific behavior for
CONFIG_GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD, which was previously implemented
for ARM64. When enabled (currently for ARM64), it clears the active state
of interrupts forwarded to virtual machines (VMs) before handling other
interrupt masking operations.
--- a/kernel/irq/Kconfig
+++ b/kernel/irq/Kconfig
@@ -154,3 +154,12 @@ config DEPRECATED_IRQ_CPU_ONOFFLINE
bool
depends on CAVIUM_OCTEON_SOC
default CAVIUM_OCTEON_SOC
+
+config GENERIC_IRQ_KEXEC_CLEAR_VM_FORWARD
+ bool "Clear forwarded VM interrupts during kexec"
+ default n
+ help
+ When enabled, this option allows the kernel to clear the active state
+ of interrupts that are forwarded to virtual machines (VMs) during a
+ machine kexec. For interrupts that are not forwarded, if supported,
+ the kernel will attempt to trigger an End of Interrupt (EOI).