]> xenbits.xensource.com Git - 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 16:17:48 +0000 (16:17 +0000)
commit638b6b21702ebf5a028a166261e4353d3028c7bd
tree70590c6adbeae2f04795fc83c8b617f26d9c7c78
parenta7ae8dbd8f4518b3d56d41d32931587b9027bc7b
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>
(cherry picked from commit 1eb91a8a06230b4b64228c9a380194f8cfe6c5e2)
xen/arch/x86/spec_ctrl.c