3

I'm running Arch Linux and I've set up kdump so that when the current kernel panics(or I manually induce a crash via sysrq+c) then another kernel(the kexec kernel) starts up in order to create a crash dump so that I can later inspect it.

The problem is that whether this triggers from console or from within Xorg, the same screen remains on the display for the entire duration of the kexec-ed kernel and I thus cannot see what it's doing.

This isn't a problem on a non-i915 laptop that's using AMD/Radeon for example.

I've tried the following kernel args for the kexec kernel and they've had no effect on this issue:
1. systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9
2. systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9 i915.fastboot=0 i915.reset=1 i915.modeset=-1 i915.force_reset_modeset_test=true i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 zram.num_devices=3 zswap.enabled=0

The full ExecStart= line that I'm currently using and has no effect is: ExecStart=/usr/bin/kexec -p /boot/vmlinuz-linux-git --initrd=/boot/initramfs-linux-git.img --reuse-cmdline --reset-vga --console-vga "--append=root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9 i915.fastboot=0 i915.reset=1 i915.modeset=-1 i915.force_reset_modeset_test=true i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 zram.num_devices=3 zswap.enabled=0"

So when kernel panics, the X or console screen that was present at panic time will remain on the screen until the kexec kernel is done saving the dump file and reboots.

When crashkernel= arg for the primary kernel is too low, the kexec kernel can OOM during makedumpfile and thus I've no idea why it didn't reboot after x minutes because I can't see its screen.

I guess I need some (working)way to switch to 80x25 mode or some way to tell kexec kernel to reset the i915 video card so it can re-init it again normally?

EDIT: not using EFI, using grub+MBR also some primary kernel info:

[    0.275493] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux-git root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a rw root_trim=yes rd.luks.allow-discards rd.luks.options=discard ipv6.disable=1 ipv6.disable_ipv6=1 ipv6.autoconf=0 loglevel=15 log_buf_len=16M ignore_loglevel printk.always_kmsg_dump=y printk.time=y printk.devkmsg=on mminit_loglevel=4 memory_corruption_check=1 fbcon=scrollback:4096k fbcon=font:ProFont6x11 net.ifnames=0 nolvm dobtrfs console=tty1 earlyprintk=vga audit=0 systemd.log_target=kmsg systemd.journald.forward_to_console=1 enforcing=0 udev.children-max=1256 rd.udev.children-max=1256 nohz=on oops=panic crashkernel=1024M panic=0 page_poison=1 psi=1 sysrq_always_enabled random.trust_cpu=off logo.nologo lpj=0 mce=bootlog reboot=force,cold noexec=on nohibernate scsi_mod.use_blk_mq=1 consoleblank=120 mitigations=off nospectre_v1 nospectre_v2 spectre_v2=off nospec_store_bypass_disable kvm-intel.vmentry_l1d_flush=never l1tf=off nopti pti=off no_stf_barrier noibrs noibpb ssbd=force-off spectre_v2_user=off noretpoline mds=off rd.log=all noefi cpuidle.governor=menu zram.num_devices=3 zswap.enabled=0 zswap.same_filled_pages_enabled=1 zswap.compressor=zstd zswap.max_pool_percent=40 zswap.zpool=z3fold vsyscall=none i915.enable_fbc=1 i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1
[    0.845622] device: 'fbcon': device_add
[    0.845626] PM: Adding info for No Bus:fbcon
...
[    4.416734] fbcon: i915drmfb (fb0) is primary device
...
[    4.494499] i915 0000:00:02.0: fb0: i915drmfb frame buffer device

Here's a cmdline word diff between primary and kexec kernel:

diff --git a/home/user/logs/pri_kernel.log b/home/user/logs/kexeckernel.log
index e6d2815..9b90a12 100644
--- a/home/user/logs/pri_kernel.log
+++ b/home/user/logs/kexeckernel.log
@@ -1,2 +1,2 @@
 [    0.000000] Command line:
-BOOT_IMAGE=/boot/vmlinuz-linux-git
  root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a rw root_trim=yes rd.luks.allow-discards rd.luks.options=discard ipv6.disable=1 ipv6.disable_ipv6=1 ipv6.autoconf=0 loglevel=15 log_buf_len=16M ignore_loglevel printk.always_kmsg_dump=y printk.time=y printk.devkmsg=on mminit_loglevel=4 memory_corruption_check=1 fbcon=scrollback:4096k fbcon=font:ProFont6x11 net.ifnames=0 nolvm dobtrfs console=tty1 earlyprintk=vga audit=0 systemd.log_target=kmsg systemd.journald.forward_to_console=1 enforcing=0 udev.children-max=1256 rd.udev.children-max=1256 nohz=on oops=panic
-crashkernel=1024M
  panic=0 page_poison=1 psi=1 sysrq_always_enabled random.trust_cpu=off logo.nologo lpj=0 mce=bootlog reboot=force,cold noexec=on nohibernate scsi_mod.use_blk_mq=1 consoleblank=120 mitigations=off nospectre_v1 nospectre_v2 spectre_v2=off nospec_store_bypass_disable kvm-intel.vmentry_l1d_flush=never l1tf=off nopti pti=off no_stf_barrier noibrs noibpb ssbd=force-off spectre_v2_user=off noretpoline mds=off rd.log=all noefi cpuidle.governor=menu zram.num_devices=3 zswap.enabled=0 zswap.same_filled_pages_enabled=1 zswap.compressor=zstd zswap.max_pool_percent=40 zswap.zpool=z3fold vsyscall=none i915.enable_fbc=1 i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 
