[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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 Aug 2021 15:15:08 +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-SenderADCheck; bh=e8gRMcdCCI+LNKSDO/B/I0uUqDiS/hEIfeAjBsv9avE=; b=FBz7D7l8NlKtvXY4GqfnreYYcbvfCz+JEhQjN2GEEp5ZUs0rq8yA57HXd/Y/nj17rYun+fK5/aRDGcgP2C3pefDT+trNQofiGMXRh/8aJqarFepESj+Csoi6LCGGaTtiqSF7VDFuiUn19WTXtRpZTyppmvM0MhRzWWKNRpUe6akSYcKhKjCocYNk/NC8NH+TaqROfH3dn5+DjRd2+OwzN7+ohirMnsODpIKK8GQgUZoKqw0sCxld5Pi3YRaJWWqQKixDNAVF5pG1MtZt4Pb44wDxFhsqpsqMKIC4lbjvL01wEdxvfpR0/pA5KiDl+gN4HwQ6iGFuczgTa45SJfNKjg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RdFUS1WFedHHrriJ4bgtb6ubletEYnDggU0ArztnHJee+wKDTtKwGx2mX+ecKbgMs/gHaAkcp41GngB8fAkKJ0eLgrJqUvekzUY3u6OG0Hl24u6oszzDWMlNu9nxB5aRm1cK9SjEGHZbtcKvqF05jdCGiHtUOU1HsDOKrPVry4m2OTpaKkQ3aY9RU5jvWHFZCq3gq3jfyiegKw5xWHz9iuwvz9Tw8mnSp1YlZiUrRxbsF2PcooE+J21ElLANoQD+o5Ue+7dL2szOq1Pezl1N0HYxZCFvrZZ2OENTIllHjstrVNtBvgBP1M7LGznV4Bds3BM0GKODwtdbI73IRlescA==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; 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, 24 Aug 2021 13:15:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.08.2021 14:57, Andrew Cooper wrote:
> On 19/08/2021 15:38, Jan Beulich wrote:
>> On 17.08.2021 16:30, Andrew Cooper wrote:
>>> --- 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.

Well, sure, I understand this. I said "slightly" not because I would
use the log this way, but because I know of at least similar (ab)uses
of logs.

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

And instead I've taken the time to reduce boot time verbosity. Plus -
the last attempt must have been years ago. Given good enough arguments
and little enough undesirable (side) effects, I'm sure I could be
convinced. (But yes, especially the "good enough" aspect is definitely
pretty subjective. Yet then I could be easily outvoted if others agree
with the provided reasoning.)

> or after sufficient uptime when the contents has wrapped.

The boot log can easily be made persistent on disk before it can wrap.

Jan




 


Rackspace

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