x86/arch_prctl: Add AMX feature numbers as ABI constants
authorChang S. Bae <chang.seok.bae@intel.com>
Sat, 21 Jan 2023 00:18:58 +0000 (16:18 -0800)
committerDave Hansen <dave.hansen@linux.intel.com>
Wed, 22 Mar 2023 20:02:33 +0000 (13:02 -0700)
commita03c376ebaf38394a63a75292329f38a47520c2c
tree7088dabc2b807c1118184ee0e990d7e2140283f3
parentad9c29f3c29197aa25d26a5f258a98e4cb901996
x86/arch_prctl: Add AMX feature numbers as ABI constants

Each distinct XSAVE feature has a number assigned to it.  Among other
things, the number determines the ordering of features in the XSAVE
buffer and is also used to generate XSAVE bitmasks like the value
for XCR0.

AMX state is dynamically enabled by the architecture-specific prctl().
This prctl() takes one XSAVE feature number as an argument.  However, the
feature numbers are not defined in any readily available userspace headers.
The means that each userspace app trying to use dynamic feature prctl()s
will likely end up defining their own constants for each feature.

Since these feature numbers are a part of the uabi, expose them in the
prctl() uabi header.  Save everyone the trouble of looking them up and
defining their own.

[ dhansen: expand changelog a bit ]

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/all/20230121001900.14900-3-chang.seok.bae%40intel.com
arch/x86/include/uapi/asm/prctl.h