eb85956
From: Andrew Cooper <andrew.cooper3@citrix.com>
eb85956
Subject: x86/amd: Fix DE_CFG truncation in amd_check_zenbleed()
eb85956
eb85956
This line:
eb85956
eb85956
	val &= ~chickenbit;
eb85956
eb85956
ends up truncating val to 32 bits, and turning off various errata workarounds
eb85956
in Zen2 systems.
eb85956
eb85956
Fixes: f91c5ea97067 ("x86/amd: Mitigations for Zenbleed")
eb85956
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
eb85956
Reviewed-by: Jan Beulich <jbeulich@suse.com>
eb85956
eb85956
diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
eb85956
index 3ed06f670491..df2681b7c455 100644
eb85956
--- a/xen/arch/x86/cpu/amd.c
eb85956
+++ b/xen/arch/x86/cpu/amd.c
eb85956
@@ -909,8 +909,8 @@ void __init detect_zen2_null_seg_behaviour(void)
eb85956
 void amd_check_zenbleed(void)
eb85956
 {
eb85956
 	const struct cpu_signature *sig = &this_cpu(cpu_sig);
eb85956
-	unsigned int good_rev, chickenbit = (1 << 9);
eb85956
-	uint64_t val, old_val;
eb85956
+	unsigned int good_rev;
eb85956
+	uint64_t val, old_val, chickenbit = (1 << 9);
eb85956
 
eb85956
 	/*
eb85956
 	 * If we're virtualised, we can't do family/model checks safely, and