On 2021/9/10 12:31, H. Peter Anvin wrote:
Note: the examples in this email all compiled with:
gcc -O2 -mpreferred-stack-boundary=3 -mcmodel=kernel
The disassembly has been slightly simplified.
Saving results in registers is non-flexible no matter in ASM or hack in C like this.
Saving CR3 in ist_regs is not different than saving rax in pt_regs, and both of
ist_regs and embedded pt_regs can be moved when stack is required to switch.
I prefer to my original design.