On 10/24/2025 2:56 PM, Zhao Liu wrote:
Xtile-cfg & xtile-data are both user xstates. Their xstates are cached
in X86CPUState, and there's a related vmsd "vmstate_amx_xtile", so that
it's safe to mark them as migratable.

Arch lbr xstate is a supervisor xstate, and it is save & load by saving
& loading related arch lbr MSRs, which are cached in X86CPUState, and
there's a related vmsd "vmstate_arch_lbr". So it's also safe to mark it
as migratable (even though KVM hasn't supported it - its migration
support is completed in QEMU).

PT is still unmigratable since KVM disabled it and there's no vmsd and
no other emulation/simulation support.

The patch itself looks reasonable.

I'm wondering why there is no issue reported since I believe folks tested the functionality of AMX live migration when AMX support was upstreamed. So I explore a bit and find that the migrable_flags/ungratable_flags in XCR0/XSS leaf don't take any effect because of the
x86_cpu_enable_xsave_components()

Though the feature expansion in x86_cpu_expand_features() under

        if (xcc->max_features) {
                ...
        }

only enables migratable features when cpu->migratable is true, x86_cpu_enable_xsave_components() overwrite the value later.

Tested-by: Farrah Chen <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
---
  target/i386/cpu.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 1917376dbea9..b01729ad36d2 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1522,7 +1522,8 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
          .migratable_flags = XSTATE_FP_MASK | XSTATE_SSE_MASK |
              XSTATE_YMM_MASK | XSTATE_BNDREGS_MASK | XSTATE_BNDCSR_MASK |
              XSTATE_OPMASK_MASK | XSTATE_ZMM_Hi256_MASK | XSTATE_Hi16_ZMM_MASK 
|
-            XSTATE_PKRU_MASK,
+            XSTATE_PKRU_MASK | XSTATE_ARCH_LBR_MASK | XSTATE_XTILE_CFG_MASK |
+            XSTATE_XTILE_DATA_MASK,
      },
      [FEAT_XSAVE_XCR0_HI] = {
          .type = CPUID_FEATURE_WORD,


Reply via email to