This patch series allows Qemu to dynamically size the xsave area from the
hypervisor by reading the property HV_PARTITION_PROPERTY_MAX_XSAVE_DATA_SIZE.

Previously, the xsave area size was set to 4kB and as a consequence AMX Tiles
feature couldn't be enabled because it needs more than the 4kB allocated.
With this change, Qemu enables all the xsave features in the partition, and it
queries the hypervisor to retrieve the maximum size of xsave.
The size is cached in `MshvState` at vCPU arch initialization time to be used
later for MSHV_{GET/SET}_VP_XSAVE.

To correctly advertise AMX support, we remove the logic disabling the AMX at
CPUID and partition level.

Changes from v1:
- change max xsave area size retrieval to be done only the first vcpu by
  checking against the `first_cpu` global
- change error handling for `mshv_get_max_xsave_size` and instead add assert for
  the return value to signal something broken in case of failure

Doru Blânzeanu (2):
  accel/mshv: size XSAVE buffers from the hypervisor
  accel/mshv: enable amx tiles support for guests

 accel/mshv/mshv-all.c       | 39 ++++++++++++++++++++++++------------
 accel/mshv/trace-events     |  2 ++
 include/system/mshv_int.h   |  3 +++
 target/i386/mshv/mshv-cpu.c | 40 ++++++++++++++-----------------------
 4 files changed, 46 insertions(+), 38 deletions(-)

-- 
2.53.0


Reply via email to