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

Re: [PATCH 1/3] x86/spec-ctrl: Split the "Hardware features" diagnostic line


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 24 Aug 2021 13:57:21 +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-SenderADCheck; bh=vfIztsSA0965LugMWS5sOkjcsyFGNv+KH37SLUbfpHs=; b=PjTAoHPqgufajcZoOk+AjAqksH2EQZsVEA6GBlFr964y3icSGsExAbFn9L4w5y2/vPT9NANEVES4Kww4ljGUK0jNoOc+fMHRI7TkfxIu4lJyxi+L+x8epcdN4+Z9u4CFuASuokjuY8uSRdbwesUeI08I/2ezoHKnTNkx9InHVuRh95d8i437XKKv2mabTgaZNFO1NDlb5q1p/791x+g7307Pq3ggjrmw5eCSxJ1I3AmgrkjOLdNdF/422NQEOUMLIC4FkxY4V3flsGaksX659eDZXOQUH62XPqQhVmwI98D+YrlFuLwvvIAOO5tajEKRWef1G9eluBBwS/OYBLaRhw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hcbrRDQgunZNjtne8HNIMURVxZD94hdEgIv3xSInek+ha3WioXmjOXgo9UHbYHYqHZ4tLEv6Pg5yDhOIaVWEJ3mwLYv5ELkCSHwNGfJssfRXp5WwNRBre9y6E7RaCv6iAjntDpfttWNpPJtQOmy5NVO90CtRNjFc5YFS/2CbYJaCsuYEQiwaDhcD0h/VH0JXKPo9//aDs3cO43HanFucYjCyzYto6+ED3qQac32rd0VP+2LOGwWdJlWktWhS48grcmZ++0e9iBr2Xp4ZvxY9TX1uNTf94tNf8EljUu0jAgzW/soFKjj939y3WbCKUty6JV7D4jbZHaJ+aE43sl+JDA==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 24 Aug 2021 12:57:43 +0000
  • Ironport-hdrordr: A9a23:foWmLa6AHOzlHtfIHwPXwDDXdLJyesId70hD6qkoc20wTiXqrb HIoB17726PtN9/YhEdcLy7VZVoBEmskKKdgrNhQItKPjOW21dARbsKhbcKgQeQeREWndQz6U 4USclD4arLY2SS4/yX3OC/KbwdKZK8gcaVbK/lvg5QZDAvUYFPqyp0FwqQDyRNLzWuK6BJbK a0945fvDyrdW4MYsn+DWlAU/nIptXNmp6OW298OyIa
  • Ironport-sdr: zCZD3ON66v5+P8vQBBjw7K1awh0fyBSEdYfPPZ7wxqLw31IipNsKaIUHi+ICR17go0AaciuZRQ g0qsMnswTF69NuVuouflm0jEIo7hDluUhA6HZLl99mz91TqhUf+V1qImZ/LbXBTXYHDCEGruLw Grdw2/q8Wbt3AC/Yi6NnGK3bPL0nOpUls5QCAeyK0Q1w71yaZkncsvTbdZAsf+K+4wuj77+41B oicenGx8hqqoSCFizT7R1r9qR05+4Vzym8dzRe2GhcZ3GlXGvgNtyTTQE5T9n49X9eHvlmAs35 TizK+JODTP1GFWQ933OIT63J
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/08/2021 15:38, Jan Beulich wrote:
> On 17.08.2021 16:30, Andrew Cooper wrote:
>> Separate the read-only hints from the features requiring active actions on
>> Xen's behalf.
>>
>> Also take the opportunity split the IBRS/IBPB and IBPB mess.  More features
>> with overlapping enumeration are on the way, and and it is not useful to 
>> split
>> them like this.
>>
>> No practical change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
Thanks.

