See here for an account of how historically broken this stuff is on Linux and how the solutions are still prioritizing performance over getting it obviously safely right.https://lwn.net/Articles/786558/ …
-
-
You don't have to tell me about drivers fucking up IOMMU mappings. That's how we owned the PS4. The solution isn't forcing bounce buffers on everything, it's better software frameworks for getting this right without just dumbly copying data.
1 reply 0 retweets 3 likes -
If final destination is userspace you can't. Other data may be in same page. Based on the LWN summary I posted it looks like they're doing bounce buffer mappings only for first/last partial pages...
2 replies 0 retweets 0 likes -
Replying to @RichFelker @marcan42 and
I've seen well-written DPDK drivers that manage to do a decent job
1 reply 0 retweets 0 likes -
Replying to @HarperMitchell @RichFelker and
Maybe there's something more fundamental I'm missing or being obtuse about
1 reply 0 retweets 0 likes -
Replying to @HarperMitchell @RichFelker and
The only thing you need to do is make sure all your DMA allocations are page-aligned and that you never store control structures not intended for the hardware in them. Any mapped pages are treated as untrusted data subject to change at any time.
1 reply 0 retweets 3 likes -
Replying to @marcan42 @RichFelker and
Right, also I don't see how the user/kernelspace distinction is relevant
2 replies 0 retweets 0 likes -
Replying to @HarperMitchell @marcan42 and
Because the kernel can't control the alignment of buffers userspace passes to recv.
2 replies 0 retweets 0 likes -
Replying to @RichFelker @HarperMitchell and
Yes, you need to use bounce buffers for the first/last pages when that happens. That is expected. Userspace that wants performance needs to align.
1 reply 0 retweets 1 like -
Replying to @marcan42 @RichFelker and
There is a distinction here between e.g. standard socket APIs (you pretty much always need to copy anyway) and high performance stuff where userspace should know what it's doing. Same with graphics, ultimately GPU contexts can 1:1 map userspace contexts for stuff like games.
1 reply 0 retweets 1 like
(and this is how it's done for secure game consoles, by the way, which are optimized for security *and* GPU perf)
-
-
Replying to @marcan42 @RichFelker and
Also for cloud network adapters that use SRIOV
1 reply 0 retweets 0 likes -
Replying to @HarperMitchell @marcan42 and
Also optimized for both security and performance
1 reply 0 retweets 0 likes - Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.