From 8238d3423da129ae06c855083b7326fac2dc8cbf Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Sun, 8 Apr 2018 16:46:24 +0000 Subject: [PATCH] powerpc64: Avoid calling isync twice Summary: It is not necessary to call isync() after calling mtmsr() function, mainly because the mtmsr() calls 'isync' internally to synchronize the machine state register. Other than that, isync() just calls the 'isync' instruction, thus, the 'isync' instruction is being called twice, and that seems to be unnecessary. This patch just remove the unecessary calls to isync() after mtmsr(). Submitted by: Breno Leitao Differential Revision: https://reviews.freebsd.org/D14583 --- sys/powerpc/powerpc/altivec.c | 2 -- sys/powerpc/powerpc/cpu.c | 2 -- sys/powerpc/powerpc/fpu.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/sys/powerpc/powerpc/altivec.c b/sys/powerpc/powerpc/altivec.c index 4cbc2fdf8ba..b13d635c4d3 100644 --- a/sys/powerpc/powerpc/altivec.c +++ b/sys/powerpc/powerpc/altivec.c @@ -58,7 +58,6 @@ save_vec_int(struct thread *td) */ msr = mfmsr(); mtmsr(msr | PSL_VEC); - isync(); /* * Save the vector registers and VSCR to the PCB @@ -120,7 +119,6 @@ enable_vec(struct thread *td) */ msr = mfmsr(); mtmsr(msr | PSL_VEC); - isync(); /* * Restore VSCR by first loading it into a vector and then into VSCR. diff --git a/sys/powerpc/powerpc/cpu.c b/sys/powerpc/powerpc/cpu.c index c71dd7018a3..af62d282a9c 100644 --- a/sys/powerpc/powerpc/cpu.c +++ b/sys/powerpc/powerpc/cpu.c @@ -710,7 +710,6 @@ cpu_idle_60x(sbintime_t sbt) default: powerpc_sync(); mtmsr(msr | PSL_POW); - isync(); break; } #endif @@ -739,7 +738,6 @@ cpu_idle_booke(sbintime_t sbt) default: powerpc_sync(); mtmsr(msr | PSL_WE); - isync(); break; } #endif diff --git a/sys/powerpc/powerpc/fpu.c b/sys/powerpc/powerpc/fpu.c index 5034ffce6b3..932ee07ca57 100644 --- a/sys/powerpc/powerpc/fpu.c +++ b/sys/powerpc/powerpc/fpu.c @@ -87,7 +87,6 @@ enable_fpu(struct thread *td) mtmsr(msr | PSL_FP | PSL_VSX); else mtmsr(msr | PSL_FP); - isync(); /* * Load the floating point registers and FPSCR from the PCB. @@ -143,7 +142,6 @@ save_fpu(struct thread *td) mtmsr(msr | PSL_FP | PSL_VSX); else mtmsr(msr | PSL_FP); - isync(); /* * Save the floating-point registers and FPSCR to the PCB