[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 13 Jun 2023 08:40:48 +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=M8rmfH8XWbpnCAIraSrFCNwK/fJUVmByhZJOTLmcmbw=; b=HBQEzZQnYCVeSuqklaDDcqbPuExlvLW3HGFVwCGj1sWlcrRPSlJZgy47iDlk88FHOR9EDxdscQV521EzrVOEbCRTrmpLo4zQoqKeSlv/ElvoGO3nalArAT74LC39YHIb/7t96uEds/CVfnjSYOZoGV6epH8/y3NCs8/JGlG3aeNs9+EkA8OYIzUkSCdClKPahETLEBpQJ2c7N6p/SxMnj4DaHLQ9qFtZw7dGhc5OjWMcf3Q+acvGTwEthG2LDBX5w3SwNt9fDDKRdq+fB8BgUCvAE4+aaOjJHXMOsOQuY0fOjMHKCR71klzJ4tVUMGDIDsvAqm09JWprqGbCPBKvvg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KZgnklRPt8D36LLGDkArjM+DiePgQLq8+Xbc/Oh96GEshJxAhicEzNT3wrZwM/Ca2p+13II0XI0cI9+R8L9g72QFOARwO5pfwBAykK1g0IcOotvQ2+4SBHep0FTBnlQthTPBNSOAt8ael9k2+fkDB+0BQlrrJ3q89In2L2CWvLrTPCS8a9VEeUsX90uEoh1fDkmX97/jIIbDSxy7BOq62wdJGxSr6hbagBobPX4+3Qjs+WGW3itTmzs02pRd3TAY0PYkAMkDrQkfqmvWgedf0DQPXn70birL0yfgWCw/p2gmm8ONQVQgGeJDK22ZTp2CmKpPp8nZuybF5CzViQAKOQ==
  • 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: Tue, 13 Jun 2023 06:41:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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

Jan



 


Rackspace

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