Re: [PATCH v7 2/9] x86/startup_64: Defer assignment of 5-level paging global variables

From: Ard Biesheuvel
Date: Sun Mar 03 2024 - 16:57:08 EST


On Sun, 3 Mar 2024 at 20:27, Borislav Petkov <bp@xxxxxxxxx> wrote:
>
..
>
> Btw, on a semi-related note, do you have an idea whether a normal guest
> kernel using OVMF istead of seabios would be even able to boot a kernel
> supplied with -kernel like above but without an -initrd?
>

How are you passing the root device to the kernel? Via root= on the
command line?

> I have everything builtin and the same kernel boots fine in a guest with
> a
> [ 0.000000] SMBIOS 3.0.0 present.
> [ 0.000000] DMI: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
>

OK, so this is SeaBIOS

> but if I try to boot the respective guest installed with the OVMF BIOS
> from the debian package:
>
> [ 0.000000] efi: EFI v2.7 by Debian distribution of EDK II
> [ 0.000000] efi: SMBIOS=0x7f788000 SMBIOS 3.0=0x7f786000 ACPI=0x7f97e000 ACPI 2.0=0x7f97e014 MEMATTR=0x7ddfe018
>

and this is OVMF.

I have tried both of these, with i440fx as well as q35, and they all
work happily with my Debian guest image passed via -hda to QEMU, and
with root=/dev/sda2 on the kernel command line.


> it fails looking up the /dev/root device major/minor deep in the bowels
> of the vfs:
>
> [ 2.565651] do_new_mount:
> [ 2.566380] vfs_get_tree: fc->root: 0000000000000000
> [ 2.567298] kern_path: filename: ffff88800d666000 of name: /dev/root
> [ 2.568418] kern_path: ret: 0
> [ 2.569009] lookup_bdev: kern_path(/dev/root, , path: ffff88800e537380), error: 0
> [ 2.571645] lookup_bdev: inode->i_rdev: 0x0
> [ 2.572417] get_tree_bdev: lookup_bdev(/dev/root, dev: 0x0), error: 0
> ^^^^^^^^^
>
> That dev_t should be 0x800002 - the major and minor of /dev/sda2 but it
> looks like something else is missing in this case...
>

How did you get this output? Are these debug printk()s you added yourself?