From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web10.13534.1583153246054022670 for ; Mon, 02 Mar 2020 04:47:26 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Mepj9v+E; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583153245; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JmAJkrprZ2uaGtp+XHPlnBOk8i2puLoyL5oROUWBWNk=; b=Mepj9v+ElFiwWBcdlW3iacDTbLhfUEh/X7AVV9xz7IMjo1EcyFZfRaLeqOaenqyT8V/mvP mqjx+pxl3usZyeCSrZFKYMdKwgqtQJZTh6AjyqU0E6nUNDzVPa6lBHE5fZrSHFOAM98uz6 8CY1E7aiL2+7Gn5pNjMJlnAFP/k8lOk= 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-378-omv4sUOzPiy6B9gYofj_TQ-1; Mon, 02 Mar 2020 07:47:19 -0500 X-MC-Unique: omv4sUOzPiy6B9gYofj_TQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 875DC189F782; Mon, 2 Mar 2020 12:47:17 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-117-197.ams2.redhat.com [10.36.117.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 97B605C296; Mon, 2 Mar 2020 12:47:14 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure From: "Laszlo Ersek" To: Eric Dong , Hao A Wu , Jian J Wang , Ray Ni Cc: edk2-devel-groups-io , Ard Biesheuvel , Igor Mammedov , Jiewen Yao , Jordan Justen , Michael Kinney , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Reply-To: devel@edk2.groups.io, lersek@redhat.com References: <20200226221156.29589-1-lersek@redhat.com> <20200226221156.29589-2-lersek@redhat.com> Message-ID: <7b5978a1-7127-f000-c655-31cf9097a80a@redhat.com> Date: Mon, 2 Mar 2020 13:47:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200226221156.29589-2-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jian, Hao, Eric, Ray, this patch is trivial; can one of you please ACK it? Thanks Laszlo On 02/26/20 23:11, Laszlo Ersek wrote: > In the CoreStartImage() function [MdeModulePkg/Core/Dxe/Image/Image.c], i= f > the image entry point returns a failure code, then the DXE Core logs a > helpful DEBUG_ERROR message, with the following format string: >=20 > "Error: Image at %11p start failed: %r\n" >=20 > Do similarly in the SMM Core (update the message slightly). >=20 > 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 > --- >=20 > 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.) >=20 > MdeModulePkg/Core/PiSmmCore/Dispatcher.c | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/MdeModulePkg/Core/PiSmmCore/Dispatcher.c b/MdeModulePkg/Core= /PiSmmCore/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 poi= nt > // > PreviousSmmEntryPointRegistered =3D gSmmCorePrivate->SmmEntryPoint= Registered; > =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->ImageEntryP= oint)(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