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

Re: [PATCH v3 3/7] vpci: Use pervcpu ranges for BAR mapping


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 22 Apr 2026 16:20:41 +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=99OiKGDnxp4LBctIajbTg5YIo2P4crnt3EVyBBz3HMo=; b=sXtzLHZ05NspeuLJ3TBJ1e2ldD8NE0bgGW5HdGnQagaP77ebhI61PHMW+d2JJBz4Ib5EpwrgIiwmMljKb+ePdfz+E2hXKQkprlreEmn7BycAO1+y21/y31LS45AY+6glZhtjJzpJkz89wzAYclLVnWg7vQbbwF1VWgQAv4FsSL8ESMAi/HcQZPSmz8nwZkW3iCHCj9XIquwXYSB0e/h1W2SBDITeM/e2YgiNNlLmqoYLmWtSYawLyRU+WEIoTYvzh0mRW8ZmQd9YnUZatA3LsqKFH5up5nlp8WTm70ZXzIXjDLv4oNmSdEG5zt/SrZxF7Syl+WlAVe+e4icJZdyhSA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JMp9Pgpz6ecvM+2c9QzDLLI2dH/oqVDwFavNeTQYmCuYHu/vXZqsdhJvPCMKnusEJQwgw5QpNTV3MhjDgTKa6Adx4l7/th72SLi8CZyvSxNygQC+MbAWex6RNGdTBZsQJMVOigMD9LN/bS7Bxk7XX7+lEQTvTjUWaM93n7ud7JTZiNo7hU5gAGX0MO3KIaQSvzqiP2myVKfsnJT5TMcPnp7a0WwRSYxhHKMM50V1ja9km+JxaVus+Zujlfor4kfF8VFIOrJq+vcTn7NJlVYEyXsMrV59P2MT0xms1RpJykiZ04aUHA5Lp1XX3wJCMEVDJxFYtAWM+2Tda7ZR/EqFFQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Stewart Hildebrand <stewart.hildebrand@xxxxxxx>, Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Delivery-date: Wed, 22 Apr 2026 14:20:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Apr 22, 2026 at 02:04:59PM +0200, Jan Beulich wrote:
> On 22.04.2026 13:00, Roger Pau Monné wrote:
> > On Thu, Apr 09, 2026 at 02:01:33PM +0000, Mykyta Poturai wrote:
> >> @@ -412,14 +414,14 @@ int vpci_modify_bars(const struct pci_dev *pdev, 
> >> uint16_t cmd, bool rom_only)
> >>          unsigned long end = PFN_DOWN(vmsix_table_addr(pdev->vpci, i) +
> >>                                       vmsix_table_size(pdev->vpci, i) - 1);
> >>  
> >> -        for ( j = 0; j < ARRAY_SIZE(header->bars); j++ )
> >> +        for ( j = 0; j < ARRAY_SIZE(current->vpci.mem); j++ )
> > 
> > You make a non-trivial use of current in vpci_modify_bars(), maybe you
> > should consider introducing a local variable for it:
> > 
> > struct *vcpu curr = current;
> 
> Without any intention to negate this, ...
> 
> > current expands to a call to get_cpu_info(9, which is better to avoid
> > doing repeatedly, specially in the context above which is used as a
> > loop upper bound.
> 
> ... I'd like to point out that "current" isn't evaluated when used by
> ARRAY_SIZE() (resolving to two uses of sizeof()).

Oh indeed, this is just for getting the type.

Thanks, Roger.



 


Rackspace

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