From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 3/4] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init()
Date: Wed, 5 Jul 2023 14:12:58 +0100 [thread overview]
Message-ID: <64a56c5b.170a0220.c33b5.793c@mx.google.com> (raw)
In-Reply-To: <0dafce38-e572-3675-7f5f-a44a097abf09@suse.com>
On Wed, Jul 05, 2023 at 12:43:27PM +0200, Jan Beulich wrote:
> On 29.06.2023 17:26, Alejandro Vallejo wrote:
> > @@ -324,9 +324,10 @@ void __init early_cpu_init(void)
> > case X86_VENDOR_SHANGHAI: this_cpu = &shanghai_cpu_dev; break;
> > case X86_VENDOR_HYGON: this_cpu = &hygon_cpu_dev; break;
> > default:
> > - printk(XENLOG_ERR
> > - "Unrecognised or unsupported CPU vendor '%.12s'\n",
> > - c->x86_vendor_id);
> > + if (verbose)
> > + printk(XENLOG_ERR
> > + "Unrecognised or unsupported CPU vendor '%.12s'\n",
> > + c->x86_vendor_id);
>
> Just as a remark:
>
> if (!verbose)
> break;
>
> would have been less of a delta and keeping all lines within the 80
> chars limit.
Very true, that looks nicer.
> > @@ -340,10 +341,11 @@ void __init early_cpu_init(void)
> > c->x86_capability[FEATURESET_1d] = edx;
> > c->x86_capability[FEATURESET_1c] = ecx;
> >
> > - printk(XENLOG_INFO
> > - "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
> > - x86_cpuid_vendor_to_str(c->x86_vendor), c->x86, c->x86,
> > - c->x86_model, c->x86_model, c->x86_mask, eax);
> > + if (verbose)
> > + printk(XENLOG_INFO
> > + "CPU Vendor: %s, Family %u (%#x), Model %u (%#x), Stepping %u (raw %08x)\n",
> > + x86_cpuid_vendor_to_str(boot_cpu_data->x86_vendor), c->x86, c->x86,
> > + c->x86_model, c->x86_model, c->x86_mask, eax);
>
> Since rearrangement to limit line length isn't really possible here,
> the last two lines need re-flowing to stay within limits.
I assumed they could could share the length of the printk string. I don't
mind either way.
>
> > --- a/xen/arch/x86/cpu/microcode/core.c
> > +++ b/xen/arch/x86/cpu/microcode/core.c
> > @@ -886,5 +886,11 @@ int __init early_microcode_init(unsigned long *module_map,
> > if ( ucode_mod.mod_end || ucode_blob.size )
> > rc = early_microcode_update_cpu();
> >
> > + /*
> > + * MSR_ARCH_CAPS may have appeared after the microcode update. Reload
> > + * boot_cpu_data if so because they are needed in tsx_init().
> > + */
> > + early_cpu_init(false);
>
> I think the comment would better talk of ARCH_CAPS as an example of what
> may newly appear with a ucode update.
I just started writing a paragraph stating that it's unlikely anything else
will just appear, but thinking it through you're definitely right. A new
MSR_NEW_SPEC_MITIGATIONS might very well appear.
Something along this lines would be better?
```
* Microcode updates may change CPUID or MSRs. We need to reload
* the early subset boot_cpu_data before continuing. Notably tsx_init()
* needs an up to date MSR_ARCH_CAPS.
```
>
> With at least the middle item taken care of (which I'd be happy to
> do while committing)
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
> Jan
Thanks. I'm happy with all 3 changes being done on commit.
Alejandro
next prev parent reply other threads:[~2023-07-05 13:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-29 15:26 [PATCH v5 0/4] Prevent attempting updates known to fail Alejandro Vallejo
2023-06-29 15:26 ` [PATCH v5 1/4] x86/microcode: Allow reading microcode revision even if it can't be updated Alejandro Vallejo
2023-07-05 14:00 ` Andrew Cooper
2023-06-29 15:26 ` [PATCH v5 2/4] x86/microcode: Ignore microcode loading interface for revision = -1 Alejandro Vallejo
2023-07-05 14:13 ` Andrew Cooper
2023-07-05 14:24 ` Jan Beulich
2023-07-05 14:28 ` Andrew Cooper
2023-07-05 14:34 ` Jan Beulich
2023-06-29 15:26 ` [PATCH v5 3/4] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init() Alejandro Vallejo
2023-07-05 10:43 ` Jan Beulich
2023-07-05 13:12 ` Alejandro Vallejo [this message]
2023-07-05 13:19 ` Alejandro Vallejo
2023-06-29 15:26 ` [PATCH v5 4/4] x86/microcode: Disable microcode update handler if DIS_MCU_UPDATE is set Alejandro Vallejo
2023-07-05 10:51 ` Jan Beulich
2023-07-05 14:03 ` Alejandro Vallejo
2023-07-05 14:30 ` Jan Beulich
2023-07-05 15:04 ` 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=64a56c5b.170a0220.c33b5.793c@mx.google.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.