From nobody Mon Feb 9 08:58:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+47422+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47422+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568749848; cv=none; d=zoho.com; s=zohoarc; b=ntbQ3zf/AnpoHwoIkieTDQFmYbykqPe6DkA9ZWp6rZZLTCpaD1iV3+b7dPQEPbDwGt9CEfabODyOLfA07ilCn2r4xCPg22QxBlsqIaxNRrJ0ii0jHN5npBYOGn7A5BUzIDTsY6Vqzloy8JMLa8l9lAAamiMacwqwmLyIDX4ciXg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568749848; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=2t3DmnrAaJWM/b2SpDAbORHZYZwLMc7xhwSsDiab7jY=; b=M6w347F8io+SJyFmjQCJhW5NNsHSHgsK87W6CJp4+84Gp0rKtTkGvPUZyQSpqbtJzxIdJSlB4N836E1Nj/iZowXIDBgT3YgO6pslM6hI2+K0ETDu+0KuUgF85QTSwxx5IzvD7LDoLWk0Rzy4Fr/t22duostS3veYQ9CqBhg5ybo= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+47422+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 1568749848533469.5938048604871; Tue, 17 Sep 2019 12:50:48 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9ByhYY1788612xcJ59JNyq3n; Tue, 17 Sep 2019 12:50:48 -0700 X-Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by groups.io with SMTP; Tue, 17 Sep 2019 12:50:47 -0700 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A948307D848; Tue, 17 Sep 2019 19:50:47 +0000 (UTC) X-Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-37.rdu2.redhat.com [10.10.120.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E08F600C4; Tue, 17 Sep 2019 19:50:45 +0000 (UTC) From: "Laszlo Ersek" To: edk2-devel-groups-io Cc: Benjamin You , Guo Dong , Maurice Ma Subject: [edk2-devel] [PATCH 35/35] UefiPayloadPkg/BlSupportDxe: fix ReserveResourceInGcd() calls Date: Tue, 17 Sep 2019 21:49:35 +0200 Message-Id: <20190917194935.24322-36-lersek@redhat.com> In-Reply-To: <20190917194935.24322-1-lersek@redhat.com> References: <20190917194935.24322-1-lersek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Tue, 17 Sep 2019 19:50:47 +0000 (UTC) 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: pcjdYWToorPrgLm6EwNInlOVx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1568749848; bh=OMjt+0SceN5shZ8sfuaKFhXZLlgFo2uXRY1bCvbKTFk=; h=Cc:Date:From:Reply-To:Subject:To; b=PBBEId0TwCpNo5kEGxLQ+WWghd/G4JXF53z9eNionUan+JSmZHVVoLE4j3oxY1A7P1f voI3vU/sSPffELE7rIWTjGaWIwIBVTiujUNw8n51SgyvPkhb51SghJ48TDKOjVdtMCIOD Ne+n0FEYgApnqKH6CL3/PHdYHRpqTTUwxKo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The last parameter of ReserveResourceInGcd() is "ImageHandle", forwarded in turn to gDS->AllocateMemorySpace() or gDS->AllocateIoSpace() as "owner" image handle. But BlDxeEntryPoint() passes "SystemTable" as "ImageHandle". Compilers have not flagged it because EFI_HANDLE (the type of "ImageHandle") is unfortunately specified as (VOID*), and (EFI_SYSTEM_TABLE*) converts to (VOID*) silently. Hand the entry point function's "ImageHandle" parameter to ReserveResourceInGcd(). This fixes an actual bug. Cc: Benjamin You Cc: Guo Dong Cc: Maurice Ma Signed-off-by: Laszlo Ersek Reviewed-by: Guo Dong Reviewed-by: Philippe Mathieu-Daude --- Notes: build-tested only UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c b/UefiPayloadPkg/Bl= SupportDxe/BlSupportDxe.c index bcee4cd9bc41..28dfc8fc5545 100644 --- a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c +++ b/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c @@ -106,10 +106,10 @@ BlDxeEntryPoint ( // // Report MMIO/IO Resources // - Status =3D ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0= xFEC00000, SIZE_4KB, 0, SystemTable); // IOAPIC + Status =3D ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0= xFEC00000, SIZE_4KB, 0, ImageHandle); // IOAPIC ASSERT_EFI_ERROR (Status); =20 - Status =3D ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0= xFED00000, SIZE_1KB, 0, SystemTable); // HPET + Status =3D ReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0= xFED00000, SIZE_1KB, 0, ImageHandle); // HPET ASSERT_EFI_ERROR (Status); =20 // --=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 (#47422): https://edk2.groups.io/g/devel/message/47422 Mute This Topic: https://groups.io/mt/34180240/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-