Re: [PATCH kvm-unit-tests v6 11/14] pci: edu: introduce pci-edu helpers

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

 



On Thu, Nov 24, 2016 at 09:47:01AM +0100, Andrew Jones wrote:

[...]

> > +static inline uint64_t edu_reg_readq(struct pci_edu_dev *dev, int reg)
> > +{
> > +	return __raw_readq(edu_reg(dev, reg));
> > +}
> > +
> > +static inline uint32_t edu_reg_readl(struct pci_edu_dev *dev, int reg)
> > +{
> > +	return __raw_readl(edu_reg(dev, reg));
> > +}
> > +
> > +static inline void edu_reg_writeq(struct pci_edu_dev *dev, int reg,
> > +				  uint64_t val)
> > +{
> > +	__raw_writeq(val, edu_reg(dev, reg));
> > +}
> > +
> > +static inline void edu_reg_writel(struct pci_edu_dev *dev, int reg,
> > +				  uint32_t val)
> > +{
> > +	__raw_writel(val, edu_reg(dev, reg));
> > +}
> 
> Can you refresh my memory on why we're using __raw accessors here instead
> of the __raw wrappers that include barriers and endian conversion? Hmm,
> actually it doesn't look like the EDU device specifies an endianness...

I see that __raw wrappers (read[bwlq]) are assuming the data is little
endian, while edu device is configured as native endianess
(DEVICE_NATIVE_ENDIAN). So looks like using __raw accessors should be
the correct way?

But, yes here I missed memory barriers. I have only volatile
protections (which __raw_*() provides).

Thanks,

-- peterx
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux