mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Sean Christopherson' <seanjc@google.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Uros Bizjak <ubizjak@gmail.com>, Jakub Jelinek <jakub@redhat.com>,
	"Andrew Pinski (QUIC)" <quic_apinski@quicinc.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: RE: [PATCH] Kconfig: Explicitly disable asm goto w/ outputs on gcc-11 (and earlier)
Date: Sat, 10 Feb 2024 17:21:45 +0000	[thread overview]
Message-ID: <9ba89b70e48143a69f76f6e0f276f149@AcuMS.aculab.com> (raw)
In-Reply-To: <ZcadTKwaSvvywNA9@google.com>

From: Sean Christopherson
> Sent: 09 February 2024 21:47
> 
> On Fri, Feb 09, 2024, Linus Torvalds wrote:
> > Sean? Does this work for the case you noticed?
> 
> Yep.  You can quite literally see the effect of the asm("").  A "good" sequence
> directly propagates the result from the VMREAD's destination register to its
> final destination
> 
>   <+1756>:  mov    $0x280e,%r13d
>   <+1762>:  vmread %r13,%r13
>   <+1766>:  jbe    0x209fa <sync_vmcs02_to_vmcs12+1834>
>   <+1768>:  mov    %r13,0xe8(%rbx)
> 
> whereas the "bad" sequence bounces through a different register.
> 
>   <+1780>:  mov    $0x2810,%eax
>   <+1785>:  vmread %rax,%rax
>   <+1788>:  jbe    0x209e4 <sync_vmcs02_to_vmcs12+1812>
>   <+1790>:  mov    %rax,%r12
>   <+1793>:  mov    %r12,0xf0(%rbx)
...

Annoying, but I doubt it is measurable in this case.
Firstly it could easily be a 'free' register rename.
Secondly isn't vmread horribly slow anyway, so an extra
clock or two won't matter?

The double register move that OPTIMER_HIDE_VAR() often
generates is another matter entirely :-)
In the old days the peephole optimiser would (should?)
have removed most of these.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2024-02-10 17:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-08 22:06 Sean Christopherson
2024-02-09 17:03 ` Nick Desaulniers
2024-02-09 17:14   ` Andrew Pinski (QUIC)
2024-02-09 17:55     ` Linus Torvalds
2024-02-09 18:43       ` Sean Christopherson
2024-02-09 18:55         ` Nick Desaulniers
2024-02-09 19:01           ` Linus Torvalds
2024-02-09 19:20             ` Nick Desaulniers
2024-02-09 20:39             ` Linus Torvalds
2024-02-09 21:46               ` Sean Christopherson
2024-02-10 17:21                 ` David Laight [this message]
2024-02-11 11:12               ` Uros Bizjak
2024-02-11 19:59                 ` Linus Torvalds
2024-02-11 20:12                   ` Jakub Jelinek
2024-02-13  0:15                   ` Sean Christopherson
2024-02-14 17:20                     ` Sean Christopherson
2024-02-14 18:43                 ` Linus Torvalds
2024-02-15  0:11                   ` Linus Torvalds
2024-02-15  8:39                     ` Jakub Jelinek
2024-02-15 18:25                       ` Linus Torvalds
2024-02-15 19:17                         ` Linus Torvalds
2024-02-15 19:26                           ` Jakub Jelinek
2024-02-09 18:56         ` Linus Torvalds
2024-02-09 19:26           ` Andrew Pinski (QUIC)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9ba89b70e48143a69f76f6e0f276f149@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=jakub@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=quic_apinski@quicinc.com \
    --cc=seanjc@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®