All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>
Subject: [PATCH v3 3/5] x86/microcode: Ignore microcode loading interface for revision = -1
Date: Thu, 15 Jun 2023 16:48:32 +0100	[thread overview]
Message-ID: <20230615154834.959-4-alejandro.vallejo@cloud.com> (raw)
In-Reply-To: <20230615154834.959-1-alejandro.vallejo@cloud.com>

Some hypervisors report ~0 as the microcode revision to mean "don't issue
microcode updates". Ignore the microcode loading interface in that case.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v3:
  * Moved from v2/patch3 (Andrew)
---
 xen/arch/x86/cpu/microcode/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 530e3e8267..1554fa38eb 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -860,6 +860,14 @@ int __init early_microcode_init(unsigned long *module_map,
     if ( ucode_ops.collect_cpu_info )
         ucode_ops.collect_cpu_info();
 
+    /*
+     * Some hypervisors deliberately report a microcode revision of -1 to
+     * mean that they will not accept microcode updates. We take the hint
+     * and ignore the microcode interface in that case.
+     */
+    if ( this_cpu(cpu_sig).rev == ~0 )
+        ucode_ops.apply_microcode = NULL;
+
     if ( !ucode_ops.apply_microcode )
     {
         printk(XENLOG_WARNING "Microcode loading not available\n");
-- 
2.34.1



  parent reply	other threads:[~2023-06-15 15:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Alejandro Vallejo [this message]
2023-06-19 15:47   ` [PATCH v3 3/5] x86/microcode: Ignore microcode loading interface for revision = -1 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230615154834.959-4-alejandro.vallejo@cloud.com \
    --to=alejandro.vallejo@cloud.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.