Re: [PATCH 17/24] x86/entry: Introduce struct ist_regs

From: H. Peter Anvin
Date: Fri Sep 10 2021 - 03:15:07 EST


On 9/10/21 12:13 AM, Lai Jiangshan wrote:


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.


I agree. I was having some issues following your arguments.

-hpa