From nobody Mon Mar 14 14:46:07 2022 X-Original-To: dev-commits-src-all@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 B3DBE1A26E86; Mon, 14 Mar 2022 14:46:07 +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 4KHK9C3wgrz3hS2; Mon, 14 Mar 2022 14:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647269167; 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=J6hck2UF7zdpTxduZlBnXHviA1RtT0d9uRILQegcjc0=; b=OiNjls706lvrxnGOqV4+kHuS7aL0ZF7FyBU/2g3nnpR3xeenCcLSxUtw9NRi4TSRrkN1rz BKas9m7TMg0ARDHMol8iXLATHRe4TXnDS/RZJIPVm3dhCBafKuUa6En9nBxAE9TGKxo/2l sIeUtIdY246526AY44gYrdyZjh73WNAORlVSx/0wkKOApmOzVt43qoHrHJZJCEpFwodlbF hpG07vGOGrHb/rezZsF0hzLU2rgAYhx5s0pY6yFNIBUVA7neOBOCMHZsPehYNIVv7kduwv 7QCJetO10mBRTiKHOJyK7CcakmyDPR7I/X+mrjD4N4xZC08TbEJE/zw1rb8C7w== 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 4106D7708; Mon, 14 Mar 2022 14:46:07 +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 22EEk7mX051895; Mon, 14 Mar 2022 14:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22EEk7QQ051894; Mon, 14 Mar 2022 14:46:07 GMT (envelope-from git) Date: Mon, 14 Mar 2022 14:46:07 GMT Message-Id: <202203141446.22EEk7QQ051894@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c4f8506809c2 - stable/13 - riscv: Use generic CSR macros for writing SATP List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c4f8506809c2f870721feffa2d67fd7f567c4527 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647269167; 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=J6hck2UF7zdpTxduZlBnXHviA1RtT0d9uRILQegcjc0=; b=ejZbFrwXIG/BtP8R2iPFts20hDOc2+HIS60Fc68szfp8Uc/bI7pamMFo2w4KRvakbD4wl/ 1xtzw2mc4sHd2oPS/Cl7FGhc6eSN5qorYpIA3Sj0my8DpYrK9BEjL+Dpv6/3CNhOIziH+M LVu4v+Xj8vQfuPyKJznnMdtFrQdItAgc6dI8Rzn/1APH3BNq6wpBd5/F1DEnq4tJYqw5q0 S1U4MfFl+cpaE6i9oXieJ5X/uaXkhwGKSi8cAoiWeKhPNs0L+Lv2D3w3g5+RLEb/Gr5VOh o3+/4yU6jIKOf8bVMXJ4pu0PL7GKYHs7E7vc936zpTtbWxtpB87oO02tFlBE3w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647269167; a=rsa-sha256; cv=none; b=IklGE4NvjzoPd5eVlM8Od1pQXUU+m5bDL9I7o50exVNZbWRiy7MnPwX2v6uKuR5pEDPBvM wU9ImyjDaDRrgRI7cV3U6fk2VL7unKUxIDc+Uk8WfjbhMH8cSEaoXEcjZKku23EQW1w3CD mA2X/dt3j8ceXIS8S0oWy6fcP8Dklk634RaYrrnoWORzcDmCFeEe1hU8aYU+Z5beigYTIz IcXdW+RkxCZ+sxc3XVsmcnMc3juzG6GbF1qz5UmcJQbgHF/KjvSxVRUXGUK0fTGSZ1VSPy FCX+FwzziSTyRNsGERFotabYzaxge3Lkkl+Tpwg98WICl8Ou6GEjqBzwGNsgfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c4f8506809c2f870721feffa2d67fd7f567c4527 commit c4f8506809c2f870721feffa2d67fd7f567c4527 Author: Mark Johnston AuthorDate: 2022-03-01 14:03:44 +0000 Commit: Mark Johnston CommitDate: 2022-03-14 14:45:29 +0000 riscv: Use generic CSR macros for writing SATP Instead of having the one-off load_satp(), just use csr_write(). No functional change intended. Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation (cherry picked from commit 2e956c30cab6a36fee9a3d5159c3903406e3e5e7) --- sys/riscv/include/cpufunc.h | 7 ------- sys/riscv/riscv/pmap.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/riscv/include/cpufunc.h b/sys/riscv/include/cpufunc.h index 0f27fc45d57d..7b7afb50fee8 100644 --- a/sys/riscv/include/cpufunc.h +++ b/sys/riscv/include/cpufunc.h @@ -120,13 +120,6 @@ extern int64_t icache_line_size; #define cpu_icache_sync_range(a, s) #define cpu_icache_sync_range_checked(a, s) -static __inline void -load_satp(uint64_t val) -{ - - __asm __volatile("csrw satp, %0" :: "r"(val)); -} - #define cpufunc_nullop() riscv_nullop() void riscv_nullop(void); diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c index 59fdbae53eb4..55f0c7f4a86e 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -4398,7 +4398,7 @@ pmap_activate_sw(struct thread *td) pmap = vmspace_pmap(td->td_proc->p_vmspace); if (pmap == oldpmap) return; - load_satp(pmap->pm_satp); + csr_write(satp, pmap->pm_satp); hart = PCPU_GET(hart); #ifdef SMP