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

Re: [PATCH v2 3/3] x86: Add support for AMD's Automatic IBRS


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 1 Jun 2023 12:35:16 +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=ffrw5v4J7yvFKFiJO2e4jw+fR9aRSKdWTfCUygVk6jk=; b=g0b39D8MVwnp296bhnXQk+Gxc5ggNbkJjTaQsOmmD2iCn4MVN+JL1wkt5MP24m2Ah7+SoWeYlHIFb/ShYpljjfWl3NtgVncVzHWBu17GJUN/qEutHYcTn7T6UqIzL1AI6YooyOcxQwPUFEcGiW9ayGWulsyIzFuQwmAsk5JbeJGzPGyUDRcVUw6PbNy1dIhsztXKCVv2KILZYGwhODLT9AyhfAJ7lWH+FX0kgnYfYCbx1/sakZqopYiKTCKIfvpp4byMPxx3AxKrmuAsECgcC9mAqkU0h42BEWlQtz7qvPR8K+Y7FSfciSTm2ZIKUwOq0M3HJ0ZUbD/KHUrTa6vX2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rxw8QdmVdRVlxrYA6OYOL65OB4kKaGvegHBAdyZYOYSN/98I6acWHbTDrQdJhvKppNmtfKk4XCW8S14xHtVCGNHIOCRkMy7nHE9yFha6kDqcFlC2yJtD5tFJMv4MJAAJjD5a33Dd31NJMlhV5zVYI1i+GbhTOMCbaNHXw8xD5TBe8s1D1XIjpxAC873vjmnVnXjvNfpAqG+KdXLjzZodph7kcjrNrDIcL09lIXfnCZ59I4mmf6+XCHfWpfnESlnjqx1LwbcEve/6dmKlLzRj/mXM3VU78o4LW89h2GNzXdX5fh9o/oksgAb/PlERpbbfm/fsIpSzLz8FpKtjVRZxAw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 01 Jun 2023 10:35:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 30.05.2023 15:58, Alejandro Vallejo wrote:
> @@ -1150,15 +1155,20 @@ void __init init_speculation_mitigations(void)
>      }
>      else
>      {
> -        /*
> -         * Evaluate the safest Branch Target Injection mitigations to use.
> -         * First, begin with compiler-aided mitigations.
> -         */

This is the only place where BTI is spelled out, so ...

> -        if ( IS_ENABLED(CONFIG_INDIRECT_THUNK) )
> +        /* Evaluate the safest BTI mitigations with lowest overhead */

... I'd like to ask that you replace the acronym here. Then
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> @@ -1357,7 +1367,9 @@ void __init init_speculation_mitigations(void)
>       */
>      if ( opt_rsb_hvm )
>      {
> -        setup_force_cpu_cap(X86_FEATURE_SC_RSB_HVM);
> +        /* Automatic IBRS wipes the RSB for us on VMEXIT */
> +        if ( !(ibrs && cpu_has_auto_ibrs) )
> +            setup_force_cpu_cap(X86_FEATURE_SC_RSB_HVM);

I'll need to remember to adjust "x86: limit issuing of IBPB during context
switch" once this change has gone in, as there's a use of the bit for
other than alternatives patching.

Jan



 


Rackspace

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