All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Prevent attempting updates known to fail
@ 2023-06-15 15:48 Alejandro Vallejo
  2023-06-15 15:48 ` [PATCH v3 1/5] x86/microcode: Allow reading microcode revision even if it can't be updated Alejandro Vallejo
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Alejandro Vallejo @ 2023-06-15 15:48 UTC (permalink / raw)
  To: Xen-devel
  Cc: Alejandro Vallejo, Jan Beulich, Andrew Cooper,
	Roger Pau Monné, Wei Liu

v3:
  * Lots of hunks moved around. Individually mentioned in each patch
  * Removed a redundant check
  * Ignore microcode interface if the revision is -1
  * Perform the DIS_MCU_LOAD checks during init rather than apply time


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 Does the refactors to allow collecting cpu info on systems with
        microcode updates disabled

Patch 2 Isolates early_microcode_init() per-vendor logic in per-vendor
        functions

Patch 3 Recognizes microcode revision of -1 as a hint meaning "don't use the
        microcode interface".

Patch 4 Moves the MSR_ARCH_CAPS read from tsx_init() to
        early_microcode_init()

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

Alejandro Vallejo (5):
  x86/microcode: Allow reading microcode revision even if it can't be
    updated
  x86/microcode: Create per-vendor microcode_ops builders
  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             |  5 ++++
 xen/arch/x86/cpu/microcode/amd.c      | 16 +++++++----
 xen/arch/x86/cpu/microcode/core.c     | 41 ++++++++++++++++++++-------
 xen/arch/x86/cpu/microcode/intel.c    | 27 ++++++++++++++----
 xen/arch/x86/cpu/microcode/private.h  | 19 ++++++++++++-
 xen/arch/x86/include/asm/cpufeature.h |  1 +
 xen/arch/x86/include/asm/msr-index.h  |  5 ++++
 xen/arch/x86/tsx.c                    | 15 ++--------
 8 files changed, 93 insertions(+), 36 deletions(-)

-- 
2.34.1



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

end of thread, other threads:[~2023-06-22 15:21 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15 15:48 [PATCH v2 0/5] Prevent attempting updates known to fail Alejandro Vallejo
2023-06-15 15:48 ` [PATCH v3 1/5] x86/microcode: Allow reading microcode revision even if it can't be updated Alejandro Vallejo
2023-06-19 15:37   ` Jan Beulich
2023-06-19 15:49   ` Andrew Cooper
2023-06-19 15:58     ` Jan Beulich
2023-06-19 16:06       ` Andrew Cooper
2023-06-19 16:10         ` Jan Beulich
2023-06-20  9:53           ` Jan Beulich
2023-06-15 15:48 ` [PATCH v3 2/5] x86/microcode: Create per-vendor microcode_ops builders Alejandro Vallejo
2023-06-19 15:45   ` Jan Beulich
2023-06-22 14:34     ` Alejandro Vallejo
2023-06-15 15:48 ` [PATCH v3 3/5] x86/microcode: Ignore microcode loading interface for revision = -1 Alejandro Vallejo
2023-06-19 15:47   ` Jan Beulich
2023-06-15 15:48 ` [PATCH v3 4/5] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init() Alejandro Vallejo
2023-06-19 15:57   ` Jan Beulich
2023-06-22 14:55     ` Alejandro Vallejo
2023-06-22 15:20       ` Jan Beulich
2023-06-15 15:48 ` [PATCH v3 5/5] x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is set Alejandro Vallejo
2023-06-20  9:51   ` Jan Beulich
2023-06-22 15:05     ` Alejandro Vallejo
2023-06-15 15:56 ` [PATCH v2 0/5] Prevent attempting updates known to fail 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.