Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging kernel 5.x kexec issues add tools to ease kernel version bumping #1351

Conversation

tlaurion
Copy link
Collaborator

This is just a tracing test in my attempt to narrow down the problem of why kexec'ing from 4.14 kernel works even though i915 driver is not provided in Tinycore boot of dd'ed iso (simplest test I found) where it just hangs when kexec'ing from 5.x.

As of now, this PR

  • adds i915drmfb into kexec patch to do equivalent of what was done for inteldrmfb (reuse vga)
    • reusing vga doesn't work. Why, not sure yet.
  • adds build statements into modules/linux to be able to copy to versioned olconfig, and from defconfig to olconfig and back and forth.
  • shows a lot of unneeded stuff that was removed in tested configs
  • Misses what is needed to work correctly

@tlaurion tlaurion marked this pull request as draft March 24, 2023 13:22
@tlaurion
Copy link
Collaborator Author

Some notes on top of my head on next steps.

  • See if entry point can be 32 bits (real-mode?)
  • See if vga=current cant be used (used by xen under kexec-boot, but uncertain if xen parameter or kernel (think its xen)
  • Check which mix was not tested in kexec options in comments of kexec-boot for elf kexectype
  • point this PR to linuxboot to seek for help

- config/linux-x230-[maximized,legacy,flash].config: real defconfig based on what was in tree without modifications
Added targets into modules/linux were used to generate oldconfigs for both 4.14.62 and 5.10.5, being then renamed to orig and mod along the way.
Goal of all of this is to
- Take defconfig format from 4.14.62 and remove unneeded compiled as modules but never packed (useless)
- Investigate comparable configs between librem_common and xx30
- Troubleshoot why in some case i915 not being provided in OS initrd is ok (xx30 on 4.14=ok vs t440p on 5.10 based on librem_common and librems)
  - That being outside coreboot iommu=on iommu_igfx=off passed from coreboot to Heads linux payload and with/without to OS
As of now, only really important differences observed between librem and xx30 are
- Some DRM addition for AST in librem and not required per xx30
- NVME addition in librem and not required per xx30
- Some additional processors support under librem that should not be there
- Some additional sched support where I do not see anything usefull more then PERFORMANCE driven scheduler
- SECURITY as base for SECURITYFS being activated but not being used
- compression algos supported but unused
- encryption compiled as modules but never packed
- Hardware Randomization sources as TPM and Intel processor should be enabled to augment entropy and reduce delay before usable in kernel (more work needed there)

This will be base for testing. Changes saved in oldconfoig format. Officially against defconfig format for github repo storage. Counterproductive.
kexec patch under tree takes into consideration that inteldrmfb hack added into kexec for 4.14 cannot apply anymore for 5.x
Those changes changes linux-qemu.config to remove all unneeded, and take into account general advises to have vgaarb, fbdev and simple fb, as well as needed gpu (where qemu requires virtio related drivers)

In all cases, kexec should be able to either be called reusing fb or resetting it.

At this point, sure kexec patch won do it.
That patch comes from older kexec, where nowadays it cannot be used as is.

Some more tools added into modules/linux
I mostly use:
linux.modify_defconfig (to use defconfig, call menuconfig on it and save back in place)
and
linux.generate_and_save-oldconfig (to save whatever defconfig or modified oldconfig file into olconfig file where linux config is expected to be found per board config)

Also kexec-boot was modified to add some additional kexec arguments in case of qemu usage, but nothing was successful, where traces are there to track what was attempted.
At this point, going back to x230 to attempt to tweak vga options, reusing cleaning that was done on linux-qemu.conf to be reused there

TODO:
- Check advancements on kexec. Something better should be possible.
 - note that xen, multiboot and other usecases are differenciated in kexec-boot, where xen reuses vga.
   - other situation then xen doesn't pass any other kexec option to deal with vga, other then inteldrmfb patch in kexec as of today, which works for 4.14 kernel jumping into others newer, but doesn work for 5.x jumping to others as of today.
Status
qemu coreboot config:
 +CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y momentarily

qemu linux config:
+CONFIG_X86_SYSFB=y seems to be requirement for non legacy VESA bringup, but seems to break Heads?!?
removal of vga 16
removal of vesa
leaving simplefb

NOTE: CONFIG_DRM_FBDEV_EMULATION is required and provides linux console support on top of modesetting driver

modules/linux/coreboot: add modify helpers to generate in place oldconfigs and defconfigs

WiP:
kexec-boot: modifying kexec passed boot options on qemu for Tinycore.
A bit confused on why kexec call just freezes there. Next time is investigating how to gdb into qemu for firmware, since we should have output on host console even if qemu is not able to get vga, and vga should be able to be reused from kexec call since:
user@heads-tests:/media/boot$ zcat core.gz | cpio -ivt | grep -e vga -e fb -e drm -e virt
lrwxrwxrwx   1 root     root           17 May  8  2022 usr/sbin/fbset -> ../../bin/busybox
drwxr-xr-x   3 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/virt
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/virt/lib
-rw-r--r--   1 root     root         1779 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/virt/lib/irqbypass.ko.gz
-rw-r--r--   1 root     root         4556 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/net/vmw_vsock/vmw_vsock_virtio_transport.ko.gz
-rw-r--r--   1 root     root         6898 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko.gz
drwxr-xr-x   3 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev
-rw-r--r--   1 root     root         9612 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/udlfb.ko.gz
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core
-rw-r--r--   1 root     root         2149 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/sysfillrect.ko.gz
-rw-r--r--   1 root     root         1274 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/fb_sys_fops.ko.gz
-rw-r--r--   1 root     root         1782 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/sysimgblt.ko.gz
-rw-r--r--   1 root     root         2268 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/syscopyarea.ko.gz
-rw-r--r--   1 root     root         7035 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/hyperv_fb.ko.gz
-rw-r--r--   1 root     root         3082 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/gpio/gpio-virtio.ko.gz
drwxr-xr-x   3 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/virt
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/virt/vboxguest
-rw-r--r--   1 root     root        12506 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virt/vboxguest/vboxguest.ko.gz
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/virtio
-rw-r--r--   1 root     root         8029 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_ring.ko.gz
-rw-r--r--   1 root     root         3847 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_pci_modern_dev.ko.gz
-rw-r--r--   1 root     root         3718 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio.ko.gz
-rw-r--r--   1 root     root         7084 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_pci.ko.gz
-rw-r--r--   1 root     root         3377 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_input.ko.gz
-rw-r--r--   1 root     root         6258 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_balloon.ko.gz
-rw-r--r--   1 root     root         1042 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_dma_buf.ko.gz
-rw-r--r--   1 root     root         3551 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_mmio.ko.gz
-rw-r--r--   1 root     root         6916 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/block/virtio_blk.ko.gz
-rw-r--r--   1 root     root        17961 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/net/virtio_net.ko.gz
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/crypto/virtio
-rw-r--r--   1 root     root         7020 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/crypto/virtio/virtio_crypto.ko.gz
-rw-r--r--   1 root     root         5924 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/iommu/virtio-iommu.ko.gz
-rw-r--r--   1 root     root        10007 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/char/virtio_console.ko.gz

Last line is virtio_console that qemu is using.... So no clue at this point
@tlaurion tlaurion force-pushed the debugging_kernel_5.x_kexec_issues-add_tools_to_ease_kernel_version_bumping branch from a9ec050 to 6459416 Compare March 30, 2023 20:14
@tlaurion
Copy link
Collaborator Author

As usual, the universe works in weird ways and other people are trying to understand how things work at the same time.
Wrote an answer on Qubes forum with what is known as of now at https://forum.qubes-os.org/t/how-to-kexec-into-qubes-from-linux-livecd/17712/6?u=insurgo

Added debug capabilities inside of KERNEL_ADD in board config, also specifying ttys0 serial speed of 115200, which works now.
Added debugging through kexec -d call as well if DEBUG output activated in board config

Now Tinycore stalls at ethernet init, loop is established and resized multiple times, so it seems that tinycore has what he was searching for to prepare normal boot options in memory.
Investigating vga options and will output some info on PR
@tlaurion tlaurion force-pushed the debugging_kernel_5.x_kexec_issues-add_tools_to_ease_kernel_version_bumping branch from 79a8b0a to a39d71c Compare March 31, 2023 15:32
qemu-coreboot: readd linear framebuffer
qemu-linux:
-add firmware options to try to help kexec
-remove low and legacy fb options to only leave simple fb
kexec-boot:
-go back to only use --console-vga, but kexec -d debug is not showing anything interesting when booting tinycore
 - TINYCORE SHOULD BOOT WITH SIMPLE FB BUT DOESN'T
modules/kexec: passed to latest (2.0.26)
patches/kexec 2.0.22 patch copied over for 2.0.26 without changes
@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 5, 2023

linuxboot working Google docs to continue kexec issues digging and collaboration https://docs.google.com/document/d/15D0xImlLwvqqHk8QoaVyl918-RkDojo3mxCeknWW5OE/edit?usp=sharing

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 5, 2023

Seems like expected to work solution might be to use 32 bit entry point of second kernel when graphics are involved (all heads use cases, all providing DRM+GPU drivers in kernel as today). Hopefully, BIOS involvement here would make it work, but still unknown why this would work... (As opposed to linuxboot on x86, we do not rely on efi, not even on libgfxinit in most cases... What BIOS calls are involved?)

kexec --entry-32bit 

https://github.com/horms/kexec-tools/blob/806711fca9e9d52a677bf090565c32c858f2b12e/kexec/arch/i386/include/arch/options.h#L80


Also.... Let's try to get rid of libgfxinit (and gnat madness) as a test for all those willing to push this forward.

Without gnat dependency, nixos would be near grasp and consequently, reproducible builds could finally be possible and not so hard to accomplish and maintain.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 5, 2023

Knowledge on related concerns seem to have made its way through webboot commits already in the past:

One of them is the following (old, talking about kernel 4.x), touching kernel graphics requirements and kexec (commit log is pretty instructing on how kernel 16->32 bits -> 64 bits works). THIS IS EXACTLY OUR ISSUE HERE:
u-root/webboot@ac6873c

The other was about setting up kexec to enter kernel through 32 bit entry point to respect kernel asking BIOS for its config:
u-root/webboot@dfc1429

@saper
Copy link
Contributor

saper commented Apr 5, 2023

This could also be a reason why tinycorelinux does not see the /dev/sd* disks (if the information is expected to come from BIOS) - just theorizing here

tlaurion added a commit to tlaurion/heads that referenced this pull request Apr 5, 2023
…blob/78c6cf99a32d82b106cc373280df9512d6e25131/config-5.6.14, minus deactivating all uneeded network drivers but intel ones for Q35.

Changes of kexec-boot to pass 32 bit entry point + noefi is based on understanding of below comments.

Keeping traces of testings traces

--
From linuxboot#1351 (comment)

Knowledge on related concerns seem to have made its way through webboot commits already in the past:

One of them is the following (old, talking about kernel 4.x), touching kernel graphics requirements and kexec (commit log is pretty instructing on how kernel 16->32 bits -> 64 bits works). THIS IS EXACTLY OUR ISSUE HERE:
u-root/webboot@ac6873c

The other was about setting up kexec to enter kernel through 32 bit entry point to respect kernel asking BIOS for its config:
u-root/webboot@dfc1429
…blob/78c6cf99a32d82b106cc373280df9512d6e25131/config-5.6.14, minus deactivating all uneeded network drivers but intel ones for Q35.

This was accomplished by using added linux module build statement, which was called through:
make BOARD=qemu-coreboot-whiptail-tpm1 linux.modify_and_save_oldconfig_in_place

Changes of kexec-boot to pass 32 bit entry point + noefi is based on understanding of below comments.

Keeping traces of testings traces

--
From linuxboot#1351 (comment)

Knowledge on related concerns seem to have made its way through webboot commits already in the past:

One of them is the following (old, talking about kernel 4.x), touching kernel graphics requirements and kexec (commit log is pretty instructing on how kernel 16->32 bits -> 64 bits works). THIS IS EXACTLY OUR ISSUE HERE:
u-root/webboot@ac6873c

The other was about setting up kexec to enter kernel through 32 bit entry point to respect kernel asking BIOS for its config:
u-root/webboot@dfc1429
@tlaurion tlaurion force-pushed the debugging_kernel_5.x_kexec_issues-add_tools_to_ease_kernel_version_bumping branch from 514a67d to f1edf70 Compare April 5, 2023 16:11
…ake exposed compiler

linux-qemu.config: have oldconfig format output exposed used compiler
@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 5, 2023

This could also be a reason why tinycorelinux does not see the /dev/sd* disks (if the information is expected to come from BIOS) - just theorizing here

No, those are static files coming from the initrd which you can see by exposing cpio content.
The kernel actually discovers the drives correctly.

I am not testing Tinycore on real hardware for the moment, trying to get qemu par with Heads 4.x kernel and simply using tinycore since what they pack there is really really limited.

As exposed off channel:

user@heads-tests:/media/boot$ zcat core.gz | cpio -ivt | grep -e vga -e fb -e drm -e virt
lrwxrwxrwx   1 root     root           17 May  8  2022 usr/sbin/fbset -> ../../bin/busybox
drwxr-xr-x   3 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/virt
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/virt/lib
-rw-r--r--   1 root     root         1779 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/virt/lib/irqbypass.ko.gz
-rw-r--r--   1 root     root         4556 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/net/vmw_vsock/vmw_vsock_virtio_transport.ko.gz
-rw-r--r--   1 root     root         6898 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/net/vmw_vsock/vmw_vsock_virtio_transport_common.ko.gz
drwxr-xr-x   3 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev
-rw-r--r--   1 root     root         9612 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/udlfb.ko.gz
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core
-rw-r--r--   1 root     root         2149 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/sysfillrect.ko.gz
-rw-r--r--   1 root     root         1274 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/fb_sys_fops.ko.gz
-rw-r--r--   1 root     root         1782 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/sysimgblt.ko.gz
-rw-r--r--   1 root     root         2268 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/core/syscopyarea.ko.gz
-rw-r--r--   1 root     root         7035 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/video/fbdev/hyperv_fb.ko.gz
-rw-r--r--   1 root     root         3082 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/gpio/gpio-virtio.ko.gz
drwxr-xr-x   3 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/virt
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/virt/vboxguest
-rw-r--r--   1 root     root        12506 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virt/vboxguest/vboxguest.ko.gz
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/virtio
-rw-r--r--   1 root     root         8029 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_ring.ko.gz
-rw-r--r--   1 root     root         3847 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_pci_modern_dev.ko.gz
-rw-r--r--   1 root     root         3718 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio.ko.gz
-rw-r--r--   1 root     root         7084 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_pci.ko.gz
-rw-r--r--   1 root     root         3377 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_input.ko.gz
-rw-r--r--   1 root     root         6258 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_balloon.ko.gz
-rw-r--r--   1 root     root         1042 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_dma_buf.ko.gz
-rw-r--r--   1 root     root         3551 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/virtio/virtio_mmio.ko.gz
-rw-r--r--   1 root     root         6916 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/block/virtio_blk.ko.gz
-rw-r--r--   1 root     root        17961 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/net/virtio_net.ko.gz
drwxr-xr-x   2 root     root            0 May  8  2022 lib/modules/5.15.10-tinycore/kernel/drivers/crypto/virtio
-rw-r--r--   1 root     root         7020 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/crypto/virtio/virtio_crypto.ko.gz
-rw-r--r--   1 root     root         5924 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/iommu/virtio-iommu.ko.gz
-rw-r--r--   1 root     root        10007 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/char/virtio_console.ko.gz
-rw-r--r--   1 root     root         1988 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/drivers/char/hw_random/virtio-rng.ko.gz
-rw-r--r--   1 root     root         7281 Dec 21  2021 lib/modules/5.15.10-tinycore/kernel/fs/fuse/virtiofs.ko.gz
crw--w--w-   1 root     staff     29,   0 May  8  2022 dev/fb0

Doing a savage comparison here between your expectation of having real /dev/sd* devices, but the point is that Tinycore exposed /dev/fb0 in the initrd, right? The initrd decompressed ramfs which then becomes / "thinks" that a fb0 exists, but the truth is, under qemu, that none does.

So is the same thing for /dev/sd* drives. And the drives that qemu exposed through drivers, but for whatever reasons, do not update /dev

Seems like Tinycore decides to not include devfs or does not map it correctly through /etc/fstab or whatever whatever, I have not digged into that. Simply using Tinycore as an exemple of an initrd which is supposed to switch from kexec'ed non efi, 32 bit entry point, discovere vga from exposed tables from bios, ninitialized vgaarb on fbcon (not happening) and then have simple fb discover, and use found vga adapter (not happening) to take over vgaarb tor simple fb driver. But that is not happening.

My next step is to ditch tinycore for testing and build kernel myself there. Something weird is happening with Tinycore, on top of weird stuff being investigated. Seems like using Tinycore as test is not good test plan.

Savagely disabling stuff, not interested in fixing Kconfig dependencies, just want ta working test case here...

Otherwise:
tail /home/user/heads/build/x86/log/linux.log
-----
  CC      net/mac80211/chan.o
  CC      net/mac80211/trace.o
  CC      net/mac80211/mlme.o
  CC      net/mac80211/tdls.o
  CC      net/mac80211/ocb.o
  CC      net/mac80211/airtime.o
  CC      net/mac80211/led.o
  CC      net/mac80211/debugfs.o
  CC      net/mac80211/debugfs_sta.o
  CC      net/mac80211/debugfs_netdev.o
  CC      net/mac80211/debugfs_key.o
  CC      net/mac80211/pm.o
  CC      net/mac80211/rc80211_minstrel.o
  CC      net/mac80211/rc80211_minstrel_ht.o
  CC      net/mac80211/rc80211_minstrel_debugfs.o
  CC      net/mac80211/rc80211_minstrel_ht_debugfs.o
  AR      net/mac80211/built-in.a
  AR      net/built-in.a
make[1]: *** [../Makefile:185: __sub-make] Error 2
make[1]: Leaving directory '/home/user/heads/build/x86/linux-5.10.5/linux-qemu'
make: *** [Makefile:419: /home/user/heads/build/x86/linux-5.10.5/linux-qemu/.build] Error 1
…i that are unneeded in our test case otherwise

make[6]: *** No rule to make target '../../linux-firmware/iwlwifi-7265D-29.ucode', needed by 'drivers/base/firmware_loader/builtin/iwlwifi-7265D-29.ucode.gen.o'.  Stop.
…ch Heads requires

same for usb controller, keyboard and unrelated usb stuff in our use case.

Interesting Kconfig dependency highlighten in that commit, all changes commit from menuconfig...
@tlaurion tlaurion force-pushed the debugging_kernel_5.x_kexec_issues-add_tools_to_ease_kernel_version_bumping branch from 5f2b29a to b1d6e91 Compare April 5, 2023 17:50
@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 5, 2023

E: Could not add [/home/user/heads/build/x86/qemu-coreboot-whiptail-tpm1/bzImage, 13499811 bytes (13183 KB)@0x0]; too big?
E: Failed to add '/home/user/heads/build/x86/qemu-coreboot-whiptail-tpm1/bzImage' into ROM image.

Of course.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 5, 2023

And.... It was qemu....
So: was that libgfxinit fault on coreboot's fault?

user@heads-tests:~/heads$ /usr/bin/qemu-system-x86_64   -machine q35   -m $RAM_SIZE   -object rng-random,filename=/dev/urandom,id=rng0   -device virti
o-rng-pci,rng=rng0   -netdev user,id=u1 -device rtl8139,netdev=u1 -kernel ~/heads/build/x86/qemu-coreboot-whiptail-tpm1/bzImage -initrd ~/heads/build/
x86/qemu-coreboot-whiptail-tpm1/initrd.cpio.xz -vga std   -serial stdio -device qemu-xhci,id=usb -drive file=~/Downloads/CorePlus-current.iso,if=none,
id=usb-fd-drive,format=raw -device usb-storage,bus=usb.0,drive=usb-fd-drive

2023-04-05-165309

2023-04-05-165747

The following 3 changes were required:

Gives access to Tinycore.
Going back to hardware with the concept.


EDIT: and importantly, calling /usr/bin/qemu-system-x86_64 -machine q35 actually uses seabios as a bootloader, which also, by the way, initializes display, acting like a BIOS....

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 6, 2023

To go back to basics here, since its always important to remember the original problem scope to attempt to isolate potential issues leading to a problem and the solution space....

As of master:

  • Kexec'ing from xx30/xx20 is from 4.x kernel and is able to kexec to whatever kernel, and booted straight to minimal console from 13.1 iso
  • An issue was spotted from a users having a lot of laptops different laptops, including t430/x230, a t440p and a librem14. Librem14 and t440p were unable to kexec into some older ISOs (which lead to understand that those isos were not providing drm+i915)
  • The t440p, the librems and qemu-coreboot* boards have two important differences compared to xx30/xx20 on master:
    • Thos boards ask for heads to build a linux kernel 5.x (not 4.x)
    • Coreboot enables libgfxinit under coreboot (t440/librems: optional, qemu coreboot config has it mandatory)

Now what was used as a test case:

  • Qemu-coreboot* was never able to boot into tinycore 13.1 iso, staying at kexec prompt.
  • Enabling serial output to ttys0 permitted to see that the kernel booted from host, but never providing VGA nor console under qemu: just as reported by t440p and librems.
  • Therefore, Tinycore 13.1 minimal iso was used in qemu-coreboot tests.
  • Latest post above used produced Heads kernel output (initrd+bzImage directly) and shown that kexec'ing from 5.x to 6.x was possible, without coreboot getting in the way.

As of now, this is where the tests went.

What seems to have been part of the solution (while latest changes just attempted to reuse webboot qemu's linux config and adapted it to match Heads requirements, including some of the modules to be loadable, not built-in, where webboot reference config is practically packing mostly everything, and nothing compiled as modules):

  • VGA fallbacks are there, no drm drivers were in, but VESA driver to produce text based console. Nothing overrides vgaarb either.
    • Let's remember here one Heads requirement: most boards depend on FBwhiptail, which ten requires that kernel provides and initializes a working framebuffer. This means that DRM+FB need to be provided.
      • It could be fb simple, but that doesn't explain why 4.x kernel is able to boot into Tinycore's fbdev (VESA basic text support)
  • having kexec-boot load the second kernel (-l) specifying to use the 32 bit entry point (--entry-32bit )
  • KERNEL_ADD (which is used to force kexec option to the second kernel, specifies vga=791 (1024x768 vga init)

Also to not be dismissed, calling /usr/bin/qemu-system-x86_64 -machine q35 actually uses seabios as qemu bootloader, initializes display, acting like a BIOS and falsifying results here...

- Tinycore does not support kexec2 (file loading, requires legacy syscall) fallback
- Booting debian works, need to remove i915 to see if fbsimple can be kicked in and tune basic config with fallbacks if kexec call doesn't work
@tlaurion
Copy link
Collaborator Author

This could also be a reason why tinycorelinux does not see the /dev/sd* disks (if the information is expected to come from BIOS) - just theorizing here

@saper confirmed issue was to not pass iommu kernel_add additional kernel options from board config to kexec from 4.14. Otherwise it works on master.

Different story still from 5.x kernel to whatever version

- qemu-coreboot-whiptail-tpm1 board config: remove vga-791 statement which is dismissed and should not be specified
- kexec-boot: remove additional statements to elf.
- kexec-2.0.26.patch: add more debug stuff on vga setup.

Current state:
- VESA is not setuped from host kernel detection.
- kexec call shows : 2012 and other debug codes which are linked to reset-vga codepath (non-working)
…ime and free resource for nothing on this PR
@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 11, 2023

Under current PR state, booting latest TinyCore http://tinycorelinux.net/13.x/x86/release/CorePlus-current.iso

make BOARD=qemu-coreboot-whiptail-tpm1 PUBKEY_ASC=~/QubesIncoming/Insurgo/Insurgo_2023_pub.asc USB_TOKEN=LibremKey ROOT_DISK_IMG=~/QubesIncoming/heads-tests/root.qcow2 INSTALL_IMG=~/Downloads/CorePlus-current.iso run

And then from within, on host's recovery shell (type enter on boot from host's console):

~ # usb-init 
TRACE: Under /bin/usb-init
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 4 -ic usb
New value of PCR[4]: 6d2066b63743d43c42e3c604e39d2f4b7b1be2fa
TRACE: Under /bin/media-scan
TRACE: under gui_functions:mount_usb
TRACE: Under /bin/mount-usb
TRACE: Under /etc/functions:enable_usb
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/ehci-hcd.ko
New value of PCR[5]: 9b0b4f8d07aca33c5566a283cb1e033c28c55f91
[   28.446996] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/uhci-hcd.ko
New value of PCR[5]: 8fdafa2fceee076e61268e2fc895acb60b45e0b8
[   29.036657] uhci_hcd: USB Universal Host Controller Interface driver
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/ohci-hcd.ko
New value of PCR[5]: 980597ffaaa71f445876c29dfa86ab8b58dfd26f
[   29.620352] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/ohci-pci.ko
New value of PCR[5]: 9852429a256a84e7e3ed2ce994d1d32d39a0748b
[   30.247778] ohci-pci: OHCI PCI platform driver
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/ehci-pci.ko
New value of PCR[5]: abb2437bcc3e585e57f2e2ee036a6aa0ab223a95
[   30.837771] ehci-pci: EHCI PCI platform driver
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/xhci-hcd.ko
New value of PCR[5]: d3678315d762bcc22855cea2d570ded26a5dfd57
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 5 -if /lib/modules/xhci-pci.ko
New value of PCR[5]: 8dfd43d2f6392ce2603a00765ef1c5a337aa9864
[   32.089810] xhci_hcd 0000:00:04.0: xHCI Host Controller
[   32.114588] xhci_hcd 0000:00:04.0: new USB bus registered, assigned bus number 1
[   32.126347] xhci_hcd 0000:00:04.0: hcc params 0x00087001 hci version 0x100 quirks 0x0000000000000010
[   32.162399] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[   32.162399] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   32.162399] usb usb1: Product: xHCI Host Controller
[   32.174922] usb usb1: Manufacturer: Linux 5.10.5-heads xhci-hcd
[   32.175535] usb usb1: SerialNumber: 0000:00:04.0
[   32.210139] hub 1-0:1.0: USB hub found
[   32.223195] hub 1-0:1.0: 4 ports detected
[   32.239331] xhci_hcd 0000:00:04.0: xHCI Host Controller
[   32.256757] xhci_hcd 0000:00:04.0: new USB bus registered, assigned bus number 2
[   32.265492] xhci_hcd 0000:00:04.0: Host supports USB 3.0 SuperSpeed
[   32.303811] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[   32.339407] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[   32.385330] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   32.405423] usb usb2: Product: xHCI Host Controller
[   32.418807] usb usb2: Manufacturer: Linux 5.10.5-heads xhci-hcd
[   32.428096] usb usb2: SerialNumber: 0000:00:04.0
[   32.487920] hub 2-0:1.0: USB hub found
[   32.517498] hub 2-0:1.0: 4 ports detected
[   32.607698] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[   32.758376] usb 1-1: New USB device found, idVendor=0627, idProduct=0001, bcdDevice= 0.00
[   32.763243] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=10
[   32.770675] usb 1-1: Product: QEMU USB Tablet
[   32.775342] usb 1-1: Manufacturer: QEMU
[   32.785114] usb 1-1: SerialNumber: 28754-0000:00:04.0-1
[   32.886333] usb 2-2: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[   32.958151] usb 2-2: New USB device found, idVendor=46f4, idProduct=0001, bcdDevice= 0.00
[   32.966195] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   32.979637] usb 2-2: Product: QEMU USB HARDDRIVE
[   33.002881] usb 2-2: Manufacturer: QEMU
[   33.007738] usb 2-2: SerialNumber: 1-0000:00:04.0-2
Scanning for USB storage devices...
[   35.173101] usb-storage 2-2:1.0: USB Mass Storage device detected
[   35.218143] scsi host6: usb-storage 2-2:1.0
[   35.218638] usbcore: registered new interface driver usb-storage
TRACE: Under /etc/functions:list_usb_storage
[   36.275363] scsi 6:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5
[   36.312513] sd 6:0:0:0: Attached scsi generic sg1 type 0
[   36.364096] sd 6:0:0:0: Power-on or device reset occurred
[   36.399424] sd 6:0:0:0: [sda] 321536 512-byte logical blocks: (165 MB/157 MiB)
[   36.446370] sd 6:0:0:0: [sda] Write Protect is off
[   36.456533] sd 6:0:0:0: [sda] Mode Sense: 63 00 00 08
[   36.471227] sd 6:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[   36.550172]  sda: sda1
[   36.633226] sd 6:0:0:0: [sda] Attached SCSI disk
TRACE: Under /etc/functions:list_usb_storage
TRACE: Under /etc/functions:list_usb_storage
[   37.832348] ISO 9660 Extensions: Microsoft Joliet Level 3
[   37.916286] ISO 9660 Extensions: RRIP_1991A
!!! Could not find any ISO, trying bootable USB
TRACE: Under /bin/kexec-select-boot
TRACE: Under /etc/functions:check_config
TRACE: Under /bin/tpmr
DEBUG: Direct translation from tpmr to tpm1 call
DEBUG: exec tpm extend -ix 4 -ic generic
New value of PCR[4]: 28d966fa5d91801a4dbfad0557ce02338455b3e0
+++ Scanning for unsigned boot options
[   39.263438] random: crng init done
TRACE: Under /bin/kexec-parse-boot bootdir=/media file=/media/boot/isolinux/isolinux.cfg
TRACE:  search_entry: syslinux label: line= LABEL plus
TRACE:  search_entry: syslinux label: name=  plus
TRACE:  search_entry: syslinux label: line= LABEL jwm
TRACE:  search_entry: syslinux label: name=  jwm
TRACE:  search_entry: syslinux label: line= LABEL icewm
TRACE:  search_entry: syslinux label: name=  icewm
TRACE:  search_entry: syslinux label: line= LABEL fluxbox
TRACE:  search_entry: syslinux label: name=  fluxbox
TRACE:  search_entry: syslinux label: line= LABEL hackedbox
TRACE:  search_entry: syslinux label: name=  hackedbox
TRACE:  search_entry: syslinux label: line= LABEL openbox
TRACE:  search_entry: syslinux label: name=  openbox
TRACE:  search_entry: syslinux label: line= LABEL flwm
TRACE:  search_entry: syslinux label: name=  flwm
TRACE:  search_entry: syslinux label: line= LABEL tiny
TRACE:  search_entry: syslinux label: name=  tiny
TRACE:  search_entry: syslinux label: line= LABEL cxi
TRACE:  search_entry: syslinux label: name=  cxi
TRACE:  search_entry: syslinux label: line= LABEL cxw
TRACE:  search_entry: syslinux label: name=  cxw
TRACE:  search_entry: syslinux label: line= LABEL cxf
TRACE:  search_entry: syslinux label: name=  cxf
TRACE:  search_entry: syslinux label: line= LABEL core
TRACE:  search_entry: syslinux label: name=  core
TRACE:  search_entry: syslinux label: line= LABEL nocde
TRACE:  search_entry: syslinux label: name=  nocde


