From e0a47ff4548343559136d495ece9f3fa80cacbef Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 24 Jul 2023 21:21:59 +0000 Subject: [PATCH] x86: Apply AMD's workaround for Zenbleed. XXX pullup-8 XXX pullup-9 XXX pullup-10 --- sys/arch/x86/include/specialreg.h | 1 + sys/arch/x86/x86/errata.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/sys/arch/x86/include/specialreg.h b/sys/arch/x86/include/specialreg.h index d6d7c0a4f069..3f828cf74001 100644 --- a/sys/arch/x86/include/specialreg.h +++ b/sys/arch/x86/include/specialreg.h @@ -1394,6 +1394,7 @@ #define MSR_DE_CFG 0xc0011029 #define DE_CFG_ERRATA_721 0x00000001 #define DE_CFG_LFENCE_SERIALIZE __BIT(1) +#define DE_CFG_ERRATA_ZENBLEED __BIT(9) #define DE_CFG_ERRATA_1021 __BIT(13) #define MSR_BU_CFG2 0xc001102a diff --git a/sys/arch/x86/x86/errata.c b/sys/arch/x86/x86/errata.c index d127116912eb..80885ac07c1b 100644 --- a/sys/arch/x86/x86/errata.c +++ b/sys/arch/x86/x86/errata.c @@ -361,6 +361,16 @@ static errata_t errata[] = { 1095, FALSE, MSR_LS_CFG, x86_errata_set13, x86_errata_setmsr, LS_CFG_ERRATA_1095 }, + /* + * Zenbleed: + * https://www.amd.com/en/resources/product-security/bulletin/amd-sb-7008.html + * https://github.com/google/security-research/security/advisories/GHSA-v6wh-rxpg-cmm8 + * https://lock.cmpxchg8b.com/zenbleed.html + */ + { + -1, FALSE, MSR_DE_CFG, x86_errata_set13, + x86_errata_setmsr, DE_CFG_ERRATA_ZENBLEED, + }, }; static bool