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

Re: [PATCH] x86/hap: Inline "flush_vcpu" in "flush_tlb"


  • To: Teddy Astie <teddy.astie@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 29 Sep 2025 16:06:52 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Q1G4m2NgbWFk6y6iUxPeTGt/UefIoHwrKolFI+FVtUU=; b=WClPhGtOiSgUHn1+3i/ZG61notvZnmOMXtEWKqTuAbVii1keTwi1qFbfzBCdoHydyUILDeXWY98YZg+qCPQW9XMVb2xjYmCfJZiIyBiwOdKPj/jsvhuApP/vz4EyfoVGc1Z5322KbilCEdIJZ4bHaatZad3tI/q9bzPjFMI3BQzqvn1krtrifaxXEbMmZGIJrQGPK3wW746YEsxZYkbVJObFoMyuj1PixkyNDhYgdM1j+enP5TGr1F7MHChwM/Hn8EvY4q74EdlWO0KAX+ioF+w6Fyf7o9SO22eHU1qKA7taW5lw01mE5yQSwCbZ2AED/IdM0NlOUJ03CPaWl4ypQg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L5NQ3hovvNy4r7YEuBi1uhRpSzrrUBzKs/fGRuBNsv/x/uAGfyi2E68S7foDAgZttW9M1wll64rGheMx9XfAF/AFBgOTiqVELBYeRLS3CpprM4NCxdUlW/p471oB1XwuVZtXCSQk228jTSjogIPMMyc/D5UP2g4h7ipWk/zi2JM3xI8KMWW38+BxFG7E6DWXpmKtJTyp3INkHnyL/qanEbZ6TwPXUtkrlTUP7PghUrBID5nbtQigJjxWPyRSQazE8UkMFkDWuXI283FHyJVBWFKJGxOOGVLeFrtNTsYqkoLR4ZPSZWHgLZue72JBuEY0ZwyOWHJHdxhm+RdyEPlhAA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Mon, 29 Sep 2025 14:07:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxxx>
> ---
>  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.



 


Rackspace

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