From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Mon, 15 Apr 2019 13:22:08 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Apr 2019 13:22:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,355,1549958400"; d="scan'208";a="142977339" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga003.jf.intel.com with ESMTP; 15 Apr 2019 13:22:07 -0700 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 15 Apr 2019 13:22:07 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 15 Apr 2019 13:22:06 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.92]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.42]) with mapi id 14.03.0415.000; Tue, 16 Apr 2019 04:22:04 +0800 From: "Ni, Ray" To: "devel@edk2.groups.io" , "ard.biesheuvel@linaro.org" CC: "Kinney, Michael D" , Andrew Fish , Leif Lindholm , "Zeng, Star" , "Dong, Eric" , "Gao, Liming" , "Carsey, Jaben" , "Shi, Steven" , "Wang, Jian J" , "Wu, Hao A" Subject: Re: [edk2-devel] [PATCH v6 4/7] MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images Thread-Topic: [edk2-devel] [PATCH v6 4/7] MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images Thread-Index: AQHU8vutbKEL15qSpUq468g8oNt8G6Y9q7lg Date: Mon, 15 Apr 2019 20:22:04 +0000 Deferred-Delivery: Mon, 15 Apr 2019 20:22:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C0EEA1D@SHSMSX104.ccr.corp.intel.com> References: <20190414195233.30045-1-ard.biesheuvel@linaro.org> <20190414195233.30045-5-ard.biesheuvel@linaro.org> In-Reply-To: <20190414195233.30045-5-ard.biesheuvel@linaro.org> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzAxNmY3ODktNzk1ZC00NWU5LTllOTktNjY4MTJlYzU2ZGM1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMGJvU1wvODNaQXpRaVRJV0h3UlpCWHhDbWNXcFJJMGtDb2ZpSlhtZXFtK2xpOVVFaUhsdnJTWXdicDVkZTR5d24ifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ray Ni > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Ard Biesheuvel > Sent: Sunday, April 14, 2019 12:53 PM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel ; Kinney, Michael D > ; Andrew Fish ; Leif > Lindholm ; Zeng, Star ; > Dong, Eric ; Ni, Ray ; Gao, Limin= g > ; Carsey, Jaben ; Shi, > Steven ; Wang, Jian J ; Wu, > Hao A > Subject: [edk2-devel] [PATCH v6 4/7] MdeModulePkg/UefiBootManagerLib: > allow foreign Driver#### images >=20 > Allow PE/COFF images that must execute under emulation for Driver#### > options, by removing the redundant machine type check from the BDS code. >=20 > Signed-off-by: Ard Biesheuvel > Reviewed-by: Michael D Kinney > --- > MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c > b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c > index 7bf96646c690..8e6caaa63548 100644 > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c > @@ -1233,10 +1233,8 @@ BmIsLoadOptionPeHeaderValid ( > // Check PE32 or PE32+ magic, and machine type > // > OptionalHeader =3D (EFI_IMAGE_OPTIONAL_HEADER32 *) &PeHeader- > >Pe32.OptionalHeader; > - if ((OptionalHeader->Magic =3D=3D > EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC || > - OptionalHeader->Magic =3D=3D > EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) && > - EFI_IMAGE_MACHINE_TYPE_SUPPORTED (PeHeader- > >Pe32.FileHeader.Machine) > - ) { > + if (OptionalHeader->Magic =3D=3D > EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC || > + OptionalHeader->Magic =3D=3D > EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) { > // > // Check the Subsystem: > // Driver#### must be of type BootServiceDriver or RuntimeDri= ver > -- > 2.17.1 >=20 >=20 >=20