Re: [PATCH 2/2] x86,entry: Use PUSH_AND_CLEAR_REGS for compat
From: Peter Zijlstra
Date: Wed Apr 20 2022 - 10:51:54 EST
On Wed, Apr 20, 2022 at 07:26:54AM -0700, Andy Lutomirski wrote:
>
>
> On Tue, Apr 19, 2022, at 1:41 PM, Peter Zijlstra wrote:
> > Since the upper regs don't exist for ia32 code, preserving them
> > doesn't hurt and it simplifies the code.
>
> They exist for compat code, though, and should be preserved for ABI
> purposes. Programs that do int $0x80 in 64-bit code do exist.
So this patch preserves semantics for int80, it changes things for
sysenter/syscall, those currently clear the high registers, whereas
after this patch they behave identical to int80.
So the earlier patch:
https://lkml.kernel.org/r/20220408223827.GR2731@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
preserves semantics across the board but is slightly more complicated.
And as argued elsewhere in thie thread; if preserving instead of
clearing the high regs is a valid attach surface, then int80 already
provides it, so I don't see how doing the same to sys* is any worse.