[v3,00/13] Overhauling amx_test

Message ID 20230221163655.920289-1-mizhang@google.com
Headers
Series Overhauling amx_test |

Message

Mingwei Zhang Feb. 21, 2023, 4:36 p.m. UTC
  In this version, I have integrated Aaron's changes to the amx_test. In
addition, we also integrated one fix patch for a kernel warning due to
xsave address issue.

Patch 1:
Fix a host FPU kernel warning due to missing XTILEDATA in xinit.

Patch 2-8:
Overhaul amx_test. These patches were basically from v2.

Patch 9-13:
Overhaul amx_test from Aaron. I modified the changelog a little bit.


v2 -> v3:
 - integrate Aaron's 5 commits with minor changes on commit message.
 - Add one fix patch for a kernel warning.

v2:
https://lore.kernel.org/all/20230214184606.510551-1-mizhang@google.com/


Aaron Lewis (5):
  KVM: selftests: x86: Assert that XTILE is XSAVE-enabled
  KVM: selftests: x86: Assert that both XTILE{CFG,DATA} are
    XSAVE-enabled
  KVM: selftests: x86: Remove redundant check that XSAVE is supported
  KVM: selftests: x86: Check that the palette table exists before using
    it
  KVM: selftests: x86: Check that XTILEDATA supports XFD

Mingwei Zhang (8):
  x86/fpu/xstate: Avoid getting xstate address of init_fpstate if
    fpstate contains the component
  KVM: selftests: x86: Add a working xstate data structure
  KVM: selftests: x86: Fix an error in comment of amx_test
  KVM: selftests: x86: Add check of CR0.TS in the #NM handler in
    amx_test
  KVM: selftests: x86: Add the XFD check to IA32_XFD in #NM handler
  KVM: selftests: x86: Fix the checks to XFD_ERR using and operation
  KVM: selftests: x86: Enable checking on xcomp_bv in amx_test
  KVM: selftests: x86: Repeat the checking of xheader when
    IA32_XFD[XTILEDATA] is set in amx_test

 arch/x86/kernel/fpu/xstate.c                  | 10 ++-
 .../selftests/kvm/include/x86_64/processor.h  | 14 ++++
 tools/testing/selftests/kvm/x86_64/amx_test.c | 80 +++++++++----------
 3 files changed, 59 insertions(+), 45 deletions(-)
  

Comments

Sean Christopherson March 24, 2023, 8:58 p.m. UTC | #1
On Tue, 21 Feb 2023 16:36:42 +0000, Mingwei Zhang wrote:
> In this version, I have integrated Aaron's changes to the amx_test. In
> addition, we also integrated one fix patch for a kernel warning due to
> xsave address issue.
> 
> Patch 1:
> Fix a host FPU kernel warning due to missing XTILEDATA in xinit.
> 
> [...]

Applied everything except patch 7 to kvm-x86 selftests.  Please holler if I
missed something subtle about patch 7 (using & vs. ==).  This is at the head
of kvm-x86/selftests, i.e. I can fix it up if necessary.

[01/13] x86/fpu/xstate: Avoid getting xstate address of init_fpstate if fpstate contains the component
        (no commit info)
[02/13] KVM: selftests: x86: Add a working xstate data structure
        https://github.com/kvm-x86/linux/commit/03e8ddff78ac
[03/13] KVM: selftests: x86: Fix an error in comment of amx_test
        https://github.com/kvm-x86/linux/commit/c23d3b210baf
[04/13] KVM: selftests: x86: Enable checking on xcomp_bv in amx_test
        https://github.com/kvm-x86/linux/commit/1e2de0651567
[05/13] KVM: selftests: x86: Add check of CR0.TS in the #NM handler in amx_test
        https://github.com/kvm-x86/linux/commit/04f5d4539105
[06/13] KVM: selftests: x86: Add the XFD check to IA32_XFD in #NM handler
        https://github.com/kvm-x86/linux/commit/eeae141ddb54

[08/13] KVM: selftests: x86: Repeat the checking of xheader when IA32_XFD[XTILEDATA] is set in amx_test
        https://github.com/kvm-x86/linux/commit/cabed3f958e9
[09/13] KVM: selftests: x86: Assert that XTILE is XSAVE-enabled
        https://github.com/kvm-x86/linux/commit/44217830267d
[10/13] KVM: selftests: x86: Assert that both XTILE{CFG,DATA} are XSAVE-enabled
        https://github.com/kvm-x86/linux/commit/7b328195c462
