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

Re: [PATCH v5 3/4] x86: Read MSR_ARCH_CAPS immediately after early_microcode_init()


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 5 Jul 2023 12:43:27 +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=kj6GmKg/KqA1sstnJgxozqSyYWM91LU7Gjl25Xzka4U=; b=WawDF8fAtwpe9QteSEPpV0FQJm60DIFfnF2HLiIfd86fxIEdWxxG3q6GeikXRbrv/ITHmXf20VqMY0Eu/1y9tao4GcefpftJJY3uqMeClqJCg7B1ecM4hZXT5206S7PCrk+Xx19/WkAHJiXGjGzJ5awV2t4p74X5yDlGGgKMcqwveLgfOhlDCiV2g/PUsvtMbLCRYGm4pTrnaDBsmIGqDQGFWJPkVjir1atD9yEoCzOVu+aRd0ZtVp27zJ2R+MR65IPaLZUPxG3J4ixSta54nCa8UXA/oZmxFEjxRcmWopIR7wo9hDvqp0pNjkjWKvjE5E9PTRa3NHDzM+PdLQsvCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n7/R22Fz7oHm3IQFEiMO8gBzdrKBCSbd/+eiLnrCu1E9Pk2fvko+FX+Xn7WIi7z9WNf7/kr/0wly8DVZYJyUhRVHESia43D7bnqa9PK9/iDsGZMyx8NK35gPFmiofGd4UcHR8+ONFHxRqQBMVRH/IhdWtpcGKb3UNrNP2BlX+jkRqiut6trwy1OLuCzHh86Sq2G6aqdSpVQNH4rAfJdVzaVeW3U5JvqNlXzhbO6r01BkKRLbUb6oXRAsgRwoLqf7F/68PJ47j8jWeB0SVZ/oPhLifEf9ydr9hmo7//vYFyAUrBmX9Bhmj7rjjIbsFFaLLFHHBRUzzm/NyB0s37k4TA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 05 Jul 2023 10:44:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

> @@ -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.

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

With at least the middle item taken care of (which I'd be happy to
do while committing)
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan



 


Rackspace

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