Skip to content

Fix AMD erratum #1485 on AMD Zen4

Alejandro Vallejo xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xen/x86: Add family guards to the is_zen[12]_uarch() macrosxen/arch/x86/cpu/amd.c xen/arch/x86/include/asm/amd.h xen/arch/x86/spec_ctrl.c+7 -104 replies
2/2x86/amd: Prevent potentially fetching wrong instruction bytes on Zen4xen/arch/x86/cpu/amd.c xen/arch/x86/include/asm/amd.h xen/arch/x86/include/asm/msr-index.h+21 -01 reply

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchHenry Wang
SeriesRelease-acked-by
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [for-4.18][PATCH 0/2] Fix AMD erratum #1485 on AMD Zen4

This patch should make it to 4.18, as it prevents random crashes on AMD Zen4 running outdated microcode.

Under certain conditions Zen4 may corrupt its own code stream when SMT is enabled and STIBP is not. The Linux thread in which this was highlighted is in patch2's commit message.

NOTE: Still running in CI as of now, but tested locally. Pipeline here.

    https://gitlab.com/xen-project/people/agvallejo/xen/-/pipelines/1034895039

Patch 1: is just a minor refactor to ensure we don't get microarchitectures
of different families mixed up now that we have 3 different families involved (Fam17h, Fam18h and Fam19h)
Patch 2: The actual fix. It involves setting a bit in an MSR if it's a non
virtualized zen4. It's not a direct copy of the Linux patch, as we have started using macros to find out microarchitectures from CPUID bits, rather than relying on models.

Alejandro Vallejo (2):
xen/x86: Add family guards to the is_zen[12]_uarch() macros x86/amd: Prevent potentially fetching wrong instruction bytes on Zen4

 xen/arch/x86/cpu/amd.c               | 16 +++++++++++++---
 xen/arch/x86/include/asm/amd.h       | 17 +++++++++++++----
 xen/arch/x86/include/asm/msr-index.h |  2 ++
 xen/arch/x86/spec_ctrl.c             |  3 ---
 4 files changed, 28 insertions(+), 10 deletions(-)
Signature · 1 line
2.34.1