From nobody Sat Feb 7 15:35:12 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+106308+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+106308+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1687545677; cv=none; d=zohomail.com; s=zohoarc; b=NEiEfM5oCx3Z3d1pOI1DQC0N59g9q+IpNbxMtDfYNPpVe8f2w2AwgkkGUgagfLsgJMeM1hP6IAilIxg85d0oe1G+bW6v221g5MOKZa/fsm8yjXzYC964fMDXljOAjos8RvCwlFLtipXza9UmSYUELlSFWqOdy+//p1+DojKAd/s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687545677; 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=TmoY6dfUOPAUn9NjCYBy5t8Wzmk2AtinSssaRdser5c=; b=C861FNePrjqKnI8CgPupsaOVm2Jcr7LhCbf2M/IUUUfofypUUe4A8FOmFiABmfxVAoVS6aQTlXsiHbRC2OPjzWGmxKcDYC4uNDcv3qTRrjID7S2gpeCxgfNMjtkR8qvu/mKvq5y+VhvViUP6puDS+Pvpde2IU4MMDBakmh+Bhn4= 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+106308+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168754567763598.02178105407904; Fri, 23 Jun 2023 11:41:17 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id rDxzYY1788612xPGpbkUZyHP; Fri, 23 Jun 2023 11:41:17 -0700 X-Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) by mx.groups.io with SMTP id smtpd.web11.6119.1687545676558992543 for ; Fri, 23 Jun 2023 11:41:16 -0700 X-Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-38c35975545so738167b6e.1 for ; Fri, 23 Jun 2023 11:41:16 -0700 (PDT) X-Gm-Message-State: cLy77Kz3sMXnAgjhPpLGJxcIx1787277AA= X-Google-Smtp-Source: ACHHUZ7rzqSzc4rgltogAaM3Os0nnB9jUipI9Ayud1RAT5+g2BCmjenGFyxisdJKDZxw44ITe1mLyQ== X-Received: by 2002:a05:6808:1904:b0:398:27d3:1fc3 with SMTP id bf4-20020a056808190400b0039827d31fc3mr17171145oib.42.1687545675460; Fri, 23 Jun 2023 11:41:15 -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 v2-20020aa78502000000b006667b36e904sm6354184pfn.113.2023.06.23.11.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jun 2023 11:41:15 -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, ardb+tianocore@kernel.org, Tuan Phan Subject: [edk2-devel] [PATCH v4 6/7] OvmfPkg: RiscVVirt: Remove satp bare mode setting Date: Fri, 23 Jun 2023 11:39:33 -0700 Message-Id: <20230623183934.23905-7-tphan@ventanamicro.com> In-Reply-To: <20230623183934.23905-1-tphan@ventanamicro.com> References: <20230623183934.23905-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=1687545677; bh=BxwkzL8P7+Qpc+jzM18XKzumWf8RoFGfvsIgOZnownw=; h=Cc:Date:From:Reply-To:Subject:To; b=Uwrq2PvZDSWd1Wx9SzJFasGu4IPdL1CpCBrQDMQ2CZ4sdVObEJClqjgV6sVhIEx22+3 o0/etWk+DdTp8sU4e94FR6lDf3I2SR8aEfgkJlzQFPdU0DxxkTb/Fop5LN6ljAGmhZaYO CluXNaOH6xc2d9TqofbNCqr55QcXXdPOCak= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1687545679125100025 Content-Type: text/plain; charset="utf-8" There is no point to set satp to bare mode as that should be the default mode when booting edk2. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- OvmfPkg/RiscVVirt/Sec/Memory.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/OvmfPkg/RiscVVirt/Sec/Memory.c b/OvmfPkg/RiscVVirt/Sec/Memory.c index 0e2690c73687..aad71ee5dcbb 100644 --- a/OvmfPkg/RiscVVirt/Sec/Memory.c +++ b/OvmfPkg/RiscVVirt/Sec/Memory.c @@ -85,21 +85,6 @@ AddMemoryRangeHob ( AddMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase)); } =20 -/** - Configure MMU -**/ -STATIC -VOID -InitMmu ( - ) -{ - // - // Set supervisor translation mode to Bare mode - // - RiscVSetSupervisorAddressTranslationRegister ((UINT64)SATP_MODE_OFF << 6= 0); - DEBUG ((DEBUG_INFO, "%a: Set Supervisor address mode to bare-metal mode.= \n", __func__)); -} - /** Publish system RAM and reserve memory regions. =20 @@ -327,7 +312,8 @@ MemoryPeimInitialization ( =20 AddReservedMemoryMap (FdtPointer); =20 - InitMmu (); + /* Make sure SEC is booting with bare mode */ + ASSERT ((RiscVGetSupervisorAddressTranslationRegister () & SATP64_MODE) = =3D=3D (SATP_MODE_OFF << SATP64_MODE_SHIFT)); =20 BuildMemoryTypeInformationHob (); =20 --=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 (#106308): https://edk2.groups.io/g/devel/message/106308 Mute This Topic: https://groups.io/mt/99724479/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-