Re: [PATCH 2/3] x86_64: Define 128-bit memory-mapped I/O operations
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2012-08-22 04:42:42
On Tue, Aug 21, 2012 at 8:52 PM, Linus Torvalds [off-list ref] wrote:
I haven't seen the patch being discussed, or the rationale for it. But I doubt it makes sense to do 128-bit MMIO and expect any kind of atomicity things anyway, and I very much doubt that using SSE would make all that much sense. What's the background, and why would you want to do this crap?
Btw, for the 64-bit case, we did have ordering issues, and maybe some
128-bit model has similar ordering issues. Fine. You can't rely on
128-bit atomic accesses anyway on 99% of all hardware - either the CPU
itself cannot do it, or it's too damn inconvenient with XMM only
registers, or the bus itself is limited to 64 bits at a time anyway,
so the CPU or the IO interface would split such an access *anyway*.
So the whole concept of "we rely on atomic 128-bit MMIO accesses"
seems terminally broken. Any driver that thinks it needs that is just
crazy.
And those issues have nothing to do with x86 kernel_fpu_begin/end()
what-so-ever.
So judging by that, I would say that some driver writer needs to take
a few pills, clear up their head, and take another look at their life.
Tell them to look at
include/asm-generic/io-64-nonatomic-hi-lo.h
(and *-lo-hi.h) instead, and ponder the wisdom of just doing it that
way. Tell them to go f*ck themselves if they think they need XMM
registers. They are wrong, for one reason or another.
Linus