On Thu, Jul 02, 2026 at 11:27:36AM +0100, Simon Glass wrote:
> Hi Yao,
>
> On 2026-07-01T11:17:53, Yao Zi <[email protected]> wrote:
> > efi: LoongArch: Define LoongArch bits everywhere
> >
> > They are all coming from UEFI specification, PE-COFF specification,
> > or IANA websites.
> >
> > Signed-off-by: Jiaxun Yang <[email protected]>
> > Signed-off-by: Yao Zi <[email protected]>
> >
> > include/asm-generic/pe.h | 2 ++
> > include/config_distro_bootcmd.h | 5 +++++
> > include/pe.h | 1 +
> > lib/efi_loader/efi_helper.c | 4 ++++
> > lib/efi_loader/efi_image_loader.c | 7 +++++++
> > lib/efi_loader/efi_runtime.c | 4 ++++
> > lib/efi_selftest/efi_selftest_miniapp_exception.c | 3 +++
> > 7 files changed, 26 insertions(+)
>
> > They are all coming from UEFI specification, PE-COFF specification,
> > or IANA websites.
...
> > diff --git a/lib/efi_selftest/efi_selftest_miniapp_exception.c
> > b/lib/efi_selftest/efi_selftest_miniapp_exception.c
> > @@ -35,6 +35,9 @@ efi_status_t EFIAPI efi_main(efi_handle_t handle,
> > +#elif defined(CONFIG_LOONGARCH)
> > + /* ud 31 */
> > + asm volatile (".word 0x386007ff\n");
>
> The rest of the series keys off CONFIG_ARCH_LA64. Please pick one
> and use it consistently - otherwise a future LA32 build will
> trigger this ud but be missing all the other bits. Given Tom's
> suggestion on patch 6 to move to CONFIG_LOONGARCH, that is probably
> the way to unify it.
It's intended to use CONFIG_LOONGARCH instead of CONFIG_ARCH_LA64 here,
since this UD works for both LA32 and LA64. Could you please explain
what's wrong with having only this UD defined for the future LA32 port?
> > diff --git a/include/pe.h b/include/pe.h
> > @@ -194,6 +194,7 @@ typedef struct _IMAGE_RELOCATION
> > +#define IMAGE_REL_BASED_LOONGARCH64_MARK_LA 8 /* yes, 8 too */
>
> The PE-COFF spec also defines IMAGE_REL_BASED_LOONGARCH32_MARK_LA
> (=8). Since __loongarch_grlen == 32 is handled in efi_image_loader.c
> below, it would be tidier to add both here even if only the 64-bit
> one is wired up today.
Okay.
> Regards,
> Simon