mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: "H . Peter Anvin" <hpa@zytor.com>,
	"Ard Biesheuvel" <ardb+git@google.com>,
	x86@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org
Subject: Re: [PATCH] x86: Make the 64-bit bzImage always physically relocatable
Date: Wed, 18 Nov 2026 18:26:57 +0100	[thread overview]
Message-ID: <16b3f916-41cf-4ad6-bd54-45384051d4dc@app.fastmail.com> (raw)
In-Reply-To: <5E2684EC-0F34-4008-B043-F912FA1AAE6C@zytor.com>



On Wed, 18 Nov 2026, at 18:04, H. Peter Anvin wrote:
> On November 18, 2026 8:55:11 AM PST, Ard Biesheuvel <ardb@kernel.org> wrote:
>>
>>
>>On Wed, 18 Nov 2026, at 17:29, H. Peter Anvin wrote:
>>> On November 18, 2026 8:18:44 AM PST, Ard Biesheuvel <ardb@kernel.org> wrote:
>>>>
>>>>
>>>>On Wed, 18 Nov 2026, at 16:51, H. Peter Anvin wrote:
>>>>> On November 11, 2026 1:18:44 AM PST, Ard Biesheuvel <ardb+git@google.com> wrote:
>>>>>>From: Ard Biesheuvel <ardb@kernel.org>
>>>>>>
>>>>>>On x86_64, the physical placement of the kernel is independent from its
>>>>>>mapping in the 'High Kernel Mapping' range. This means that even a
>>>>>>position dependent kernel built without boot-time relocation support can
>>>>>>run from any suitably aligned physical address, and there is no need to
>>>>>>make this behavior dependent on whether or not the kernel is virtually
>>>>>>relocatable.
>>>>>>
>>>>>>On i386, the situation is different, given that the physical and virtual
>>>>>>load offsets must be equal, and so only a relocatable kernel can be
>>>>>>loaded at a physical address that deviates from its build-time default.
>>>>>>
>>>>>>Clarify this in Kconfig and in the code, and advertise the 64-bit
>>>>>>bzImage as loadable at any physical offset regardless of whether
>>>>>>CONFIG_RELOCATABLE is set. In practice, this makes little difference,
>>>>>>given that it defaults to 'y' and is a prerequisite for EFI_STUB and
>>>>>>RANDOMIZE_BASE, but it will help with some future refactoring of the
>>>>>>relocation code.
>>>>>>
>>>>>>Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
>>>>>>---
>>>>>> arch/x86/Kconfig                   | 40 ++++++++++++++++++------------
>>>>>> arch/x86/boot/compressed/head_64.S |  4 ---
>>>>>> arch/x86/boot/compressed/misc.c    |  8 +++---
>>>>>> arch/x86/boot/header.S             |  8 ++----
>>>>>> 4 files changed, 29 insertions(+), 31 deletions(-)
>>>>>>
>>...
>>> I'm going to vote NAK on this one... I was already thinking that it 
>>> would mess up low-level debugging too much,
>>
>>How so? The last time I proposed this, you replied that you were
>>planning to do this yourself.
>>
>>https://lore.kernel.org/all/3f2e8d7c-6029-49ef-8e31-a3eb5efb385b@zytor.com/
>>
>
> If we are going to get rid of it, we should get rid of it properly as 
> in removing the conditional machinery,

Which conditional machinery is that? All the code that reasons about the
physical load address needs to stay, the only thing I am changing here
is that you can no longer disable it on x86_64, as there is no upside to
forcing the 64-bit kernel to run from a fixed physical address. This
means the EFI stub no longer needs to depend on CONFIG_RELOCATABLE
(which also controls the generation for relocation data for virtual
displacement) for x86_64.

The i386 situation is different, but I left that alone on purpose.
Would you prefer it if that always became relocatable as well?

> not use it as a backdoor for 
> doing something explicitly NAKed (forcing PIC compilation.)
>

I know PIC compilation is a sensitive subject for some people, but
would you mind not framing this as some backhanded action on my part?

Once I get to resending that series, you will have ample opportunity
to voice your concerns and suggest workloads that will prove that
it is infeasible. Or even provide one now so that I won't have to
bother resending it in the first place.

> What you are proposing is literally the exact opposite.

I don't think so, but I'm still not sure what you meant by "it 
would mess up low-level debugging too much", so maybe you could
clarify that?


  reply	other threads:[~2026-11-18 17:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  9:18 Ard Biesheuvel
2026-11-18 11:23 ` Ard Biesheuvel
2026-11-18 15:51 ` H. Peter Anvin
2026-11-18 16:18   ` Ard Biesheuvel
2026-11-18 16:29     ` H. Peter Anvin
2026-11-18 16:55       ` Ard Biesheuvel
2026-11-18 17:04         ` H. Peter Anvin
2026-11-18 17:26           ` Ard Biesheuvel [this message]
2026-11-18 19:35             ` H. Peter Anvin

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=16b3f916-41cf-4ad6-bd54-45384051d4dc@app.fastmail.com \
    --to=ardb@kernel.org \
    --cc=ardb+git@google.com \
    --cc=hpa@zytor.com \
    --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

all inboxes | Powered by JetHome®