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

Re: [PATCH v2 6/6] x86: limit amount of INT3 in IND_THUNK_*


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 13 Oct 2020 13:58:10 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 13 Oct 2020 12:58:25 +0000
  • Ironport-sdr: pTbrwNvhuBfjRIVIZxxhHSWkIGoabKGl/dsk/EUU2R9FhgXzrohcumz39k0/4BNs3iwtAthUyL TM8CXHFd73MwSPgLzSSFh5KF+lOv6IEH2CCfRABgefihzNqbaNeq/s3pPY/vvm0a/w9fbyKpna W4W4xVZthO5fYY86QwhrkYhrFuLHyJ3iOEuB3jxxn5NhKapRym6jSO+JuwilI0L00u6KMeItOp zl44A/1E8clD/s5euiAdUs8hdUZVnDtgq3FMubJ14Byp8VL9Tm8Of4F9zYCCIH6XhFPywmG/tU Aho=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28/09/2020 13:32, Jan Beulich wrote:
> There's no point having every replacement variant to also specify the
> INT3 - just have it once in the base macro. When patching, NOPs will get
> inserted, which are fine to speculate through (until reaching the INT3).
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> I also wonder whether the LFENCE in IND_THUNK_RETPOLINE couldn't be
> replaced by INT3 as well. Of course the effect will be marginal, as the
> size of the thunk will still be 16 bytes when including tail padding
> resulting from alignment.

There are surprising performance implications from the choice of
speculation blocker.  RSB filling in particular had a benefit (up to 6%
iirc) from unrolling the loop.

Any differences here are likely to be marginal, whereas for inline
retpoline, the code volume reduction might easily be the winning factor.

> ---
> v2: New.
>
> --- a/xen/arch/x86/indirect-thunk.S
> +++ b/xen/arch/x86/indirect-thunk.S
> @@ -11,6 +11,8 @@
>  
>  #include <asm/asm_defns.h>
>  
> +.purgem ret

This needs a comment.

~Andrew



 


Rackspace

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