Alex Thiessen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40895 )
Change subject: libpayload: xhci: Do not memcpy registers ......................................................................
Patch Set 2:
Even though it's already merged, my two cents:
The underlying issue here seems that `phys_to_virt()` returns a non-volatile pointer to things which are volatile. It should probably be split into `phys_mem_to_virt()` (same as `phys_to_virt()` today) and `phys_dev_to_virt()` (returning a volatile pointer) to catch such bugs in build, not in development or even production. A compiler warning would then be triggered, like "passing argument 2 of ‘memcpy’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]"