> with a remark and a question:
>
>> --- a/xen/arch/x86/spec_ctrl.c
>> +++ b/xen/arch/x86/spec_ctrl.c
>> @@ -317,23 +317,30 @@ static void __init print_details(enum ind_thunk thunk, 
>> uint64_t caps)
>>  
>>      printk("Speculative mitigation facilities:\n");
>>  
>> -    /* Hardware features which pertain to speculative mitigations. */
>> -    printk("  Hardware features:%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
>> -           (_7d0 & cpufeat_mask(X86_FEATURE_IBRSB)) ? " IBRS/IBPB" : "",
>> -           (_7d0 & cpufeat_mask(X86_FEATURE_STIBP)) ? " STIBP"     : "",
>> -           (_7d0 & cpufeat_mask(X86_FEATURE_L1D_FLUSH)) ? " L1D_FLUSH" : "",
>> -           (_7d0 & cpufeat_mask(X86_FEATURE_SSBD))  ? " SSBD"      : "",
>> -           (_7d0 & cpufeat_mask(X86_FEATURE_MD_CLEAR)) ? " MD_CLEAR" : "",
>> -           (_7d0 & cpufeat_mask(X86_FEATURE_SRBDS_CTRL)) ? " SRBDS_CTRL" : 
>> "",
>> -           (e8b  & cpufeat_mask(X86_FEATURE_IBPB))  ? " IBPB"      : "",
>> -           (caps & ARCH_CAPS_IBRS_ALL)              ? " IBRS_ALL"  : "",
>> -           (caps & ARCH_CAPS_RDCL_NO)               ? " RDCL_NO"   : "",
>> -           (caps & ARCH_CAPS_RSBA)                  ? " RSBA"      : "",
>> -           (caps & ARCH_CAPS_SKIP_L1DFL)            ? " SKIP_L1DFL": "",
>> -           (caps & ARCH_CAPS_SSB_NO)                ? " SSB_NO"    : "",
>> -           (caps & ARCH_CAPS_MDS_NO)                ? " MDS_NO"    : "",
>> -           (caps & ARCH_CAPS_TSX_CTRL)              ? " TSX_CTRL"  : "",
>> -           (caps & ARCH_CAPS_TAA_NO)                ? " TAA_NO"    : "");
>> +    /*
>> +     * Hardware read-only information, stating immunity to certain issues, 
>> or
>> +     * suggestions of which mitigation to use.
>> +     */
>> +    printk("  Hardware hints:%s%s%s%s%s%s%s\n",
>> +           (caps & ARCH_CAPS_RDCL_NO)                        ? " RDCL_NO"   
>>      : "",
>> +           (caps & ARCH_CAPS_IBRS_ALL)                       ? " IBRS_ALL"  
>>      : "",
> I take it you flipped the order of these two to match the ordering
> of their bit numbers?

Yes.  IIRC, the first draft spec had the bits in the opposite order, and
I presumably forgot to flip the printk() when correcting msr-index.h

>  I'm slightly inclined to ask whether we
> wouldn't better stay with what we had, as I could imagine users
> having not sufficiently flexible text matching in place somewhere.
> But I'm not going to insist. It only occurred to me and is, unlike
> for the IBRS/IBPB re-arrangement of the other part, easily possible
> here.

dmesg is not and never can will be an ABI.

Amongst other things, `xl dmesg | grep` fails at boot on large systems
(because you keep on refusing to let in patches which bump the size of
the pre-dynamic console), or after sufficient uptime when the contents
has wrapped.

If you want an ABI, then it ought to be in xenhypfs or some other
hypercall, where the information is guaranteed to be available at any
point in time.

>> +           (caps & ARCH_CAPS_RSBA)                           ? " RSBA"      
>>      : "",
>> +           (caps & ARCH_CAPS_SKIP_L1DFL)                     ? " 
>> SKIP_L1DFL"     : "",
>> +           (caps & ARCH_CAPS_SSB_NO)                         ? " SSB_NO"    
>>      : "",
>> +           (caps & ARCH_CAPS_MDS_NO)                         ? " MDS_NO"    
>>      : "",
>> +           (caps & ARCH_CAPS_TAA_NO)                         ? " TAA_NO"    
>>      : "");
> I'm curious why we do not report IF_PSCHANGE_MC_NO here.

It isn't a speculative sidechannel vulnerability.

It is "error in the instruction fetch leads to a completely dead CPU",
and is reported in the EPT setup logic.

MSR_ARCH_CAPS really is just "misc CPUID bits" which were done in an MSR
because of microcode patch space.

~Andrew




 


Rackspace

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