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.web12.11063.1601455875711502969 for ; Wed, 30 Sep 2020 01:51:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=It+Saxfw; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0542154863=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08U8pE4X017669; Wed, 30 Sep 2020 08:51:14 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 : content-transfer-encoding : content-type : mime-version; s=pps0720; bh=EqLCL++c5nyZ2cM8ON2OyFffSots2wlUj5Cu6y0f+ME=; b=It+Saxfwx+7YeVc356021nE94MAUp9VQ06WU1FDJJ82O3zRXaIYhxWz1q18LfmsYMM4z SEQrxo+czVnyXabA5lxXxCNCS1uReC90DSqulWp9wD2N4Jd2n7XDYx3ispREocnzy1So 1H/rsde5883YLeLqcyoGfdy2p+jY+DMpAXdRybBvucUcLQvBZro78mIGYWmW+Y8PF1gs IivGKE5QZ44IfCSkh1W1H29i2sNWsotdEfrZd+6XqaKqHoHSajUNk5dNAlp0lQAN7X1u OIuF+ghgvsv/0q6xuTBgXLSx0nFDQ4YlBLhkz4vw7sgBcoLlEAE89K1MK6cUlWFgsyy7 Yw== Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 33uwgtbdee-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 08:51:14 +0000 Received: from G2W6310.americas.hpqcorp.net (g2w6310.austin.hp.com [16.197.64.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 55B4CB0; Wed, 30 Sep 2020 08:50:59 +0000 (UTC) Received: from G4W9120.americas.hpqcorp.net (2002:10d2:150f::10d2:150f) by G2W6310.americas.hpqcorp.net (2002:10c5:4034::10c5:4034) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 08:50:27 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.241.52.13) by G4W9120.americas.hpqcorp.net (16.210.21.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 08:50:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d4/41cBwWvJqF0pvZv4GIJ1ZzutKG8UmlYsPwHD3fYV9OpV5D39RGzWjlG6Nps9rq80wZZGfhuUgbRwAP0+MWwFzGGS+hn+ncU2vbXuELxeoujMgDF6/Adleml4MjqSdXOeYrH54H4n+/Oxl4KRH5zgMST73SOn9ZVa4ht2tS1fQJW9pZ0EOKQg8HUkyoJevTOYOJ8atDJLrmAB2gk09vR39JGzZ9L4sAB/0t3VInXxXCID2niEOVV+RYCQZ8lKbbErLAR1dWN2EuI+t/vuhrv8mNj537aBuieTC/rDM6SkimgCzzAsRSb9mOaFk6pil9DQqIH2GGbMYXplB/QC+iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EqLCL++c5nyZ2cM8ON2OyFffSots2wlUj5Cu6y0f+ME=; b=i5OERpmVeWeRti10Dz6da107DZoF7HMSn13Yzz6sLO6SQF64U1f7rGIkKAvxmKMmTgl4pqWHERuP/ak6gGh58BpFbhGaBVit6PYxvU8ctvYeNOnI5ZWIYHdxKMiHBRiPhwh1Wp+fXTTQQeQd6nMqAEGEJZ+AqYgwydIXLawm9+dJU1ltlZTcEKNeVfaaalGHEOrtsfWQUPSo9FhfEBuNqd87+K6OSPDnMid9GsFW3yGPipgnCsR2sTdud9rdEK0hThRggb/mPMJGzWzu2tv4T7BWmkgYR31C+0iOBo/i+5Lt5DIYyWKfxsh3xvUNbpa5pGOcSwgsYc8D+reHLUaeiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB0858.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.22; Wed, 30 Sep 2020 08:50:26 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::11b0:1862:f48c:d2a9]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::11b0:1862:f48c:d2a9%9]) with mapi id 15.20.3433.035; Wed, 30 Sep 2020 08:50:26 +0000 From: "Daniel Schaefer" To: CC: Daniel Schaefer , Abner Chang , Leif Lindholm Subject: [PATCH 1/1] Silicon/SiFive: Handle case of NULL FirmwareContext Date: Wed, 30 Sep 2020 16:50:05 +0800 Message-ID: <20200930085005.27148-2-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200930085005.27148-1-daniel.schaefer@hpe.com> References: <20200930085005.27148-1-daniel.schaefer@hpe.com> X-Originating-IP: [15.211.146.34] X-ClientProxiedBy: SG2PR02CA0052.apcprd02.prod.outlook.com (2603:1096:4:54::16) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from x360-nix.wireless.hpe.com (15.211.146.34) by SG2PR02CA0052.apcprd02.prod.outlook.com (2603:1096:4:54::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.32 via Frontend Transport; Wed, 30 Sep 2020 08:50:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 80007587-a679-49f3-1cf9-08d8651de01c X-MS-TrafficTypeDiagnostic: DF4PR8401MB0858: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wZ1P0DDVYYnxs+RBSb94s+arQf6zVzW2S9bTl46qs0C8NojMfUy0NtlgKXfaYYD5iTeb4qwfVn70cqSKZyWxW40/GoPeTF8GHRjC7TSZj3DhheaP/p7LdEP+wndeKgcx90L+Xk1UVZNdynRPYrTaxWmzT1Vb++bjvhFKx4sB9wcByNbrUY1xvQbNTXpAcYMPkkKmnqDnIpiqP13hx9vDJaTgPa8I7cv/WInuPumzc38uDOSFUOE0fqdi1ZQTJUrvgpjayaQqEsVqe0UybsXftSHPbn5x1igByKMWNCKvFUNiA5Tq/In9boeo36ebO5XE1jgU/9dEvQtyXdXtJRX5jnFXL1ZGjwYlHz3gM70D6PRZV5whlj/byZkwKtwZvmYD X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(6029001)(366004)(39860400002)(376002)(396003)(346002)(136003)(6486002)(4326008)(316002)(2906002)(8676002)(86362001)(8936002)(6666004)(54906003)(478600001)(44832011)(16526019)(5660300002)(186003)(26005)(1076003)(52116002)(83380400001)(66946007)(36756003)(7696005)(19627235002)(6916009)(2616005)(66556008)(66476007)(956004);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 3AUm0C0lqdMmW871SV7yt4G7s7CHJ7kBG9glWHBsHdNTaLteXhdOAaVI0r8XSWcIlau/y8LBooTDqqfMtYRekZ1/mGoDc6DVdzXYBMCAQo52+zf4Fuf5YU4qVSebvGhNzJnZWY/T4rtSQDhYWrknLekaRKpmjRboNROnEbr1lPpL0L6jqaKgXQj8IpcLvN3bmrltuqAVy0du6sskDv3p1p57unG4KifS91XjxkLnkScbrgWPUpIyhmB+kfmtK2jrouxiN5TxQ8HR6eVXVfxeIzCGKByGSlfoZtiQ/7MuvdDzHezi1ymaQzzI9J2DqLExLQiAkIpHVQGbBuT81gjGNxg1WQ7e7AapWku6wpnxeIcewVQTJpJvvqaYJc5anu0cmTnDfpAcUDWx6CEsscylHR41JKlykJAM7BWGOkBD79nyESA54+0kGyW+Z3mt8zR5U/hMliYOA9GaSK+h5vks+yjxv3wuc8soga3xUrDPqIX4lgC8dkKbOUxLqsR9dPgFhDZGU6/N+MwdZUlo+/hPuAeqQPXPr6oQeFfbzXLJ64yt0PDQekpt1NxRXln1ASceIbIh3TfX8sMI1SYTDcquubTpf5iDOTFlHszGVFvLqXfnoANaK5ktcqbYbLDWbEP9j1bt17TqcJDIOuTxydMOLw== X-MS-Exchange-CrossTenant-Network-Message-Id: 80007587-a679-49f3-1cf9-08d8651de01c X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2020 08:50:26.3519 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wOBXgZL9yoOzl0i0XkK3JZzifI4P8JcW+DyXxb22dQrqIVjJiJPIlXP150d/zZclrbsfaoCwTbeqE3pioJjBxA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0858 X-OriginatorOrg: hpe.com X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-30_05:2020-09-29,2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1011 impostorscore=0 bulkscore=0 suspectscore=4 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300070 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Abort creating the SMBIOS HOBs if there's no firmware context to get the information from. Turn SbiLib functions for getting mscratch into VOID since they can never practically fail. Signed-off-by: Daniel Schaefer Cc: Abner Chang Cc: Leif Lindholm --- .../Include/Library/RiscVEdk2SbiLib.h | 12 ++--- .../PlatformPkg/Universal/Sec/SecMain.c | 11 +++-- .../Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c | 46 +++++++------------ .../Library/PeiCoreInfoHobLib/CoreInfoHob.c | 13 ++++-- 4 files changed, 36 insertions(+), 46 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h = b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h index 558841a970ce..f81ea06b05b0 100644 --- a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h +++ b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h @@ -514,9 +514,8 @@ SbiVendorCall ( access the firmware context.=0D =0D @param[out] ScratchSpace The scratch space pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiGetMscratch (=0D OUT SBI_SCRATCH **ScratchSpace=0D @@ -527,9 +526,8 @@ SbiGetMscratch ( =0D @param[in] HartId The hart id.=0D @param[out] ScratchSpace The scratch space pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiGetMscratchHartid (=0D IN UINTN HartId,=0D @@ -540,9 +538,8 @@ SbiGetMscratchHartid ( Get firmware context of the calling hart.=0D =0D @param[out] FirmwareContext The firmware context pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiGetFirmwareContext (=0D OUT EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT **FirmwareContext=0D @@ -552,9 +549,8 @@ SbiGetFirmwareContext ( Set firmware context of the calling hart.=0D =0D @param[in] FirmwareContext The firmware context pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiSetFirmwareContext (=0D IN EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext=0D diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 877777bfa1ab..fa9ecd789a57 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -415,7 +415,10 @@ EFI_STATUS EFIAPI TemporaryRamDone ( return EFI_SUCCESS;=0D }=0D =0D -/** Handles SBI calls of EDK2's SBI FW extension=0D +/**=0D + Handles SBI calls of EDK2's SBI FW extension.=0D +=0D + The return value is the error code returned by the SBI call.=0D =0D @param[in] ExtId The extension ID of the FW extension.=0D @param[in] FuncId The called function ID.=0D @@ -424,7 +427,7 @@ EFI_STATUS EFIAPI TemporaryRamDone ( @param[out] OutTrap Trap info for trapping further, see OpenSBI cod= e.=0D Is ignored if return value is not SBI_ETRAP.=0D =0D - @retval 0 If the handler succeeds.=0D + @retval SBI_OK If the handler succeeds.=0D @retval SBI_ENOTSUPP If there's no function with the given ID.=0D @retval SBI_ETRAP If the called SBI functions wants to trap furth= er.=0D **/=0D @@ -436,7 +439,7 @@ STATIC int SbiEcallFirmwareHandler ( OUT struct sbi_trap_info *OutTrap=0D )=0D {=0D - int Ret =3D 0;=0D + int Ret =3D SBI_OK;=0D =0D switch (FuncId) {=0D case SBI_EXT_FW_MSCRATCH_FUNC:=0D @@ -447,6 +450,8 @@ STATIC int SbiEcallFirmwareHandler ( break;=0D default:=0D Ret =3D SBI_ENOTSUPP;=0D + DEBUG ((DEBUG_ERROR, "%a: Called SBI firmware ecall with invalid fun= ction ID\n", __FUNCTION__));=0D + ASSERT (FALSE);=0D };=0D =0D return Ret;=0D diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2S= biLib.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiL= ib.c index 0df505d2675b..9bbeaaec3f7a 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c @@ -801,9 +801,8 @@ SbiVendorCall ( access the firmware context.=0D =0D @param[out] ScratchSpace The scratch space pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiGetMscratch (=0D OUT SBI_SCRATCH **ScratchSpace=0D @@ -811,11 +810,10 @@ SbiGetMscratch ( {=0D SbiRet Ret =3D SbiCall (SBI_EDK2_FW_EXT, SBI_EXT_FW_MSCRATCH_FUNC, 0);=0D =0D - if (!Ret.Error) {=0D - *ScratchSpace =3D (SBI_SCRATCH *)Ret.Value;=0D - }=0D + // Our ecall handler never returns an error, only when the func id is in= valid=0D + ASSERT (Ret.Error =3D=3D SBI_OK);=0D =0D - return EFI_SUCCESS;=0D + *ScratchSpace =3D (SBI_SCRATCH *)Ret.Value;=0D }=0D =0D /**=0D @@ -823,9 +821,8 @@ SbiGetMscratch ( =0D @param[in] HartId The hart id.=0D @param[out] ScratchSpace The scratch space pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiGetMscratchHartid (=0D IN UINTN HartId,=0D @@ -839,11 +836,10 @@ SbiGetMscratchHartid ( HartId=0D );=0D =0D - if (!Ret.Error) {=0D - *ScratchSpace =3D (SBI_SCRATCH *)Ret.Value;=0D - }=0D + // Our ecall handler never returns an error, only when the func id is in= valid=0D + ASSERT (Ret.Error =3D=3D SBI_OK);=0D =0D - return EFI_SUCCESS;=0D + *ScratchSpace =3D (SBI_SCRATCH *)Ret.Value;=0D }=0D =0D /**=0D @@ -852,7 +848,7 @@ SbiGetMscratchHartid ( @param[out] FirmwareContext The firmware context pointer.=0D @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiGetFirmwareContext (=0D OUT EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT **FirmwareContext=0D @@ -860,24 +856,18 @@ SbiGetFirmwareContext ( {=0D SBI_SCRATCH *ScratchSpace;=0D SBI_PLATFORM *SbiPlatform;=0D - SbiRet Ret =3D SbiCall (SBI_EDK2_FW_EXT, SBI_EXT_FW_MSCRATCH_FUNC, 0);=0D =0D - if (!Ret.Error) {=0D - ScratchSpace =3D (SBI_SCRATCH *)Ret.Value;=0D - SbiPlatform =3D (SBI_PLATFORM *)sbi_platform_ptr(ScratchSpace);=0D - *FirmwareContext =3D (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)SbiPlatform= ->firmware_context;=0D - }=0D -=0D - return EFI_SUCCESS;=0D + SbiGetMscratch(&ScratchSpace);=0D + SbiPlatform =3D (SBI_PLATFORM *)sbi_platform_ptr(ScratchSpace);=0D + *FirmwareContext =3D (EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *)SbiPlatform->= firmware_context;=0D }=0D =0D /**=0D Set firmware context of the calling hart.=0D =0D @param[in] FirmwareContext The firmware context pointer.=0D - @retval EFI_SUCCESS The operation succeeds.=0D **/=0D -EFI_STATUS=0D +VOID=0D EFIAPI=0D SbiSetFirmwareContext (=0D IN EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext=0D @@ -885,13 +875,9 @@ SbiSetFirmwareContext ( {=0D SBI_SCRATCH *ScratchSpace;=0D SBI_PLATFORM *SbiPlatform;=0D - SbiRet Ret =3D SbiCall (SBI_EDK2_FW_EXT, SBI_EXT_FW_MSCRATCH_FUNC, 0);=0D =0D - if (!Ret.Error) {=0D - ScratchSpace =3D (SBI_SCRATCH *)Ret.Value;=0D - SbiPlatform =3D (SBI_PLATFORM *)sbi_platform_ptr (ScratchSpace);=0D - SbiPlatform->firmware_context =3D (UINTN)FirmwareContext;=0D - }=0D + SbiGetMscratch(&ScratchSpace);=0D =0D - return EFI_SUCCESS;=0D + SbiPlatform =3D (SBI_PLATFORM *)sbi_platform_ptr (ScratchSpace);=0D + SbiPlatform->firmware_context =3D (UINTN)FirmwareContext;=0D }=0D diff --git a/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c b/S= ilicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c index edeabf028ff8..88f36cbbe299 100644 --- a/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c +++ b/Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c @@ -38,7 +38,7 @@ =0D @return EFI_SUCCESS The PEIM initialized successfully.=0D EFI_UNSUPPORTED HART is ignored by platform.=0D -=0D + EFI_NOT_FOUND Processor specific data hob is not available.=0D **/=0D EFI_STATUS=0D EFIAPI=0D @@ -56,7 +56,6 @@ CreateU54E51CoreProcessorSpecificDataHob ( RISC_V_PROCESSOR_SPECIFIC_HOB_DATA ProcessorSpecDataHob;=0D EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext;=0D EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *FirmwareContextHartSpecific;=0D - EFI_STATUS Status;=0D =0D DEBUG ((DEBUG_INFO, "%a: Entry.\n", __FUNCTION__));=0D =0D @@ -64,9 +63,14 @@ CreateU54E51CoreProcessorSpecificDataHob ( return EFI_INVALID_PARAMETER;=0D }=0D =0D - Status =3D SbiGetFirmwareContext (&FirmwareContext);=0D - ASSERT_EFI_ERROR (Status);=0D + SbiGetFirmwareContext (&FirmwareContext);=0D + ASSERT (FirmwareContext !=3D NULL);=0D + if (FirmwareContext =3D=3D NULL) {=0D + DEBUG ((DEBUG_ERROR, "Failed to get the pointer of EFI_RISCV_OPENSBI_F= IRMWARE_CONTEXT of hart %d\n", HartId));=0D + return EFI_NOT_FOUND;=0D + }=0D DEBUG ((DEBUG_INFO, " Firmware Context is at 0x%x.\n", FirmwareContex= t));=0D +=0D FirmwareContextHartSpecific =3D FirmwareContext->HartSpecific[HartId];=0D DEBUG ((DEBUG_INFO, " Firmware Context Hart specific is at 0x%x.\n", = FirmwareContextHartSpecific));=0D if (FirmwareContextHartSpecific =3D=3D NULL) {=0D @@ -102,7 +106,6 @@ CreateU54E51CoreProcessorSpecificDataHob ( ProcessorSpecDataHob.ProcessorSpecificData.SupervisorModeXlen = =3D RegisterLen64;=0D }=0D =0D -=0D DebugPrintHartSpecificInfo (&ProcessorSpecDataHob);=0D =0D //=0D --=20 2.28.0