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 v3 4/5] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init()
Date: Thu, 22 Jun 2023 15:55:00 +0100 [thread overview]
Message-ID: <649460c6.df0a0220.f4bf6.4717@mx.google.com> (raw)
In-Reply-To: <e0b2bd19-8b77-50f2-2759-065529b89c84@suse.com>
On Mon, Jun 19, 2023 at 05:57:14PM +0200, Jan Beulich wrote:
> > + * We might have exposed MSR_ARCH_CAPS after the microcode update.
>
> I'm struggling a little with this sentence, but not being a native speaker
> it may be me, not the sentence. I would perhaps have said "MSR_ARCH_CAPS
> may have appeared with the microcode update."
Sure, works for me.
> I also wonder whether you wouldn't want to insert "e.g.", since iirc with
> the next patch tsx_init() isn't going to be the only user anymore.
tsx_init() is the only user, as far as I have seen. DIS_MCU_LOAD is checked
before the update, using the cached data read in early_cpu_init()
>
> > + */
> > + if ( boot_cpu_data.cpuid_level >= 7 )
> > + boot_cpu_data.x86_capability[FEATURESET_7d0]
> > + = cpuid_count_edx(7, 0);
>
> I take it we assume the maximum CPUID level won't go from below 7 to 7
> or higher with the ucode update?
Do you mean from >=7 to <7 instead? Otherwise it just works and I don't
undertand the concern.
If so, that's an impossibly unlikely case and the current code does not try
to clean up in that case.
>
> > --- a/xen/arch/x86/tsx.c
> > +++ b/xen/arch/x86/tsx.c
> > @@ -39,9 +39,9 @@ void tsx_init(void)
> > static bool __read_mostly once;
> >
> > /*
> > - * This function is first called between microcode being loaded, and CPUID
> > - * being scanned generally. Read into boot_cpu_data.x86_capability[] for
> > - * the cpu_has_* bits we care about using here.
> > + * This function is first called between microcode being loaded, and
> > + * CPUID being scanned generally. early_microcode_init() has already
> > + * prepared the feature bits needed here after the microcode update.
>
> Is this true in all cases? early_microcode_init() may have bailed
> early, so I think you need to further transform early_microcode_init()
> (and as a personal request of mine preferably without goto).
>
> Jan
The series is eventually correct because MSR_ARCH_CAPS are also collected
in early_cpu_init(). Alas, that's not the case here. You're right. I'll
move the early MSR_ARCH_CAPS read to this patch as well.
Alejandro
next prev parent reply other threads:[~2023-06-22 14:55 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 ` [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 [this message]
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=649460c6.df0a0220.f4bf6.4717@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.