Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-18 Thread Matthew Macy
> > > > PowerPC barrier instructions are needed to prevent reordering. > > > > Correct. The current lkpi implementation also assumes that device > > endian == host endian. The Linux generic accessors will do use endian > > macros to byte swap where necessary. > > Yes, these functions are used to ac

Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-18 Thread Matthew Macy
Correct. This is just the generic case. We just need to define the __io macros as __compiler_membar in x86/io.h Cheers. -M On Sun, Nov 18, 2018 at 13:08 Tijl Coosemans wrote: > On Sun, 18 Nov 2018 12:10:25 -0800 Matthew Macy > wrote: > >> Note that these functions are normally used on uncacheab

Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-18 Thread Tijl Coosemans
On Sun, 18 Nov 2018 12:10:25 -0800 Matthew Macy wrote: >> Note that these functions are normally used on uncacheable memory which >> is strongly ordered on x86. There should be no reordering at all. On >> PowerPC barrier instructions are needed to prevent reordering. > > Correct. The current

Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-18 Thread Matthew Macy
> Note that these functions are normally used on uncacheable memory which > is strongly ordered on x86. There should be no reordering at all. On > PowerPC barrier instructions are needed to prevent reordering. Correct. The current lkpi implementation also assumes that device endian == host endia

Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-18 Thread Tijl Coosemans
On Sat, 17 Nov 2018 14:55:05 -0800 Matthew Macy wrote: > When looking at powerpc io.h raw and relaxed are not aliases, but it > appears that on x86, they are: > https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/io.h > > Sorry for the noise. But let's starting moving the x86 speci

Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-17 Thread Matthew Macy
When looking at powerpc io.h raw and relaxed are not aliases, but it appears that on x86, they are: https://github.com/torvalds/linux/blob/master/arch/x86/include/asm/io.h Sorry for the noise. But let's starting moving the x86 specific atomic.h and io.h under asm/x86. Thanks. On Sat, Nov 17, 2

Re: svn commit: r339618 - head/sys/compat/linuxkpi/common/include/linux

2018-11-17 Thread Matthew Macy
You should probably revert this. The implied understanding of the _relaxed version is incorrect. compiler_membar is there to prevent instruction reordering which is possible on FreeBSD because the accesses are done in C. The relaxed variants still do not permit instruction reordering. On Linux __co