@samitouri / QOSamiQemu / commits / f3a89cded2

target/i386/mshv: disable AMX TILE features

For the time being we disable AMX TILE in partition processor features and CPUID b/c AMX TILE XSAVE state (XTILE_DATA) is 8KB, which exceeds the current fixed 4KB XSAVE buffer size. For now we filter it until buffer sizing is computed dynamically from CPUID. Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com> Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com> Link: https://lore.kernel.org/r/20260710101534.664604-2-magnuskulke@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Magnus Kulke committed Jul 10, 2026 at 12:15 UTC f3a89cded28054161d72feeb85a6fe082b4d1b70
2 files changed +24
accel/mshv/mshv-all.c
+8
@@ -203,6 +203,14 @@ static int create_partition(int mshv_fd, int *vm_fd)
203
204 /* enable all */
205 disabled_xsave_features.as_uint64 = 0;
206 + /*
207 + * AMX TILE XSAVE state (XTILE_DATA) is 8KB, which exceeds the
208 + * current fixed 4KB XSAVE buffer size.
209 + */
210 + disabled_xsave_features.amx_tile_support = 1;
211 + disabled_xsave_features.amx_bf16_support = 1;
212 + disabled_xsave_features.amx_int8_support = 1;
213 + disabled_xsave_features.amx_fp16_support = 1;
214
215 /*
216 * query host for supported processor features and disable unsupported
target/i386/mshv/mshv-cpu.c
+16
@@ -2156,6 +2156,22 @@ uint32_t mshv_get_supported_cpuid(uint32_t func, uint32_t idx, int reg)
2156 */
2157 ret &= ~CPUID_7_0_ECX_LA57;
2158 }
2159 + if (func == 0x07 && idx == 0 && reg == R_EDX) {
2160 + /*
2161 + * AMX TILE XSAVE state (XTILE_DATA) is 8KB, which exceeds the
2162 + * current fixed 4KB XSAVE buffer size. Filter until buffer
2163 + * sizing is computed dynamically from CPUID.
2164 + */
2165 + ret &= ~CPUID_7_0_EDX_AMX_TILE;
2166 + ret &= ~CPUID_7_0_EDX_AMX_BF16;
2167 + ret &= ~CPUID_7_0_EDX_AMX_INT8;
2168 + }
2169 + if (func == 0x07 && idx == 1 && reg == R_EAX) {
2170 + ret &= ~CPUID_7_1_EAX_AMX_FP16;
2171 + }
2172 + if (func == 0x07 && idx == 1 && reg == R_EDX) {
2173 + ret &= ~CPUID_7_1_EDX_AMX_COMPLEX;
2174 + }
2175
2176 return ret;
2177 }