All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert 9696846600ca ("multiboot: Prevent loading of x86_64 images")
@ 2026-08-29 17:50 Samuel Thibault
  2026-09-07 11:41 ` Samuel Thibault
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2026-08-29 17:50 UTC (permalink / raw)
  To: qemu-devel, adam, pbonzini, richard.henderson, mst; +Cc: Samuel Thibault

Loading x86_64 images in multiboot was disabled on the ground that since
multiboot actually boots 64bit kernels in 32bit mode, the binary would
have to be 32bit.

https://lists.gnu.org/archive/html/qemu-devel/2010-08/msg00913.html

But making the binary 32bit makes using debugging tools such as gdb
unnecessarily complex since they don't understand what architecture the
kernel actually is.  Letting qemu load x86_64 images and boot them in 32bit
mode is completely fine, works, and is what the multiboot standard actually
expects.

This notably fixes loading gnumach in x86_64 mode.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 hw/i386/multiboot.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
index d544b62afb..004d5185fb 100644
--- a/hw/i386/multiboot.c
+++ b/hw/i386/multiboot.c
@@ -196,11 +196,6 @@ int load_multiboot(X86MachineState *x86ms,
         int kernel_size;
         fclose(f);
 
-        if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
-            error_report("Cannot load x86-64 image, give a 32bit one.");
-            exit(1);
-        }
-
         kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
                                &elf_low, &elf_high, NULL,
                                ELFDATA2LSB, I386_ELF_MACHINE, 0, 0);
-- 
2.53.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert 9696846600ca ("multiboot: Prevent loading of x86_64 images")
  2026-08-29 17:50 [PATCH] Revert 9696846600ca ("multiboot: Prevent loading of x86_64 images") Samuel Thibault
@ 2026-09-07 11:41 ` Samuel Thibault
  2026-09-13 23:25   ` Samuel Thibault
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2026-09-07 11:41 UTC (permalink / raw)
  To: qemu-devel, adam, pbonzini, richard.henderson, mst

Hello,

Ping on this?

With regards,
Samuel

Samuel Thibault, le sam. 29 août 2026 19:50:47 +0200, a ecrit:
> Loading x86_64 images in multiboot was disabled on the ground that since
> multiboot actually boots 64bit kernels in 32bit mode, the binary would
> have to be 32bit.
> 
> https://lists.gnu.org/archive/html/qemu-devel/2010-08/msg00913.html
> 
> But making the binary 32bit makes using debugging tools such as gdb
> unnecessarily complex since they don't understand what architecture the
> kernel actually is.  Letting qemu load x86_64 images and boot them in 32bit
> mode is completely fine, works, and is what the multiboot standard actually
> expects.
> 
> This notably fixes loading gnumach in x86_64 mode.
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
>  hw/i386/multiboot.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
> index d544b62afb..004d5185fb 100644
> --- a/hw/i386/multiboot.c
> +++ b/hw/i386/multiboot.c
> @@ -196,11 +196,6 @@ int load_multiboot(X86MachineState *x86ms,
>          int kernel_size;
>          fclose(f);
>  
> -        if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
> -            error_report("Cannot load x86-64 image, give a 32bit one.");
> -            exit(1);
> -        }
> -
>          kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
>                                 &elf_low, &elf_high, NULL,
>                                 ELFDATA2LSB, I386_ELF_MACHINE, 0, 0);
> -- 
> 2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert 9696846600ca ("multiboot: Prevent loading of x86_64 images")
  2026-09-07 11:41 ` Samuel Thibault
@ 2026-09-13 23:25   ` Samuel Thibault
  2026-09-19 14:45     ` Samuel Thibault
  0 siblings, 1 reply; 4+ messages in thread
From: Samuel Thibault @ 2026-09-13 23:25 UTC (permalink / raw)
  To: qemu-devel, adam, pbonzini, richard.henderson, mst

Hello,

Any opinion on this?

With regards,
Samuel

