From nobody Mon Mar 14 15:07:31 2022 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 7B1B41A0E4FB; Mon, 14 Mar 2022 15:07:32 +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 4KHKdv5CHYz3p6d; Mon, 14 Mar 2022 15:07:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647270452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B0Q/2OiitlZdfxx4f+xwiAOQn0Pfza9IuXx29A3+fQA=; b=B8odH5DUCTJE/jK0YaJajTlRMJYPR6QtK2q5Hf30P796YLtMRp+/i608mecgsgU1RhbPsd sTyZMCoXGagaV5k9SD+8U4nkY4VhPlwWX5EIsB1zM+ktU8toGAeYz/zB2IV+M1vCDDiGbj DFTj5XyhLpL5IYKLt/RDJR3YFuE5B2wmwZniQsiV0bPDfivLAQBZoxT9ucndx9EaWsYf49 xG6KyMNCGSpBZAZEQ0ngUeDVFdQ4jYR1YkDSsOw6qa4sm8tQ6x4zjTD37es/DTfN+rlDQJ XmftR2t0GEr3ZsXcjbknQ3g9fKS4+mtccNbC0wgEz8wtLQpfJQLFZjHPyCKQjA== 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 71DA179A5; Mon, 14 Mar 2022 15:07:31 +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 22EF7Vkx080132; Mon, 14 Mar 2022 15:07:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22EF7V4g080131; Mon, 14 Mar 2022 15:07:31 GMT (envelope-from git) Date: Mon, 14 Mar 2022 15:07:31 GMT Message-Id: <202203141507.22EF7V4g080131@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: 1169099f8fd9 - stable/13 - Make the arm64 get_pcpu a function again 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1169099f8fd981f2e085f451f0b4a62e18bfe507 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647270452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=B0Q/2OiitlZdfxx4f+xwiAOQn0Pfza9IuXx29A3+fQA=; b=L12MX+Rx92i2N24grg3Ih7pG9ZQ9ZdL03X+eL85smx0TXuoEWofFPF3xbRhOaMkn1EmT2n SRlb3pO61oluHlBZvIrjusBvKT4jNArIgWAtpJMYMJpqx8CcvmwxLpPFh3gclkIEl2m2dj 2Go0hxwbgLrIcLZgyrGQQIAiKO9/jbIhI4WMhvFDe4/U/TJSpBt3x+mNsYj6TBY4BvVC55 a5XI7wkft1PUJk9B5zLo5Dw1PbY1b3o01tdDedUEIGRBrXF3u26Dd7L/RWu7H/lErZgQOm Vreoh8HJIXykJShzss4ldU8f2VSMvTITtKJ8+8AcnS2x5R9NKhpIUpZgaf+j+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647270452; a=rsa-sha256; cv=none; b=sat7bWAb8Oi4VWXQEZr4vxBL10q9sEwbyuv8ifuc90l/5TYv5VUBVsxebpAywNHJa31uvK L7Y4DmrLfsQmpFpHpA+GD7vlL3038rfKqaUEmCR876AZmm0tKas81ugmDvgCbdyI0mN79N QVmEZwXdA5Z9aULecrYp/79q/fUF+TjT/Y16ocqM5peioCw3yOxsXb41Aih/pHjNBtpy9W RyfV1IhWzDgqel0ivxofEf+rJYQGD0iZj2o1e/8ve+0HB/uh9C4bpDkXEUiUpG4/+bRxaB s6e6h+n82TtbAtIXTHj0dAJGyyE2PeywWKJBenJpz28vOsQZEjoE3nlAkZCmXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1169099f8fd981f2e085f451f0b4a62e18bfe507 commit 1169099f8fd981f2e085f451f0b4a62e18bfe507 Author: Andrew Turner AuthorDate: 2022-03-08 11:38:51 +0000 Commit: Andrew Turner CommitDate: 2022-03-14 15:00:27 +0000 Make the arm64 get_pcpu a function again We assume the pointer returned from get_pcpu will be consistent even if the thread is moved to a new CPU. Fix this by partially reverting 63c858a04d565 to make get_pcpu a function again. Sponsored by: The FreeBSD Foundation (cherry picked from commit ed306634266002a05c88c3a4cd036c99d4cd139a) --- sys/arm64/include/pcpu.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/arm64/include/pcpu.h b/sys/arm64/include/pcpu.h index ce4dc46e1609..d83c9a656634 100644 --- a/sys/arm64/include/pcpu.h +++ b/sys/arm64/include/pcpu.h @@ -58,7 +58,14 @@ struct pcpu; register struct pcpu *pcpup __asm ("x18"); -#define get_pcpu() pcpup +static inline struct pcpu * +get_pcpu(void) +{ + struct pcpu *pcpu; + + __asm __volatile("mov %0, x18" : "=&r"(pcpu)); + return (pcpu); +} static inline struct thread * get_curthread(void)