Kernel – Pre-Release Tests for 5.6-rc1 ..
Kernel 5.6-rc1 should be out on Sunday, February 9th, but I noticed that early-version-test patches are already available for VMware 15.5.1, here: https://github.com/mkubecek/vmware-host-modules/tree/tmp/workstation-15.5.1-k5.6
These patches gave clues to what might affect NVIDIA as well, and I managed to get a GIT version of 5.6-rc1-pre (dated February 5th) to compile OK, and was able to use this. Of course, there are still changes being made to the kernel source, but the goal was to get some ‘advance’ testing done..
# uname -a
Linux rgz220 5.6.0-rc01 #1 SMP Wed Feb 5 17:08:41 PST 2020 x86_64 x86_64 x86_64 GNU/Linux
The patches for VMware worked OK, and it seems to run OK, (after brief tests..)
For NVIDIA, driver 440.59 compilation failed at several stages, as expected, and clues to changes necessary are found at the kernel patch source https://lore.kernel.org/patchwork/patch/584202/ (timespec64…) and https://lore.kernel.org/netdev/20191225172546.GB13378@avx2/ (convert everything to “struct proc_ops”). There was also a generic change from ioremap_nocache(phys, size) to ioremap(phys, size) in NVIDIA-Linux-x86_64-440.59/kernel/common/inc/nv-linux.h
The timespec64 change was relatively simple, to NVIDIA-Linux-x86_64-440.59/kernel/nvidia/os-interface.c , but the “struct proc_ops” changes meant going through the affected source and making changes along the way, re-compiling / testing as I went.. There are good examples of the changes needed at the start of the patch article, to make the job a bit easier. The files changed are:
NVIDIA-Linux-x86_64-440.59/kernel/common/inc/nv-linux.h
NVIDIA-Linux-x86_64-440.59/kernel/common/inc/nv-procfs.h
NVIDIA-Linux-x86_64-440.59/kernel/nvidia/nv-procfs.c
NVIDIA-Linux-x86_64-440.59/kernel/nvidia/os-interface.c
With all these changes, I got the driver to compile, and run, although it gave a tombstone (again!) after # startx, but appears to work OK despite this:
[32517.283386] ------------[ cut here ]------------
[32517.287605] refcount_t: underflow; use-after-free.
[32517.292033] WARNING: CPU: 1 PID: 141273 at lib/refcount.c:28 refcount_warn_saturate+0xa6/0xf0
[32517.300186] Modules linked in: rfcomm cmac bnep btusb btrtl btbcm btintel bluetooth ecdh_generic ecc hid_logitech_hidpp joydev hid_logitech_dj nvidia_drm(PO) nvidia_modeset(PO) nvidia(PO) drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm vmnet(O) vmw_vsock_vmci_transport vsock vmw_vmci vmmon(O) sunrpc vfat fat x86_pkg_temp_thermal intel_powerclamp coretemp snd_hda_codec_realtek kvm_intel snd_hda_codec_generic snd_hda_codec_hdmi iTCO_wdt kvm ledtrig_audio irqbypass iTCO_vendor_support snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core crct10dif_pclmul snd_hwdep crc32_pclmul snd_seq snd_seq_device snd_pcm ghash_clmulni_intel intel_cstate intel_uncore hp_wmi sparse_keymap rfkill intel_rapl_perf snd_timer i2c_i801 pcspkr wmi_bmof snd lpc_ich soundcore binfmt_misc crc32c_intel e1000e wmi fuse [last unloaded: syscopyarea]
[32517.377452] CPU: 1 PID: 141273 Comm: Xorg.wrap Tainted: P O 5.6.0-rc01 #1
[32517.385321] Hardware name: Hewlett-Packard HP Z220 CMT Workstation/1790, BIOS K51 v01.87 06/10/2019
[32517.394134] RIP: 0010:refcount_warn_saturate+0xa6/0xf0
[32517.399033] Code: 05 a7 13 cf 00 01 e8 57 8a d0 ff 0f 0b c3 80 3d 95 13 cf 00 00 75 95 48 c7 c7 50 db db 91 c6 05 85 13 cf 00 01 e8 38 8a d0 ff <0f> 0b c3 80 3d 74 13 cf 00 00 0f 85 72 ff ff ff 48 c7 c7 a8 db db
[32517.417622] RSP: 0018:ffffb8d0810f3da0 EFLAGS: 00010286
[32517.422692] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[32517.429689] RDX: ffff98994dc5d400 RSI: ffff98994dc58748 RDI: ffff98994dc58748
[32517.436685] RBP: ffff9899490d7ce8 R08: 0000000000000000 R09: 00000000000003f0
[32517.443680] R10: 0000000000aaaaaa R11: 0000000000000000 R12: ffff9899474132e8
[32517.450677] R13: ffff989947413000 R14: 0000000000000008 R15: 0000000000000000
[32517.457679] FS: 00007f41e2abc740(0000) GS:ffff98994dc40000(0000) knlGS:0000000000000000
[32517.465622] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[32517.471232] CR2: 00007f41e2b10e20 CR3: 0000000406f4c005 CR4: 00000000001606e0
[32517.478233] Call Trace:
[32517.480522] nv_drm_atomic_helper_disable_all+0xe7/0x280 [nvidia_drm]
[32517.486808] nv_drm_master_drop+0x1d/0x60 [nvidia_drm]
[32517.491786] drm_drop_master+0x19/0x30 [drm]
[32517.495870] drm_master_release+0x8c/0xb0 [drm]
[32517.500236] drm_file_free.part.0+0x24a/0x2c0 [drm]
[32517.504932] drm_release+0x46/0x80 [drm]
[32517.508630] __fput+0xbc/0x250
[32517.511456] task_work_run+0x84/0xa0
[32517.514798] exit_to_usermode_loop+0x95/0xa0
[32517.518827] do_syscall_64+0x1bc/0x210
[32517.522309] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[32517.527085] RIP: 0033:0x7f41e2c9b8e7
[32517.530348] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 e3 fb ff ff
[32517.548848] RSP: 002b:00007ffe5dc99f78 EFLAGS: 00000246 ORIG_RAX: 0000000000000003
[32517.556171] RAX: 0000000000000000 RBX: 0000000000000001 RCX: 00007f41e2c9b8e7
[32517.563022] RDX: 00007ffe5dc99f90 RSI: 00000000c04064a0 RDI: 0000000000000003
[32517.569845] RBP: 00007ffe5dc9a070 R08: 0000000000000000 R09: 00007ffe5dc99e00
[32517.576690] R10: 000055c65bdb7731 R11: 0000000000000246 R12: 0000000000000003
[32517.583536] R13: 0000000000000001 R14: 0000000000000000 R15: 00007ffe5dc99f90
[32517.590384] ---[ end trace 9f09730ade497b97 ]---
There may be additional patches necessary for the released version of 5.6-rc1, but at least I now have a good idea of what is needed to get it all working, when the time comes.
Robert Gadsdon. February 6th 2020.
Comments
Kernel – Pre-Release Tests for 5.6-rc1 .. — No Comments