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

Re: [PATCH] x86/cpu: Drop _init from *_cpu_cap functions


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 11 Aug 2022 12:59:33 +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=OBYO4Xg7bCVuAbhNPgj8vmzhgJWbAmx8JtTystD9Nzc=; b=NagZUnLUnKjsrZkFwkXSOM/igxPhYaOgEDABwGRFDpQ5dCjJReTV14DPu7shdYqVFPnVcpqCPY+PAeAYLY/VUq6R+HOXzVAPyN7UDzLkdehnmS/bgogQUbVBcNX/otLMFqZgu6we5cx2N9YrpIaKefqJjcx6uZH5sDGBDOIwt4wgyCVanZoYg3cTBE1MHmJQ5YKN+j1Vwi8m4C96ajsz2MInx+Sygkl6zejLTdTCHB9EBV1ANvWx3vnvQ1BSfV+P/4f3SoAP1zyng/88gNtB8QACN3u8NjFCLFTeeVfwgtyiTZib2h1fpbb5cYcPvaplNavSQ2HlrMhtXkrNLRxKCA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m0OQd+IYiycH0OjhyeZsVVNsXcwjt5WTUzuiIfcVcZ+Ok06kaFTXqrdXaBm8xPpd0wfTSVoRG2GNpze3IN4uaB/UucFARiyOyAhD5+lfh4K6ZNQOxQ2C9Ko72mIzJ705god5pIlUwZU65x/U1fB8OtSuDqldEHucE1z72ZniZtoXyVu0MzUpGuo7Cf7bqTirR3SsY6nnNc7dphmXS7o1g+I4sVmMO30UaA+mklgaYxvn/YiPrnXsRDoyFfzO9FZkPZghAcre/hLu0Eyo64yFrjzWh4O94E8hE75htIngiymEZ/RoHMWyNntc+Z8BqgTBdyme+yxKxv2Auii/my06TA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 10:59:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.08.2022 12:34, Andrew Cooper wrote:
> On 11/08/2022 11:30, Ross Lagerwall wrote:
>>> From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
>>> Sent: Thursday, August 11, 2022 11:21 AM
>>> To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>; 
>>> xen-devel@xxxxxxxxxxxxxxxxxxxx <xen-devel@xxxxxxxxxxxxxxxxxxxx>
>>> Cc: Jan Beulich <jbeulich@xxxxxxxx>; Roger Pau Monne 
>>> <roger.pau@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>
>>> Subject: Re: [PATCH] x86/cpu: Drop _init from *_cpu_cap functions 
>>>  
>>> On 11/08/2022 11:17, Ross Lagerwall wrote:
>>>> These functions may be called by init_amd() after the _init functions
>>>> have been purged during CPU hotplug or PV shim boot so drop the _init.
>>>>
>>>> Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
>>> Hmm.  That's a bug in init_amd() I'd say.  These really shouldn't be
>>> used after __init.
>>>
>>> Which path exploded specifically?
>> The stack trace was:
>>
>> setup_force_cpu_cap
>> init_amd
>> identify_cpu
>> start_secondary
>>
>> In setup_force_cpu_cap() here:
>>
>>         /*
>>          * On pre-CLFLUSHOPT AMD CPUs, CLFLUSH is weakly ordered with
>>          * everything, including reads and writes to address, and
>>          * LFENCE/SFENCE instructions.
>>          */
>>         if (!cpu_has_clflushopt)
>>                 setup_force_cpu_cap(X86_BUG_CLFLUSH_MFENCE);
>>
>> which was recently introduced by:
>>
>> commit 062868a5a8b428b85db589fa9a6d6e43969ffeb9
>> Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> Date:   Thu Jun 9 14:23:07 2022 +0200
>>
>>     x86/amd: Work around CLFLUSH ordering on older parts
> 
> Bah, and that was also backported in a security fix, to everything back
> to 4.12 is broken.

4.13, but yes. Oh well.

It's actually odd that we use __set_bit() for X86_FEATURE_MFENCE_RDTSC (a
few lines up) but the more heavyweight function for X86_BUG_CLFLUSH_MFENCE.

Jan



 


Rackspace

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