News for hackers. Stuff that matters.
Re:Next steps for Rust in the kernel by kjeetgill on Wednesday September 21, 2022 @09:19AM (#32924762)
The cache hierarchy and speculative execution are completely hidden at the level of assembly too, so I'm not sure what you're getting at.
Re:Next steps for Rust in the kernel by Twisol on Wednesday September 21, 2022 @02:23PM (#32929128)
> The cache hierarchy [...] are completely hidden at the level of assembly too

A quick glance at Intel's Software Developer's Manuals [0] falsifies this:

>> TLB and Cacheability control: CLFLUSH, CLFLUSHOPT, CLWB, INVD, WBINVD, INVLPG, INVPCID, and memory instructions with a non-temporal hint (V/MOVNTDQA, V/MOVNTDQ, V/MOVNTI, V/MOVNTPD, V/MOVNTPS, V/MOVNTQ, V/MASKMOVQ, and V/MASKMOVDQU).

> [..] speculative execution are completely hidden at the level of assembly too

Section 18.1.13 specifically mentions side-channels for speculative execution, and there are more than 100 other matches for "speculative" across the document (some of which also refer to load barriers).

So no, these things are not completely hidden at the assembly level, and at least in the case of the (or one of the?) most popular consumer CPU architecture in the world, they are actively documented in the primary reference for an assembly programmer.

[0] https://www.intel.com/content/www/us/en/developer/articles/t...

Re:Next steps for Rust in the kernel by cbm-vic-20 on Wednesday September 21, 2022 @10:24AM (#32925572)
This is true even on later PDP-11 models with memory caches.
Re:Next steps for Rust in the kernel by packetlost on Wednesday September 21, 2022 @09:36AM (#32924956)
You're much more likely to get bitten by those 2 things at the ASM level... I guess.
Re:Next steps for Rust in the kernel by kjeetgill on Wednesday September 21, 2022 @09:42AM (#32925031)
So I don't work at that level, I'd love to hear more. What situations do they leak through in?
Re:Next steps for Rust in the kernel by packetlost on Wednesday September 21, 2022 @09:50AM (#32925137)
you'll mostly notice performance problems if you're not aware of cache lines when writing concurrent software, though it's relevant whenever you read from main memory. As for speculative execution, you probably won't really encounter issues related to that unless you go out of your way to. I don't believe it can actually cause problems in programs (though it is helpful for exfiltrating otherwise secret data).