Re: [PATCH v6 01/21] x86/head_64: Store boot_params pointer in callee save register

From: Borislav Petkov
Date: Tue Jul 18 2023 - 07:40:11 EST


On Tue, Jul 11, 2023 at 11:14:33AM +0200, Ard Biesheuvel wrote:
> Instead of pushing/popping %RSI to/from the stack every time a function
> is called from startup_64(), store it in callee preserved register R15
> and grab it from there when its value is actually needed.
>
> Secondary boot does not and should not care about the value of %RSI at
> entry, and all the C handlers except the primary boot C entrypoint all
> ignore the function arguments entirely. Avoid inadvertent surprises by
> zeroing R15 on the secondary boot path explicitly.
>
> Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
> ---
> arch/x86/kernel/head_64.S | 23 +++++---------------
> 1 file changed, 5 insertions(+), 18 deletions(-)

LGTM.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette