mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Dave Hansen <dave.hansen@intel.com>, Uros Bizjak <ubizjak@gmail.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH] x86/acrn: Improve ACRN hypercalls
Date: Mon, 8 Aug 2022 11:59:54 -0700	[thread overview]
Message-ID: <09d75b16-841b-0eaa-eff6-66673c7c019b@zytor.com> (raw)
In-Reply-To: <6c516a7c-ac97-e0b1-b056-06a17d1b7420@intel.com>

On August 4, 2022 12:03:56 PM PDT, Dave Hansen <dave.hansen@intel.com> 
wrote:
>On 8/4/22 11:56, Uros Bizjak wrote:
>> The %r8 is not preserved across function calls, so your statement
>> above is correct. But as long as there is no function call *between*
>> the variable definition and the assembly, the approach with the local
>> register variable works without any problems. It is even something GCC
>> itself has used in its library for years.
>
>I'm glad it's workout out for GCC.  But, the kernel is not GCC.  I
>specifically asked for the ACRN code to be the way that it is today and
>your argument is not making me reconsider it in the slightest.
>
>So, thanks for the patch, but I don't think we should apply it.

Well, this is universally used, so it isn't going to break. x86 is kind 
of unique in that it often doesn't need it, because it has predicates 
for so many of the specific registers, but even x86 needs it for 
inlining system calls in glibc, for example.

There is a way to do it right, which is to wrap the assignments (which 
don't have to be the declarations, but customarily are) and asm() 
statements in a block (e.g. an inline function, but can also just be a 
plain old statement block.)



  reply	other threads:[~2022-08-08 19:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 18:03 Uros Bizjak
2022-08-04 18:41 ` Dave Hansen
2022-08-04 18:56   ` Uros Bizjak
2022-08-04 19:03     ` Dave Hansen
2022-08-08 18:59       ` H. Peter Anvin [this message]
2022-08-04 18:52 ` Sean Christopherson
2022-08-04 19:05   ` Uros Bizjak

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=09d75b16-841b-0eaa-eff6-66673c7c019b@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /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®