[RFC PATCH 4/6] x86/softirq: Support softirq disabled mask

From: Frederic Weisbecker
Date: Tue Aug 01 2023 - 09:25:11 EST


Support the new softirq disabled vectors mask and put in the per-cpu
hot structure along with the pending vectors mask as both are used
closely together.

Signed-off-by: Frederic Weisbecker <frederic@xxxxxxxxxx>
---
arch/x86/Kconfig | 1 +
arch/x86/include/asm/current.h | 1 +
arch/x86/include/asm/hardirq.h | 1 +
3 files changed, 3 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index a2a410d13e39..f1cd68b672dc 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -93,6 +93,7 @@ config X86
select ARCH_HAS_COPY_MC if X86_64
select ARCH_HAS_SET_MEMORY
select ARCH_HAS_SET_DIRECT_MAP
+ select ARCH_HAS_SOFTIRQ_DISABLED_MASK
select ARCH_HAS_STRICT_KERNEL_RWX
select ARCH_HAS_STRICT_MODULE_RWX
select ARCH_HAS_SYNC_CORE_BEFORE_USERMODE
diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h
index a1168e7b69e5..b86ca9c0ddc2 100644
--- a/arch/x86/include/asm/current.h
+++ b/arch/x86/include/asm/current.h
@@ -23,6 +23,7 @@ struct pcpu_hot {
unsigned long top_of_stack;
void *hardirq_stack_ptr;
u16 softirq_pending;
+ u16 softirq_disabled;
#ifdef CONFIG_X86_64
bool hardirq_stack_inuse;
#else
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index 66837b8c67f1..933cf05e5738 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -61,6 +61,7 @@ extern u64 arch_irq_stat(void);
#define arch_irq_stat arch_irq_stat

#define local_softirq_pending_ref pcpu_hot.softirq_pending
+#define local_softirq_disabled_ref pcpu_hot.softirq_disabled

#if IS_ENABLED(CONFIG_KVM_INTEL)
static inline void kvm_set_cpu_l1tf_flush_l1d(void)
--
2.34.1