radeon/i586: BUG: kernel NULL pointer dereference, address: 00000004
Brief summary of the problem:
radeon and drm driver emits BUG and kernel panics on i586 CPU and AGP bus card.
Hardware description:
- CPU: Pentium 120 (P54C)
- GPU: 01:00.0 0300: 1002:5960 (rev 01) 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV280 [Radeon 9200 PRO / 9250] (rev 01) (prog-if 00 [VGA controller]) Bus connection: AGP
- System Memory: 1GiB
- Display(s): 1
- Type of Display Connection: VGA
System information:
- Distro name and Version: Rocky Linux 9.2
- Kernel version: kernel-6.1.11 https://gitlab.freedesktop.org/agd5f/linux.git HEAD->amd-staging-drm-next 9487fb8eb1f
- Custom kernel: Kernel from amd-staging-drm-next, compiled under rpmbuild
How to reproduce the issue:
- Compile an i586 kernel with CONFIG_DRM_RADEON=m .
- Install onto machine with Radeon 9200 AGP card.
- Boot. On transition to graphical console, the kernel panics.
- To grab the kernel panic message, boot by adding "console=ttyS0" and use serial console.
Console Log
[ 463.512597] [drm] radeon kernel modesetting enabled.
[ 463.571435] radeon 0000:01:00.0: vgaarb: deactivate vga console
[ 463.676628] Console: switching to colour dummy device 80x25
[ 463.834998] [drm] initializing kernel modesetting (RV280 0x1002:0x5960 0x148C:0x2094 0x01).
[ 463.845435] [drm] Forcing AGP to PCI mode
[ 464.060722] [drm] Generation 2 PCI interface, using max accessible memory
[ 464.061689] radeon 0000:01:00.0: VRAM: 128M 0x00000000C0000000 - 0x00000000C7FFFFFF (128M used)
[ 464.074217] radeon 0000:01:00.0: GTT: 512M 0x00000000A0000000 - 0x00000000BFFFFFFF
[ 464.242304] [drm] Detected VRAM RAM=128M, BAR=128M
[ 464.251369] [drm] RAM width 64bits DDR
[ 464.392636] [drm] radeon: 128M of VRAM memory ready
[ 464.462477] [drm] radeon: 512M of GTT memory ready.
[ 464.522200] [drm] GART: num cpu pages 131072, num gpu pages 131072
[ 464.701594] [drm] PCI GART of 512M enabled (table at 0x0000000008200000).
[ 464.777076] radeon 0000:01:00.0: WB disabled
[ 464.783044] radeon 0000:01:00.0: fence driver on ring 0 use gpu addr 0x00000000a0000000
[ 464.857834] radeon 0000:01:00.0: Disabling GPU acceleration
[ 464.874988] [drm] radeon: cp finalized
[ 465.110546] [drm] Radeon Display Connectors
[ 465.115998] [drm] Connector 0:
[ 465.125799] [drm] VGA-1
[ 465.140634] [drm] DDC: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60
[ 465.146921] [drm] Encoders:
[ 465.155015] [drm] CRT1: INTERNAL_DAC1
[ 465.169283] [drm] Connector 1:
[ 465.177982] [drm] DVI-I-1
[ 465.184978] [drm] HPD1
[ 465.200419] [drm] DDC: 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64
[ 465.206674] [drm] Encoders:
[ 465.214656] [drm] CRT2: INTERNAL_DAC2
[ 465.228887] [drm] DFP1: INTERNAL_TMDS1
[ 465.233613] [drm] Connector 2:
[ 465.242142] [drm] SVIDEO-1
[ 465.259632] [drm] Encoders:
[ 465.267660] [drm] TV1: INTERNAL_DAC2
[ 466.211483] BUG: kernel NULL pointer dereference, address: 00000004
[ 466.221070] #PF: supervisor read access in kernel mode
[ 466.221070] #PF: error_code(0x0000) - not-present page
[ 466.221070] *pde = 00000000
[ 466.221070] Oops: 0000 [#1] PREEMPT SMP
[ 466.221070] CPU: 0 PID: 370 Comm: systemd-udevd Not tainted 6.1.11-1.el9_2.v1.i586 #1
[ 466.221070] Hardware name: System Manufacturer System Name/ALADDIN5, BIOS 0626 07/15/95
[ 466.221070] EIP: _raw_spin_lock_irqsave+0x1f/0x40
[ 466.221070] Code: cc cc cc cc cc cc cc cc cc cc cc 3e 8d 74 26 00 55 89 c1 89 e5 56 53 9c 5b fa 64 ff 05 dc d6 79 c2 31 d2 be 01 00 00 00 89 d0 <3e> 0f b1 31 75 0b 89 d8 5b 5e 5d c3 8d 74 26 00 90 89 c2 89 c8 e8
[ 466.221070] EAX: 00000000 EBX: 00000246 ECX: 00000004 EDX: 00000000
[ 466.221070] ESI: 00000001 EDI: c3e5dc28 EBP: c3e5dc1c ESP: c3e5dc14
[ 466.221070] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010046
[ 466.221070] CR0: 80050033 CR2: 00000004 CR3: 05818000 CR4: 00000010
[ 466.221070] Call Trace:
[ 466.221070] kthread_flush_worker+0x52/0xa0
[ 466.221070] ? kthread_data+0x30/0x30
[ 466.221070] drm_crtc_vblank_off+0x173/0x260 [drm]
[ 466.221070] ? ww_mutex_lock+0x14/0x80
[ 466.221070] radeon_crtc_dpms+0x197/0x1b0 [radeon]
[ 466.221070] radeon_crtc_disable+0x16/0xa0 [radeon]
[ 466.221070] __drm_helper_disable_unused_functions+0x74/0xc0 [drm_kms_helper]
[ 466.221070] drm_helper_disable_unused_functions+0x3c/0x50 [drm_kms_helper]
[ 466.221070] radeon_fbdev_init+0xb0/0x130 [radeon]
[ 466.221070] radeon_modeset_init+0x24d/0x310 [radeon]
[ 466.221070] radeon_driver_load_kms+0xc4/0x240 [radeon]
[ 466.221070] drm_dev_register+0xd6/0x1c0 [drm]
[ 466.221070] radeon_pci_probe+0xc0/0x100 [radeon]
[ 466.221070] pci_device_probe+0xaa/0x160
[ 466.221070] really_probe+0xb7/0x340
[ 466.221070] __driver_probe_device+0x79/0x1e0
[ 466.221070] ? sysfs_create_dir_ns+0x54/0xc0
[ 466.221070] driver_probe_device+0x1f/0x90
[ 466.221070] __driver_attach+0xc7/0x1a0
[ 466.221070] ? __device_attach_driver+0x100/0x100
[ 466.221070] bus_for_each_dev+0x58/0x90
[ 466.221070] driver_attach+0x19/0x20
[ 466.221070] ? __device_attach_driver+0x100/0x100
[ 466.221070] bus_add_driver+0x177/0x1c0
[ 466.221070] driver_register+0x79/0xd0
[ 466.221070] ? 0xf7e2a000
[ 466.221070] __pci_register_driver+0x4c/0x50
[ 466.221070] radeon_module_init+0x5c/0x1000 [radeon]
[ 466.221070] do_one_initcall+0x3e/0x1c0
[ 466.221070] ? __vunmap+0x20b/0x2a0
[ 466.221070] ? __kmem_cache_alloc_node+0x2f/0x3e0
[ 466.221070] ? do_init_module+0x21/0x1d0
[ 466.221070] ? kmalloc_trace+0x20/0x90
[ 466.221070] ? do_init_module+0x21/0x1d0
[ 466.221070] do_init_module+0x43/0x1d0
[ 466.221070] load_module+0x862/0x8f0
[ 466.221070] ? check_heap_object+0xdf/0x130
[ 466.221070] ? security_kernel_post_load_data+0x52/0x60
[ 466.221070] __ia32_sys_init_module+0x16d/0x1a0
[ 466.221070] do_int80_syscall_32+0x2e/0x80
[ 466.221070] entry_INT80_32+0xf0/0xf0
[ 466.221070] EIP: 0xb79f0e4e
[ 466.221070] Code: 0f 83 d6 06 00 00 c3 66 90 66 90 90 57 56 53 8b 7c 24 20 8b 74 24 1c 8b 54 24 18 8b 4c 24 14 8b 5c 24 10 b8 80 00 00 00 cd 80 <5b> 5e 5f 3d 01 f0 ff ff 0f 83 a4 06 00 00 c3 66 90 90 53 8b 54 24
[ 466.221070] EAX: ffffffda EBX: b5516010 ECX: 0023bca2 EDX: b7c2f274
[ 466.221070] ESI: b7c29295 EDI: b7c36dd8 EBP: 009d6500 ESP: bfc86d60
[ 466.221070] DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 007b EFLAGS: 00000292
[ 466.221070] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib radeon(+) nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 amdxcp gpu_sched drm_buddy video wmi i2c_algo_bit drm_display_helper cec drm_ttm_helper ppdev rfkill ip_set ttm nf_tables libcrc32c nfnetlink drm_kms_helper pcspkr e100 syscopyarea parport_pc sysfillrect mii sysimgblt parport qrtr drm fuse ext4 mbcache jbd2 sd_mod t10_pi sr_mod crc64_rocksoft_generic cdrom crc64_rocksoft crc64 sg ata_generic pata_ali libata serio_raw
[ 466.221070] CR2: 0000000000000004
[ 466.221070] ---[ end trace 0000000000000000 ]---
[ 466.221070] EIP: _raw_spin_lock_irqsave+0x1f/0x40
[ 466.221070] Code: cc cc cc cc cc cc cc cc cc cc cc 3e 8d 74 26 00 55 89 c1 89 e5 56 53 9c 5b fa 64 ff 05 dc d6 79 c2 31 d2 be 01 00 00 00 89 d0 <3e> 0f b1 31 75 0b 89 d8 5b 5e 5d c3 8d 74 26 00 90 89 c2 89 c8 e8
[ 466.221070] EAX: 00000000 EBX: 00000246 ECX: 00000004 EDX: 00000000
[ 466.221070] ESI: 00000001 EDI: c3e5dc28 EBP: c3e5dc1c ESP: c3e5dc14
[ 466.221070] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 EFLAGS: 00010046
[ 466.221070] CR0: 80050033 CR2: 00000004 CR3: 05818000 CR4: 00000010
[ 466.221070] Kernel panic - not syncing: Fatal exception
[ 466.221070] Kernel Offset: disabled
[ 466.221070] ---[ end Kernel panic - not syncing: Fatal exception ]--
Discussion
Previous Rocky Linux 9.1 kernel (kernel-5.14.0-162.23.1) was working flawlessly. RHEL 9.2 seems to have retrofitted kernel-6.0 DRM code according to %changelog, so this seems to be a regression.
Interesting phenomena: By booting kernel option "init=/bin/sh", and typing "exec /usr/lib/systemd/systemd" on the shell prompt, makes the radeon.ko driver to propely work. It looks like some raw input to the console fixes something.