path: root/sys/sys/pcpu.h
diff options
authorLeandro Lupori <luporl@FreeBSD.org>2019-06-25 17:15:44 +0000
committerLeandro Lupori <luporl@FreeBSD.org>2019-06-25 17:15:44 +0000
commite2edff41672437d201f7df6994ced3ed002d7bad (patch)
treee88c523056ba9cb5ab35fa655972f0cd1a2232e6 /sys/sys/pcpu.h
parent4ae6e084f088f6a0b50cf2a78eb48dc44ea086c2 (diff)
[PowerPC64] Don't mark module data as static
Fixes panic when loading ipfw.ko and if_epair.ko built with modern compiler. Similar to arm64 and riscv, when using a modern compiler (!gcc4.2), code generated tries to access data in the wrong location, causing kernel panic (data storage interrupt trap) when loading if_epair and ipfw. Issue was reproduced with kernel/module compiled using gcc8 and clang8. It affects both ELFv1 and ELFv2 ABI environments. PR: 232387 Submitted by: alfredo.junior_eldorado.org.br Reported by: Mark Millard Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20461
Notes: svn path=/head/; revision=349377
Diffstat (limited to 'sys/sys/pcpu.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h
index 38785cd26c94..3672d6070deb 100644
--- a/sys/sys/pcpu.h
+++ b/sys/sys/pcpu.h
@@ -85,7 +85,8 @@ extern uintptr_t dpcpu_off[];
/* struct _hack is to stop this from being used with the static keyword. */
#define DPCPU_DEFINE(t, n) \
struct _hack; t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used
-#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv))
+#if defined(KLD_MODULE) && (defined(__aarch64__) || defined(__riscv) \
+ || defined(__powerpc64__))
* On some architectures the compiler will use PC-relative load to
* find the address of DPCPU data with the static keyword. We then