From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web08.3783.1641630362945550004 for ; Sat, 08 Jan 2022 00:26:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=LyBBpi6o; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=000704d8ca=abner.chang@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2082C5mp024444 for ; Sat, 8 Jan 2022 08:26:02 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=5C/nxJlihzi5bu8yx56znvVXWZSfiUm4MhU2vGX83FY=; b=LyBBpi6oIsSYamH9PdKE38tDh3RoeHqZs/eXcR+Gj6rW54IdQw+sGEdd1AUBb0jnwQCi og4TYesJdMCdQ8FuKW5BUXGLYPqp9YtzzW5lt1jkLHlbAUeqNqRWd25WAw/w54X/kADG CDSDtbSrkgMFnXCHBwJ6X2FwFNVvahI/OFW3YX+hQPz/215OgG5Io0St6yCOSb5Ys2Wc H/LEmZm+fgRlvu3vtjCI1lPBhwXniLL1v8bXSYML8OtUn2X8htJdWp62E4O8Dwj93tir oFcBdfpVQYux/ktaRk0SA6CCxeFo/gRWrRK7ssDD5ztX0QICn5hKc45SHhHmHgn8/xh0 JA== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3df1kq18yj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 08 Jan 2022 08:26:01 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 2732481 for ; Sat, 8 Jan 2022 08:25:56 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 6E9B339; Sat, 8 Jan 2022 08:25:55 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com Subject: [PATCH 52/79] RiscVPlatformPkg/Sec: Check Cold/Warm hart Date: Sat, 8 Jan 2022 15:24:35 +0800 Message-Id: <20220108072444.17879-11-abner.chang@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220108072444.17879-1-abner.chang@hpe.com> References: <20220108072444.17879-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 31UVsHxKFvl1AOcT3DwGzCtIiaosrU-k X-Proofpoint-GUID: 31UVsHxKFvl1AOcT3DwGzCtIiaosrU-k X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-08_03,2022-01-07_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 bulkscore=0 malwarescore=0 suspectscore=0 phishscore=0 mlxscore=0 impostorscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201080064 Content-Transfer-Encoding: quoted-printable (This is migrated from edk2-platforms:Platform) Check Coldboot or Warmboot hart in SEC OpenSBI platform function. Cc: Sunil V L Cc: Daniel Schaefer Signed-off-by: Abner Chang Reviewed-by: Daniel Schaefer Reviewed-by: Sunil V L --- .../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