From nobody Thu Oct 07 03:28:14 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2A1A912DDD6F; Thu, 7 Oct 2021 03:28:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HPxbz547xz4r4C; Thu, 7 Oct 2021 03:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11D174168; Thu, 7 Oct 2021 03:28:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1973SEvW060858; Thu, 7 Oct 2021 03:28:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1973SEUO060857; Thu, 7 Oct 2021 03:28:14 GMT (envelope-from git) Date: Thu, 7 Oct 2021 03:28:14 GMT Message-Id: <202110070328.1973SEUO060857@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 716baab384de - stable/12 - [PowerPC] Fix atomic_cmpset_masked(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 716baab384ded0d02bad67a4be52e9d2408ae636 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=716baab384ded0d02bad67a4be52e9d2408ae636 commit 716baab384ded0d02bad67a4be52e9d2408ae636 Author: Brandon Bergren AuthorDate: 2020-05-26 19:03:45 +0000 Commit: Kyle Evans CommitDate: 2021-10-07 03:27:27 +0000 [PowerPC] Fix atomic_cmpset_masked(). A recent kernel change caused the previously unused atomic_cmpset_masked() to be used. It had a typo in it. Instead of reading the old value from an uninitialized variable, read it from the passed-in pointer as intended. This fixes crashes on 64 bit Book-E. Obtained from: jhibbits (cherry picked from commit 9941cb0657d63b4b1570dcf384196bb599bf9024) --- sys/powerpc/include/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index 2510160a402a..8da4607d71ff 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -621,7 +621,7 @@ atomic_cmpset_masked(uint32_t *p, uint32_t cmpval, uint32_t newval, uint32_t tmp; __asm __volatile ( - "1:\tlwarx %2, 0, %2\n\t" /* load old value */ + "1:\tlwarx %2, 0, %3\n\t" /* load old value */ "and %0, %2, %7\n\t" "cmplw %4, %0\n\t" /* compare */ "bne- 2f\n\t" /* exit if not equal */