Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Ard Biesheuvel <ardb+git@google.com>,
	linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Huacai Chen <chenhuacai@kernel.org>,
	loongarch@lists.linux.dev, linux-riscv@lists.infradead.org
Subject: Re: [PATCH v2 04/10] efi/libstub: Capture loaded image information in struct efi_image_info
Date: Fri, 13 Nov 2026 15:51:32 -0400	[thread overview]
Message-ID: <20261113195132.GA386258@nvidia.com> (raw)
In-Reply-To: <274609cc-2c17-4bde-bcf3-f309655f0594@app.fastmail.com>

On Fri, Nov 13, 2026 at 05:15:29PM +0100, Ard Biesheuvel wrote:
> 
> On Fri, 13 Nov 2026, at 16:10, Jason Gunthorpe wrote:
> > You could do the same by passing image_base and image_info everywhere,
> > but that seems less nice.
> >
> 
> I'd prefer to handle this by adding another offset, and an API to update
> it after moving the image. That way, the EFI stub code can still grab the
> info struct pointer without threading it through the API, while it will
> always remain valid.

I did draft threading it throughout the API and it was a net
improvement, IMHO. There wasn't much and it removed __weak function
shenanigans because info is always available and you can just always
jump to entry even for zboot.

But yeah, you can adjust the function to return the corrected version
too.

> > The code could consistently use the offset_to_ptr() macro if the label was
> > included in the macro?
> > 
> >   #define REL_REF(sym)	0: .long	sym - 0b
> >
> > It would make the efistub_kernel_ptr() simpler, and the three size
> > calculations would look like:
> >
> > 	return efistub_kernel_ptr(image_info, __inittext_end) - 
> > 	       efistub_kernel_ptr(image_info, _text);
> >
> 
> Again, probably cleaner to just refer to the copy of the struct once
> it exists.

Well, we need pointers, like for entry, so as long as there is some
way to get them that always works I'm fine.

Converting directly from image_info without the image_base argument
was convenient..

Jason


  reply	other threads:[~2026-11-13 19:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 12:17 [PATCH v2 00/10] efi: Expose loaded image properties via info struct Ard Biesheuvel
2026-11-10 12:17 ` [PATCH v2 01/10] efi/zboot: arm64: Add missing barrier after cache maintenance Ard Biesheuvel
2026-11-10 12:17 ` [PATCH v2 02/10] efi/riscv: Rename __init_text_end to __inittext_end like other archs Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 03/10] efi/libstub: Avoid _end section marker in library code Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 04/10] efi/libstub: Capture loaded image information in struct efi_image_info Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-13 16:15     ` Ard Biesheuvel
2026-11-13 19:51       ` Jason Gunthorpe [this message]
2026-11-10 12:17 ` [PATCH v2 05/10] efi/libstub: arm64: Use struct efi_image_info to access image properties Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 06/10] efi/libstub: loongarch: " Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 07/10] efi/libstub: riscv: " Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 08/10] efi/libstub: Make efi_remap_image() return efi_status_t Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 09/10] efi/zboot: Disentangle efi_remap_image() from efi_cache_sync_image() Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-10 12:17 ` [PATCH v2 10/10] efi/libstub: arm64: Drop zboot code_size hack Ard Biesheuvel
2026-11-13 15:10   ` Jason Gunthorpe
2026-11-13 15:10 ` [PATCH v2 00/10] efi: Expose loaded image properties via info struct Jason Gunthorpe

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=20261113195132.GA386258@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=ardb+git@google.com \
    --cc=ardb@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=loongarch@lists.linux.dev \
    --cc=palmer@dabbelt.com \
    --cc=pjw@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