┌─────────────────────────┤ Select your boot option ├──────────────────────────┐
│ Choose the boot option [1-13, a to abort]:                                   │
│                                                                              │
│         1  Boot_Core_without_embedded_extensions_with_waitusb=5.             │
│         2  Boot_Core_with_only_X/GUI_(TinyCore).                             │
│         3  Boot_Core_with_X/GUI_(TinyCore)_+_Wifi_Extension.                 │
│         4  Boot_Core_with_X/GUI_(TinyCore)_+_Wifi_+_Firmware.                │
│         5  Boot_Core_with_X/GUI_(TinyCore)_+_Installation_Extension.         │
│         6  Boot_Core_to_command_line_only._No_X/GUI_or_extensions.           │
│         7  Boot_Core_Plus_with_default_FLWM_topside.                         │
│         8  Boot_Core_Plus_with_Openbox_Window_Manager.                       │
│         9  Boot_Core_Plus_with_Joe's_Window_Manager.                         │
│         10 Boot_Core_Plus_with_ICE_Window_Manager.                           │
│         11 Boot_Core_Plus_with_Hackedbox_Window_Manager.                     │
│         12 Boot_Core_Plus_with_Fluxbox_Window_Manager.                       │
│         13 Boot_Core_Plus_with_FLWM_Classic_Window_Manager.                  │
│                                                                              │
│                                                                              │
│                     <Ok>                         <Cancel>                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘

