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

Re: [PATCH 3/8] x86/spec-ctrl: Turn the remaining SPEC_CTRL_{ENTRY,EXIT}_* into asm macros


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 14 Sep 2023 09:20:49 +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=H1GIjyqJaHp0A1kx6eE6El+vsyXkNGFvUP0N1lEPVJk=; b=UCthDF/+cGF7+lPJ6fteHhsy+5Y5Z5MveeOJUCTWtQfp6K84Dw/VcZaDVKSwleRTqWzKElfoJHBByDqrBXUJCGBFoV7M+Oi3rYY7yRRFHkJ5hCkxurnn2ooJk/Ws7LMcaQVo6x3BVn/ime/ASvXBaTj6xzIngPP4XBEY/VrCTIadMqFAd20k8H/aCNbNn6qAVVbDyrI808dGpzu8Ih/jeQjSaGwK//QocLEJQeLz5aGbjRp9O12erqkfGI36RUdKIn34Ann1gQ/PB/JbFzTBn+OX7ubbuPhPlW5gywUtFQLLYzbthjlRrCH5xp8fGE2q+138rYFp0OYi85BNl3Q4mw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lNKH8y78FjDDf5MlKoJId4cyexHuBIomD6vEPTINwAU191X5u+vo5oULkxcA+rN95BWy5T6OJMl9Bzgug2MdYF+lbDDSR82Sr8iZytkLbbbF2XZ/ZNrDsTsB2hYmIVk0uE6qo6oAYrxv/k6xOiVcLKoo7iijA2Whpwbk9kvyG33N9D2Tk2Adt/hKJ/fuHGZamk5wUWauoZbbzWWaWCH0WoXu6pwhHuiKQ67M6sKlRey7I1ywWasNNGhRmeRvsVmnMpK5FHNGACIXS1CNe9rqTy5edT2RoAZ3a48oPKycIyVBtDvwUV9HjoIFYN/tyXoz4gPoHAR/L2fq6AnE0o6SSQ==
  • 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: Thu, 14 Sep 2023 07:20:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13.09.2023 22:27, Andrew Cooper wrote:
> These have grown more complex over time, with some already having been
> converted.
> 
> Provide full Requires/Clobbers comments, otherwise missing at this level of
> indirection.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

>  /* Use when exiting to PV guest context. */
> -#define SPEC_CTRL_EXIT_TO_PV                                            \
> -    ALTERNATIVE "",                                                     \
> -        DO_SPEC_CTRL_EXIT_TO_GUEST, X86_FEATURE_SC_MSR_PV;              \
> +.macro SPEC_CTRL_EXIT_TO_PV
> +/*
> + * Requires %rax=spec_ctrl, %rsp=regs/info
> + * Clobbers %rcx, %rdx
> + */
> +    ALTERNATIVE "", DO_SPEC_CTRL_EXIT_TO_GUEST, X86_FEATURE_SC_MSR_PV
> +
>      DO_SPEC_CTRL_COND_VERW
> +.endm
>  
>  /*
>   * Use in IST interrupt/exception context.  May interrupt Xen or PV context.

I'll need to carefully rebase "x86/spec-ctrl: add logic to issue IBPB on
exit to guest" over this change. In particular the use of __LINE__ there
(which probably you didn't really like anyway) won't work anymore. Yet
with just a single use of the macro per source file we ought to be able
to get away without this extra label disambiguation ...

Jan



 


Rackspace

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