From nobody Fri Apr 19 19:57:45 2024 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+100908+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+100908+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1678335529; cv=none; d=zohomail.com; s=zohoarc; b=Yej3Hlj5aAiiAgXIWa2Er+zMisZjk0c0+Bx4JY9/WWlysS2SPGlYLAGJy96N9095jPpSbqvb9NMiFuuG1i+SpYbOPTkqp6fpP+ZZ3ULW810vHgEXGuV82y2hXjK3k/TMtSdwZCLipiguUMDyZxrh6N20bnQNZE5Bf2PSCiQJr2g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678335529; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=S5wDzoStB0HdZbN3VR5ti9StaHhTxx8/Z7yKaIutdn8=; b=Quupdc73eFGDz+kOtSmm1CfIRrV9l1nsCM7Y7rWU9iL2ayPJVUwfco9Xo1WSEeup4Ap2m6REud8XU5pz+yU7MCfY+TPL6Utr5x+q2KWvoVvUzps2UknrDGcTcVsMqd83T7MWsQocWwB7YrYG8aTrOM7M5Wm7FxaOy7hkpC6pzI0= 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+100908+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1678335529586923.4925502473901; Wed, 8 Mar 2023 20:18:49 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id HYn6YY1788612xBuvIhX8hBC; Wed, 08 Mar 2023 20:18:49 -0800 X-Received: from zg8tndyumtaxlji0oc4xnzya.icoremail.net (zg8tndyumtaxlji0oc4xnzya.icoremail.net [46.101.248.176]) by mx.groups.io with SMTP id smtpd.web10.5100.1678332364439970375 for ; Wed, 08 Mar 2023 19:26:06 -0800 X-Received: from localhost.localdomain (unknown [10.12.130.31]) by app2 (Coremail) with SMTP id EggMCgB3czbGUQlkU28EAA--.11208S5; Thu, 09 Mar 2023 11:26:02 +0800 (CST) From: "Haijun Qin" To: devel@edk2.groups.io Cc: zhuwenjun@eswincomputing.com, zhengyu@eswincomputing.com, jinyanjiang@eswincomputing.com, qinhaijun@eswincomputing.com, zhangdongdong@eswincomputing.com Subject: [edk2-devel] [PATCH 1/1] Platform/RISC-V/PlatformPkg: Get privileged mode from PCD Date: Thu, 9 Mar 2023 11:25:47 +0800 Message-Id: <20230309032547.567-2-qinhaijun@eswincomputing.com> In-Reply-To: <20230309032547.567-1-qinhaijun@eswincomputing.com> References: <20230309032547.567-1-qinhaijun@eswincomputing.com> X-CM-TRANSID: EggMCgB3czbGUQlkU28EAA--.11208S5 X-Coremail-Antispam: 1UD129KBjvJXoWxJrWkuF1rtr43Zw4xtF13Arb_yoW8GrWfpr 4vkrWkZr9YqrW2v3WrJay8Xr4jy343tr10yF1DJ342kwn8XFnIqr10qw1Sya4qywsak34a yFWFkrWDCF47uaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUB214x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jr4l82xGYIkIc2 x26xkF7I0E14v26r1I6r4UM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE-syl42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfU5iSlUUUUU X-CM-SenderInfo: xtlqxthlmx0qphvzx0xfrp13pwlqwhhfrp/ 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,qinhaijun@eswincomputing.com X-Gm-Message-State: DINkaDzDrMDhq6GKfvkFYpeyx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1678335529; bh=TDbOUMWAgKpaMJ7WncARONK4bufqmcfu2TuyhLWgxkA=; h=Cc:Date:From:Reply-To:Subject:To; b=uCiXKiiehaCo+0bDzUgMYgpMr+MYNw+VqoZP1WuKGM5HSWvXG7O7zKpQVbqnwGVZJdn 1kZ+3Mez/iIUHrSt9W5jN+zl1hN+o4+SG2e6JhlMg9F97FvWK1RXRzila6xf4PeCxkw1J wEjf8SmUR3JBoRW/8SO70SkxNH/Fu1Wcg0c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1678335531363100006 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: qinhaijun The privileged mode of next booting stage is forced to S-mode,there change it getting from PcdPeiCorePrivilegeMode PCD. Signed-off-by: qinhaijun --- Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.c index c488f03a6a..750d27567d 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -488,7 +488,7 @@ PeiCore ( // Scratch->next_arg1 is the device tree. // Scratch->next_addr =3D (UINTN)(PeiCoreEntryPoint); - Scratch->next_mode =3D PRV_S; + Scratch->next_mode =3D FixedPcdGet32(PcdPeiCorePrivilegeMode); DEBUG ((DEBUG_INFO, "%a: Initializing OpenSBI library for booting hart %= d\n", __FUNCTION__, BootHartId)); sbi_init (Scratch); } @@ -728,6 +728,6 @@ SecCoreStartUpWithStack ( // Non boot hart wiil be halted waiting for SBI_HART_STARTING. // Use HSM ecall to start non boot hart (SBI_EXT_HSM_HART_START) later o= n, // - Scratch->next_mode =3D PRV_S; + Scratch->next_mode =3D FixedPcdGet32(PcdPeiCorePrivilegeMode); sbi_init (Scratch); } --=20 2.17.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 (#100908): https://edk2.groups.io/g/devel/message/100908 Mute This Topic: https://groups.io/mt/97490102/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-