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

Re: [PATCH 4/4] amd/virt_ssbd: add to max HVM policy when SSB_NO is available


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 12 Oct 2022 10:36:57 +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=vpCbc1UXGVDHC3hoW7/BwA8ZrprD1MAEJdnQ3iZsO/c=; b=lrB1IhHLRdB7G1Y3sLX/E5xDex3WSpmFtPBtONQQ1CjkkleAJ5sFD6RVSGkij4PxPoirOOYHRONpnTgPAPoNA1VnGmRtcqacAV2rmtu2huHNFwAkkRJ8sUZFUa6pZzbx4XK+RaXz7LZMq0zacM2wBhvRLPLzJ4+G7qLS0KfRsfqrxU4bQhcN6YPLrh61M/dexW766h50bkgR2FUXwSwkp+0CPHVPArkb9iazTxfvOFkgMhKIEvC0mQu5ibbDSWo5oSmAyeGNjkqw9Mv4a69CP16IIUlvePMHQnrX5ex/NYU7+/66LQfMsDt5+gMREZdEigZYBqnSF+FF13/1GwRw8A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eZ9wa3M42YxW+0Hn6jgMQw1GW+7dNdpDGOxUy7z6zgU+2slj3Aeocxb3eZWIQo29OLapeNAgkevuVGnYBfqKns78upFsGPnFXTJSFLuuUlun0luWOgDBMqUykEwncq/dTwxxldV2ImKAMTibu+YvTNqcv6LELihm85yvdg5fZFfsTlmZsV2sbDe+0CXFF4baP7ektSKOxYqnLQ956PgwmvhI7uyrxeIfm2Z+U/VLS2bKTiTqA9PWGwyQlr5dOe9W0qsTTV5+puy+wK4y8ZsiMQUr4W7hJsw7ogt5WKnLSaJEeoX4X4RdP5mSwJFhJUhRvvlUQY9QTd5oVnPpjRgxMQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Henry.Wang@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 12 Oct 2022 08:37:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.10.2022 18:02, Roger Pau Monne wrote:
> --- a/xen/arch/x86/cpu/amd.c
> +++ b/xen/arch/x86/cpu/amd.c
> @@ -814,7 +814,9 @@ void amd_set_ssbd(bool enable)
>               wrmsr(MSR_VIRT_SPEC_CTRL, enable ? SPEC_CTRL_SSBD : 0, 0);
>       else if ( amd_legacy_ssbd )
>               core_set_legacy_ssbd(enable);
> -     else
> +     else if ( cpu_has_ssb_no ) {

Nit: While already an issue in patch 1, it is actually the combination
of inner blanks and brace placement which made me spot the style issue
here.

> +             /* Nothing to do. */

How is the late placement here in line with ...

> --- a/xen/arch/x86/cpuid.c
> +++ b/xen/arch/x86/cpuid.c
> @@ -558,11 +558,16 @@ static void __init calculate_hvm_max_policy(void)
>          __clear_bit(X86_FEATURE_IBRSB, hvm_featureset);
>          __clear_bit(X86_FEATURE_IBRS, hvm_featureset);
>      }
> -    else if ( boot_cpu_has(X86_FEATURE_AMD_SSBD) )
> +    else if ( boot_cpu_has(X86_FEATURE_AMD_SSBD) ||
> +              boot_cpu_has(X86_FEATURE_SSB_NO) )
>          /*
>           * If SPEC_CTRL.SSBD is available VIRT_SPEC_CTRL.SSBD can be exposed
>           * and implemented using the former. Expose in the max policy only as
>           * the preference is for guests to use SPEC_CTRL.SSBD if available.
> +         *
> +         * Allow VIRT_SSBD in the max policy if SSB_NO is exposed for 
> migration
> +         * compatibility reasons.  If SSB_NO is present setting
> +         * VIRT_SPEC_CTRL.SSBD is a no-op.
>           */
>          __set_bit(X86_FEATURE_VIRT_SSBD, hvm_featureset);

... this comment addition talking about "no-op"?

Jan



 


Rackspace

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