+root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9 i915.fastboot=0 i915.reset=1 i915.modeset=-1 i915.force_reset_modeset_test=true i915.verbose_state_checks=1 i915.enable_hangcheck=1 i915.error_capture=1 zram.num_devices=3 zswap.enabled=0 acpi_rsdp=0xf05b0 elfcorehdr=2588032K
~

~

There's no mention in kexec kernel dmesg of i915 except in cmdline.

2

I've just solved this by building i915 driver in kernel(CONFIG_DRM_I915=y) instead of as a module(CONFIG_DRM_I915=m), which required CONFIG_DRM=y instead of =m.

Doing the above two changes, here's what make nconfig actually changed in .config:

--- .config.old 2019-09-10 12:38:12.798272432 +0200
+++ .config 2019-09-10 15:17:26.327144324 +0200
@@ -2279,7 +2279,7 @@ CONFIG_I2C_MUX=m

 CONFIG_I2C_HELPER_AUTO=y
 CONFIG_I2C_SMBUS=m
-CONFIG_I2C_ALGOBIT=m
+CONFIG_I2C_ALGOBIT=y

 #
 # I2C Hardware Bus support
@@ -3124,11 +3124,12 @@ CONFIG_AGP_INTEL=y
 CONFIG_INTEL_GTT=y
 # CONFIG_VGA_ARB is not set
 # CONFIG_VGA_SWITCHEROO is not set
-CONFIG_DRM=m
+CONFIG_DRM=y
 CONFIG_DRM_MIPI_DSI=y
 CONFIG_DRM_DP_AUX_CHARDEV=y
+# CONFIG_DRM_DEBUG_MM is not set
 # CONFIG_DRM_DEBUG_SELFTEST is not set
-CONFIG_DRM_KMS_HELPER=m
+CONFIG_DRM_KMS_HELPER=y
 CONFIG_DRM_KMS_FB_HELPER=y
 CONFIG_DRM_FBDEV_EMULATION=y
 CONFIG_DRM_FBDEV_OVERALLOC=100
@@ -3160,7 +3161,7 @@ CONFIG_DRM_I2C_NXP_TDA998X=m
 # end of ACP (Audio CoProcessor) Configuration

 # CONFIG_DRM_NOUVEAU is not set
-CONFIG_DRM_I915=m
+CONFIG_DRM_I915=y
 CONFIG_DRM_I915_ALPHA_SUPPORT=y
 CONFIG_DRM_I915_FORCE_PROBE="*"
 CONFIG_DRM_I915_CAPTURE_ERROR=y
@@ -3223,7 +3224,7 @@ CONFIG_DRM_PANEL_BRIDGE=y
 # CONFIG_DRM_TINYDRM is not set
 # CONFIG_DRM_VBOXVIDEO is not set
 # CONFIG_DRM_LEGACY is not set
-CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=m
+CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

 #
 # Frame buffer Devices
@@ -3236,11 +3237,11 @@ CONFIG_FB_BOOT_VESA_SUPPORT=y
 CONFIG_FB_CFB_FILLRECT=y
 CONFIG_FB_CFB_COPYAREA=y
 CONFIG_FB_CFB_IMAGEBLIT=y
-CONFIG_FB_SYS_FILLRECT=m
-CONFIG_FB_SYS_COPYAREA=m
-CONFIG_FB_SYS_IMAGEBLIT=m
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
 # CONFIG_FB_FOREIGN_ENDIAN is not set
-CONFIG_FB_SYS_FOPS=m
+CONFIG_FB_SYS_FOPS=y
 CONFIG_FB_DEFERRED_IO=y
 # CONFIG_FB_MODE_HELPERS is not set
 CONFIG_FB_TILEBLITTING=y
@@ -3265,7 +3266,6 @@ CONFIG_FB_VESA=y
 # CONFIG_FB_RIVA is not set
 # CONFIG_FB_I740 is not set
 # CONFIG_FB_LE80578 is not set
-# CONFIG_FB_INTEL is not set
 # CONFIG_FB_MATROX is not set
 # CONFIG_FB_RADEON is not set
 # CONFIG_FB_ATY128 is not set

I kept all the kexec kernel args from OP and it works! I've also removed all the i915 args from OP and it still works, so like this: systemd.unit=kdump-save.service irqpoll nr_cpus=1 reset_devices ipv6.disable=1 loglevel=9

Now the video mode is reset and I could see everything in kexec kernel from 0.2 seconds into the boot.

This is likely why it (already)worked on AMD/Radeon too: had DRM_RADEON=y and CONFIG_DRM=y.

UPDATE: I've found another way:
if you want to keep i915 and drm as kernel modules, just make sure that /etc/mkintcpio.conf has MODULES=(i915 drm fbcon) (not sure if all are needed, to be honest) and (this is probably not needed) /etc/modules-load.d/i915.conf has i915 on one line.
This method also works but the oldest dmesg line visible is at 4.3 seconds into the boot(compared with 0.2 sec for the in-kernel i915/drm)

^ In other words, make sure initrd/initramfs image has those modules for the kexec kernel to load early on startup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy