[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] x86/spec-ctrl: Remove opencoded MSR_ARCH_CAPS check


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 19 May 2023 08:00:56 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BSeGtClR+KejmygyDgqPrvKuUAT9gGUEr5MA54PAiMk=; b=OCfPRe/2lyDVhjAUE/el2gNRqXoyGihtuTpNHMfAIoBZIlq7jfpIj6kU+B6MHTx7pEfS9CyGz3QKRDPDrTAtylwbC+x1lL65QqN3aN/B/dvxFSqj8DyL6T+sCoEe0X3T9uzLIhfIneeSNENSZETbAOVGwi1jtC6eslKhxwJabuYA+p6Tj7Ve66ochI/ZOBMZNLLgLTEfo9TdAMFMBaCnEfqyVxPrcOAKet+FMN+AQBTABY4JxEH2msWrtZRV0XZ7/6LIf3t7cxDS6YB244U3TngNc3F9RCTK/mEB0E6heKE9361yMBnw1d/ADj9djBz2zdwkr5JjZ27vMlXlgS7NGw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OQPJjjGTGtC/hZw4sw+gZ34TqHInWAiIC+ERcQFb/fIVYRdNHkW5DU/BjxZ9Cc7eC5LCmhj/EIOhATOqloX/AA8mPKx+y310pE4NRvnZew+UlJMmvgkXJ8fETjLppDqn/wIBmXW88v5HdcdDECnUjWRKi3NIaCqk+zYf61yzkOY4MsVX7pLem8OBhNUHMwGdgHQlBW35pbvGyXkqjOKpCyxb7eaY7y3Di6pcDfbOrrFgoK9s+juV9gWS5ahP5LtS3V9mfppfecWm/w7SCTN4qo9zVlu0B1hQzWogMOXraCaNiyR4jA0PseDYOng2aF9N2PdjqkheHmmnOG9eM01wNA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 May 2023 06:01:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> 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?

>> Apart from this, with all the uses further down gone, perhaps there's
>> not even a need for the raw value, if you used the bitfields in the
>> printk(). Which in turn raises the question whether the #define-s in
>> msr-index.h are of much use then anymore.
> 
> One of the next phases of work is synthesizing these in the host policy
> for CPUs which didn't receive microcode updates (for whatever reason).
> 
> There is a valid discussion for whether we ought to render the raw or
> host info here (currently we do raw), but I'm not adjusting that in this
> patch.

In the end I think both have their merits to log. So far it was my
assumption that "Hardware {hints,features}:" was intended to cover
raw, while "Xen settings:" was meaning to be close to "host" (but of
course there's quite a bit of a delta).

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.