From nobody Sun Feb 8 19:48:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+54943+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54943+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582755136; cv=none; d=zohomail.com; s=zohoarc; b=VVGWrPq6ef6U8Ib/y2PZMLfkbczWCOAoyQRQMD+LnfnAFx7TcobfFz2RTGP3w3ygwDWz9AaDHMiK3kQ9fnKVtXUbGNTOw1wPVo4GPymVxgoB70zThgMiuzbWwubO7P/8i5+xzs+gTMMqNvMcChRjM2jaKH2c/yLcmqE5p6mJbls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582755136; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9MrnSOxyaenLRZrUFPNzT89MivqEll1dKYMfGLK2UxQ=; b=mm8vvS/FMSd9EXQMvwfR5hasuIZS+8u3JrSWJ74O0LfgECSn2NXpRitcbc6aVRrT4Gp0YkjxUnBG+9Q7QapVK1oekjXNi7q3J5uRY2qLUL6zdOqVuxcZTDIAtnggWFT+KgNvnZYv4YeK+67qIU7zxOEUvkbM0aLsjvFogSq0oAk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+54943+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1582755136389132.22615972945437; Wed, 26 Feb 2020 14:12:16 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id jwjjYY1788612xS5KXOdE8Rk; Wed, 26 Feb 2020 14:12:15 -0800 X-Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web09.286.1582755134484684367 for ; Wed, 26 Feb 2020 14:12:14 -0800 X-Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-21-nDxX2Ra2N52uVd8P8dIKmw-1; Wed, 26 Feb 2020 17:12:07 -0500 X-MC-Unique: nDxX2Ra2N52uVd8P8dIKmw-1 X-Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B49418CA240; Wed, 26 Feb 2020 22:12:06 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-185.ams2.redhat.com [10.36.116.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id B2C9F60BEF; Wed, 26 Feb 2020 22:12:03 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Ard Biesheuvel , Eric Dong , Hao A Wu , Igor Mammedov , Jian J Wang , Jiewen Yao , Jordan Justen , Michael Kinney , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Ray Ni Subject: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure Date: Wed, 26 Feb 2020 23:11:41 +0100 Message-Id: <20200226221156.29589-2-lersek@redhat.com> In-Reply-To: <20200226221156.29589-1-lersek@redhat.com> References: <20200226221156.29589-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.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,lersek@redhat.com X-Gm-Message-State: fVATJmj1opDdoI80xbtMbytMx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1582755135; bh=9MrnSOxyaenLRZrUFPNzT89MivqEll1dKYMfGLK2UxQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=uxfR1Bt8FnDB1RFmuddYrIamwAc1qgOILlGvRQEwff6A499e5xv1AOb0IXDt+XSwFIj Q5PN/R75MHMXvwQ43B1ogEP4CPBifZatojylveAhxLfjhinKuWsc3E3WO/TiEeTG1UofJ 8w3zhad3bsTshm15oMn/GqOJaSmKHYdRdSY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" In the CoreStartImage() function [MdeModulePkg/Core/Dxe/Image/Image.c], if the image entry point returns a failure code, then the DXE Core logs a helpful DEBUG_ERROR message, with the following format string: "Error: Image at %11p start failed: %r\n" Do similarly in the SMM Core (update the message slightly). Cc: Ard Biesheuvel Cc: Eric Dong Cc: Hao A Wu Cc: Igor Mammedov Cc: Jian J Wang Cc: Jiewen Yao Cc: Jordan Justen Cc: Michael Kinney Cc: Philippe Mathieu-Daud=C3=A9 Cc: Ray Ni Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D1512 Signed-off-by: Laszlo Ersek Acked-by: Ard Biesheuvel Reviewed-by: Eric Dong Reviewed-by: Philippe Mathieu-Daude --- Notes: v2: =20 - Pick up Ard's Acked-by, which is conditional on approval from Intel reviewers on Cc. (I'd like to save Ard the churn of re-acking unmodified patches.) MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core/P= iSmmCore/Dispatcher.c index 9bec731e5312..76ee9e0b89cc 100644 --- a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c +++ b/MdeModulePkg/Core/PiSmmCore/Dispatcher.c @@ -883,44 +883,50 @@ SmmDispatcher ( RemoveEntryList (&DriverEntry->ScheduledLink); =20 REPORT_STATUS_CODE_WITH_EXTENDED_DATA ( EFI_PROGRESS_CODE, EFI_SOFTWARE_SMM_DRIVER | EFI_SW_PC_INIT_BEGIN, &DriverEntry->ImageHandle, sizeof (DriverEntry->ImageHandle) ); =20 // // Cache state of SmmEntryPointRegistered before calling entry point // PreviousSmmEntryPointRegistered =3D gSmmCorePrivate->SmmEntryPointRe= gistered; =20 // // For each SMM driver, pass NULL as ImageHandle // RegisterSmramProfileImage (DriverEntry, TRUE); PERF_START_IMAGE_BEGIN (DriverEntry->ImageHandle); Status =3D ((EFI_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPoi= nt)(DriverEntry->ImageHandle, gST); PERF_START_IMAGE_END (DriverEntry->ImageHandle); if (EFI_ERROR(Status)){ + DEBUG (( + DEBUG_ERROR, + "Error: SMM image at %11p start failed: %r\n", + DriverEntry->SmmLoadedImage.ImageBase, + Status + )); UnregisterSmramProfileImage (DriverEntry, TRUE); SmmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage); // // Uninstall LoadedImage // Status =3D gBS->UninstallProtocolInterface ( DriverEntry->ImageHandle, &gEfiLoadedImageProtocolGuid, DriverEntry->LoadedImage ); if (!EFI_ERROR (Status)) { if (DriverEntry->LoadedImage->FilePath !=3D NULL) { gBS->FreePool (DriverEntry->LoadedImage->FilePath); } gBS->FreePool (DriverEntry->LoadedImage); } Status =3D SmmUninstallProtocolInterface ( DriverEntry->SmmImageHandle, &gEfiLoadedImageProtocolGuid, &DriverEntry->SmmLoadedImage ); if (!EFI_ERROR(Status)) { --=20 2.19.1.3.g30247aa5d201 -=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 (#54943): https://edk2.groups.io/g/devel/message/54943 Mute This Topic: https://groups.io/mt/71575164/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-