On Wed, Jun 29, 2016 at 10:24:16AM +0200, Alexander Gordeev wrote: > On Mon, Jun 13, 2016 at 04:17:19PM +0200, Andrew Jones wrote: > > On Mon, Jun 13, 2016 at 04:03:53PM +0200, Paolo Bonzini wrote: > > > Are the barriers really necessary? I.e. why do we need > > > __raw_{read,write}* vs just {read,write}*. > > > > We could drop the wrappers, and require unit tests to use barriers > > explicitly, when needed. I'm OK with that, because I think I mostly > > forget that we have them in the wrappers and use them explicitly > > anyway... I'll need to double check all the uses though. > > According to my findings read*/write* io accessors are used on > ioremap-ed areas in lib/arm/io.c and lib/virtio-mmio.c at the moment. > > Even if read*/write* wrappers are stripped of SMP barriers, > removing compiler barriers from them would be a bad idea AFAICT. > > So if we need compiler barriers in read*/write* then why not > just leave SMP barriers there? Andrew, Paolo, I am paraphrasing myself. So read*/write* are used extensively by lib/virtio-mmio.c to access memory mapped registers. AFAICT we do want serialize accesses to devices and need barriers for that. The same applies to lib/pci-testdev.c when/if it accepted. > > Thanks, > > drew -- 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