From: "Ard Biesheuvel" <ardb@kernel.org>
To: "Dave Young" <dyoung@redhat.com>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
kexec@lists.infradead.org, x86@kernel.org
Subject: Re: [PATCH] efi/x86-stub: store acpi_rsdp_addr in bootparams
Date: Thu, 19 Feb 2026 08:21:30 +0100 [thread overview]
Message-ID: <7c10262c-b320-4e80-b92b-107b693a928f@app.fastmail.com> (raw)
In-Reply-To: <CALu+AoRdx_=FFkFUcfwc8Z_7qmMbyC6Yf5AJA6PpTyDcjBS2Hw@mail.gmail.com>
On Thu, 19 Feb 2026, at 07:57, Dave Young wrote:
> Hi Ard,
>
>> Actually, looking at that code more closely, I kind of wonder why the kexec code tests for EFI_RUNTIME_SERVICES to begin with. Perhaps it might be sufficient to do this:
>>
>> diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
>> index c3244ac680d1..bec91ee7e668 100644
>> --- a/arch/x86/kernel/kexec-bzimage64.c
>> +++ b/arch/x86/kernel/kexec-bzimage64.c
>> @@ -192,7 +192,7 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
>> struct efi_info *current_ei = &boot_params.efi_info;
>> struct efi_info *ei = ¶ms->efi_info;
>>
>> - if (!efi_enabled(EFI_RUNTIME_SERVICES))
>> + if (!efi_enabled(EFI_MEMMAP))
>> return 0;
>>
>> if (!current_ei->efi_memmap_size)
>>
>> That way, if the first kernel was booted via EFI but without runtime services enabled, the kexec'ed kernel will simply inherit the ACPI and EFI tables.
>
> Actually it does not work, EFI_MEMMAP is unset in function
> efi_memmap_unmap() when runtime is disabled, so nodifference for
> checking EFI_MEMMAP or EFI_RUNTIME_SERVICES bits.
>
> The x86 kexec efi code is simply written to assume EFI runtime is
> enabled as it copies the cooked runtime service mem ranges in memmap.
> If we want to improve it I suspect the efi initialization code could
> need changes, and then even if first kernel disabled runtime, the
> kexec 2nd kernel still have chance to enter virtual mode to enable
> runtime. But this does requires more work to be done.
>
Yeah, fixing that seems a bit risky, and not really worth the reward.
next prev parent reply other threads:[~2026-02-19 7:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 8:04 [PATCH] efi/x86-stub: store acpi_rsdp_addr in bootparams Dave Young
2026-02-17 8:10 ` Ard Biesheuvel
2026-02-17 8:19 ` Dave Young
2026-02-17 9:20 ` Ard Biesheuvel
2026-02-17 10:01 ` Dave Young
2026-02-17 10:26 ` Ard Biesheuvel
2026-02-17 10:29 ` Dave Young
2026-02-17 18:14 ` Ard Biesheuvel
2026-02-19 6:57 ` Dave Young
2026-02-19 7:21 ` Ard Biesheuvel [this message]
2026-02-19 7:03 ` Dave Young
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=7c10262c-b320-4e80-b92b-107b693a928f@app.fastmail.com \
--to=ardb@kernel.org \
--cc=dyoung@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox