> -----Original Message-----
> From: Ashish Singhal [mailto:ashishsin...@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
> 
> 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.
> 
> Signed-off-by: Ashish Singhal <ashishsin...@nvidia.com>
> ---
>  MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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 helper
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


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48672): https://edk2.groups.io/g/devel/message/48672
Mute This Topic: https://groups.io/mt/34465466/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to