The CEDT CFMWS "Window Restrictions" field (CXL r4.0 9.18.1.3) advertises which coherency models and memory types a CXL Fixed Memory Window (CFMW) permits. Qemu hardcodes this to 0x2f, which advertises Device Coherent, host-only coherent and Back-Invalidate (BI) simultaneously, which is a spec violation/UB.
- Patches 1-3 fix the default Window Restrictions from 0x2f to 0xe (host-only coherent, volatile, persistent), so an unconfigured window is spec-compliant out of the box. I have split it in 3 patches as indicated by the bios-tables-test, please shout if I did something stupid updating the binary (this was a bit confusing). - Patch 4 makes the restrictions configurable per window via named machine properties -- device-coherent, host-only, volatile, persistent, fixed-config, back-invalidate. Without patch 4 the HDM-DB support is effectively untestable upstream. Davidlohr Bueso (4): tests/bios-tables-test: Exclude CEDT.cxl for host-only restriction default hw/cxl: Use host-only coherency for default CFMW restrictions tests/acpi/cxl: Update CEDT.cxl for host-only default restrictions hw/cxl: Add per-capability CXL Fixed Memory Window restriction flags docs/system/devices/cxl.rst | 13 +++----- hw/acpi/cxl.c | 2 +- hw/cxl/cxl-host.c | 55 +++++++++++++++++++++++++++++++ include/hw/cxl/cxl.h | 12 +++++++ qapi/machine.json | 29 ++++++++++++++++ tests/data/acpi/x86/q35/CEDT.cxl | Bin 184 -> 184 bytes 6 files changed, 101 insertions(+), 10 deletions(-) -- 2.39.5
