[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, 7 Sep 2021 15:29:13 +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; bh=E9qaqhkQxxacAGQ126F758E9SkuBmd5PlZ0+MFHQQXw=; b=J1+vnW1lZEcnDh7lOaMgxcjuiZ8/1oZrw4ScVKoSPftnoTxTkrignCQzlXYDNL5UY5Nr0txiQwiXjm+myw1TeEBhxBN+N5p0Icp5jfCTth0YdoEBLKnWBti5z4lmL/jlYEbRanJ5cQe75RausrJp9/h5run9PfSKFtH/jTW0/oTWaIxjW7kHNGqtIcoWAeRAJWW98aiJrRfKkcAWbng5YIM/yxMPDQgfX5tFYoocNw9HRUzpJMhhePuTAk8GU3g8cpuG8k39jkMnLBcEQyfKAk+c6vsHVqAk1yh4C9GFKygpeXQ6nHsa3k8Kf+mtcbADnByICZBM6iCqaC1HaI5TfQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2FAZXfta6HueaFIwDivZSRLlKn79/z9UJaRxDffmo4v20ClQkQ260H1LcfwUF0DK7ErXvMuF6cULkgZp4lSCYA0GtmjIrCaV98eYK5bFRsQ3eFjwkiv9cnYxY/6ocytfJJrKcEt3CoqJQEOZHBfMqgujmrky0p5IvUd3fFHvqKVbDnP4U+gro/Zi01bXusXcekZG/G4u0DjAi+/Td8Fw8R8sWZQQpfg8KT3yEqDl62zwdOeqNPM1vYUJyuaiuzEjq3wLm6t5PUQ6cQUuNT+PLdwYxjlDQSEcOz+XRt2/glbGa4/27LjSFesyDMRifffdxkwBmLEqDs1NvQnGFA2Ig==
  • Authentication-results: esa5.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, 07 Sep 2021 14:29:31 +0000
  • Ironport-hdrordr: A9a23:zQzsKqC7ICIJpFTlHeglsceALOsnbusQ8zAXPh9KJyC9I/b2qy nxppgmPH/P6Ar4WBkb6LS90dq7MA3hHPlOkPYs1NaZLXXbUQ6TTb2KgrGSuAEIdxeOkNK1kJ 0QDpSWa+eAfmSS7/yKmDVQeuxIqLLsndHK9IWuvUuFDzsaDJ2Ihz0JejpzeXcGPTWua6BJca Z0qvA33QZJLh8sH7WG7zQ+Lqf+juyOsKijTQ8NBhYh5gXLpTS06ITiGxzd+hsFSTtAzZor7G CAymXCl+SemsD+7iWZ+37Y7pxQltek4txfBPaUgsxQDjn3kA6naKloRrXHljEop+OE7kosjb D30lkdFvU2z0mUUnC+oBPr1QWl+DEy60X6wVvdunfnqdyRfkNxN+NxwaZiNjfJ4Uspu99xlI hR2XiCipZRBRTc2Azg+tnhTXhR5wiJiEtntdRWo21UUIMYZrMUh5cY5llpHJAJGz+/wJw7Ed NpENrX6J9tABCnhkjizy1SKeGXLzMO9k/seDlFhiXV6UkXoJlB9Tpc+CRF9U1wra7USPF/lq /52+pT5elzpmJ/V9MKOA47e7rCNoX6e2OFDIujGyWTKEg5AQO7l3fW2sR52Aj4Qu1F8HMN8K 6xGW+w81RCIH7TNQ==
  • Ironport-sdr: 5G8ZHOZDQ3UqttNSD/nRZIat0DCwuD8jlbOvjimFqOVhYrrHEuzc+DivD1AzVvCyeukkGzEz5P DS8sg3h8jVBnB+fWxASj0PB5PLcqpbNSLjlEWt9AKfMAb2E9ydNHGpndmO9VeSYx5lxJIteQbI pWhtVqRf1wlursJasycsPg5DNpb20RRDlSsgKa5bO5TGDGqnWvL8REC+cpX0Ob/HDcKrpWLStM A4aEY+e5EEv/hH0LpQUv7gZ4uwg1twkQx7XF9ZiVQnsv/UXMZsaUoFhUiugj0yBSHmC2TfOl3c 9okHltYbV+aigI0QcNG34S6o
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/08/2021 14:15, Jan Beulich wrote:
> 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.

Lots of details which are currently only available in `xl dmesg` should
be available via a real hypercall.

The domain creation improvement work is making headway with retrofitting
proper details to virt_caps/etc, but there is loads more data needing
exposing.

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

All failures we've had with customers are the fixed initdata buffer
wrapping before it gets dynamically allocated.  As a consequence, we
unilaterally up _CONRING_SIZE to 64k.

And yes - reducing the verbosity of the ACPI tables is a good thing, but
there's plenty more in need of shrinking.

~Andrew




 


Rackspace

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