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.web10.17945.1636948562260591146 for ; Sun, 14 Nov 2021 19:56:05 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=EWCzL8gy; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0953f1bc5c=abner.chang@hpe.com) Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AF1mrUo024631; Mon, 15 Nov 2021 03:56: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=xmH5E78dnW6GcC59tXiNSSyAx10mkhL9tIHPd9U3sF8=; b=EWCzL8gyu1KxKBUSJql8OFYd0z5gXRoHFjUavUgEE+yFHj7OWGTPIcMky+pxc2+GvZfT bn11/B8MUzGuuKZEtYsrdLDllHVQHRWULgETbvPUdLsPqLWT9vy9WDsqEqxqV4S7554j ysIq4mygBerMauwRiZmCMMiHbpcKb+xeGKjiedYZCcxaNNEc62V5meUH1+R6iNBSjvmi I8HoJFN5ThnrcWzA9387pWPfBWf+BNsOs8exknmZRbKgISPTH4QEZWhymaaEEtXSiuB7 W9JTmlrn/LxaA5/5SIjXIYyfXUwBEuKX6ef33yVeHdSu9Q9tTels7EjRxCpw8sOIG9B2 0Q== Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 3cbe7bgk1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:56:01 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 6BBAA63; Mon, 15 Nov 2021 03:56:01 +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 5AB553A; Mon, 15 Nov 2021 03:56:00 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-platforms][PATCH 13/14] Platform/RISC-V: Add debug message to SecMain.c Date: Mon, 15 Nov 2021 10:56:39 +0800 Message-Id: <20211115025640.12897-14-abner.chang@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Lqw2d6yHkRgtqVJ7b7arEQBtq0Lcwb4c X-Proofpoint-GUID: Lqw2d6yHkRgtqVJ7b7arEQBtq0Lcwb4c 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.0.607.475 definitions=2021-11-15_02,2021-11-12_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 clxscore=1015 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111150021 Content-Transfer-Encoding: quoted-printable Add more debug messages when search FFS in SEC phase. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L --- .../RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 17f33a02cc..05f228c44d 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -166,6 +166,8 @@ FindFfsFileAndSection ( UINT32 Size;=0D EFI_PHYSICAL_ADDRESS EndOfFile;=0D =0D + DEBUG ((DEBUG_INFO, "%a: DBT FV at 0x%x\n", __FUNCTION__, Fv));=0D +=0D if (Fv->Signature !=3D EFI_FVH_SIGNATURE) {=0D DEBUG ((DEBUG_ERROR, "%a: FV at %p does not have FV header signature\n= ", __FUNCTION__, Fv));=0D return EFI_VOLUME_CORRUPTED;=0D @@ -181,17 +183,20 @@ FindFfsFileAndSection ( =0D CurrentAddress =3D (EndOfFile + 7) & ~(7ULL);=0D if (CurrentAddress > EndOfFirmwareVolume) {=0D + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__));=0D return EFI_VOLUME_CORRUPTED;=0D }=0D =0D File =3D (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress;=0D Size =3D *(UINT32*) File->Size & 0xffffff;=0D if (Size < (sizeof (*File) + sizeof (EFI_COMMON_SECTION_HEADER))) {=0D + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__));=0D return EFI_VOLUME_CORRUPTED;=0D }=0D =0D EndOfFile =3D CurrentAddress + Size;=0D if (EndOfFile > EndOfFirmwareVolume) {=0D + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__));=0D return EFI_VOLUME_CORRUPTED;=0D }=0D =0D @@ -199,6 +204,7 @@ FindFfsFileAndSection ( // Look for the request file type=0D //=0D if (File->Type !=3D FileType) {=0D + DEBUG ((DEBUG_INFO, "%a: (File->Type !=3D FileType), find next FFS\n= ", __FUNCTION__));=0D continue;=0D }=0D =0D @@ -208,9 +214,15 @@ FindFfsFileAndSection ( SectionType,=0D FoundSection=0D );=0D - if (!EFI_ERROR (Status) || (Status =3D=3D EFI_VOLUME_CORRUPTED)) {=0D + if (!EFI_ERROR(Status)) {=0D + DEBUG ((DEBUG_INFO, "%a: Get firmware file section\n", __FUNCTION__)= );=0D + return Status;=0D + }=0D + if (Status =3D=3D EFI_VOLUME_CORRUPTED) {=0D + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__));=0D return Status;=0D }=0D + DEBUG ((DEBUG_INFO, "%a: Find next FFS\n", __FUNCTION__));=0D }=0D }=0D =0D --=20 2.31.1