Re: [PATCH v3 1/3] vfio/pci: Extract duplicated code into macro

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

 



On Mon, 2024-04-29 at 19:33 -0300, Jason Gunthorpe wrote:
> On Mon, Apr 29, 2024 at 04:11:03PM -0600, Alex Williamson wrote:
> > > This isn't very performance optimal already, we take a lock on
> > > every
> > > iteration, so there isn't much point in inlining multiple copies
> > > of
> > > everything to save an branch.
> > 
> > These macros are to reduce duplicate code blocks and the errors
> > that typically come from such duplication, 
> 
> But there is still quite a bit of repetition here..

I appears like duplications, I agree - but the vfio_pci_core_ioreadX
and vfio_pci_core_iowriteX accessors are exported as such, or might be
reused by way of vfio_pci_iordwrX in vfio_pci_core_do_io_rw for
arbitrarily sized read/writes, too.

> > as well as to provide type safe functions in the spirit of the
> > ioread# and iowrite# helpers.
> 
> But it never really takes any advantage of type safety? It is making
> a memcpy..

At first, I was overwhelmed by the macro definitions, too. But after a
while I started to like the strict typing once the value came out of
memcpy or until it is memcpy'd.

> 
> Jason
> 






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux