All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 4/4] x86/spec-ctrl: Remove opencoded MSR_ARCH_CAPS check
Date: Fri, 19 May 2023 15:38:18 +0100	[thread overview]
Message-ID: <a8013bb5-b0bb-6e42-85de-2e12d7b6f83c@citrix.com> (raw)
In-Reply-To: <fb95d033-7a71-7cc1-bb8f-ee2a74d1c5cf@suse.com>

On 19/05/2023 7:00 am, Jan Beulich wrote:
> On 17.05.2023 18:35, Andrew Cooper wrote:
>> On 17/05/2023 3:47 pm, Jan Beulich wrote:
>>> On 16.05.2023 16:53, Andrew Cooper wrote:
>>>> @@ -401,6 +400,8 @@ static void __init print_details(enum ind_thunk thunk, uint64_t caps)
>>>>          cpuid_count(7, 2, &tmp, &tmp, &tmp, &_7d2);
>>>>      if ( boot_cpu_data.extended_cpuid_level >= 0x80000008 )
>>>>          cpuid(0x80000008, &tmp, &e8b, &tmp, &tmp);
>>>> +    if ( cpu_has_arch_caps )
>>>> +        rdmsrl(MSR_ARCH_CAPABILITIES, caps);
>>> Why do you read the MSR again? I would have expected this to come out
>>> of raw_cpu_policy now (and incrementally the CPUID pieces as well,
>>> later on).
>> Consistency with the surrounding logic.
> I view this as relevant only when the code invoking CPUID directly is
> intended to stay.

Quite the contrary.  It stays because this patch, and changing the
semantics of the print block are unrelated things and should not be
mixed together.

>> Also because the raw and host policies don't get sorted until much later
>> in boot.
> identify_cpu(), which invokes init_host_cpu_policies(), is called
> ahead of init_speculation_mitigations(), isn't it?

What is init_host_cpu_policies() ?

I have a plan for what it's going to be if prior MSR work hadn't ground
to a halt, but it's a bit too late for that now.

(To answer the question properly, no the policies aren't set up until
just before building dom0, and that's not something that is trivial to
change.)

~Andrew


  reply	other threads:[~2023-05-19 14:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 14:53 [PATCH 0/4] x86: Feature check cleanup Andrew Cooper
2023-05-16 14:53 ` [PATCH 1/4] x86/cpufeature: Rework {boot_,}cpu_has() Andrew Cooper
2023-05-17 14:01   ` Jan Beulich
2023-05-19 15:24     ` Andrew Cooper
2023-05-22  6:58       ` Jan Beulich
2023-05-16 14:53 ` [PATCH 2/4] x86/vtx: Remove opencoded MSR_ARCH_CAPS check Andrew Cooper
2023-05-17 14:36   ` Jan Beulich
2023-05-17 14:38     ` Jan Beulich
2023-05-26  4:56   ` Tian, Kevin
2023-05-16 14:53 ` [PATCH 3/4] x86/tsx: " Andrew Cooper
2023-05-17 14:38   ` Jan Beulich
2023-05-16 14:53 ` [PATCH 4/4] x86/spec-ctrl: " Andrew Cooper
2023-05-17 14:47   ` Jan Beulich
2023-05-17 16:35     ` Andrew Cooper
2023-05-19  6:00       ` Jan Beulich
2023-05-19 14:38         ` Andrew Cooper [this message]
2023-05-22  7:10           ` Jan Beulich
2023-05-22 14:14             ` Andrew Cooper
2023-05-22 14:30               ` Jan Beulich

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=a8013bb5-b0bb-6e42-85de-2e12d7b6f83c@citrix.com \
    --to=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.