summaryrefslogtreecommitdiff
path: root/arch/powerpc/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-22 08:05:19 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-22 08:05:19 -1000
commitbb2235894a8a604c08b3f93f4e1082b9df03265a (patch)
treec6e58a900d8e77472ecd8d5c7837985f2023055b /arch/powerpc/include
parent979fac3eaaa02fa887c7dfe6509248b21dca3872 (diff)
parent129f5d395fd66b6587a5ac156b232cca060d6512 (diff)
Merge tag 'powerpc-7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Madhavan Srinivasan: - powerpc/numa: Support coregroup on PowerNV - powerpc/irq: Move __softirq_pending out of irq_stat - powerpc/512x: Remove pdm360ng platform setup in favor of mpc512x_generic - powerpc/ps3: Simplify control flow in ps3_{virq,irq_plug}_setup() - KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users - powerpc/syscall: Avoid atomic test_and_clear_thread_flag on fast path - pseries/plpks cleanup and fixes - Misc fixes and cleanup Thanks to Abhishek Dubey, Amit Machhiwal, Anushree Mathur, Bui Nguyen Nhu Quynh, Christophe Leroy (CS GROUP), Dmitry Torokhov, Gaurav Batra, Gautam Menghani, Geert Uytterhoeven, Greg Joyce, Hari Bathini, Harsh Prateek Bora, Karl Mehltretter, Link Mauve, Michal Suchánek, Mukesh Kumar Chaurasiya (IBM), Nayna Jain, Ritesh Harjani (IBM), R Nageswara Sastry, Saket Kumar Bhaskar, Samir Mulani, Shivang Upadhyay, Shrikanth Hegde, Sourabh Jain, Srikar Dronamraju, Srish Srinivasan, Thorsten Blum, Vaibhav Jain (IBM), Venkat Rao Bagalkote, and Yeswanth Krishna Tellakula * tag 'powerpc-7.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (44 commits) powerpc/numa: Support coregroup on PowerNV powerpc/numa: Allow cpu_to_coregroup_id without PPC_SPLPAR powerpc/numa: Simplify find_primary_domain_index powerpc/fadump: collect dump when CPU_STATE_DATA is less than reserved powerpc/syscall: Avoid atomic test_and_clear_thread_flag on fast path powerpc/kasan: fix r2 corruption in mem*() on GENERIC_ENTRY with old compilers powerpc: fix NMI exit ordering: restore soft masks after irqentry_nmi_exit() powerpc/pseries/iommu: Add TCEs for 16GB pages when RAM is pre-mapped KVM: PPC: Book3S HV: Free the queue pages in error path KVM: PPC: Book3S HV: Add missing mappings for tracing exits powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard KVM: PPC: Fix get_d_signext() 12-bit displacement for paired-single D-form KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users KVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls pseries/plpks: update PKS documentation and MAINTAINERS entry pseries/plpks: rename the default wrapping key macro pseries/plpks: make narrowing conversions explicit pseries/plpks: hide wrapping_features when unsupported pseries/plpks: fix self-reference in plpks_var initializer pseries/plpks: clear SED key data after use ...
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r--arch/powerpc/include/asm/hardirq.h31
-rw-r--r--arch/powerpc/include/asm/interrupt.h7
-rw-r--r--arch/powerpc/include/asm/kasan.h15
-rw-r--r--arch/powerpc/include/asm/string.h21
-rw-r--r--arch/powerpc/include/asm/topology.h15
5 files changed, 32 insertions, 57 deletions
diff --git a/arch/powerpc/include/asm/hardirq.h b/arch/powerpc/include/asm/hardirq.h
index f133b5930ae1..be6cd5aab016 100644
--- a/arch/powerpc/include/asm/hardirq.h
+++ b/arch/powerpc/include/asm/hardirq.h
@@ -5,24 +5,33 @@
#include <linux/threads.h>
#include <linux/irq.h>
-typedef struct {
- unsigned int __softirq_pending;
- unsigned int timer_irqs_event;
- unsigned int broadcast_irqs_event;
- unsigned int timer_irqs_others;
- unsigned int pmu_irqs;
- unsigned int mce_exceptions;
- unsigned int spurious_irqs;
- unsigned int sreset_irqs;
+enum irq_stat_counts {
+ IRQ_COUNT_LOC_TIMER,
+ IRQ_COUNT_BCT_TIMER,
+ IRQ_COUNT_OTHER_TIMER,
+ IRQ_COUNT_SPURIOUS,
+ IRQ_COUNT_PMI,
+ IRQ_COUNT_MCE,
+ IRQ_COUNT_NMI_SRESET,
#ifdef CONFIG_PPC_WATCHDOG
- unsigned int soft_nmi_irqs;
+ IRQ_COUNT_WATCHDOG,
#endif
#ifdef CONFIG_PPC_DOORBELL
- unsigned int doorbell_irqs;
+ IRQ_COUNT_DOORBELL,
#endif
+ IRQ_COUNT_MAX,
+};
+
+typedef struct {
+ unsigned int counts[IRQ_COUNT_MAX];
} ____cacheline_aligned irq_cpustat_t;
DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
+DECLARE_PER_CPU(unsigned int, __softirq_pending);
+#define local_softirq_pending_ref __softirq_pending
+
+#define inc_irq_stat(index) __this_cpu_inc(irq_stat.counts[IRQ_COUNT_##index])
+void inc_irq_stat_and_enable(enum irq_stat_counts which);
#define __ARCH_IRQ_STAT
#define __ARCH_IRQ_EXIT_IRQS_DISABLED
diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
index 1b45a49e9bed..c7d0e71eac83 100644
--- a/arch/powerpc/include/asm/interrupt.h
+++ b/arch/powerpc/include/asm/interrupt.h
@@ -70,6 +70,7 @@
#include <linux/irq-entry-common.h>
#include <asm/kprobes.h>
+#include <asm/mmu.h>
#include <asm/runlatch.h>
#ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
@@ -290,7 +291,7 @@ interrupt_handler long func(struct pt_regs *regs) \
state = irqentry_nmi_enter(regs); \
} else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && \
firmware_has_feature(FW_FEATURE_LPAR) && \
- !radix_enabled()) { \
+ !early_radix_enabled()) { \
/* no nmi_entry for a pseries hash guest \
* taking a real mode exception */ \
} else if (IS_ENABLED(CONFIG_KASAN)) { \
@@ -301,13 +302,12 @@ interrupt_handler long func(struct pt_regs *regs) \
state = irqentry_nmi_enter(regs); \
} \
ret = ____##func (regs); \
- arch_interrupt_nmi_exit_prepare(regs, &nmi_state); \
if (mfmsr() & MSR_DR) { \
/* nmi_exit if relocations are on */ \
irqentry_nmi_exit(regs, state); \
} else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && \
firmware_has_feature(FW_FEATURE_LPAR) && \
- !radix_enabled()) { \
+ !early_radix_enabled()) { \
/* no nmi_exit for a pseries hash guest \
* taking a real mode exception */ \
} else if (IS_ENABLED(CONFIG_KASAN)) { \
@@ -317,6 +317,7 @@ interrupt_handler long func(struct pt_regs *regs) \
} else { \
irqentry_nmi_exit(regs, state); \
} \
+ arch_interrupt_nmi_exit_prepare(regs, &nmi_state); \
\
return ret; \
} \
diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
index a690e7da53c2..599a9e02af02 100644
--- a/arch/powerpc/include/asm/kasan.h
+++ b/arch/powerpc/include/asm/kasan.h
@@ -2,21 +2,6 @@
#ifndef __ASM_KASAN_H
#define __ASM_KASAN_H
-#if defined(CONFIG_KASAN) && !defined(CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX)
-#define _GLOBAL_KASAN(fn) \
- _GLOBAL(fn); \
- _GLOBAL(__##fn)
-#define _GLOBAL_TOC_KASAN(fn) \
- _GLOBAL_TOC(fn); \
- _GLOBAL_TOC(__##fn)
-#define EXPORT_SYMBOL_KASAN(fn) \
- EXPORT_SYMBOL(__##fn)
-#else /* CONFIG_KASAN && !CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX */
-#define _GLOBAL_KASAN(fn) _GLOBAL(fn)
-#define _GLOBAL_TOC_KASAN(fn) _GLOBAL_TOC(fn)
-#define EXPORT_SYMBOL_KASAN(fn)
-#endif /* CONFIG_KASAN && !CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX */
-
#ifndef __ASSEMBLER__
#include <asm/page.h>
diff --git a/arch/powerpc/include/asm/string.h b/arch/powerpc/include/asm/string.h
index 1981bd4036b5..161b949683b3 100644
--- a/arch/powerpc/include/asm/string.h
+++ b/arch/powerpc/include/asm/string.h
@@ -29,29 +29,10 @@ extern void * memchr(const void *,int,__kernel_size_t);
void memcpy_flushcache(void *dest, const void *src, size_t size);
#ifdef CONFIG_KASAN
-/* __mem variants are used by KASAN to implement instrumented meminstrinsics. */
-#ifdef CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX
+/* Used by mm/kasan as raw backends to bypass KASAN checking. */
#define __memset memset
#define __memcpy memcpy
#define __memmove memmove
-#else /* CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX */
-void *__memset(void *s, int c, __kernel_size_t count);
-void *__memcpy(void *to, const void *from, __kernel_size_t n);
-void *__memmove(void *to, const void *from, __kernel_size_t n);
-#ifndef __SANITIZE_ADDRESS__
-/*
- * For files that are not instrumented (e.g. mm/slub.c) we
- * should use not instrumented version of mem* functions.
- */
-#define memcpy(dst, src, len) __memcpy(dst, src, len)
-#define memmove(dst, src, len) __memmove(dst, src, len)
-#define memset(s, c, n) __memset(s, c, n)
-
-#ifndef __NO_FORTIFY
-#define __NO_FORTIFY /* FORTIFY_SOURCE uses __builtin_memcpy, etc. */
-#endif
-#endif /* !__SANITIZE_ADDRESS__ */
-#endif /* CONFIG_CC_HAS_KASAN_MEMINTRINSIC_PREFIX */
#endif /* CONFIG_KASAN */
#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 44ec416fa489..02c3c9ab3ea9 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -71,6 +71,7 @@ extern void map_cpu_to_node(int cpu, int node);
extern void unmap_cpu_from_node(unsigned long cpu);
#endif /* CONFIG_HOTPLUG_CPU */
+int cpu_to_coregroup_id(int cpu);
#else
static inline int early_cpu_to_node(int cpu) { return 0; }
@@ -107,14 +108,6 @@ static inline void map_cpu_to_node(int cpu, int node) {}
static inline void unmap_cpu_from_node(unsigned long cpu) {}
#endif /* CONFIG_HOTPLUG_CPU */
#endif /* CONFIG_SMP */
-
-#endif /* CONFIG_NUMA */
-
-#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
-void find_and_update_cpu_nid(int cpu);
-extern int cpu_to_coregroup_id(int cpu);
-#else
-static inline void find_and_update_cpu_nid(int cpu) {}
static inline int cpu_to_coregroup_id(int cpu)
{
#ifdef CONFIG_SMP
@@ -124,6 +117,12 @@ static inline int cpu_to_coregroup_id(int cpu)
#endif
}
+#endif /* CONFIG_NUMA */
+
+#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)
+void find_and_update_cpu_nid(int cpu);
+#else
+static inline void find_and_update_cpu_nid(int cpu) {}
#endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
#include <asm-generic/topology.h>