From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.7310.1634634523022490278 for ; Tue, 19 Oct 2021 02:08:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=goppUeSX; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0926d272d9=abner.chang@hpe.com) Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19ILhNO1008060; Tue, 19 Oct 2021 09:08:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pps0720; bh=BdYI9HTCqTZh2fhddaVCJmOyy9aneAMXGC1WeNzGqKo=; b=goppUeSXyLMe+HOAhE1Jw5GI8s4IiPD9qivfBIihjtas5R5eOKteZpL3PW0f5vT6NwV9 yi4Q0i+evisuNT1XpD8k227+dT1OeV4/Eb+nXZjrNrURLFKq/sBByMOcOXX3Sfo392Z6 huupbKiucjQfywm3XvN+WtYki1Q75x3zn6lUItpWZ8C5a0DdAbq/ASiASM/vaOk6/HzL Vgo1tQ4rSmzhDcjN0sdRSxjAvRRrB0SNk+BuO+ACuqSmljelQD3IzQnySuUsFRAoVVcr vnHXQe3YCVL6irZDJgPBvDCL/Hlz6BnXOdqBgRQ+8VOv9LkXfSEhqJVHzanPusR5aiON vw== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0a-002e3701.pphosted.com with ESMTP id 3bs9b3qryg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Oct 2021 09:08:42 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id A41264F; Tue, 19 Oct 2021 09:08:41 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 9470D48; Tue, 19 Oct 2021 09:08:40 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Sunil V L , Daniel Schaefer Subject: [edk2-platforms][PATCH 21/30] RiscVPlatformPkg/Sec: Check Cold/Warm hart Date: Tue, 19 Oct 2021 16:09:58 +0800 Message-Id: <20211019081007.31165-22-abner.chang@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211019081007.31165-1-abner.chang@hpe.com> References: <20211019081007.31165-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: elPg4Nonfmk7uXOWBGUrulK0ksiXWKId X-Proofpoint-ORIG-GUID: elPg4Nonfmk7uXOWBGUrulK0ksiXWKId X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-18_07,2021-10-18_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 spamscore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110190056 Content-Transfer-Encoding: quoted-printable Check Coldboot or Warmboot hart in SEC OpenSBI platform function. Cc: Sunil V L Cc: Daniel Schaefer Signed-off-by: Abner Chang --- .../RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 51d9edfe75..9b162fb3b6 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -398,6 +398,13 @@ SecPostOpenSbiPlatformEarlylInit( IN BOOLEAN ColdBoot=0D )=0D {=0D + UINT32 HartId;=0D +=0D + if (!ColdBoot) {=0D + HartId =3D current_hartid();=0D + DEBUG ((DEBUG_INFO, "%a: Non boot hart %d.\n", __FUNCTION__, HartId));= =0D + return 0;=0D + }=0D //=0D // Boot HART is already in the process of OpenSBI initialization.=0D // We can let other HART to keep booting.=0D @@ -423,6 +430,12 @@ SecPostOpenSbiPlatformFinalInit ( struct sbi_platform *SbiPlatform;=0D EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext;=0D =0D + if (!ColdBoot) {=0D + HartId =3D current_hartid();=0D + DEBUG ((DEBUG_INFO, "%a: Non boot hart %d.\n", __FUNCTION__, HartId));= =0D + return 0;=0D + }=0D +=0D DEBUG((DEBUG_INFO, "%a: Entry, preparing to jump to PEI Core\n\n", __FUN= CTION__));=0D =0D SbiScratch =3D sbi_scratch_thishart_ptr();=0D @@ -777,7 +790,7 @@ VOID EFIAPI SecCoreStartUpWithStack( sbi_init(Scratch);=0D }=0D =0D -void xxxx (char *debugstr, ...)=0D +void OpensbiDebugPrint (char *debugstr, ...)=0D {=0D VA_LIST Marker;=0D =0D --=20 2.31.1