[PATCH 0/3] Add Automatic IBRS support

Alejandro Vallejo posted 3 patches 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230526150044.31553-1-alejandro.vallejo@cloud.com
There is a newer version of this series
tools/libs/light/libxl_cpuid.c              |  1 +
tools/misc/xen-cpuid.c                      |  2 +
xen/arch/x86/hvm/hvm.c                      |  3 ++
xen/arch/x86/include/asm/cpufeature.h       |  1 +
xen/arch/x86/include/asm/msr-index.h        |  4 +-
xen/arch/x86/pv/emul-priv-op.c              |  4 +-
xen/arch/x86/setup.c                        |  3 ++
xen/arch/x86/smpboot.c                      |  3 ++
xen/arch/x86/spec_ctrl.c                    | 52 +++++++++++++++------
xen/include/public/arch-x86/cpufeatureset.h |  1 +
10 files changed, 56 insertions(+), 18 deletions(-)
[PATCH 0/3] Add Automatic IBRS support
Posted by Alejandro Vallejo 11 months ago
Adds support for AMD's Automatic IBRS. It's a set-and-forget feature that
prevents lower privileged executions from affecting speculations of higher
privileged executions, so retpolines are not required. Furthermore, it
clears the RSB upon VMEXIT, so we can avoid doing it if the feature is
present.

Patch 1 adds the relevant bit definitions for CPUID and EFER.

Patch 2 Hooks up AutoIBRS to spec_ctrl. so it's used when IBRS is picked.
        It also tweaks the heuristics so AutoIBRS is preferred over
        retpolines as BTI mitigation. This is enough to protect Xen.

Patch 3 exposes the feature to HVM guests.

Alejandro Vallejo (3):
  x86: Add bit definitions for Automatic IBRS
  x86: Add support for AMD's Automatic IBRS
  x86: Expose Automatic IBRS to guests

 tools/libs/light/libxl_cpuid.c              |  1 +
 tools/misc/xen-cpuid.c                      |  2 +
 xen/arch/x86/hvm/hvm.c                      |  3 ++
 xen/arch/x86/include/asm/cpufeature.h       |  1 +
 xen/arch/x86/include/asm/msr-index.h        |  4 +-
 xen/arch/x86/pv/emul-priv-op.c              |  4 +-
 xen/arch/x86/setup.c                        |  3 ++
 xen/arch/x86/smpboot.c                      |  3 ++
 xen/arch/x86/spec_ctrl.c                    | 52 +++++++++++++++------
 xen/include/public/arch-x86/cpufeatureset.h |  1 +
 10 files changed, 56 insertions(+), 18 deletions(-)

-- 
2.34.1