From nobody Thu May 2 14:18:47 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+67175+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+67175+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.alibaba.com ARC-Seal: i=1; a=rsa-sha256; t=1604930190; cv=none; d=zohomail.com; s=zohoarc; b=dDd0vNGqJYBqh5cYk3n1MintQ/RblvSLO22F/lBHGyvGlbulEZoWRe0h0/AsXTXiK9wh+YpnmUo0qFVIe1aiVi/51/k9hhP9VEunSaH+3tjn7Z5r/529NmVAZN/5Yc7evch6eowLgSbWcQgf2FmQCnlPOmyahYQ0hiKAAn2udxM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604930190; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=7kxQqqEm3aI8laDUUJGREY1f2aSwqdHOJIY/lZPWPi8=; b=jDf1n8V7NPCzdjUnVxfFg5lslH0A9+9ULKCMu+mBgrh/DfNK6dStnm5o3LxaAtREyKmdgQ38LIFwGC/M3yOGtSrbyafGcgGtSyiRE5qdJ08y/z3vAHld3ij1N78Svlf99YeTFHl6ksAuFEtI3FdV1BXtxy5Z2M+K7YZQU+d9jTk= 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+67175+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604930190813908.3892307783323; Mon, 9 Nov 2020 05:56:30 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id tb0cYY1788612x2WfnXdvRwH; Mon, 09 Nov 2020 05:56:30 -0800 X-Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by mx.groups.io with SMTP id smtpd.web08.1538.1604737830772155622 for ; Sat, 07 Nov 2020 00:30:31 -0800 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=huangming@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UEUytGW_1604737739; X-Received: from 842effaa37a8.tbsite.net(mailfrom:huangming@linux.alibaba.com fp:SMTPD_---0UEUytGW_1604737739) by smtp.aliyun-inc.com(127.0.0.1); Sat, 07 Nov 2020 16:29:36 +0800 From: Ming Huang To: devel@edk2.groups.io Cc: yitian.ly@alibaba-inc.com, terui.cl@alibaba-inc.com, guoheyi@linux.alibaba-inc.com, ming.huang-@outlook.com, Ming Huang Subject: [edk2-devel] [PATCH edk2 v1 1/2] edk2/StandaloneMmPkg: Fix several print issues Date: Sat, 7 Nov 2020 16:28:56 +0800 Message-Id: <20201107082857.8527-2-huangming@linux.alibaba.com> In-Reply-To: <20201107082857.8527-1-huangming@linux.alibaba.com> References: <20201107082857.8527-1-huangming@linux.alibaba.com> Precedence: Bulk List-Unsubscribe: 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,huangming@linux.alibaba.com X-Gm-Message-State: VlPHKBC40OzM1dQeK7UupkpJx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604930190; bh=FvYrrusZHG3kjiSUTKc4t5LJgeX0UIWFgaHrpCtAl+U=; h=Cc:Date:From:Reply-To:Subject:To; b=KwLKZIzxRHqPA6FiXNgi0W7Sz8EwTMEJ64yhjcW1aQLyFP8tWz5IYPGUVjeHtckR86Q YuzxM5fYfsQsI+KGYYnYTxuk5vut/bs3Qm0crfcbpQkyGckzuNSCfSrUwWqTEJZ/YT9sT W+l+GcoHaEtflYCfe0M9WSyFNg0mhLKK3Do= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 1 DEBUG_ERROR should be used for error print; 2 The %r is finer for edk2 status print; Signed-off-by: Ming Huang --- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c = | 4 ++-- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCor= eEntryPoint.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c = b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c index 6a25c4c548..3730ee6379 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c @@ -110,7 +110,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( ); =20 if (Status !=3D EFI_SUCCESS) { - DEBUG ((DEBUG_INFO, "Mem alloc failed - 0x%x\n", EventId)); + DEBUG ((DEBUG_ERROR, "Mem alloc failed - 0x%x\n", EventId)); return EFI_OUT_OF_RESOURCES; } =20 @@ -131,7 +131,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( mMmst->CpuSaveState =3D NULL; =20 if (mMmEntryPoint =3D=3D NULL) { - DEBUG ((DEBUG_INFO, "Mm Entry point Not Found\n")); + DEBUG ((DEBUG_ERROR, "Mm Entry point Not Found\n")); return EFI_UNSUPPORTED; } =20 diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Sta= ndaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPo= int/AArch64/StandaloneMmCoreEntryPoint.c index 9cecfa667b..59a9963ff2 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalone= MmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalone= MmCoreEntryPoint.c @@ -126,7 +126,7 @@ DelegatedEventLoop ( ); =20 if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Failed delegated event 0x%x, Status 0x%x\n", + DEBUG ((DEBUG_ERROR, "Failed delegated event 0x%x, Status %r\n", EventCompleteSvcArgs->Arg0, Status)); } =20 --=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 (#67175): https://edk2.groups.io/g/devel/message/67175 Mute This Topic: https://groups.io/mt/78135574/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- From nobody Thu May 2 14:18:47 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+67176+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+67176+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.alibaba.com ARC-Seal: i=1; a=rsa-sha256; t=1604930192; cv=none; d=zohomail.com; s=zohoarc; b=llpBvwhZZWZCBFW23HJhudaDbrnDFMSNBvutpxER+2Half7qyz1Qu/l1o7lPVTzsRdY8NgUGvyERHsQnmKvQrPzfTu5FOqJwCHbZxrzC/uUqnvxWm3GowkCJm3NUa10xNRhZHBa7IdpPxI8e+awqF6OMIMqlNw1XXwigMcuMWAM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604930192; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=OZH1NHDVHn9tUqQm0MWwuSEgi0iv0PLEJRlQ5ka0rwA=; b=K60mCUooQK0YT5Xn1oBVDK5beghyCKxeEAW48GK8nIp9wttI990uO/Rqd/q5sYrHj2CP89Zx6pP0sDxb5YuB/kC0zqTg3sghTY6ii3r7XzVWA8yTOSua7s2ptHv6GyodBW75lcZSOMjdYo9MMhmoYcOPPI+9hyzPgisRaNvFmqg= 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+67176+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1604930192374957.5874360868671; Mon, 9 Nov 2020 05:56:32 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9jRCYY1788612xZy1z67JFYI; Mon, 09 Nov 2020 05:56:32 -0800 X-Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by mx.groups.io with SMTP id smtpd.web09.1513.1604737859853230582 for ; Sat, 07 Nov 2020 00:31:00 -0800 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04357;MF=huangming@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UEUytGW_1604737739; X-Received: from 842effaa37a8.tbsite.net(mailfrom:huangming@linux.alibaba.com fp:SMTPD_---0UEUytGW_1604737739) by smtp.aliyun-inc.com(127.0.0.1); Sat, 07 Nov 2020 16:29:36 +0800 From: Ming Huang To: devel@edk2.groups.io Cc: yitian.ly@alibaba-inc.com, terui.cl@alibaba-inc.com, guoheyi@linux.alibaba-inc.com, ming.huang-@outlook.com, Ming Huang Subject: [edk2-devel] [PATCH edk2 v1 2/2] edk2/MM: Fix MM Communicate return wrong status issue Date: Sat, 7 Nov 2020 16:28:57 +0800 Message-Id: <20201107082857.8527-3-huangming@linux.alibaba.com> In-Reply-To: <20201107082857.8527-1-huangming@linux.alibaba.com> References: <20201107082857.8527-1-huangming@linux.alibaba.com> Precedence: Bulk List-Unsubscribe: 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,huangming@linux.alibaba.com X-Gm-Message-State: zwHr92hYpGSYp8FPjhNxkfGex1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1604930192; bh=EQPswazNsVkdGZDSiJnO7Byk4y0wbepqfLDEPy1lAQQ=; h=Cc:Date:From:Reply-To:Subject:To; b=sALdpPiHURDJMN/cy38oQsmBMHHFr1bsMU3vWeBj2o6eY0HhChfZorc4CLaa8mGy4ra VcnlCDJRb02vUK0zAObiboFhOSnzZc7bQQ0pVYg0q3b/4XhnOMDNXRLZZljqE3ZDHUTlw qIBNBQ8S5zzXiT/5yvNhhI0ocGPkIKFU5h4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When edk2 driver call EFI_MM_COMMUNICATION_PROTOCOL.Communicate, the status of mm event can't return exactly to edk2 driver. Signed-off-by: Ming Huang --- ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c | 2 -- MdePkg/Include/Pi/PiMmCis.h | 2 +- StandaloneMmPkg/Core/StandaloneMmCore.c | 5 +++-- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c | 5 +++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/D= rivers/MmCommunicationDxe/MmCommunication.c index 9457eaf1d8..b5b074b56e 100644 --- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c +++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c @@ -172,12 +172,10 @@ MmCommunication2Communicate ( // Unexpected error since the CommSize was checked for zero length // prior to issuing the SMC Status =3D EFI_OUT_OF_RESOURCES; - ASSERT (0); break; =20 default: Status =3D EFI_ACCESS_DENIED; - ASSERT (0); } =20 return Status; diff --git a/MdePkg/Include/Pi/PiMmCis.h b/MdePkg/Include/Pi/PiMmCis.h index fdf0591a03..762a1fbce5 100644 --- a/MdePkg/Include/Pi/PiMmCis.h +++ b/MdePkg/Include/Pi/PiMmCis.h @@ -237,7 +237,7 @@ typedef struct _EFI_MM_ENTRY_CONTEXT { @param[in] MmEntryContext Processor information and functionality neede= d by MM Foundation. **/ typedef -VOID +EFI_STATUS (EFIAPI *EFI_MM_ENTRY_POINT)( IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext ); diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core= /StandaloneMmCore.c index ac3e2c0b1b..aa59ceb5d7 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.c +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c @@ -332,7 +332,7 @@ MmEndOfDxeHandler ( needed by MM Foundation. =20 **/ -VOID +EFI_STATUS EFIAPI MmEntryPoint ( IN CONST EFI_MM_ENTRY_CONTEXT *MmEntryContext @@ -398,7 +398,7 @@ MmEntryPoint ( // // Process Asynchronous MMI sources // - MmiManage (NULL, NULL, NULL, NULL); + Status =3D MmiManage (NULL, NULL, NULL, NULL); =20 // // TBD: Do not use private data structure ? @@ -410,6 +410,7 @@ MmEntryPoint ( gMmCorePrivate->InMm =3D FALSE; =20 DEBUG ((DEBUG_INFO, "MmEntryPoint Done\n")); + return Status; } =20 EFI_STATUS diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c = b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c index 3730ee6379..6951d8ae50 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c @@ -68,6 +68,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( EFI_MM_COMMUNICATE_HEADER *GuidedEventContext =3D NULL; EFI_MM_ENTRY_CONTEXT MmEntryPointContext =3D {0}; EFI_STATUS Status; + EFI_STATUS MmRetStatus; UINTN NsCommBufferSize; =20 DEBUG ((DEBUG_INFO, "Received event - 0x%x on cpu %d\n", EventId, CpuNum= ber)); @@ -135,7 +136,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( return EFI_UNSUPPORTED; } =20 - mMmEntryPoint (&MmEntryPointContext); + MmRetStatus =3D mMmEntryPoint (&MmEntryPointContext); =20 // Free the memory allocation done earlier and reset the per-cpu context ASSERT (GuidedEventContext); @@ -147,7 +148,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( } PerCpuGuidedEventContext[CpuNumber] =3D NULL; =20 - return Status; + return MmRetStatus; } =20 EFI_STATUS --=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 (#67176): https://edk2.groups.io/g/devel/message/67176 Mute This Topic: https://groups.io/mt/78135575/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-