- Make sure TF is cleared before calling other functions (BHI mitigation in

this case) in the SYSENTER compat handler, as otherwise it will warn about
   being in single-step mode
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmaTlqoACgkQEsHwGGHe
 VUraAA/+P1oWQRyZ9iso8HSN+kfbvZgiwsTwXBOsqaVHJ4t/TOY2SUnX9u3NjqJl
 xNk+NN6qyNrWAcBJL9pqFjwUnGtMXqpPdw/iy66xaQQ9l2TogtqZENMePrJz2VU6
 T3+dI8lT1xZry2FeqquVZGPgG/8XsMu2zDQ0GiqZk/WVEQZE6cb+80hgFFUVNYvs
 01QigzBWOr1Gvw8c32NCSXQgkOsahCfbhrTKPJmgvYOeaLteXiCmXWQMqj/LJpdP
 NO3Ew0A7k2u8Hd5Z6w2Y5+rZTO1a0nfyQToexFAdZk9QsLyyUOibs+QhZ6TRk5Mw
 jtMfx7nLAZCoc55pCr7Z2gKEXjsJvN8QMKup3MadJ/cBNsPJoRhZMEBUjr6wxNuh
 /CnS1g83R9JkH/pjl488A+ZL5zeuHEerF+70Ot2Q9BHaulVIPnCFClVF/pukV7mf
 6fzTJ6lq6fJTiBRhxwhWZIX2J0eJ1IB4JatYNrbStAsLwjlR4sIV5jQSIvBnn104
 keU7UxY9esIp0AGjwxKT1wwa5egstEgSQvJom7bl9Dfb4oQ0byd8Ri1ECVHckhNs
 fUOJdt7Pc2jZGGLXDVO0LYeWjpreWcMLIoVOt0Wbl0BmfBCuammJTHVpzw5cl4Xw
 SvgLx9P1KfKV9h4wp993DdgRbOAQ72DoNq9bNlNlf11Vq0YzsMs=
 =iGW9
 -----END PGP SIGNATURE-----

Merge tag 'x86_urgent_for_v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fix from Borislav Petkov:

 - Make sure TF is cleared before calling other functions (BHI
   mitigation in this case) in the SYSENTER compat handler, as
   otherwise it will warn about being in single-step mode

* tag 'x86_urgent_for_v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/bhi: Avoid warning in #DB handler due to BHI mitigation
This commit is contained in:
Linus Torvalds 2024-07-14 10:11:20 -07:00
commit 35ce463245

View File

@ -89,10 +89,6 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL)
cld
IBRS_ENTER
UNTRAIN_RET
CLEAR_BRANCH_HISTORY
/*
* SYSENTER doesn't filter flags, so we need to clear NT and AC
* ourselves. To save a few cycles, we can check whether
@ -116,6 +112,16 @@ SYM_INNER_LABEL(entry_SYSENTER_compat_after_hwframe, SYM_L_GLOBAL)
jnz .Lsysenter_fix_flags
.Lsysenter_flags_fixed:
/*
* CPU bugs mitigations mechanisms can call other functions. They
* should be invoked after making sure TF is cleared because
* single-step is ignored only for instructions inside the
* entry_SYSENTER_compat function.
*/
IBRS_ENTER
UNTRAIN_RET
CLEAR_BRANCH_HISTORY
movq %rsp, %rdi
call do_SYSENTER_32
jmp sysret32_from_system_call