[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAFULd4ZAFuGMdkXz_Lu0vrQHQG4CSgaJzuGSdM0abPpNOO8cPg@mail.gmail.com>
Date: Thu, 7 Nov 2024 15:30:26 +0100
From: Uros Bizjak <ubizjak@...il.com>
To: Brian Gerst <brgerst@...il.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Ingo Molnar <mingo@...nel.org>, "H . Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, Ard Biesheuvel <ardb@...nel.org>, Juergen Gross <jgross@...e.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>, xen-devel@...ts.xenproject.org
Subject: Re: [PATCH v5 05/16] x86/pvh: Use fixed_percpu_data for early boot GSBASE
On Tue, Nov 5, 2024 at 4:58 PM Brian Gerst <brgerst@...il.com> wrote:
>
> Instead of having a private area for the stack canary, use
> fixed_percpu_data for GSBASE like the native kernel.
>
> Signed-off-by: Brian Gerst <brgerst@...il.com>
> ---
This patch looks like it could be submitted independently of the main
series and should include XEN maintainers (CC'd).
Uros.
> arch/x86/platform/pvh/head.S | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
> index 64fca49cd88f..b0a9a58952aa 100644
> --- a/arch/x86/platform/pvh/head.S
> +++ b/arch/x86/platform/pvh/head.S
> @@ -159,10 +159,15 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
> 1:
> UNWIND_HINT_END_OF_STACK
>
> - /* Set base address in stack canary descriptor. */
> - mov $MSR_GS_BASE,%ecx
> - leal canary(%rip), %eax
> - xor %edx, %edx
> + /*
> + * Set up GSBASE.
> + * Note that, on SMP, the boot cpu uses init data section until
> + * the per cpu areas are set up.
> + */
> + movl $MSR_GS_BASE,%ecx
> + leaq INIT_PER_CPU_VAR(fixed_percpu_data)(%rip), %rdx
> + movq %edx, %eax
> + shrq $32, %rdx
> wrmsr
>
> /*
> @@ -232,8 +237,6 @@ SYM_DATA_START_LOCAL(gdt_start)
> SYM_DATA_END_LABEL(gdt_start, SYM_L_LOCAL, gdt_end)
>
> .balign 16
> -SYM_DATA_LOCAL(canary, .fill 48, 1, 0)
> -
> SYM_DATA_START_LOCAL(early_stack)
> .fill BOOT_STACK_SIZE, 1, 0
> SYM_DATA_END_LABEL(early_stack, SYM_L_LOCAL, early_stack_end)
> --
> 2.47.0
>
Powered by blists - more mailing lists