Intel: enable x86 AMX

Bug #1967750 reported by Andrea Righi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Committed
High
Andrea Righi
Jammy
Fix Released
Medium
Andrea Righi

Bug Description

[Impact]

Enable AMX (aka TMUL) new instructions on the 5.15 kernel.

[Test case]

Tests have been performed directly by Intel.

[Fix]

Apply the following upstream commits:

20df73756148 ("selftests/x86/amx: Update the ARCH_REQ_XCOMP_PERM test")
063452fd94d1 ("x86/fpu/xstate: Fix the ARCH_REQ_XCOMP_PERM implementation")
fa31a4d669bd ("x86/cpufeatures: Put the AMX macros in the word 18 block")
6c3118c32129 ("signal: Skip the altstack update when not needed")
52d0b8b18776 ("x86/fpu/signal: Initialize sw_bytes in save_xstate_epilog()")
d7a9590f608d ("Documentation/x86: Add documentation for using dynamic XSTATE features")
101c669d165d ("selftests/x86/amx: Add context switch test")
6a3e0651b4a0 ("selftests/x86/amx: Add test cases for AMX state management")
2308ee57d93d ("x86/fpu/amx: Enable the AMX feature in 64-bit mode")
db3e7321b4b8 ("x86/fpu: Add XFD handling for dynamic states")
2ae996e0c1a3 ("x86/fpu: Calculate the default sizes independently")
eec2113eabd9 ("x86/fpu/amx: Define AMX state components and have it used for boot-time checks")
70c3f1671b0c ("x86/fpu/xstate: Prepare XSAVE feature table for gaps in state component numbers")
500afbf645a0 ("x86/fpu/xstate: Add fpstate_realloc()/free()")
783e87b40495 ("x86/fpu/xstate: Add XFD #NM handler")
672365477ae8 ("x86/fpu: Update XFD state where required")
5529acf47ec3 ("x86/fpu: Add sanity checks for XFD")
8bf26758ca96 ("x86/fpu: Add XFD state to fpstate")
dae1bd583896 ("x86/msr-index: Add MSRs for XFD")
c351101678ce ("x86/cpufeatures: Add eXtended Feature Disabling (XFD) feature bit")
e61d6310a0f8 ("x86/fpu: Reset permission and fpstate on exec()")
9e798e9aa14c ("x86/fpu: Prepare fpu_clone() for dynamically enabled features")
53599b4d54b9 ("x86/fpu/signal: Prepare for variable sigframe length")
4b7ca609a33d ("x86/signal: Use fpu::__state_user_size for sigalt stack validation")
23686ef25d4a ("x86/fpu: Add basic helpers for dynamically enabled features")
db8268df0983 ("x86/arch_prctl: Add controls for dynamic XSTATE components")
c33f0a81a2cf ("x86/fpu: Add fpu_state_config::legacy_features")
6f6a7c09c406 ("x86/fpu: Add members to struct fpu to cache permission information")
84e4dccc8fce ("x86/fpu/xstate: Provide xstate_calculate_size()")
3aac3ebea08f ("x86/signal: Implement sigaltstack size validation")
1bdda24c4af6 ("signal: Add an optional check for altstack size")
582b01b6ab27 ("x86/fpu: Remove old KVM FPU interface")
d69c1382e1b7 ("x86/kvm: Convert FPU handling to a single swap buffer")
69f6ed1d14c6 ("x86/fpu: Provide infrastructure for KVM FPU cleanup")
75c52dad5e32 ("x86/fpu: Prepare for sanitizing KVM FPU code")
d72c87018d00 ("x86/fpu/xstate: Move remaining xfeature helpers to core")
eda32f4f93b4 ("x86/fpu: Rework restore_regs_from_fpstate()")
daddee247319 ("x86/fpu: Mop up xfeatures_mask_uabi()")
1c253ff2287f ("x86/fpu: Move xstate feature masks to fpu_*_cfg")
2bd264bce238 ("x86/fpu: Move xstate size to fpu_*_cfg")
cd9ae7617449 ("x86/fpu/xstate: Cleanup size calculations")
617473acdfe4 ("x86/fpu: Cleanup fpu__init_system_xstate_size_legacy()")
578971f4e228 ("x86/fpu: Provide struct fpu_config")
5509cc78080d ("x86/fpu/signal: Use fpstate for size and features")
49e4eb4125d5 ("x86/fpu/xstate: Use fpstate for copy_uabi_to_xstate()")
3ac8d75778fc ("x86/fpu: Use fpstate in __copy_xstate_to_uabi_buf()")
ad6ede407aae ("x86/fpu: Use fpstate in fpu_copy_kvm_uabi_to_fpstate()")
0b2d39aa0357 ("x86/fpu/xstate: Use fpstate for xsave_to_user_sigframe()")
073e627a4537 ("x86/fpu/xstate: Use fpstate for os_xsave()")
be31dfdfd75b ("x86/fpu: Use fpstate::size")
248452ce21ae ("x86/fpu: Add size and mask information to fpstate")
2dd8eedc80b1 ("x86/process: Move arch_thread_struct_whitelist() out of line")
f0cbc8b3cdf7 ("x86/fpu: Do not leak fpstate pointer on fork")
2f27b5034244 ("x86/fpu: Remove fpu::state")
63d6bdf36ce1 ("x86/math-emu: Convert to fpstate")
c20942ce5128 ("x86/fpu/core: Convert to fpstate")
7e049e8b7459 ("x86/fpu/signal: Convert to fpstate")
caee31a36c33 ("x86/fpu/regset: Convert to fpstate")
cceb496420fa ("x86/fpu: Convert tracing to fpstate")
1c57572d754f ("x86/KVM: Convert to fpstate")
087df48c298c ("x86/fpu: Replace KVMs xstate component clearing")
18b3fa1ad15f ("x86/fpu: Convert restore_fpregs_from_fpstate() to struct fpstate")
f83ac56acdad ("x86/fpu: Convert fpstate_init() to struct fpstate")
87d0e5be0fac ("x86/fpu: Provide struct fpstate")
bf5d00470787 ("x86/fpu: Replace KVMs home brewed FPU copy to user")
079ec41b22b9 ("x86/fpu: Provide a proper function for ex_handler_fprestore()")
b56d2795b297 ("x86/fpu: Replace the includes of fpu/internal.h")
6415bb809263 ("x86/fpu: Mop up the internal.h leftovers")
ff0c37e191f2 ("x86/sev: Include fpu/xcr.h")
0ae67cc34f76 ("x86/fpu: Remove internal.h dependency from fpu/signal.h")
90489f1dee8b ("x86/fpu: Move fpstate functions to api.h")
d9d005f32aac ("x86/fpu: Move mxcsr related code to core")
9848fb96839b ("x86/fpu: Move fpregs_restore_userregs() to core")
cdcb6fa14e14 ("x86/fpu: Make WARN_ON_FPU() private")
34002571cb41 ("x86/fpu: Move legacy ASM wrappers to core")
df95b0f1aa56 ("x86/fpu: Move os_xsave() and os_xrstor() to core")
b579d0c3750e ("x86/fpu: Make os_xrstor_booting() private")
d06241f52cfe ("x86/fpu: Clean up CPU feature tests")
63e81807c1f9 ("x86/fpu: Move context switch and exit to user inlines into sched.h")
9603445549da ("x86/fpu: Mark fpu__init_prepare_fx_sw_frame() as __init")
ca834defd33b ("x86/fpu: Rework copy_xstate_to_uabi_buf()")
ea4d6938d4c0 ("x86/fpu: Replace KVMs home brewed FPU copy from user")
a0ff0611c2fb ("x86/fpu: Move KVMs FPU swapping to FPU core")
63cf05a19a5d ("x86/fpu/xstate: Mark all init only functions __init")
ffd3e504c9e0 ("x86/fpu/xstate: Provide and use for_each_xfeature()")
126fe0401883 ("x86/fpu: Cleanup xstate xcomp_bv initialization")
509e7a30cd0a ("x86/fpu: Do not inherit FPU context for kernel and IO worker threads")
2d16a1876f20 ("x86/process: Clone FPU in copy_thread()")
01f9f62d3ae7 ("x86/fpu: Remove pointless memset in fpu_clone()")
dc2f39fd1bf2 ("x86/fpu: Cleanup the on_boot_cpu clutter")
f5daf836f292 ("x86/fpu: Restrict xsaves()/xrstors() to independent states")
b50854eca0e0 ("x86/pkru: Remove useless include")
d2d926482cdf ("x86/fpu: Update stale comments")
9568bfb4f04b ("x86/fpu: Remove pointless argument from switch_fpu_finish()")
724fc0248d45 ("x86/fpu/signal: Fix missed conversion to correct boolean retval in save_xstate_epilog()")
a2a8fd9a3efd ("x86/fpu/signal: Change return code of restore_fpregs_from_user() to boolean")
be0040144152 ("x86/fpu/signal: Change return code of check_xstate_in_sigframe() to boolean")
1193f408cd51 ("x86/fpu/signal: Change return type of __fpu_restore_sig() to boolean")
f3305be5feec ("x86/fpu/signal: Change return type of fpu__restore_sig() to boolean")
ee4ecdfbd289 ("x86/signal: Change return type of restore_sigcontext() to boolean")
2af07f3a6e9f ("x86/fpu/signal: Change return type of copy_fpregs_to_sigframe() helpers to boolean")
052adee66828 ("x86/fpu/signal: Change return type of copy_fpstate_to_sigframe() to boolean")
fcfb7163329c ("x86/fpu/signal: Move xstate clearing out of copy_fpregs_to_sigframe()")
4164a482a5d9 ("x86/fpu/signal: Move header zeroing out of xsave_to_user_sigframe()")
4339d0c63c2d ("x86/fpu/signal: Clarify exception handling in restore_fpregs_from_user()")
0c2e62ba04cd ("x86/extable: Remove EX_TYPE_FAULT from MCE safe fixups")
c6304556f3ae ("x86/fpu: Use EX_TYPE_FAULT_MCE_SAFE for exception fixups")
c1c97d175493 ("x86/copy_mc: Use EX_TYPE_DEFAULT_MCE_SAFE for exception fixups")
2cadf5248b93 ("x86/extable: Provide EX_TYPE_DEFAULT_MCE_SAFE and EX_TYPE_FAULT_MCE_SAFE")
46d28947d987 ("x86/extable: Rework the exception table mechanics")
083b32d6f4fa ("x86/mce: Get rid of stray semicolons")
e42404afc4ca ("x86/mce: Deduplicate exception handling")
32fd8b59f91f ("x86/extable: Get rid of redundant macros")
326b567f82df ("x86/extable: Tidy up redundant handler functions")