[11/13] KVM: selftests: x86: Remove redundant check that XSAVE is supported
        https://github.com/kvm-x86/linux/commit/08f63d826980
[12/13] KVM: selftests: x86: Check that the palette table exists before using it
        https://github.com/kvm-x86/linux/commit/7042ef575496
[13/13] KVM: selftests: x86: Check that XTILEDATA supports XFD
        https://github.com/kvm-x86/linux/commit/564435d346ff

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes
  
Sean Christopherson March 24, 2023, 9:01 p.m. UTC | #2
On Fri, Mar 24, 2023, Sean Christopherson wrote:
> On Tue, 21 Feb 2023 16:36:42 +0000, Mingwei Zhang wrote:
> > In this version, I have integrated Aaron's changes to the amx_test. In
> > addition, we also integrated one fix patch for a kernel warning due to
> > xsave address issue.
> > 
> > Patch 1:
> > Fix a host FPU kernel warning due to missing XTILEDATA in xinit.
> > 
> > [...]
> 
> Applied everything except patch 7 to kvm-x86 selftests.  Please holler if I
> missed something subtle about patch 7 (using & vs. ==).  This is at the head
> of kvm-x86/selftests, i.e. I can fix it up if necessary.
> 
> [01/13] x86/fpu/xstate: Avoid getting xstate address of init_fpstate if fpstate contains the component
>         (no commit info)

*sigh*  And by "everything" I meant "all of the selftests patches".
  
Sean Christopherson March 24, 2023, 9:30 p.m. UTC | #3
On Fri, Mar 24, 2023, Sean Christopherson wrote:
> On Fri, Mar 24, 2023, Sean Christopherson wrote:
> > On Tue, 21 Feb 2023 16:36:42 +0000, Mingwei Zhang wrote:
> > > In this version, I have integrated Aaron's changes to the amx_test. In
> > > addition, we also integrated one fix patch for a kernel warning due to
> > > xsave address issue.
> > > 
> > > Patch 1:
> > > Fix a host FPU kernel warning due to missing XTILEDATA in xinit.
> > > 
> > > [...]
> > 
> > Applied everything except patch 7 to kvm-x86 selftests.  Please holler if I
> > missed something subtle about patch 7 (using & vs. ==).  This is at the head
> > of kvm-x86/selftests, i.e. I can fix it up if necessary.
> > 
> > [01/13] x86/fpu/xstate: Avoid getting xstate address of init_fpstate if fpstate contains the component
> >         (no commit info)
> 
> *sigh*  And by "everything" I meant "all of the selftests patches".

Continuing my circus of goofs, I already force pushed selftests due to an unrelated
mixup.  New hashes below (the comment above still stands in case another overwrite
is necessary).

       [1/11] KVM: selftests: Add a fully functional "struct xstate" for x86
             https://github.com/kvm-x86/linux/commit/5de4a3765b7e
       [2/11] KVM: selftests: Fix an error in comment of amx_test
             https://github.com/kvm-x86/linux/commit/bec357a4af55
       [3/11] KVM: selftests: Enable checking on xcomp_bv in amx_test
             https://github.com/kvm-x86/linux/commit/48ad4222c43c
       [4/11] KVM: selftests: Add check of CR0.TS in the #NM handler in amx_test
             https://github.com/kvm-x86/linux/commit/0aeb9729486a
       [5/11] KVM: selftests: Assert that XTILE_DATA is set in IA32_XFD on #NM
             https://github.com/kvm-x86/linux/commit/9cbd9aaa670f
       [6/11] KVM: selftests: Verify XTILE_DATA in XSTATE isn't affected by IA32_XFD
             https://github.com/kvm-x86/linux/commit/bfc5afc37c9d
       [7/11] KVM: selftests: Assert that XTILE is XSAVE-enabled
             https://github.com/kvm-x86/linux/commit/7e1075f05078
       [8/11] KVM: selftests: Assert that both XTILE{CFG,DATA} are XSAVE-enabled
             https://github.com/kvm-x86/linux/commit/2ab3991b0b9b
       [9/11] KVM: selftests: Move XSAVE and OSXSAVE CPUID checks into AMX's init_regs()
             https://github.com/kvm-x86/linux/commit/d01d4a4f7bd2
       [10/11] KVM: selftests: Check that the palette table exists before using it
             https://github.com/kvm-x86/linux/commit/d32fb0714293
       [11/11] KVM: selftests: Check that XTILEDATA supports XFD
             https://github.com/kvm-x86/linux/commit/d563164eaeb1