RISC-V with Linux 6.7 Gains Optimized TLB Flushing, Software Shadow Call Stacks
phoronix.com
phoronix.com
I upvoted because I think it sounds important and cool but I have no clue what it means :-)
I'm not sure but I think shadow stack makes assumptions about how you use the ISA. For example, it's a completely legitimate program to just execute forward 10 million instructions, and use the stack pointer for other things. Or use another register. RISC-V made JAL take any register, but then no compiler that I've ever seen will use anything but RA. But it's also pretty harmless! What isn't an assumption is how Linux uses the stack, so we can at least say that it makes Linux more reliable.
Fun fact: Golang doesn't use GP as a global pointer to data. It doesn't even use the register, maybe to be compatible with C?
It gets worse when you consider that modern languages often depend on glibc too. Example: https://blog.rust-lang.org/2022/08/01/Increasing-glibc-kerne...
But, you can always go the golang route of depending on nothing but yourself. Then you get to decide!
Having said that, you can easily assign two registers as stack pointers (instead of the normal one) and decide to use one to save link registers and the other to store stack frames, so you could do this if you wanted (and with many other arches too, definitely Power and Arm would support this, although not x86).
Nothing in the ISA precludes this. It's all about the software stack, and what the compilers do. All you need to do is assign another register the role of data stack pointer and define the ABI to use it.
Even the stack pointer is just a convention in RISC V