TRACE: Under /bin/kexec-boot
DEBUG: kexectype= elf
DEBUG: restval= 
DEBUG: filepath= /media/boot/vmlinuz
DEBUG: kexeccmd= kexec -d -l /media/boot/vmlinuz
Loading the new kernel:
kexec -d -l /media/boot/vmlinuz --initrd=/media/boot/core.gz --append="loglevel=3 cde showapps lst=xfbase.lst desktop=flwm_topside nosmp debug console
=ttyS0,115200 console=tty systemd.zram=0 "
Try gzip decompression.
kernel: 0x7f21505bd020 kernel_size: 0x4d8800
MEMORY RANGES
0000000000000000-0000000000000fff (1)
0000000000001000-000000000009ffff (0)
00000000000a0000-00000000000fffff (1)
0000000000100000-000000003ff59fff (0)
000000003ff5a000-000000003fffffff (1)
00000000b0000000-00000000bfffffff (1)
00000000fed40000-00000000fed44fff (1)
bzImage is relocatable
sym: sha256_starts info: 12 other: 00 shndx: 1 value: 1120 size: 48
sym: sha256_starts value: 3ff52120 addr: 3ff51002
R_X86_64_64
sym: sha256_update info: 12 other: 00 shndx: 1 value: 3cb0 size: 19
sym: sha256_update value: 3ff54cb0 addr: 3ff5100f
R_X86_64_64
sym: sha256_regions info: 11 other: 00 shndx: 8 value: 40 size: 100
sym: sha256_regions value: 3ff56040 addr: 3ff5101a
R_X86_64_64
sym: sha256_regions info: 11 other: 00 shndx: 8 value: 40 size: 100
sym: sha256_regions value: 3ff56140 addr: 3ff51044
R_X86_64_64
sym: sha256_finish info: 12 other: 00 shndx: 1 value: 3cd0 size: 15e
sym: sha256_finish value: 3ff54cd0 addr: 3ff5105b
R_X86_64_64
sym: sha256_digest info: 11 other: 00 shndx: 8 value: 20 size: 20
sym: sha256_digest value: 3ff56020 addr: 3ff5106f
R_X86_64_64
sym:     memcmp info: 12 other: 00 shndx: 1 value: 599 size: 21
sym: memcmp value: 3ff51599 addr: 3ff51079
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f40 addr: 3ff5108d
R_X86_64_64
sym:     printf info: 12 other: 00 shndx: 1 value: 4ba size: a0
sym: printf value: 3ff514ba addr: 3ff5109b
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f70 addr: 3ff510a5
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f60 addr: 3ff510b3
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f76 addr: 3ff510d3
R_X86_64_64
sym: sha256_digest info: 11 other: 00 shndx: 8 value: 20 size: 20
sym: sha256_digest value: 3ff56020 addr: 3ff510e1
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f78 addr: 3ff510ef
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f70 addr: 3ff51105
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f76 addr: 3ff51117
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f88 addr: 3ff51136
R_X86_64_64
sym:     printf info: 12 other: 00 shndx: 1 value: 4ba size: a0
sym: printf value: 3ff514ba addr: 3ff51142
R_X86_64_64
sym: setup_arch info: 12 other: 00 shndx: 1 value: 762 size: 56
sym: setup_arch value: 3ff51762 addr: 3ff5114f
R_X86_64_64
sym: skip_checks info: 11 other: 00 shndx: 8 value: 0 size: 4
sym: skip_checks value: 3ff56000 addr: 3ff5115b
R_X86_64_64
sym: verify_sha256_digest info: 12 other: 00 shndx: 1 value: 0 size: 134
sym: verify_sha256_digest value: 3ff51000 addr: 3ff5116a
R_X86_64_64
sym: post_verification_setup_arch info: 12 other: 00 shndx: 1 value: 7f0 size: 58
sym: post_verification_setup_arch value: 3ff517f0 addr: 3ff5117c
R_X86_64_64
sym:    putchar info: 12 other: 00 shndx: 1 value: d8e size: 124
sym: putchar value: 3ff51d8e addr: 3ff5118f
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54f9a addr: 3ff512d1
R_X86_64_64
sym:   vsprintf info: 12 other: 00 shndx: 1 value: 187 size: 29d
sym: vsprintf value: 3ff51187 addr: 3ff514a0
R_X86_64_64
sym:   vsprintf info: 12 other: 00 shndx: 1 value: 187 size: 29d
sym: vsprintf value: 3ff51187 addr: 3ff51540
R_X86_64_64
sym:    entry32 info: 10 other: 00 shndx: 1 value: 5c0 size: 0
sym: entry32 value: 3ff515bc addr: 3ff515cd
R_X86_64_PC32
sym:    entry32 info: 10 other: 00 shndx: 1 value: 5c0 size: 0
sym: entry32 value: 3ff515bc addr: 3ff515e2
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5615c addr: 3ff515fd
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5613c addr: 3ff51604
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e54 addr: 3ff5160a
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff561ac addr: 3ff51610
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e2c addr: 3ff51616
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ec1 addr: 3ff51649
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ed0 addr: 3ff51650
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54edb addr: 3ff51657
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ee6 addr: 3ff5165e
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ef1 addr: 3ff51665
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54efc addr: 3ff5166c
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54f07 addr: 3ff51673
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ef6 addr: 3ff5167a
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff56271 addr: 3ff51681
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54eec addr: 3ff51693
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54f1c addr: 3ff516a9
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e5c addr: 3ff516bc
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e64 addr: 3ff516c3
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e6c addr: 3ff516ca
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e74 addr: 3ff516d1
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e7c addr: 3ff516d8
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e84 addr: 3ff516df
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e8c addr: 3ff516e6
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e94 addr: 3ff516ed
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54e9c addr: 3ff516f4
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ea4 addr: 3ff516fb
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54eac addr: 3ff51702
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54eb4 addr: 3ff51709
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ebc addr: 3ff51710
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ec4 addr: 3ff51717
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ecc addr: 3ff5171e
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ed4 addr: 3ff51725
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54edc addr: 3ff5172b
R_X86_64_PC32
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54f1c addr: 3ff51733
R_X86_64_PC32
sym: jump_back_entry info: 11 other: 00 shndx: 8 value: 2008 size: 8
sym: jump_back_entry value: 3ff58004 addr: 3ff5174d
R_X86_64_PC32
sym:       .bss info: 03 other: 00 shndx: a value: 0 size: 0
sym: .bss value: 3ff59ffc addr: 3ff51754
R_X86_64_PC32
sym:  purgatory info: 12 other: 00 shndx: 1 value: 134 size: 53
sym: purgatory value: 3ff51130 addr: 3ff51759
R_X86_64_PLT32
sym:    entry64 info: 10 other: 00 shndx: 1 value: 690 size: 0
sym: entry64 value: 3ff5168c addr: 3ff5175e
R_X86_64_PLT32
sym:  reset_vga info: 11 other: 00 shndx: 8 value: 2012 size: 1
sym: reset_vga value: 3ff58012 addr: 3ff51764
R_X86_64_64
sym: x86_reset_vga info: 12 other: 00 shndx: 1 value: eb2 size: 232
sym: x86_reset_vga value: 3ff51eb2 addr: 3ff51773
R_X86_64_64
sym: legacy_pic info: 11 other: 00 shndx: 8 value: 2011 size: 1
sym: legacy_pic value: 3ff58011 addr: 3ff51780
R_X86_64_64
sym: x86_setup_legacy_pic info: 12 other: 00 shndx: 1 value: 10e4 size: 35
sym: x86_setup_legacy_pic value: 3ff520e4 addr: 3ff5178f
R_X86_64_64
sym: legacy_pic info: 11 other: 00 shndx: 8 value: 2011 size: 1
sym: legacy_pic value: 3ff58011 addr: 3ff5179e
R_X86_64_64
sym: x86_setup_legacy_pic info: 12 other: 00 shndx: 1 value: 10e4 size: 35
sym: x86_setup_legacy_pic value: 3ff520e4 addr: 3ff517ad
R_X86_64_64
sym: cmdline_end info: 11 other: 00 shndx: 8 value: 2000 size: 8
sym: cmdline_end value: 3ff58000 addr: 3ff517ba
R_X86_64_64
sym: jump_back_entry info: 11 other: 00 shndx: 8 value: 2008 size: 8
sym: jump_back_entry value: 3ff58008 addr: 3ff517cc
R_X86_64_64
sym: .rodata.str1.1 info: 03 other: 00 shndx: 5 value: 0 size: 0
sym: .rodata.str1.1 value: 3ff54fab addr: 3ff517db
R_X86_64_64
sym:    sprintf info: 12 other: 00 shndx: 1 value: 424 size: 96
sym: sprintf value: 3ff51424 addr: 3ff517e5
R_X86_64_64
sym: panic_kernel info: 11 other: 00 shndx: 8 value: 2010 size: 1
sym: panic_kernel value: 3ff58010 addr: 3ff517f2
R_X86_64_64
sym: crashdump_backup_memory info: 12 other: 00 shndx: 1 value: cb3 size: 3e
sym: crashdump_backup_memory value: 3ff51cb3 addr: 3ff51801
R_X86_64_64
sym: jump_back_entry info: 11 other: 00 shndx: 8 value: 2008 size: 8
sym: jump_back_entry value: 3ff58008 addr: 3ff5180e
R_X86_64_64
sym: x86_setup_jump_back_entry info: 12 other: 00 shndx: 1 value: 7b8 size: 38
sym: x86_setup_jump_back_entry value: 3ff517b8 addr: 3ff5181e
R_X86_64_64
sym: jump_back_entry info: 11 other: 00 shndx: 8 value: 2008 size: 8
sym: jump_back_entry value: 3ff58008 addr: 3ff5182d
R_X86_64_64
sym: x86_setup_jump_back_entry info: 12 other: 00 shndx: 1 value: 7b8 size: 38
sym: x86_setup_jump_back_entry value: 3ff517b8 addr: 3ff5183d
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58047 addr: 3ff51867
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5804f addr: 3ff5186d
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58075 addr: 3ff5188d
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5807f addr: 3ff51893
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58089 addr: 3ff51899
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58093 addr: 3ff5189f
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58076 addr: 3ff518a6
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5808d addr: 3ff518ad
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5806d addr: 3ff51977
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58075 addr: 3ff5197d
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5809b addr: 3ff5199d
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff580a5 addr: 3ff519a3
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff580af addr: 3ff519a9
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff580b9 addr: 3ff519af
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff580e2 addr: 3ff519f2
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff5812b addr: 3ff51a35
R_X86_64_PC32
sym: backup_src_size info: 11 other: 00 shndx: 8 value: 2070 size: 8
sym: backup_src_size value: 3ff58070 addr: 3ff51cb5
R_X86_64_64
sym: backup_start info: 11 other: 00 shndx: 8 value: 2080 size: 8
sym: backup_start value: 3ff58080 addr: 3ff51cc7
R_X86_64_64
sym: backup_src_start info: 11 other: 00 shndx: 8 value: 2078 size: 8
sym: backup_src_start value: 3ff58078 addr: 3ff51cd9
R_X86_64_64
sym:     memcpy info: 12 other: 00 shndx: 1 value: 581 size: 18
sym: memcpy value: 3ff51581 addr: 3ff51ce6
R_X86_64_64
sym: serial_base info: 11 other: 00 shndx: 8 value: 2090 size: 2
sym: serial_base value: 3ff58090 addr: 3ff51cf3
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58088 addr: 3ff51d00
R_X86_64_64
sym: serial_baud info: 11 other: 00 shndx: 8 value: 208c size: 4
sym: serial_baud value: 3ff5808c addr: 3ff51d3a
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58088 addr: 3ff51d69
R_X86_64_64
sym: console_vga info: 11 other: 00 shndx: 8 value: 2093 size: 1
sym: console_vga value: 3ff58093 addr: 3ff51d90
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58098 addr: 3ff51da4
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58098 addr: 3ff51e09
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58094 addr: 3ff51e1e
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58094 addr: 3ff51e37
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff58094 addr: 3ff51e6d
R_X86_64_64
sym: console_serial info: 11 other: 00 shndx: 8 value: 2092 size: 1
sym: console_serial value: 3ff58092 addr: 3ff51e81
R_X86_64_64
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51cf1 addr: 3ff51e90
R_X86_64_64
sym: sha256_process info: 12 other: 00 shndx: 1 value: 1170 size: 2a25
sym: sha256_process value: 3ff52170 addr: 3ff54bef
R_X86_64_64
sym:     memcpy info: 12 other: 00 shndx: 1 value: 581 size: 18
sym: memcpy value: 3ff51581 addr: 3ff54c53
R_X86_64_64
sym: sha256_process info: 12 other: 00 shndx: 1 value: 1170 size: 2a25
sym: sha256_process value: 3ff52170 addr: 3ff54c65
R_X86_64_64
sym:     memcpy info: 12 other: 00 shndx: 1 value: 581 size: 18
sym: memcpy value: 3ff51581 addr: 3ff54c93
R_X86_64_64
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff54ba0 addr: 3ff54cb7
R_X86_64_64
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff54ba0 addr: 3ff54d1a
R_X86_64_64
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff580a0 addr: 3ff54d27
R_X86_64_64
sym:    entry16 info: 10 other: 00 shndx: 1 value: 850 size: 0
sym: entry16 value: 3ff51850 addr: 3ff54e58
R_X86_64_64
sym:    entry32 info: 10 other: 00 shndx: 1 value: 5c0 size: 0
sym: entry32 value: 3ff515c0 addr: 3ff54ee0
R_X86_64_64
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54ef0 addr: 3ff54ef2
R_X86_64_64
sym:    .rodata info: 03 other: 00 shndx: 3 value: 0 size: 0
sym: .rodata value: 3ff54f20 addr: 3ff54f22
R_X86_64_64
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51000 addr: 3ff54fe8
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51134 addr: 3ff5501c
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51187 addr: 3ff55050
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51424 addr: 3ff5509c
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff514ba addr: 3ff550b8
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff5155a addr: 3ff550f0
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff5156d addr: 3ff55104
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51581 addr: 3ff55118
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51599 addr: 3ff5512c
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51762 addr: 3ff55158
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff517b8 addr: 3ff55178
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff517f0 addr: 3ff5518c
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51cb3 addr: 3ff551c8
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51cf1 addr: 3ff551f8
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51d8e addr: 3ff5520c
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff51eb2 addr: 3ff55248
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff520e4 addr: 3ff55278
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff52120 addr: 3ff552a8
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff52170 addr: 3ff552bc
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff54ba0 addr: 3ff55308
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff54cb0 addr: 3ff5536c
R_X86_64_PC32
sym:      .text info: 03 other: 00 shndx: 1 value: 0 size: 0
sym: .text value: 3ff54cd0 addr: 3ff55380
R_X86_64_PC32
sym:      .data info: 03 other: 00 shndx: 8 value: 0 size: 0
sym: .data value: 3ff56140 addr: 3ff56142
R_X86_64_64
Loaded purgatory at addr 0x3ff51000
Loaded real-mode code and command line at 0x3000
Loaded 32bit kernel at 0x100000
initrd_addr_max is 0x7fffffff
Loaded initrd at 0x3f46b000 size 0xae5459
setup_linux_vesafb: VIDEO_TYPE not VGA.
E820 memmap:
0000000000000000-0000000000000fff (2)
0000000000001000-000000000009ffff (1)
00000000000a0000-00000000000fffff (2)
0000000000100000-000000003ff59fff (1)
000000003ff5a000-000000003fffffff (2)
00000000b0000000-00000000bfffffff (2)
00000000fed40000-00000000fed44fff (2)
/sys/firmware/edd does not exist.
kexec_load: entry = 0x3ff51730 flags = 0x3e0000
nr_segments = 5
segment[0].buf   = 0x1709120
segment[0].bufsz = 0x3cb9
segment[0].mem   = 0x3000
segment[0].memsz = 0x4000
segment[1].buf   = 0x7f21505c0c20
segment[1].bufsz = 0x4d4c00
segment[1].mem   = 0x100000
segment[1].memsz = 0x4d5000
segment[2].buf   = 0x6fbfa0
segment[2].bufsz = 0x30
segment[2].mem   = 0x5d5000
segment[2].memsz = 0x1000
segment[3].buf   = 0x7f214fad7020
segment[3].bufsz = 0xae5459
segment[3].mem   = 0x3f46b000
segment[3].memsz = 0xae6000
segment[4].buf   = 0x1702020
segment[4].bufsz = 0x70e0
segment[4].mem   = 0x3ff51000
segment[4].memsz = 0x9000
TRACE: Under /bin/tpmr
Starting the new kernel
DEBUG: kexeccmd= kexec -d -l /media/boot/vmlinuz --initrd=/media/boot/core.gz --append="loglevel=3 cde showapps lst=xfbase.lst desktop=flwm_topside no
smp debug console=ttyS0,115200 console=tty systemd.zram=0 "
DEBUG: exec kexec -d -e

