mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clayton Craft <clayton@craftyguy.net>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	linux-efi@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	regressions@lists.linux.dev
Subject: Re: x86_64 32-bit EFI mixed mode boot broken
Date: Fri, 22 Mar 2024 09:18:57 -0700	[thread overview]
Message-ID: <20240322091857.GM8211@craftyguy.net> (raw)
In-Reply-To: <CAMj1kXE-sxGM2H8akunJ1mZPDSVX1+2ehDtK-jqW--8tw9J5LA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1981 bytes --]

On Fri, 22 Mar 2024 13:52:05 +0100 Ard Biesheuvel <ardb@kernel.org> wrote:
> That depends on the bootloader. One of the changes around that time is
> the introduction of this Kconfig symbol: before that, the EFI handover
> protocol was always supported but now it can be compiled out. So the
> safe choice is to enable it.

I am using systemd-boot, and based on my understanding of its source it seems to
only use handover on old kernels that don't support LINUX_INITRD_MEDIA_GUID.
> 
> However, while looking more deeply into this, I noticed that we are
> running quite low own stack space. Mixed mode is different because it
> calls into the boot services using the decompressor's boot stack,
> rather than using the one that was provided by firmware at entry.
> (Note that the UEFI spec mandates 128k of stack space)
> 
> In my case, I bisected the regression to
> 
> commit 5c4feadb0011983bbc4587bc61056c7b379d9969 (HEAD)
> Author: Ard Biesheuvel <ardb@kernel.org>
> Date:   Mon Aug 7 18:27:16 2023 +0200
> 
>     x86/decompressor: Move global symbol references to C code
> 
> which moves the boot stack into a different memory region. Formerly,
> we'd end up at the far end of the heap when overrunning the stack but
> now, we end up crashing. Of course, overwriting the heap can cause
> problems of its own, so we'll need to bump this in any case.
> 
> Could you give this a try please?
> 
> 
> --- a/arch/x86/include/asm/boot.h
> +++ b/arch/x86/include/asm/boot.h
> @@ -38,7 +38,7 @@
>  #endif
> 
>  #ifdef CONFIG_X86_64
> -# define BOOT_STACK_SIZE       0x4000
> +# define BOOT_STACK_SIZE       0x10000
> 
>  /*
>   * Used by decompressor's startup_32() to allocate page tables for identity

Just gave this a try, on 6.1.82, and the system still reboots after selecting
the kernel in the bootloader. So it seems like my problem is different.

As I mentioned initially, I bisected my failure to e2ab9eab32. Does that give
any hint about what might be the problem?

-Clayton

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-03-22 16:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 22:05 Clayton Craft
2024-03-21 22:48 ` Ard Biesheuvel
2024-03-22  0:06   ` Clayton Craft
2024-03-22 12:52     ` Ard Biesheuvel
2024-03-22 16:18       ` Clayton Craft [this message]
2024-03-22 16:51         ` Ard Biesheuvel
2024-03-22 17:57           ` Clayton Craft
2024-03-22 18:30             ` Ard Biesheuvel
2024-03-22 19:34               ` Clayton Craft
2024-03-23 12:39                 ` Ard Biesheuvel
2024-03-23 17:18                   ` Ard Biesheuvel
2024-03-24  5:53                     ` Clayton Craft
2024-03-24 14:49   ` Hans de Goede
2024-03-24 17:43     ` Ard Biesheuvel
2024-03-24 20:45       ` Clayton Craft
2024-03-24 20:53         ` Ard Biesheuvel
2024-04-01 22:44           ` Clayton Craft
2024-04-02  6:25             ` Ard Biesheuvel

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=20240322091857.GM8211@craftyguy.net \
    --to=clayton@craftyguy.net \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=regressions@lists.linux.dev \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®