All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/3] Prevent attempting updates known to fail
@ 2023-07-24 16:52 Alejandro Vallejo
  2023-07-24 16:52 ` [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface for revision = -1 Alejandro Vallejo
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alejandro Vallejo @ 2023-07-24 16:52 UTC (permalink / raw)
  To: Xen-devel
  Cc: Alejandro Vallejo, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu

Under certain conditions a CPU may not be able to perform microcode updates
even if hardware exists to that effect. In particular:

 * If Xen runs under certain hypervisors they won't allow microcode
   updates, and will signal this fact by reporting a microcode revision of
   -1.
 * If the DIS_MCU_LOAD bit is set, which is expected in some baremetal
   clouds where the owner may not trust the tenant, then the CPU is not
   capable of loading new microcode.

This series adds logic so that in both of these cases we don't needlessly
attempt updates that are not going to succeed. Patch summary:

Patch 1 Ignores microcode facilities when the current microcode revision is -1

Patch 2 Moves the MSR_ARCH_CAPS read in tsx_init() to early_cpu_init() and
        early_microcode_init()

Patch 3 Adds the logic to detect microcode updates being disabled on Intel.

Alejandro Vallejo (3):
  x86/microcode: Ignore microcode loading interface for revision = -1
  x86: Read MSR_ARCH_CAPS immediately after early_microcode_init()
  x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is
    set

 xen/arch/x86/cpu/common.c             | 20 ++++++++++----
 xen/arch/x86/cpu/microcode/core.c     | 38 ++++++++++++++++++++++++---
 xen/arch/x86/cpu/microcode/intel.c    | 13 +++++++++
 xen/arch/x86/cpu/microcode/private.h  |  7 +++++
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 xen/arch/x86/include/asm/msr-index.h  |  5 ++++
 xen/arch/x86/include/asm/setup.h      |  2 +-
 xen/arch/x86/setup.c                  |  2 +-
 xen/arch/x86/tsx.c                    | 16 +++--------
 9 files changed, 81 insertions(+), 23 deletions(-)

-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-07-28 11:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 16:52 [PATCH v6 0/3] Prevent attempting updates known to fail Alejandro Vallejo
2023-07-24 16:52 ` [PATCH v6 1/3] x86/microcode: Ignore microcode loading interface for revision = -1 Alejandro Vallejo
2023-07-25  6:40   ` Jan Beulich
2023-07-25  6:43     ` Jan Beulich
2023-07-25 12:50     ` Alejandro Vallejo
2023-07-28 11:45       ` Alejandro Vallejo
2023-07-24 16:52 ` [PATCH v6 2/3] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init() Alejandro Vallejo
2023-07-24 16:52 ` [PATCH v6 3/3] x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is set Alejandro Vallejo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.