From nobody Sun Feb 8 06:00:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103016+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103016+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1681498717; cv=none; d=zohomail.com; s=zohoarc; b=JgzIALJj5gLeBvjLbGfbguQKb3VKMR04aNJ39Iu2w/9X8CVJGqLe3XghR1cVVfNJEEqfMF5We3H32s9Kr1vPE4naKIVoPpQJ1PzrxkxcmuOVkwTCh3hg5oIZMqzdQuHWPkfbi16OXZTf1azbsDjU11RYvDdL1kiE2J7y6DLpJKM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681498717; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=ljoAicsFig38cupVtNz5PZd6woHjKoRtC1a7vtn2Q8A=; b=gFji1d/cZPIij5ofHQplyQiQAv07/BsdsfXIW5j7AsjVTa6QTJ5rxH0UMao/2pDzLSzAp0WpiynUG9zBw6HSg7cnXZN4Kwc/ODc1os0oYCao/pCfqZUgvOSrWkjfCkYG+N0hlU33qX1g5Q0z5ePnDdfUcyp3EgaL5QtTK7dVWwo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103016+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1681498717456559.2973940290166; Fri, 14 Apr 2023 11:58:37 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dYBjYY1788612xYfT5hzYmTW; Fri, 14 Apr 2023 11:58:37 -0700 X-Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mx.groups.io with SMTP id smtpd.web11.19127.1681498716562035141 for ; Fri, 14 Apr 2023 11:58:36 -0700 X-Received: by mail-pj1-f49.google.com with SMTP id pm7-20020a17090b3c4700b00246f00dace2so11722416pjb.2 for ; Fri, 14 Apr 2023 11:58:36 -0700 (PDT) X-Gm-Message-State: soP1nIyda9afbG4gPInVXPdox1787277AA= X-Google-Smtp-Source: AKy350aiTD8qICl6M+L7ydXUvl4JFcfJt0ol2RF+rqKKHmG+2muo+rhjr7gLzelgu/d6Y5pYZCdNuA== X-Received: by 2002:a17:902:d482:b0:1a4:fae1:d6b0 with SMTP id c2-20020a170902d48200b001a4fae1d6b0mr4987922plg.28.1681498715626; Fri, 14 Apr 2023 11:58:35 -0700 (PDT) X-Received: from localhost.localdomain (c-174-50-177-95.hsd1.ca.comcast.net. [174.50.177.95]) by smtp.gmail.com with ESMTPSA id g20-20020a170902869400b001a681d123a0sm3329760plo.297.2023.04.14.11.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Apr 2023 11:58:35 -0700 (PDT) From: "Tuan Phan" To: devel@edk2.groups.io Cc: michael.d.kinney@intel.com, gaoliming@byosoft.com.cn, zhiguang.liu@intel.com, sunilvl@ventanamicro.com, git@danielschaefer.me, andrei.warkentin@intel.com, Tuan Phan Subject: [edk2-devel] [PATCH v2 1/6] MdePkg/BaseLib: RISC-V: Support getting satp register value Date: Fri, 14 Apr 2023 11:58:10 -0700 Message-Id: <20230414185815.2994-2-tphan@ventanamicro.com> In-Reply-To: <20230414185815.2994-1-tphan@ventanamicro.com> References: <20230414185815.2994-1-tphan@ventanamicro.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,tphan@ventanamicro.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1681498717; bh=e9eK+wb+slmpeRTIkCfF4oqXmnj1uLhjG6tqxugVqzw=; h=Cc:Date:From:Reply-To:Subject:To; b=bPmldLymiA5N/tQ+HBY7OoAw7F4e3l+uZua7kNI3ETlMQoQhrIQ2VTV7ykYHvBFPYSX NsJNRR/NjGubTHXypBpBXowj7PzucSggdQP65McLGFGcGMQu1fJ+tl+Yw5hV3OveDYQQ2 oGh8NBS/Wsb8X7Nevf/wgHXGEXutoyIcZ18= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1681498719383100012 Content-Type: text/plain; charset="utf-8" Add an API to retrieve satp register value. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- MdePkg/Include/Library/BaseLib.h | 5 +++++ MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/Base= Lib.h index 8f2df76c29a3..5d7067ee854e 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -181,6 +181,11 @@ RiscVSetSupervisorAddressTranslationRegister ( IN UINT64 ); =20 +UINT64 +RiscVGetSupervisorAddressTranslationRegister ( + VOID + ); + UINT64 RiscVReadTimer ( VOID diff --git a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S b/MdePkg/Library/Bas= eLib/RiscV64/RiscVMmu.S index ac8f92f38aed..c9cf60c1664b 100644 --- a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S @@ -21,3 +21,11 @@ ASM_FUNC (RiscVSetSupervisorAddressTranslationRegister) csrw CSR_SATP, a0 ret + +// +// Get the value of Supervisor Address Translation and +// Protection Register. +// +ASM_FUNC (RiscVGetSupervisorAddressTranslationRegister) + csrr a0, CSR_SATP + ret --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103016): https://edk2.groups.io/g/devel/message/103016 Mute This Topic: https://groups.io/mt/98269072/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-