From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: guo.dong@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by groups.io with SMTP; Sun, 22 Sep 2019 19:28:39 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2019 19:28:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,538,1559545200"; d="scan'208";a="388331157" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 22 Sep 2019 19:28:38 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 22 Sep 2019 19:28:38 -0700 Received: from fmsmsx119.amr.corp.intel.com ([169.254.14.227]) by fmsmsx111.amr.corp.intel.com ([169.254.12.246]) with mapi id 14.03.0439.000; Sun, 22 Sep 2019 19:28:38 -0700 From: "Guo Dong" To: "devel@edk2.groups.io" , "lersek@redhat.com" CC: "You, Benjamin" , "Ma, Maurice" Subject: Re: [edk2-devel] [PATCH 35/35] UefiPayloadPkg/BlSupportDxe: fix ReserveResourceInGcd() calls Thread-Topic: [edk2-devel] [PATCH 35/35] UefiPayloadPkg/BlSupportDxe: fix ReserveResourceInGcd() calls Thread-Index: AQHVbZE8mo/6FnO4oEGBFhGr8o/Bgqc4kR+Q Date: Mon, 23 Sep 2019 02:28:37 +0000 Message-ID: <0DE6ECBAEEB99B4DA9564FF580F3580A498EE26D@FMSMSX119.amr.corp.intel.com> References: <20190917194935.24322-1-lersek@redhat.com> <20190917194935.24322-36-lersek@redhat.com> In-Reply-To: <20190917194935.24322-36-lersek@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2Q1ZTgzMzMtYzdkNi00NDUyLThiNTctZTY4M2YwZGZjMmJlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieXJFbDhiZXdYSFIzekY1SlJoSStMOURHRnNvWmY3WVA0YWp5clpuRHQ2XC8wQXZuaXJ4dkJjdFhxUWhPNmhmWVcifQ== dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.1.200.106] MIME-Version: 1.0 Return-Path: guo.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the fix. Reviewed-by: Guo Dong > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Tuesday, September 17, 2019 12:50 PM > To: edk2-devel-groups-io > Cc: You, Benjamin ; Dong, Guo > ; Ma, Maurice > Subject: [edk2-devel] [PATCH 35/35] UefiPayloadPkg/BlSupportDxe: fix > ReserveResourceInGcd() calls >=20 > The last parameter of ReserveResourceInGcd() is "ImageHandle", forwarded > in turn to gDS->AllocateMemorySpace() or gDS->AllocateIoSpace() as > "owner" > image handle. >=20 > But BlDxeEntryPoint() passes "SystemTable" as "ImageHandle". >=20 > 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. >=20 > Hand the entry point function's "ImageHandle" parameter to > ReserveResourceInGcd(). This fixes an actual bug. >=20 > Cc: Benjamin You > Cc: Guo Dong > Cc: Maurice Ma > Signed-off-by: Laszlo Ersek > --- >=20 > Notes: > build-tested only >=20 > UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c > b/UefiPayloadPkg/BlSupportDxe/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, 0xFEC00000, SIZE_4KB, 0, > SystemTable); // IOAPIC > + Status =3D ReserveResourceInGcd (TRUE, > EfiGcdMemoryTypeMemoryMappedIo, > + 0xFEC00000, SIZE_4KB, 0, ImageHandle); // IOAPIC > ASSERT_EFI_ERROR (Status); >=20 > - Status =3D ReserveResourceInGcd (TRUE, > EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, > SystemTable); // HPET > + Status =3D ReserveResourceInGcd (TRUE, > EfiGcdMemoryTypeMemoryMappedIo, > + 0xFED00000, SIZE_1KB, 0, ImageHandle); // HPET > ASSERT_EFI_ERROR (Status); >=20 > // > -- > 2.19.1.3.g30247aa5d201 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. >=20 > View/Reply Online (#47422): https://edk2.groups.io/g/devel/message/47422 > Mute This Topic: https://groups.io/mt/34180240/1781375 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [guo.dong@intel.com] > -=3D-=3D-=3D-=3D-=3D-=3D