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

Re: [PATCH 6/8] x86/spec-ctrl: Use common MSR_SPEC_CTRL logic for AMD


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 26 Jan 2022 18:05:18 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=D6xXIlZsR/EHC3KNSbZpEtND2Qqmdsanz5jGkPQWzr8=; b=Gl6boWEgoYVpFa01euQW4QNhgsD/rTAjzDRYm2mQe/pyWlpbV7xkmsMUu4WDRwY3emcAWIvGsB/CMmXZpLdFuDjrWXQxrKs3TE8By5DMvwfB/t4EO4HNAhKWp/3dRbKiksq7FjQeDDpUOlU4zdL7ZnEebFlAKL3KNcHNLuQ5+oKD5SY3ZafEecJHn3GkZxFRWIzsKdzLVLnw8dSM6ggQ2pbxFfHUM4FQIG5EhkIrLhL6z8b4mTNEk4hjSPGmfLoY80miLnmhMGGdRKHF/zqI8JJfPbyuEVi/G0rdjerJQ0EWLsr3xgeOPfxAYiPSM8+EuRTDoBgwwdTB1o7H5gqCGQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HEkm/s4/9mxRXgC59HaOltbLFWFeR7ZpudF0zHyL4R5zgwXq7/nsfUWanogOynUlkP74DS5sqxFErg0YIGHyRoTVLs12ZAzzB+YPibkWRCjysUOsIdGrz82UFKavNxLhu5G1/ORTwMAZgk0joD3zmdc5YhgaxTZdGxuCi1B/bO0U0XDhDSjt+rz7Nec5o+jj0w39kwoGkYJWLWKnXBhQFq2DCtbytw3X9xbi1cZMVDr/SAgrwfwbvYs0ypbW7GgDr93X1ZwXwF44rpnzG9W4ofRnyPoGc0uiUMZiwK2LA6M79w35XGLC18/U15nml5RFo4Hznc0E3Qevas5M2hHlsg==
  • Authentication-results: dkim=none (message not signed) header.d=none;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: Wed, 26 Jan 2022 17:05:32 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.01.2022 09:44, Andrew Cooper wrote:
> Currently, amd_init_ssbd() works by being the only write to MSR_SPEC_CTRL in
> the system.  This ceases to be true when using the common logic.
> 
> Include AMD MSR_SPEC_CTRL in has_spec_ctrl to activate the common paths, and
> introduce an AMD specific block to control alternatives.
> 
> For now, only configure alternatives for HVM.  PV will require more work.
> 
> This is a reasonably large change for low level defaults in the common case,
> but should have no practical change in behaviour.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

One nit:

> --- a/xen/arch/x86/cpu/amd.c
> @@ -1031,12 +1033,32 @@ void __init init_speculation_mitigations(void)
>          }
>      }
>  
> +    /* AMD hardware: MSR_SPEC_CTRL alternatives setup. */
> +    if ( boot_cpu_has(X86_FEATURE_IBRS) )
> +    {
> +        /*
> +         * Virtualising MSR_SPEC_CTRL for guests depends on SVM support, 
> which
> +         * on real hardware matches the availability of MSR_SPEC_CTRL in the
> +         * first place.
> +         *
> +         * No need for SCF_ist_wrmsr because, because Xen's value is restored
> +         * atomically WRT NMIs in the VMExit path.

There's one "because" too many here.

Jan




 


Rackspace

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