kexec -d -l /media/boot/vmlinuz --initrd=/media/boot/core.gz --append="loglevel=3 cde showapps lst=xfbase.lst desktop=flwm_topside nosmp debug console=ttyS0,115200 console=tty systemd.zram=0 "

produces the above important debug traces:

R_X86_64_PLT32
sym:  reset_vga info: 11 other: 00 shndx: 8 value: 2012 size: 1
sym: reset_vga value: 3ff58012 addr: 3ff51764
R_X86_64_64
sym: x86_reset_vga info: 12 other: 00 shndx: 1 value: eb2 size: 232
sym: x86_reset_vga value: 3ff51eb2 addr: 3ff51773

Confirmed by added debug traces in kexec patches under heads:
setup_linux_vesafb: VIDEO_TYPE not VGA.

@tlaurion
Copy link
Collaborator Author

In current state of PR, even if we specify to reuse vga through --reuse-video-type

TRACE: Under /bin/kexec-boot
DEBUG: kexectype= elf
DEBUG: restval= 
DEBUG: filepath= /media/boot/vmlinuz
DEBUG: kexeccmd= kexec -d -l /media/boot/vmlinuz --noefi --reuse-video-type
Loading the new kernel:
kexec -d -l /media/boot/vmlinuz --noefi --reuse-video-type --initrd=/media/boot/core.gz --append="loglevel=3 waitusb=5 base nosmp debug console=ttyS0,115200 console=tty systemd.zram=0 "

