From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id C902B386F468; Mon, 11 May 2020 14:11:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C902B386F468 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] POWER: Add context-synchronizing instructions to pkey_write [BZ #25954] X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 61416e19218605a54e94edd9740bbe9d2785af6d X-Git-Newrev: e627106266ad8785457fadbf5bf67ed604d2a353 Message-Id: <20200511141157.C902B386F468@sourceware.org> Date: Mon, 11 May 2020 14:11:57 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 14:11:57 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e627106266ad8785457fadbf5bf67ed604d2a353 commit e627106266ad8785457fadbf5bf67ed604d2a353 Author: Florian Weimer Date: Mon May 11 11:20:02 2020 +0200 POWER: Add context-synchronizing instructions to pkey_write [BZ #25954] Sandipan Das reported that, "The Power ISA mandates that all writes to the Authority Mask Register (AMR) must always be preceded as well as succeeded by a context-synchronizing instruction. This applies to both the privileged and unprivileged variants of the Move To AMR instruction. This [requirement] is from Table 6 of Chapter 11 in page 1134 of Power ISA 3.0B. The document can be found here: " See this kernel patch submission: Diff: --- sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h index 623b073d5a..25d080c9a6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/arch-pkey.h @@ -37,7 +37,7 @@ pkey_read (void) static inline void pkey_write (unsigned long int value) { - __asm__ volatile ("mtspr 13, %0" : : "r" (value)); + __asm__ volatile ("isync; mtspr 13, %0; isync" : : "r" (value)); } /* Number of the largest supported key. This depends on the width of