More detail here would be great, especially using the terms "issue" and "commit" rather than execute.
A barrier makes sense to me, but preventing instructions from issuing seems like too hard of a requirement, how could anyone tell?
More detail here would be great, especially using the terms "issue" and "commit" rather than execute.
A barrier makes sense to me, but preventing instructions from issuing seems like too hard of a requirement, how could anyone tell?
But after spectre+meltdown mitigations landed it felt like the 1990s all over again where syscall overhead was a huge cost relative to the MIPS available.
For example, why bother saving userspace registers? Just zero them out to prevent leaks. Ideally with a single instruction.
If this were the case, you could perform SYSCALL in the shadow of a mispredicted branch, and then try to use it to leak data from privileged code.
When the machine encounters an instruction that changes privilege level, you need to validate that you're on a correct path before you start scheduling and executing instructions from another context. Otherwise, you might be creating a situation where instructions in userspace can speculatively influence instructions in the kernel (among probably many other things).
That's why you typically make things like this drain the pipeline - once all younger instructions have retired, you know that you're on a correct [not-predicted] path through the program.
edit: Also, here's a recent example[^1] of how tricky these things can be (where SYSCALL isn't even serializing enough to prevent effects in one privilege level from propagating to another)
[^1]: https://comsec.ethz.ch/wp-content/files/bprc_sec25.pdf
> some CPUs like those in the AMD 7000 series can actually give a worse performance if mitigations are turned off.
Due diligence!