From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E9DA5817E4 for ; Tue, 10 Jan 2017 18:08:53 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 10 Jan 2017 18:08:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,345,1477983600"; d="scan'208";a="1110834390" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 10 Jan 2017 18:08:53 -0800 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 10 Jan 2017 18:08:53 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 10 Jan 2017 18:08:53 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.59]) by shsmsx102.ccr.corp.intel.com ([169.254.2.88]) with mapi id 14.03.0248.002; Wed, 11 Jan 2017 10:08:50 +0800 From: "Wu, Hao A" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" CC: Ard Biesheuvel Thread-Topic: [edk2] [PATCH] MdeModulePkg/NonDiscoverable: Compare SIZE_4GB with address type Thread-Index: AQHSa66jiWl+aoW4KUGpcM0abcN95qEyANKAgACHAJA= Date: Wed, 11 Jan 2017 02:08:49 +0000 Message-ID: References: <1484100071-33228-1-git-send-email-hao.a.wu@intel.com> <734D49CCEBEEF84792F5B80ED585239D5B87AE3E@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5B87AE3E@SHSMSX104.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg/NonDiscoverable: Compare SIZE_4GB with address type X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 02:08:54 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Got it, I will update the codes before check in. Thanks for the feedback. Best Regards, Hao Wu > -----Original Message----- > From: Ni, Ruiyu > Sent: Wednesday, January 11, 2017 10:05 AM > To: Wu, Hao A; edk2-devel@lists.01.org > Cc: Wu, Hao A; Ard Biesheuvel > Subject: RE: [edk2] [PATCH] MdeModulePkg/NonDiscoverable: Compare > SIZE_4GB with address type >=20 > One minor comments: put one space after (EFI_PHYSICAL_ADDRESS) and > (UINTN) as below. > > + (EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress + *NumberOfByte= s > > SIZE_4GB >=20 > Reviewed-by: Ruiyu Ni >=20 >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Hao Wu > > Sent: Wednesday, January 11, 2017 10:01 AM > > To: edk2-devel@lists.01.org > > Cc: Wu, Hao A ; Ni, Ruiyu ; Ard > > Biesheuvel > > Subject: [edk2] [PATCH] MdeModulePkg/NonDiscoverable: Compare > > SIZE_4GB with address type > > > > Refine the codes to compare the definition 'SIZE_4GB' with type > > EFI_PHYSICAL_ADDRESS. > > > > Cc: Ard Biesheuvel > > Cc: Ruiyu Ni > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Hao Wu > > --- > > .../Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c = | > > 4 ++-- > > .../NonDiscoverableDeviceRegistrationLib.c = | 2 +- > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git > > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > > PciDeviceIo.c > > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > > PciDeviceIo.c > > index b07c129..c836ad6 100644 > > --- > > a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > > PciDeviceIo.c > > +++ > > b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverable > > Pc > > +++ iDeviceIo.c > > @@ -598,7 +598,7 @@ CoherentPciIoMap ( > > // > > Dev =3D NON_DISCOVERABLE_PCI_DEVICE_FROM_PCI_IO(This); > > if ((Dev->Attributes & EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) =3D= =3D > > 0 && > > - (UINTN)HostAddress + *NumberOfBytes > SIZE_4GB) { > > + (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes > > > + SIZE_4GB) { > > > > // > > // Bounce buffering is not possible for consistent mappings @@ -10= 06,7 > > +1006,7 @@ NonCoherentPciIoMap ( > > // a bounce buffer and copy over the data in case HostAddress >=3D 4= GB. > > // > > Bounce =3D ((Dev->Attributes & > > EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE) =3D=3D 0 && > > - (UINTN)HostAddress + *NumberOfBytes > SIZE_4GB); > > + (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress + *NumberOfBytes = > > > + SIZE_4GB); > > > > if (!Bounce) { > > switch (Operation) { > > diff --git > > a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > > verableDeviceRegistrationLib.c > > b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > > verableDeviceRegistrationLib.c > > index 6f46dfa..4180b0a 100644 > > --- > > a/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > > verableDeviceRegistrationLib.c > > +++ > > b/MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDisco > > +++ verableDeviceRegistrationLib.c > > @@ -163,7 +163,7 @@ RegisterNonDiscoverableMmioDevice ( > > Desc->AddrLen =3D Size; > > Desc->AddrRangeMax =3D Base + Size - 1; > > Desc->ResType =3D ACPI_ADDRESS_SPACE_TYPE_MEM; > > - Desc->AddrSpaceGranularity =3D (Base + Size > SIZE_4GB) ? 64 : 32= ; > > + Desc->AddrSpaceGranularity =3D ((EFI_PHYSICAL_ADDRESS) Base + Siz= e > > > + SIZE_4GB) ? 64 : 32; > > Desc->AddrTranslationOffset =3D 0; > > } > > VA_END (Args); > > -- > > 1.9.5.msysgit.0 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel