From 95090cd0243f577804c088b577761b2d90dbecec Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Tue, 8 Sep 2020 22:59:43 +0000 Subject: [PATCH] [PowerPC64] Hide dssall instruction from llvm assembler When doing a build for a modern CPUTYPE, llvm will throw errors if obsolete instructions are used, even if they will never run due to runtime checks. Hiding the dssall instruction from the assembler fixes kernel build when overriding CPUTYPE, without having any effect on the generated binary. This has been in my local tree for over a year and is well tested across a variety of machines. Sponsored by: Tag1 Consulting, Inc. --- sys/powerpc/aim/aim_machdep.c | 3 ++- sys/powerpc/powerpc/cpu.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/aim/aim_machdep.c b/sys/powerpc/aim/aim_machdep.c index e6bf48ae41c0..3f9bbe988a56 100644 --- a/sys/powerpc/aim/aim_machdep.c +++ b/sys/powerpc/aim/aim_machdep.c @@ -629,7 +629,8 @@ flush_disable_caches(void) mtspr(SPR_MSSCR0, msscr0); powerpc_sync(); isync(); - __asm__ __volatile__("dssall; sync"); + /* 7e00066c: dssall */ + __asm__ __volatile__(".long 0x7e00066c; sync"); powerpc_sync(); isync(); __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index 8967bcd9804f..ad30d2853d0f 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -753,8 +753,9 @@ cpu_idle_60x(sbintime_t sbt) case MPC7450: case MPC7455: case MPC7457: + /* 0x7e00066c: dssall */ __asm __volatile("\ - dssall; sync; mtmsr %0; isync" + .long 0x7e00066c; sync; mtmsr %0; isync" :: "r"(msr | PSL_POW)); break; default: