summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm')
-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>