mirror_ubuntu-kernels/include/linux/irqchip
Valentin Schneider d23bc2bc1d irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve
Memory used by the LPI tables have to be made persistent for kexec to have
a chance to work, as explained in [1]. If they have been made persistent
and we are booting into a kexec'd kernel, we also need to free the pages
that were preemptively allocated by the new kernel for those tables.

Both of those operations currently happen during its_cpu_init(), which
happens in a _STARTING (IOW atomic) cpuhp callback for secondary
CPUs. efi_mem_reserve_iomem() issues a GFP_ATOMIC allocation, which
unfortunately doesn't work under PREEMPT_RT (this ends up grabbing a
non-raw spinlock, which can sleep under PREEMPT_RT). Similarly, freeing the
pages ends up grabbing a sleepable spinlock.

Since the memreserve is only required by kexec, it doesn't have to be done
so early in the secondary boot process. Issue the reservation in a new
CPUHP_AP_ONLINE_DYN cpuhp callback, and piggy-back the page freeing on top
of it. A CPU gets to run the body of this new callback exactly once.

As kexec issues a machine_shutdown() prior to machine_kexec(), it will be
serialized vs a CPU being plugged to life by the hotplug machinery - either
the CPU will have been brought up and have had its redistributor's pending
table memreserved, or it never went online and will have its table
allocated by the new kernel.

[1]: https://lore.kernel.org/lkml/20180921195954.21574-1-marc.zyngier@arm.com/

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211027151506.2085066-3-valentin.schneider@arm.com
2021-12-16 13:21:11 +00:00
..
arm-gic-common.h irqchip/gic: Split vGIC probing information from the GIC code 2021-06-01 10:45:58 +01:00
arm-gic-v3.h irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve 2021-12-16 13:21:11 +00:00
arm-gic-v4.h irqchip/gic-v4.1: Disable vSGI upon (GIC CPUIF < v4.1) detection 2021-04-22 15:55:21 +01:00
arm-gic.h
arm-vgic-info.h KVM: arm64: vgic: Let an interrupt controller advertise lack of HW deactivation 2021-06-01 10:45:59 +01:00
arm-vic.h irqchip/vic: Cut down the external API 2020-06-27 11:54:54 +01:00
chained_irq.h
irq-bcm2836.h irqchip: irq-bcm2836.h: drop a duplicated word 2020-07-27 08:55:03 +01:00
irq-davinci-aintc.h
irq-davinci-cp-intc.h
irq-ixp4xx.h
irq-madera.h
irq-omap-intc.h include/: replace HTTP links with HTTPS ones 2020-08-12 10:57:59 -07:00
irq-partition-percpu.h
irq-sa11x0.h
mmp.h
mxs.h
versatile-fpga.h
xtensa-mx.h
xtensa-pic.h