Skip to content
Commit 8e67fda2 authored by Laurent Vivier's avatar Laurent Vivier Committed by Gerd Hoffmann
Browse files

xhci: fix valid.max_access_size to access address registers



QEMU XHCI advertises AC64 (64-bit addressing) but doesn't allow
64-bit mode access in "runtime" and "operational" MemoryRegionOps.

Set the max_access_size based on sizeof(dma_addr_t) as AC64 is set.

XHCI specs:
"If the xHC supports 64-bit addressing (AC64 = ‘1’), then software
should write 64-bit registers using only Qword accesses.  If a
system is incapable of issuing Qword accesses, then writes to the
64-bit address fields shall be performed using 2 Dword accesses;
low Dword-first, high-Dword second.  If the xHC supports 32-bit
addressing (AC64 = ‘0’), then the high Dword of registers containing
64-bit address fields are unused and software should write addresses
using only Dword accesses"

The problem has been detected with SLOF, as linux kernel always accesses
registers using 32-bit access even if AC64 is set and revealed by
5d971f9e ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid"")

Suggested-by: default avatarAlexey Kardashevskiy <aik@au1.ibm.com>
Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
Message-id: 20200721083322.90651-1-lvivier@redhat.com
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent af3d6905
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment