All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/2] x86/svm: Remove regs param from asm-called functions
Date: Fri, 12 Aug 2022 09:06:57 +0200	[thread overview]
Message-ID: <cc46a75d-e68e-c4de-edc6-ecfcd66859ac@suse.com> (raw)
In-Reply-To: <20220811195905.7780-2-andrew.cooper3@citrix.com>

On 11.08.2022 21:59, Andrew Cooper wrote:
> A optimisation is going to want to conditionally have extra data on the stack
> around VMExit.
> 
> We could alternative between `mov %rsp, %rdi` and `lea 8(%rsp), %rdi`, but it
> is easier just to make the functions void and let the compiler do the (not
> very) hard work.
> 
> Passing regs is a bit weird for HVM guests anyway, because the resulting
> pointer is invariant (this isn't native exception handling where the regs
> pointers *are* important), and all functions calculate `current` themselves
> which is another invariant.
> 
> Finally, the compiler can merge the get_cpu_info() calculation which is common
> to both `current` and guest_cpu_user_regs(), meaning the delta in C really is
> just one `lea`, and not any more expensive than `mov`'s in ASM anyway.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>



  reply	other threads:[~2022-08-12  7:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 19:59 [PATCH 0/2] x86/spec-ctrl: Reduce HVM RAS overhead Andrew Cooper
2022-08-11 19:59 ` [PATCH 1/2] x86/svm: Remove regs param from asm-called functions Andrew Cooper
2022-08-12  7:06   ` Jan Beulich [this message]
2022-08-11 19:59 ` [PATCH 2/2] x86/svm: Keep the RAS balanced for guests Andrew Cooper
2022-08-12  7:29   ` Jan Beulich
2022-08-12 10:04     ` Andrew Cooper

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=cc46a75d-e68e-c4de-edc6-ecfcd66859ac@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.