lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250506155610.GS3339421@horms.kernel.org>
Date: Tue, 6 May 2025 16:56:10 +0100
From: Simon Horman <horms@...nel.org>
To: Larysa Zaremba <larysa.zaremba@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org,
	Tony Nguyen <anthony.l.nguyen@...el.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Jonathan Corbet <corbet@....net>,
	Przemek Kitszel <przemyslaw.kitszel@...el.com>,
	Jiri Pirko <jiri@...nulli.us>,
	Tatyana Nikolova <tatyana.e.nikolova@...el.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Alexander Lobakin <aleksander.lobakin@...el.com>,
	Michael Ellerman <mpe@...erman.id.au>,
	Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
	Lee Trager <lee@...ger.us>,
	Madhavan Srinivasan <maddy@...ux.ibm.com>,
	Sridhar Samudrala <sridhar.samudrala@...el.com>,
	Jacob Keller <jacob.e.keller@...el.com>,
	Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>,
	Mateusz Polchlopek <mateusz.polchlopek@...el.com>,
	Ahmed Zaki <ahmed.zaki@...el.com>, netdev@...r.kernel.org,
	linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
	"Karlsson, Magnus" <magnus.karlsson@...el.com>,
	Emil Tantilov <emil.s.tantilov@...el.com>,
	Madhu Chittim <madhu.chittim@...el.com>,
	Josh Hay <joshua.a.hay@...el.com>,
	Milena Olech <milena.olech@...el.com>, pavan.kumar.linga@...el.com,
	"Singhai, Anjali" <anjali.singhai@...el.com>,
	Phani R Burra <phani.r.burra@...el.com>
Subject: Re: [PATCH iwl-next v2 03/14] libie: add PCI device initialization
 helpers to libie

On Mon, May 05, 2025 at 08:56:18AM +0200, Larysa Zaremba wrote:
> On Mon, Apr 28, 2025 at 05:56:57PM +0100, Simon Horman wrote:
> > On Thu, Apr 24, 2025 at 01:32:26PM +0200, Larysa Zaremba wrote:
> > > From: Phani R Burra <phani.r.burra@...el.com>
> > > 
> > > Add memory related support functions for drivers to access MMIO space and
> > > allocate/free dma buffers.
> > > 
> > > Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
> > > Signed-off-by: Phani R Burra <phani.r.burra@...el.com>
> > > Co-developed-by: Victor Raj <victor.raj@...el.com>
> > > Signed-off-by: Victor Raj <victor.raj@...el.com>
> > > Co-developed-by: Sridhar Samudrala <sridhar.samudrala@...el.com>
> > > Signed-off-by: Sridhar Samudrala <sridhar.samudrala@...el.com>
> > > Co-developed-by: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
> > > Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
> > > Co-developed-by: Larysa Zaremba <larysa.zaremba@...el.com>
> > > Signed-off-by: Larysa Zaremba <larysa.zaremba@...el.com>
> > 
> > ...
> > 
> > > diff --git a/include/linux/intel/libie/pci.h b/include/linux/intel/libie/pci.h
> > 
> > ...
> > 
> > > +#define libie_pci_map_mmio_region(mmio_info, offset, size, ...)	\
> > > +	__libie_pci_map_mmio_region(mmio_info, offset, size,		\
> > > +				     COUNT_ARGS(__VA_ARGS__), ##__VA_ARGS__)
> > > +
> > > +#define libie_pci_get_mmio_addr(mmio_info, offset, ...)		\
> > > +	__libie_pci_get_mmio_addr(mmio_info, offset,			\
> > > +				   COUNT_ARGS(__VA_ARGS__), ##__VA_ARGS__)
> > 
> > Perhaps I'm missing something terribly obvious.  But it seems to me that
> > both libie_pci_map_mmio_region() and libie_pci_get_mmio_addr() are always
> > called with the same number of arguments in this patchset.
> 
> This is true.
> 
> > And if so,
> > perhaps the va_args handling would be best dropped.
> >
> 
> For now (but this will change), we do not map BAR indexes other than zero, 
> therefore it is the default less-argument variant, this looks nicer than adding 
> ', 0);'. Still, it does not feel right to hardcode the library function to use 
> BAR0 only, hence the variadic macro.

Thanks for the clarification. I would slightly lead towards adding
va_args support when it is needed. But I understand if you want
to stick with the approach that you have taken in this patch.

> 
> > > +
> > > +bool __libie_pci_map_mmio_region(struct libie_mmio_info *mmio_info,
> > > +				 resource_size_t offset, resource_size_t size,
> > > +				 int num_args, ...);
> > > +void __iomem *__libie_pci_get_mmio_addr(struct libie_mmio_info *mmio_info,
> > > +					resource_size_t region_offset,
> > > +					int num_args, ...);
> > > +void libie_pci_unmap_all_mmio_regions(struct libie_mmio_info *mmio_info);
> > > +int libie_pci_init_dev(struct pci_dev *pdev);
> > > +void libie_pci_deinit_dev(struct pci_dev *pdev);
> > > +
> > > +#endif /* __LIBIE_PCI_H */
> > > -- 
> > > 2.47.0
> > > 
> > 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