All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Ard Biesheuvel <ardb@google.com>,
	linux-efi@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH] x86/boot: efistub: Assign global boot_params variable
Date: Tue, 17 Oct 2023 13:34:37 +0200	[thread overview]
Message-ID: <ZS5xTR/7jgUHZXb3@gmail.com> (raw)
In-Reply-To: <CAMj1kXFootPaQJTYTFoRWido1Fn_trmT2u42hdPOjP+=8D0H_g@mail.gmail.com>


* Ard Biesheuvel <ardb@kernel.org> wrote:

> On Mon, 16 Oct 2023 at 18:46, Ard Biesheuvel <ardb@google.com> wrote:
> >
> > From: Ard Biesheuvel <ardb@kernel.org>
> >
> > Now that the x86 EFI stub calls into some APIs exposed by the
> > decompressor (e.g., kaslr_get_random_long()), it is necessary to ensure
> > that the global boot_params variable is set correctly before doing so.
> >
> > Note that the decompressor and the kernel proper carry conflicting
> > declarations for the global variable 'boot_params' so refer to it via an
> > alias to work around this.
> >
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> > ---
> >  drivers/firmware/efi/libstub/x86-stub.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
> > index 3bfc59637dd1..51407207ded5 100644
> > --- a/drivers/firmware/efi/libstub/x86-stub.c
> > +++ b/drivers/firmware/efi/libstub/x86-stub.c
> > @@ -812,12 +812,15 @@ void __noreturn efi_stub_entry(efi_handle_t handle,
> >                                efi_system_table_t *sys_table_arg,
> >                                struct boot_params *boot_params)
> >  {
> > +       extern struct boot_params *bpp asm("boot_params");
> 
> I am getting hatemail from the bots about this extern declaration, so
> I will move that into x86-stub.h.

Hm, it would be better if we moved all of x86-stub.h into 
arch/x86/include/asm/ or so. We don't really encourage "deep" driver-level 
exports like that, and there's little reason why this couldn't be in the 
x86 headers, right?

> Unless anyone minds, I'll queue this up and send it to Linus myself
> via the EFI fixes branch.

Other than the above:

  Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

  reply	other threads:[~2023-10-17 11:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 16:46 [PATCH] x86/boot: efistub: Assign global boot_params variable Ard Biesheuvel
2023-10-17  6:57 ` Ard Biesheuvel
2023-10-17 11:34   ` Ingo Molnar [this message]
2023-10-17 11:38     ` Ard Biesheuvel
2023-10-17 13:06       ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZS5xTR/7jgUHZXb3@gmail.com \
    --to=mingo@kernel.org \
    --cc=ardb@google.com \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.