Samuel Thibault, le lun. 07 sept. 2026 13:41:11 +0200, a ecrit:
> Hello,
> 
> Ping on this?
> 
> With regards,
> Samuel
> 
> Samuel Thibault, le sam. 29 août 2026 19:50:47 +0200, a ecrit:
> > Loading x86_64 images in multiboot was disabled on the ground that since
> > multiboot actually boots 64bit kernels in 32bit mode, the binary would
> > have to be 32bit.
> > 
> > https://lists.gnu.org/archive/html/qemu-devel/2010-08/msg00913.html
> > 
> > But making the binary 32bit makes using debugging tools such as gdb
> > unnecessarily complex since they don't understand what architecture the
> > kernel actually is.  Letting qemu load x86_64 images and boot them in 32bit
> > mode is completely fine, works, and is what the multiboot standard actually
> > expects.
> > 
> > This notably fixes loading gnumach in x86_64 mode.
> > 
> > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> > ---
> >  hw/i386/multiboot.c | 5 -----
> >  1 file changed, 5 deletions(-)
> > 
> > diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
> > index d544b62afb..004d5185fb 100644
> > --- a/hw/i386/multiboot.c
> > +++ b/hw/i386/multiboot.c
> > @@ -196,11 +196,6 @@ int load_multiboot(X86MachineState *x86ms,
> >          int kernel_size;
> >          fclose(f);
> >  
> > -        if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
> > -            error_report("Cannot load x86-64 image, give a 32bit one.");
> > -            exit(1);
> > -        }
> > -
> >          kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
> >                                 &elf_low, &elf_high, NULL,
> >                                 ELFDATA2LSB, I386_ELF_MACHINE, 0, 0);
> > -- 
> > 2.53.0

-- 
Samuel
Linux, c'est simple : ça s'adresse à une machine qui est parfois un peu
maraboutée mais qui d'habitude n'a pas d'états d'âme. Sur Usenet y'a
plein d'humains et de primates, et ça devient vraiment gore par moment.
-+- TP in : Guide du linuxien pervers - "Le linuxien a-t-il une âme ?" -+-


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert 9696846600ca ("multiboot: Prevent loading of x86_64 images")
  2026-09-13 23:25   ` Samuel Thibault
@ 2026-09-19 14:45     ` Samuel Thibault
  0 siblings, 0 replies; 4+ messages in thread
From: Samuel Thibault @ 2026-09-19 14:45 UTC (permalink / raw)
  To: qemu-devel, adam, pbonzini, richard.henderson, mst

Hello,

I am still waiting for feedback on this.

With regards,
Samuel

Samuel Thibault, le lun. 14 sept. 2026 01:25:30 +0200, a ecrit:
> Hello,
> 
> Any opinion on this?
> 
> With regards,
> Samuel
> 
> Samuel Thibault, le lun. 07 sept. 2026 13:41:11 +0200, a ecrit:
> > Hello,
> > 
> > Ping on this?
> > 
> > With regards,
> > Samuel
> > 
> > Samuel Thibault, le sam. 29 août 2026 19:50:47 +0200, a ecrit:
> > > Loading x86_64 images in multiboot was disabled on the ground that since
> > > multiboot actually boots 64bit kernels in 32bit mode, the binary would
> > > have to be 32bit.
> > > 
> > > https://lists.gnu.org/archive/html/qemu-devel/2010-08/msg00913.html
> > > 
> > > But making the binary 32bit makes using debugging tools such as gdb
> > > unnecessarily complex since they don't understand what architecture the
> > > kernel actually is.  Letting qemu load x86_64 images and boot them in 32bit
> > > mode is completely fine, works, and is what the multiboot standard actually
> > > expects.
> > > 
> > > This notably fixes loading gnumach in x86_64 mode.
> > > 
> > > Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> > > ---
> > >  hw/i386/multiboot.c | 5 -----
> > >  1 file changed, 5 deletions(-)
> > > 
> > > diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c
> > > index d544b62afb..004d5185fb 100644
> > > --- a/hw/i386/multiboot.c
> > > +++ b/hw/i386/multiboot.c
> > > @@ -196,11 +196,6 @@ int load_multiboot(X86MachineState *x86ms,
> > >          int kernel_size;
> > >          fclose(f);
> > >  
> > > -        if (((struct elf64_hdr*)header)->e_machine == EM_X86_64) {
> > > -            error_report("Cannot load x86-64 image, give a 32bit one.");
> > > -            exit(1);
> > > -        }
> > > -
> > >          kernel_size = load_elf(kernel_filename, NULL, NULL, NULL, &elf_entry,
> > >                                 &elf_low, &elf_high, NULL,
> > >                                 ELFDATA2LSB, I386_ELF_MACHINE, 0, 0);
> > > -- 
> > > 2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-19 14:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-29 17:50 [PATCH] Revert 9696846600ca ("multiboot: Prevent loading of x86_64 images") Samuel Thibault
2026-09-07 11:41 ` Samuel Thibault
2026-09-13 23:25   ` Samuel Thibault
2026-09-19 14:45     ` Samuel Thibault

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.