From nobody Tue Mar 01 14:39:59 2022 X-Original-To: dev-commits-src-main@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 6C43419DACDC; Tue, 1 Mar 2022 14:40:00 +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 4K7Kf74nMKz3Fhn; Tue, 1 Mar 2022 14:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646145599; 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=NedD+FnxEc7mn4af8L0yGXRPyivpr173nqP07+eqk9g=; b=Jkc0mXLoV4OvMR4md/aw3GG/IufaGz+/VfEgIMZB5ZZFggTiXjsf0msBr5A59dO46guuTK GNry8Cqh7PlOtN2lN6F82tzLpvsZUhWjiP79wYYtsdyrt0oG0WGxnIx67HAwLDHHsfteIB koRN3NfXDnKMuFiGl3NC78PnAZN4p7GE+I5xX0VsiD+fXi8rtkGJ46BvTtCHWcB6s+6QTY Ndjjho2ff/0+qLTNj71kscEM706p7+h3LdtKlPruttSg0xtoISLP7D/W6PsjcX9HVgyn/W hZPnscl7Z4d6dVg67kYxQorZT92/SEwPGvT/B1tcGl53yEKqlv0gPdR2tyLWqA== 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 6402211632; Tue, 1 Mar 2022 14:39:59 +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 221Edx3A038578; Tue, 1 Mar 2022 14:39:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 221EdxgS038577; Tue, 1 Mar 2022 14:39:59 GMT (envelope-from git) Date: Tue, 1 Mar 2022 14:39:59 GMT Message-Id: <202203011439.221EdxgS038577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2e956c30cab6 - main - riscv: Use generic CSR macros for writing SATP List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2e956c30cab6a36fee9a3d5159c3903406e3e5e7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1646145599; 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=NedD+FnxEc7mn4af8L0yGXRPyivpr173nqP07+eqk9g=; b=F8LaEBgrzAGKpS2Y2I7DK9t0AfKHEHO/lxUPy2WNZjb+qPwSvB55MScJWnvofVbIyedl32 mNCniLwaK13W9VrhhwP8mLYI+sNoVMEJgw4lCkPzgVY3mCaK8MXAZ9nYH6CXp4fhZgUkXb 3ozLO6s8u8pT90ShA+ntnVcmh1/1/ddVPbVI4ibrz90UUQANCCCEKR+2GO0G8QgsudBokM n92TCcYfgGzDgYqDOjKxfO4tV2SBMoubEd6EDAN0mBvJKvZ4KQNtCDQbxLld+Zu6AF48c/ yeLDKDm/3HMEslaNsfyyCjoFDJuPxUbMa7+QMqZ6uHdJGi6Pnc8VL6SoEDW1jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1646145599; a=rsa-sha256; cv=none; b=S+SEt99HH6qX6YRRcuPSyRooblePyP+VEiqOGQ1vJ1JSbdd8tsQ3xUoRp/g2Y6i9Q1/ugE EqG11zKzwWMROeMiCsUSmdiAUl5kfCiZYpd4ufQNpN2olXchpTg+6m8AxkHwY8pGWgLuFu 0dMWpZ0DcLk7y5qxGgYXUYn5LlXCj56NiUqWvt1nMLueDuMdidwh+FyfX6dTyr06pd589i 4VT5s48p2Mvv1jQ9xoYSUIekP32Vl1LhHs+Oj0ImbA7QijFflC6yKFC+yPcsMkuZL+/iKH y47iSx5AatxjPg8MKlPSgrBPQy5E1AX5sRnGl1wUskHJRGfZuaQW46Ki+uL90A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2e956c30cab6a36fee9a3d5159c3903406e3e5e7 commit 2e956c30cab6a36fee9a3d5159c3903406e3e5e7 Author: Mark Johnston AuthorDate: 2022-03-01 14:03:44 +0000 Commit: Mark Johnston CommitDate: 2022-03-01 14:39:43 +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 MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34271 --- 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 545d77f808c7..d26d6113ee36 100644 --- a/sys/riscv/riscv/pmap.c +++ b/sys/riscv/riscv/pmap.c @@ -4402,7 +4402,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