On Mon, Feb 21, 2022 at 01:25:53PM +0000, David Edmondson wrote: > On Wednesday, 2022-02-16 at 22:04:32 -08, Yang Zhong wrote: > > > From: Jing Liu <jing2....@intel.com> > > > > When dynamic xfeatures (e.g. AMX) are used by the guest, the xsave > > area would be larger than 4KB. KVM_GET_XSAVE2 and KVM_SET_XSAVE > > under KVM_CAP_XSAVE2 works with a xsave buffer larger than 4KB. > > Always use the new ioctls under KVM_CAP_XSAVE2 when KVM supports it. > > > > Signed-off-by: Jing Liu <jing2....@intel.com> > > Signed-off-by: Zeng Guang <guang.z...@intel.com> > > Signed-off-by: Wei Wang <wei.w.w...@intel.com> > > Signed-off-by: Yang Zhong <yang.zh...@intel.com> > > --- > > target/i386/cpu.h | 4 ++++ > > target/i386/kvm/kvm.c | 42 ++++++++++++++++++++++++-------------- > > target/i386/xsave_helper.c | 33 ++++++++++++++++++++++++++++++ > > 3 files changed, 64 insertions(+), 15 deletions(-) > > > > diff --git a/target/i386/cpu.h b/target/i386/cpu.h > > index f7fc2e97a6..de9da38e42 100644 > > --- a/target/i386/cpu.h > > +++ b/target/i386/cpu.h > > @@ -1528,6 +1528,10 @@ typedef struct CPUX86State { > > uint64_t opmask_regs[NB_OPMASK_REGS]; > > YMMReg zmmh_regs[CPU_NB_REGS]; > > ZMMReg hi16_zmm_regs[CPU_NB_REGS]; > > +#ifdef TARGET_X86_64 > > + uint8_t xtilecfg[64]; > > + uint8_t xtiledata[8192]; > > +#endif > > Can we have defined constants for these sizes? They also appear in patch > 2.
David, the constants we used here are mainly consistent with other members in this struct and file. thanks! Yang