Re: [PATCH v2 1/1] Documentation/x86: Add the AMX enabling example

From: Chang S. Bae
Date: Thu Jun 30 2022 - 11:27:09 EST


On 6/29/2022 4:30 PM, Luck, Tony wrote:
+ #define ARCH_GET_XCOMP_SUPP 0x1021
+
+ #define XFEATURE_XTILECFG 17
+ #define XFEATURE_XTILEDATA 18

What's the long-term plan for these #defines? I see that ARCH_GET_XCOMP_SUPP
is in arch/x86/include/uapi/asm/prctl.h ... so eventually that will show up in distribution
/usr/include/asm/prctl.h courtesy of a glibc update.

But the XFEATURE bits aren't in a "uapi" file. They are an "enum" in:

arch/x86/include/asm/fpu/types.h

How will that get to /usr/include?

Perhaps I can think of something like this for AMX state:

diff --git a/arch/x86/include/uapi/asm/prctl.h b/arch/x86/include/uapi/asm/prctl.h
index 500b96e71f18..08b6c9155b8a 100644
--- a/arch/x86/include/uapi/asm/prctl.h
+++ b/arch/x86/include/uapi/asm/prctl.h
@@ -16,6 +16,9 @@
#define ARCH_GET_XCOMP_GUEST_PERM 0x1024
#define ARCH_REQ_XCOMP_GUEST_PERM 0x1025

+#define ARCH_XCOMP_XTILECFG 17
+#define ARCH_XCOMP_XTILEDATA 18
+
#define ARCH_MAP_VDSO_X32 0x2001
#define ARCH_MAP_VDSO_32 0x2002
#define ARCH_MAP_VDSO_64 0x2003

But these state components are architectural. While this can help userspace anyway, saying "XSTATE component" here and on the man-page is probably it as they are already defined in the x86 spec.

Thanks,
Chang