]> xenbits.xensource.com Git - xen.git/commitdiff
x86/amd: Fix DE_CFG truncation in amd_check_zenbleed()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Jul 2023 17:42:12 +0000 (18:42 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 31 Jul 2023 12:55:21 +0000 (13:55 +0100)
This line:

val &= ~chickenbit;

ends up truncating val to 32 bits, and turning off various errata workarounds
in Zen2 systems.

Fixes: f91c5ea97067 ("x86/amd: Mitigations for Zenbleed")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit c0dd53b8cbd1e47e9c89873a9265a7170bdc6b4c)

xen/arch/x86/cpu/amd.c

index 4ed08df4a8ce1399356cfcf197668b63bc04efd9..81008a2d94b2a3e84975ace48bd98d0257133def 100644 (file)
@@ -773,8 +773,8 @@ void __init detect_zen2_null_seg_behaviour(void)
 void amd_check_zenbleed(void)
 {
        const struct cpu_signature *sig = &this_cpu(cpu_sig);
-       unsigned int good_rev, chickenbit = (1 << 9);
-       uint64_t val, old_val;
+       unsigned int good_rev;
+       uint64_t val, old_val, chickenbit = (1 << 9);
 
        /*
         * If we're virtualised, we can't do family/model checks safely, and