Attention is currently required from: Christian Walter, Johnny Lin, Jonathan Zhang, Shuo Liu, Tim Chu.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/85809?usp=email )
Change subject: soc/intel/xeon_sp/ebg/soc_xhci: Check if BAR is reachable ......................................................................
soc/intel/xeon_sp/ebg/soc_xhci: Check if BAR is reachable
On x86_32 the xHCI BAR isn't reachable as it's mapped in high MMIO. Currently this is not a problem since the code is unused.
Add a check and return NULL instead of cutting of the higher bits and thus do not return an invalid pointer. On x86_64 it's working when the extended page-tables are installed.
Change-Id: I00496ad476c33e0984d7cb0019f27154302edda5 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/soc/intel/xeon_sp/ebg/soc_xhci.c 1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/85809/1
diff --git a/src/soc/intel/xeon_sp/ebg/soc_xhci.c b/src/soc/intel/xeon_sp/ebg/soc_xhci.c index 2d3d09c..a13aaac 100644 --- a/src/soc/intel/xeon_sp/ebg/soc_xhci.c +++ b/src/soc/intel/xeon_sp/ebg/soc_xhci.c @@ -18,6 +18,13 @@ printk(BIOS_ERR, "XHCI BAR is not found\n"); return NULL; } + +#if ENV_X86_32 + assert(res->base < 0x100000000ULL); + if (res->base >= 0x100000000ULL) + return NULL; +#endif + return (void *)(uintptr_t)res->base; }