[Regression potential]

The changes are limited to x86, mostly fpu code and signal handling, so we may see regressions on x86, especially on FPU-intensive workloads.

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1967750

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Changed in linux (Ubuntu):
status: Incomplete → Triaged
Andrea Righi (arighi)
Changed in linux (Ubuntu):
status: Triaged → Fix Committed
assignee: nobody → Andrea Righi (arighi)
importance: Undecided → High
Stefan Bader (smb)
Changed in linux (Ubuntu Jammy):
assignee: nobody → Andrea Righi (arighi)
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux/5.15.0-28.29 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-jammy' to 'verification-done-jammy'. If the problem still exists, change the tag 'verification-needed-jammy' to 'verification-failed-jammy'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-jammy
Revision history for this message
Stefan Bader (smb) wrote :

The patch set was verified at Intel with pre-release HW.

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (6.9 KiB)

This bug was fixed in the package linux - 5.15.0-30.31

---------------
linux (5.15.0-30.31) jammy; urgency=medium

  * jammy/linux: 5.15.0-30.31 -proposed tracker (LP: #1971685)

  * Packaging resync (LP: #1786013)
    - [Packaging] update variants
    - debian/dkms-versions -- update from kernel-versions (main/2022.04.18)

  * Intel: enable x86 AMX (LP: #1967750)
    - x86/extable: Tidy up redundant handler functions
    - x86/extable: Get rid of redundant macros
    - x86/mce: Deduplicate exception handling
    - x86/mce: Get rid of stray semicolons
    - x86/extable: Rework the exception table mechanics
    - x86/extable: Provide EX_TYPE_DEFAULT_MCE_SAFE and EX_TYPE_FAULT_MCE_SAFE
    - x86/copy_mc: Use EX_TYPE_DEFAULT_MCE_SAFE for exception fixups
    - x86/fpu: Use EX_TYPE_FAULT_MCE_SAFE for exception fixups
    - x86/extable: Remove EX_TYPE_FAULT from MCE safe fixups
    - x86/fpu/signal: Clarify exception handling in restore_fpregs_from_user()
    - x86/fpu/signal: Move header zeroing out of xsave_to_user_sigframe()
    - x86/fpu/signal: Move xstate clearing out of copy_fpregs_to_sigframe()
    - x86/fpu/signal: Change return type of copy_fpstate_to_sigframe() to boolean
    - x86/fpu/signal: Change return type of copy_fpregs_to_sigframe() helpers to
      boolean
    - x86/signal: Change return type of restore_sigcontext() to boolean
    - x86/fpu/signal: Change return type of fpu__restore_sig() to boolean
    - x86/fpu/signal: Change return type of __fpu_restore_sig() to boolean
    - x86/fpu/signal: Change return code of check_xstate_in_sigframe() to boolean
    - x86/fpu/signal: Change return code of restore_fpregs_from_user() to boolean
    - x86/fpu/signal: Fix missed conversion to correct boolean retval in
      save_xstate_epilog()
    - x86/fpu: Remove pointless argument from switch_fpu_finish()
    - x86/fpu: Update stale comments
    - x86/pkru: Remove useless include
    - x86/fpu: Restrict xsaves()/xrstors() to independent states
    - x86/fpu: Cleanup the on_boot_cpu clutter
    - x86/fpu: Remove pointless memset in fpu_clone()
    - x86/process: Clone FPU in copy_thread()
    - x86/fpu: Do not inherit FPU context for kernel and IO worker threads
    - x86/fpu: Cleanup xstate xcomp_bv initialization
    - x86/fpu/xstate: Provide and use for_each_xfeature()
    - x86/fpu/xstate: Mark all init only functions __init
    - x86/fpu: Move KVMs FPU swapping to FPU core
    - x86/fpu: Replace KVMs home brewed FPU copy from user
    - x86/fpu: Rework copy_xstate_to_uabi_buf()
    - x86/fpu: Mark fpu__init_prepare_fx_sw_frame() as __init
    - x86/fpu: Move context switch and exit to user inlines into sched.h
    - x86/fpu: Clean up CPU feature tests
    - x86/fpu: Make os_xrstor_booting() private
    - x86/fpu: Move os_xsave() and os_xrstor() to core
    - x86/fpu: Move legacy ASM wrappers to core
    - x86/fpu: Make WARN_ON_FPU() private
    - x86/fpu: Move fpregs_restore_userregs() to core
    - x86/fpu: Move mxcsr related code to core
    - x86/fpu: Move fpstate functions to api.h
    - x86/fpu: Remove internal.h dependency from fpu/signal.h
    - x86/sev: Include fpu/xcr.h
    - x86/fpu: Mop up the internal.h leftovers
    - ...

Read more...

Changed in linux (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote :

This bug is awaiting verification that the linux-hwe-5.15/5.15.0-32.33~20.04.1 kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-focal' to 'verification-done-focal'. If the problem still exists, change the tag 'verification-needed-focal' to 'verification-failed-focal'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-focal
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.