]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
MdeModulePkg/XhciDxe: Add boundary check for TRB ring allocation
authorjdzhang <jdzhang@kunluntech.com.cn>
Tue, 18 Oct 2022 02:56:02 +0000 (10:56 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 20 Oct 2022 03:23:51 +0000 (03:23 +0000)
commitc6720db5ddffec747bb0b2830e528511b1a4bfb2
treebc1d3f5c845d1dcc89b818c175afc52ae60d819b
parent31b16384688df9ce0e8f59021fd667e47d7d3972
MdeModulePkg/XhciDxe: Add boundary check for TRB ring allocation

According the Xhci Spec, TRB Rings may be larger than a Page, however they
shall not cross a 64K byte boundary, so add a parameter to indicate
whether the memory allocation is for TRB Rings or not. It will ensure the
allocation not crossing 64K boundary in UsbHcAllocMemFromBlock if the
memory is allocated for TRB Rings.

Signed-off-by: jdzhang <jdzhang@kunluntech.com.cn>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.c
MdeModulePkg/Bus/Pci/XhciDxe/UsbHcMem.h
MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c