]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commit
x86/spec-ctrl: VERW-handling adjustments
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 5 Mar 2024 19:33:37 +0000 (19:33 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Mar 2024 15:50:04 +0000 (15:50 +0000)
commit1eb91a8a06230b4b64228c9a380194f8cfe6c5e2
treeb7f18e4bf66ecec9f02032ee5a05add76492b530
parentf7603ca252e4226739eb3129a5290ee3da3f8ea4
x86/spec-ctrl: VERW-handling adjustments

... before we add yet more complexity to this logic.  Mostly expanded
comments, but with three minor changes.

1) Introduce cpu_has_useful_md_clear to simplify later logic in this patch and
   future ones.

2) We only ever need SC_VERW_IDLE when SMT is active.  If SMT isn't active,
   then there's no re-partition of pipeline resources based on thread-idleness
   to worry about.

3) The logic to adjust HVM VERW based on L1D_FLUSH is unmaintainable and, as
   it turns out, wrong.  SKIP_L1DFL is just a hint bit, whereas opt_l1d_flush
   is the relevant decision of whether to use L1D_FLUSH based on
   susceptibility and user preference.

   Rewrite the logic so it can be followed, and incorporate the fact that when
   FB_CLEAR is visible, L1D_FLUSH isn't a safe substitution.

This is part of XSA-452 / CVE-2023-28746.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/spec_ctrl.c