<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="https://github.com/pttuan/edk2.git">https://github.com/pttuan/edk2.git</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">branch: tphan/riscv_mmu_new_pcd<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Andrei Warkentin <andrei.warkentin@intel.com><br>
<b>Date: </b>Wednesday, October 4, 2023 at 11:42 AM<br>
<b>To: </b>Tuan Phan <tphan@ventanamicro.com>, devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc: </b>Kinney, Michael D <michael.d.kinney@intel.com>, Gao, Liming <gaoliming@byosoft.com.cn>, Liu, Zhiguang <zhiguang.liu@intel.com>, sunilvl@ventanamicro.com <sunilvl@ventanamicro.com>, git@danielschaefer.me <git@danielschaefer.me>, ardb+tianocore@kernel.org
 <ardb+tianocore@kernel.org><br>
<b>Subject: </b>Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">Do you happen to have a link to a Github tree?<br>
<br>
A<br>
<br>
> -----Original Message-----<br>
> From: Tuan Phan <tphan@ventanamicro.com><br>
> Sent: Tuesday, October 3, 2023 4:00 PM<br>
> To: devel@edk2.groups.io<br>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming<br>
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>;<br>
> sunilvl@ventanamicro.com; git@danielschaefer.me; Warkentin, Andrei<br>
> <andrei.warkentin@intel.com>; ardb+tianocore@kernel.org; Tuan Phan<br>
> <tphan@ventanamicro.com><br>
> Subject: [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode<br>
> <br>
> Introduce a PCD to control the maximum SATP mode that MMU allowed to<br>
> use. This PCD helps RISC-V platform set bare or minimum SATA mode during<br>
> bring up to debug memory map issue.<br>
> <br>
> Signed-off-by: Tuan Phan <tphan@ventanamicro.com><br>
> ---<br>
>  UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c   | 6 +++++-<br>
>  UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf | 3 +++<br>
>  UefiCpuPkg/UefiCpuPkg.dec                              | 8 ++++++++<br>
>  3 files changed, 16 insertions(+), 1 deletion(-)<br>
> <br>
> diff --git a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c<br>
> b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c<br>
> index 9cca5fc128af..826a1d32a1d4 100644<br>
> --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c<br>
> +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c<br>
> @@ -36,7 +36,7 @@<br>
>  #define PTE_PPN_SHIFT         10 #define RISCV_MMU_PAGE_SHIFT  12 -<br>
> STATIC UINTN  mModeSupport[] = { SATP_MODE_SV57, SATP_MODE_SV48,<br>
> SATP_MODE_SV39 };+STATIC UINTN  mModeSupport[] = { SATP_MODE_SV57,<br>
> SATP_MODE_SV48, SATP_MODE_SV39, SATP_MODE_OFF }; STATIC UINTN<br>
> mMaxRootTableLevel; STATIC UINTN  mBitPerLevel; STATIC UINTN<br>
> mTableEntryCount;@@ -590,6 +590,10 @@ RiscVMmuSetSatpMode  (<br>
>    UINTN                            Index;   EFI_STATUS                       Status; +  if<br>
> (SatpMode > PcdGet32 (PcdCpuRiscVMmuMaxSatpMode)) {+    return<br>
> EFI_DEVICE_ERROR;+  }+   switch (SatpMode) {     case SATP_MODE_OFF:<br>
> return EFI_SUCCESS;diff --git<br>
> a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf<br>
> b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf<br>
> index 9b28a98cb346..51ebe1750e97 100644<br>
> --- a/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf<br>
> +++ b/UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.inf<br>
> @@ -25,3 +25,6 @@<br>
>   [LibraryClasses]   BaseLib++[Pcd]+<br>
> gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode  ##<br>
> CONSUMESdiff --git a/UefiCpuPkg/UefiCpuPkg.dec<br>
> b/UefiCpuPkg/UefiCpuPkg.dec<br>
> index 68473fc640e6..79191af18a05 100644<br>
> --- a/UefiCpuPkg/UefiCpuPkg.dec<br>
> +++ b/UefiCpuPkg/UefiCpuPkg.dec<br>
> @@ -396,6 +396,14 @@<br>
>    # @Prompt Access to non-SMRAM memory is restricted to reserved,<br>
> runtime and ACPI NVS type after SmmReadyToLock.<br>
> gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmRestrictedMemoryAccess|TRUE|B<br>
> OOLEAN|0x3213210F +[PcdsFixedAtBuild.RISCV64]+  ## Indicate the<br>
> maximum SATP mode allowed.+  #  0 - Bare mode.+  #  8 - 39bit mode.+  #  9 -<br>
> 48bit mode.+  #  10 - 57bit mode.+<br>
> gUefiCpuPkgTokenSpaceGuid.PcdCpuRiscVMmuMaxSatpMode|0|UINT32|0x6<br>
> 0000021+ [PcdsDynamic, PcdsDynamicEx]   ## Contains the pointer to a CPU<br>
> S3 data buffer of structure ACPI_CPU_DATA.   # @Prompt The pointer to a CPU<br>
> S3 data buffer.--<br>
> 2.25.1<br>
<br>
<br>
<br>
<br>
<br>
<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</body>
</html>


<div width="1" style="color:white;clear:both">_._,_._,_</div>
<hr>


Groups.io Links:<p>


  
    You receive all messages sent to this group.
  
  


<p>
<a target="_blank" href="https://edk2.groups.io/g/devel/message/109332">View/Reply Online (#109332)</a> |


  

|

  <a target="_blank" href="https://groups.io/mt/101742937/1813853">Mute This Topic</a>


| <a href="https://edk2.groups.io/g/devel/post">New Topic</a>

<br>




<a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> |
<a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |

<a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>

 [edk2-devel-archive@redhat.com]<br>
<div width="1" style="color:white;clear:both">_._,_._,_</div>