kexec codepath to reset vga is still called:

R_X86_64_PLT32
sym:  reset_vga info: 11 other: 00 shndx: 8 value: 2012 size: 1
sym: reset_vga value: 3ff58012 addr: 3ff51764
R_X86_64_64
sym: x86_reset_vga info: 12 other: 00 shndx: 1 value: eb2 size: 232
sym: x86_reset_vga value: 3ff51eb2 addr: 3ff51773
R_X86_64_64

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 12, 2023

Read a lot more.

Suggestions are to see things as incompatible to test from qemu (q35, latest) from real hardware. This is really really not helping.

Some notes found on the internet are explaining the differences between kexec codepath with noefi (Heads on coreboot usecase). Other stakeholders want to use the GOP from FSP to provide common ground and dodge the problem. Understandable but not helpful.

I searched my old boxes to try to find my old "screwdriver" EHCI USB debugger and try to debug on x230. But that might or might not be helping.

So.

Again, what we know:

  • When kexec'in as in master through kexec-parse-boot to kexec-boot (not multiboot: qubes use case, but general case), we get into the "other" use case then multiboot, and basically not do anything special. We pass the initrd and kernel, and then pass any kernel_add option defined in the board config to construct the "load" kexec call and then execute inside of the second kernel through execute (-e). This means that we are passing from 64 bit to 64 bit, not using the kernel to reinit from bios the vga driver. What we are seeing is that it works alright when the next kernel provides drm+gpu driver as in first kernel for 5.x kernels. But we cannot kexec into older kernels not newer ones that do not provide drm+gpu drivers.
  • On qemu q35, RSDT is filled with BOCH identifiers. I have found no way to have kexec dismiss that
  • booting into second kernel with 32 bit entry point, noefi or reset-vga is not helping...

