From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Teddy Astie <teddy.astie@vates.tech>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] x86/hap: Inline "flush_vcpu" in "flush_tlb"
Date: Mon, 29 Sep 2025 16:06:52 +0200 [thread overview]
Message-ID: <aNqSfAW448rOMCW-@Mac.lan> (raw)
In-Reply-To: <bb570008f237cb77f2c74c5f025375ca6c4f140a.1759148418.git.teddy.astie@vates.tech>
On Mon, Sep 29, 2025 at 12:36:30PM +0000, Teddy Astie wrote:
> flush_vcpu static function here is only used in one place which is just below
> where it is defined. Inline the function to reduce the noise and clarify
> what we are doing.
Did you check that the compiler doesn't inline it already?
It seems like an obvious optimization for the compiler to do.
> No functional change.
>
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
> ---
> xen/arch/x86/mm/hap/hap.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
> index 2f69ff9c7b..407c80afab 100644
> --- a/xen/arch/x86/mm/hap/hap.c
> +++ b/xen/arch/x86/mm/hap/hap.c
> @@ -721,11 +721,6 @@ static pagetable_t cf_check hap_update_cr3(struct vcpu *v, bool noflush)
> return pagetable_null();
> }
>
> -static bool flush_vcpu(const struct vcpu *v, const unsigned long *vcpu_bitmap)
> -{
> - return !vcpu_bitmap || test_bit(v->vcpu_id, vcpu_bitmap);
The same construct is used in shadow code also, maybe it would be
helpful to place the flush_vcpu() helper in a common header as static
inline?
OTOH we don't care much for shadow, so it might be simpler to leave
shadow as-is and do the change just for HAP, but would be good to
mention in the commit message why shadow is not adjusted in the same
way.
Thanks, Roger.
next prev parent reply other threads:[~2025-09-29 14:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-29 12:36 [PATCH] x86/hap: Inline "flush_vcpu" in "flush_tlb" Teddy Astie
2025-09-29 14:06 ` Roger Pau Monné [this message]
2025-09-29 15:48 ` Teddy Astie
2025-09-29 19:39 ` Andrew Cooper
2025-09-30 12:11 ` Teddy Astie
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=aNqSfAW448rOMCW-@Mac.lan \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=teddy.astie@vates.tech \
--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.