From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.1076.1570671180923884685 for ; Wed, 09 Oct 2019 18:33:01 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: hao.a.wu@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 18:33:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="345547469" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 09 Oct 2019 18:33:00 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 18:32:59 -0700 Received: from shsmsx107.ccr.corp.intel.com (10.239.4.96) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 9 Oct 2019 18:32:59 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by SHSMSX107.ccr.corp.intel.com ([169.254.9.33]) with mapi id 14.03.0439.000; Thu, 10 Oct 2019 09:32:57 +0800 From: "Wu, Hao A" To: Ashish Singhal , "devel@edk2.groups.io" , "Ni, Ray" Subject: Re: [PATCH] MdeModulePkg/XhciDxe: Fix Aligned Page Allocation Thread-Topic: [PATCH] MdeModulePkg/XhciDxe: Fix Aligned Page Allocation Thread-Index: AQHVfsNZ4DcOEA/aqEOUTbXlESnb2adTE2xQ Date: Thu, 10 Oct 2019 01:32:57 +0000 Message-ID: References: <9ce268553db91fbe7fb13e2205d0e1611e1d0212.1570640221.git.ashishsingha@nvidia.com> In-Reply-To: <9ce268553db91fbe7fb13e2205d0e1611e1d0212.1570640221.git.ashishsingha@nvidia.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 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Ashish Singhal [mailto:ashishsingha@nvidia.com] > Sent: Thursday, October 10, 2019 1:02 AM > To: devel@edk2.groups.io; Wu, Hao A; Ni, Ray > Cc: Ashish Singhal > Subject: [PATCH] MdeModulePkg/XhciDxe: Fix Aligned Page Allocation >=20 > While allocating pages aligned at an alignment higher than > 4K, allocate memory taking into consideration the padding > required for that alignment. The calls to free pages takes > care of this already. >=20 > Signed-off-by: Ashish Singhal > --- > MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c > b/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c > index fd79988..aa69c47 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c > @@ -656,7 +656,7 @@ UsbHcAllocateAlignedPages ( > PciIo, > AllocateAnyPages, > EfiBootServicesData, > - Pages, > + RealPages, > &Memory, > 0 > ); Hello, The change looks good to me. Just a couple of things to confirm: 1. I think there is a similar case within the XhciPei driver Could you help to resolve it as well? I think for the PEI counterpart you may need to update both UsbHcAllocateAlignedPages() and UsbHcFreeAlignedPages(), since the IOMMU he= lper functions like IoMmuAllocateBuffer() and IoMmuFreeBuffer() might not be suitable now. Instead, I think services in the IoMmu PPI can be used. 2. Could you help to provide the information on what test has been done for= the proposed patch? Thanks in advance. Best Regards, Hao Wu > -- > 2.7.4