[PATCH v7 05/24] x86/apic/vector: Skip cleanup for the NMI vector

From: Ricardo Neri
Date: Wed Mar 01 2023 - 18:38:19 EST


The NMI vector is fixed. No cleanup is needed after updating affinity.

Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: "Ravi V. Shankar" <ravi.v.shankar@xxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
Cc: linuxppc-dev@xxxxxxxxxxxxxxxx
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>

---
Changes since v6:
* Introduced this patch.

Changes since v5:
* N/A

Changes since v4:
* N/A

Changes since v3:
* N/A

Changes since v2:
* N/A

Changes since v1:
* N/A
---
arch/x86/kernel/apic/vector.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index a4cf041427cb..3045823ecc1b 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -1050,6 +1050,10 @@ void send_cleanup_vector(struct irq_cfg *cfg)
{
struct apic_chip_data *apicd;

+ /* NMI has a fixed vector. No vector management required. */
+ if (cfg->delivery_mode == APIC_DELIVERY_MODE_NMI)
+ return;
+
apicd = container_of(cfg, struct apic_chip_data, hw_irq_cfg);
if (apicd->move_in_progress)
__send_cleanup_vector(apicd);
--
2.25.1