Re: [PATCH v2 5/6] KVM: selftests: Add XFEATURE masks to common code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 30, 2022, Aaron Lewis wrote:
> Add XFEATURE masks to processor.h to make them more broadly available
> in KVM selftests.
> 
> They were taken from fpu/types.h, which included a difference in

Nit, state the rename as a command, e.g.

  Use the names from the kernel's fpu/types.h for consistency, i.e. rename
  XTILECFG and XTILEDATA to XTILE_CFG and XTILE_DATA respectively.

> spacing between the ones in amx_test from XTILECFG and XTILEDATA, to
> XTILE_CFG and XTILE_DATA.  This has been reflected in amx_test.
> 
> Signed-off-by: Aaron Lewis <aaronlewis@xxxxxxxxxx>
> ---
>  .../selftests/kvm/include/x86_64/processor.h  | 16 ++++++++++++++
>  tools/testing/selftests/kvm/x86_64/amx_test.c | 22 +++++++------------
>  2 files changed, 24 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/testing/selftests/kvm/include/x86_64/processor.h b/tools/testing/selftests/kvm/include/x86_64/processor.h
> index 5f06d6f27edf7..c1132ac277227 100644
> --- a/tools/testing/selftests/kvm/include/x86_64/processor.h
> +++ b/tools/testing/selftests/kvm/include/x86_64/processor.h
> @@ -45,6 +45,22 @@
>  #define X86_CR4_SMAP		(1ul << 21)
>  #define X86_CR4_PKE		(1ul << 22)
>  

Add 

 #define XFEATURE_MASK_FP		BIT_ULL(0)

so that you don't have to open code the literal in the next patch.

> +#define XFEATURE_MASK_SSE		BIT_ULL(1)
> +#define XFEATURE_MASK_YMM		BIT_ULL(2)
> +#define XFEATURE_MASK_BNDREGS		BIT_ULL(3)
> +#define XFEATURE_MASK_BNDCSR		BIT_ULL(4)
> +#define XFEATURE_MASK_OPMASK		BIT_ULL(5)
> +#define XFEATURE_MASK_ZMM_Hi256		BIT_ULL(6)
> +#define XFEATURE_MASK_Hi16_ZMM		BIT_ULL(7)
> +#define XFEATURE_MASK_XTILE_CFG		BIT_ULL(17)
> +#define XFEATURE_MASK_XTILE_DATA	BIT_ULL(18)
> +
> +#define XFEATURE_MASK_AVX512		(XFEATURE_MASK_OPMASK \
> +					 | XFEATURE_MASK_ZMM_Hi256 \
> +					 | XFEATURE_MASK_Hi16_ZMM)

'|' on the previous line please, i.e.

#define XFEATURE_MASK_AVX512		(XFEATURE_MASK_OPMASK | \
					 XFEATURE_MASK_ZMM_Hi256 | \
					 XFEATURE_MASK_Hi16_ZMM)

> +#define XFEATURE_MASK_XTILE		(XFEATURE_MASK_XTILE_DATA \
> +					 | XFEATURE_MASK_XTILE_CFG)

Same comment here.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux