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

Re: [PATCH v2 2/4] x86: Read MSR_ARCH_CAPS after early_microcode_init()


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 13 Jun 2023 10:06:54 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=Vo11QhvgllCnVHAQkRrnHmV/ux+kwbhW9D7qxsapFb0=; b=lgRrctxU+b1Cyed3J567b9sRL0Y/jTrT3q42nv3fw0RE0Y1/Pysj69JpQG2VaprxSe8grJrX1ZKEeWCTqXs8u3jj6SkRf5q7HCs/netPL6GYux2maiZXEkvLm69nmpq6XSKbYcrdNbc1id+VjvA/nY4AsigfpowZJArcvveQGLeAaQK/jHeqLacaFG7wDETlKUu0k7F6eP+mTx1KYDP3AHUQbOG+msOna7dOcUq2+KaQnjJmPjsONfsc3/0dOiUf7UGH0X1jkwg2gOtOC/Wvr1YADJZ5plfe5aBNWSeY//hpX0p0BKWg4e+t2wh6m9G6pdqk4D51uQNr9jYqVpmJmQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XW/RZOCWF+9NKxJC+KoT/yw6vWbT22usLJA5l4giFzOm5vADW42zBE1EE1GY1WaZIJSDvH9izno+znCvIfWToFJ6CRsILYT8Vyv29kPFm7C0ZtVOCJQ/ZeFPSY2/cqY03Dh4dJth5LBO1cAIMIAGzkxsjxXRsADpwjfFkYzVnQZ9iy2ffR4RK3IIwiDNONMjARkHJSjxKpeNSZcJth7T3FSrkeFs0PaPapV5nvwmtWrr2zLM7tXZ4QBF3CmFrE8bO4KNNrlAKTeMLr3OhSU/h5qeTFn2GSdevqOjXahboBpsq/xJINoeUH9dSngFbI0Z24RJ/wuZCHfytlVd4aLiYA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 13 Jun 2023 09:07:28 +0000
  • Ironport-data: A9a23:C73vNKIGtHIqebYUFE+REJQlxSXFcZb7ZxGr2PjKsXjdYENShjcCy DcYWGzUP/2CYjSnKdp3a9y+90NT6pXUxtY2QQZlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/rOHvykU7Ss1hlZHWdMUD0mhQ9oh9k3i4tphcnRKw6Ws Jb5rta31GWNglaYCUpKrfrbwP9TlK6q4mhA4AVlPakjUGL2zBH5MrpOfcldEFOgKmVkNrbSb /rOyri/4lTY838FYj9yuu+mGqGiaue60Tmm0hK6aYD76vRxjnVaPpIAHOgdcS9qZwChxLid/ jnvWauYEm/FNoWU8AgUvoIx/ytWZcWq85efSZSzXFD6I+QrvBIAzt03ZHzaM7H09c5UIlNcz s4gKQwhby+Hjr+V57efdOJF05FLwMnDZOvzu1lG5BSBUbMKZM6GRK/Ho9hFwD03m8ZCW+7EY NYUYiZuaxKGZABTPlAQC9Q1m+LAanvXKmUE7g7K4/VspTSJpOBy+OGF3N79U9qGX8hK2G2fo XrL5T/RCRAGLt2PjzGC9xpAg8eWxHmnBt5KTuPQGvhCiVCM7WcPNjEvXl6VpNSpgHT9d99HN BlBksYphe1onKCxdfH/VRClpH+PvjYHRsFdVeY97Wmlw67Z4Q+fCnIDCCBIbNgrtsgeTjgty 1PPlNTsbRRwtJWFRHTb8a2bxRuiNC5QIWIcaCssSQoe/8KlsIw1lgjITNtoDOiylNKdJN3r6 zWDrSx7i7BNi8cOj/m/5Qqf32jqoYXVRAko4AmRRnii8g5yeI+iYcqv9ETf6vFDao2eSzFto UQ5piRX18hWZbnlqcBHaLxl8G2BjxpdDADhvA==
  • Ironport-hdrordr: A9a23:QBvWXa8zHTDykpTe/6Nuk+DnI+orL9Y04lQ7vn2ZESYlEPBw5P re+cjztCWE8Qr5N0tApTntAsO9qDbnhP1ICOoqTM+ftWvd2FdARbsKheDfKlbbdxEWg9Qy6U 4WScdD4bPLYGSSxvyKhDVQW+xQp+Vv3prY49vj8w==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13/06/2023 7:40 am, Jan Beulich wrote:
> On 12.06.2023 20:25, Andrew Cooper wrote:
>> On 12/06/2023 4:46 pm, Jan Beulich wrote:
>>> On 05.06.2023 19:08, Alejandro Vallejo wrote:
>>>> @@ -878,5 +887,17 @@ int __init early_microcode_init(unsigned long 
>>>> *module_map,
>>>>      if ( ucode_mod.mod_end || ucode_blob.size )
>>>>          rc = early_microcode_update_cpu();
>>>>  
>>>> +    early_read_cpuid_7d0();
>>>> +
>>>> +    /*
>>>> +     * tsx_init() needs MSR_ARCH_CAPS, but it runs before identify_cpu()
>>>> +     * populates boot_cpu_data, so we read it here to centralize early
>>>> +     * CPUID/MSR reads in the same place.
>>>> +     */
>>>> +    if ( cpu_has_arch_caps )
>>>> +        rdmsr(MSR_ARCH_CAPABILITIES,
>>>> +              boot_cpu_data.x86_capability[FEATURESET_m10Al],
>>>> +              boot_cpu_data.x86_capability[FEATURESET_m10Ah]);
>>> ... "centralize" aspect goes away, and hence the comment needs adjusting.
>> I find it weird splitting apart the various reads into x86_capability[],
>> but in light of the feedback, only the rdmsr() needs to stay.
> Hmm, wait: When updating a CPU from a pre-arch-caps ucode level on one
> that supports arch-caps, don't we need to re-read 7d0 here? (I.e. the
> call to early_read_cpuid_7d0() needs to stay, but for a reason
> different from the one presently stated in the description, and
> possibly even worth a brief comment.)

Urgh yes.  We do have situations where this ucode load will cause
MSR_ARCH_CAPS (and features there-within) to appear.

I'll rethink the safety here when I've got some breathing room from
other tasks.

~Andrew



 


Rackspace

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