This article shares a deep diving experience (but doesn't help):
https://eastrivervillage.com/kexec-tools-with-the-hidden-purgatory/

…core 14.0 released today, tests with debian shows that again things are ok when drm+gpu replaces fb but not before on both qemu and real hardware
@tlaurion
Copy link
Collaborator Author

A reminder that on qemu vga side, not all modes provide vesa/vga compatibility https://www.kraxel.org/blog/2019/09/display-devices-in-qemu/

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 18, 2023

Note: CONFIG_DRIVERS_EMULATION_QEMU_BOCHS present on coreboot side for qemu boards.
Will need to be removed.

#1378 will implement the working bits and this PR will be closed. @JonathonHall-Purism bissecting kernel code to see where things hanged.

Also seems that the way forward for Heads is to make sure kexec path is to make sure we use VIDEO_TYPE_VLFB unconditionally to prepare fb for next kernel; there is no use under Heads to support other modes if vesa on second kernel can be used and then reowned by more specific kernel drivers present under initrd/kernel.

@lankredotp41
Copy link

Just a note regarding kexec-tools newer than v2.0.22.
Because of this commit:
horms/kexec-tools@dbc151e
Kexec will now boot with multiboot2 by default instead of multiboot if -t multiboot-x86 option is not specified.
And for multiboot2 segment 0 will no longer be 0 and the code in kexec patch that hacks ebda into segment 0 will no longer work:
https://github.com/osresearch/heads/blob/bca26c17ea8b7dbfce9cddb0fb745b6e4952deb3/patches/kexec-2.0.26.patch

@tlaurion
Copy link
Collaborator Author

tlaurion commented Apr 21, 2023

Just a note regarding kexec-tools newer than v2.0.22. Because of this commit: horms/kexec-tools@dbc151e Kexec will now boot with multiboot2 by default instead of multiboot if -t multiboot-x86 option is not specified. And for multiboot2 segment 0 will no longer be 0 and the code in kexec patch that hacks ebda into segment 0 will no longer work: https://github.com/osresearch/heads/blob/bca26c17ea8b7dbfce9cddb0fb745b6e4952deb3/patches/kexec-2.0.26.patch

Confirmed not needed per 4f88f35 at #1381

Will close this PR because it contained way too much directions exploration.
Discussion can continue under #1381

@tlaurion tlaurion closed this Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants