LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-13-2018, 06:40 PM   #1
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Rep: Reputation: Disabled
Angry Kernel issues with vfio-bind and Sapphire RX 580


I had originally planned on making a post in this thread but my problems have escalated far beyond what I was hoping or wanting them to do.

I want to pass through a sapphire RX 580, to a qemu machine through vms. I went through the VM-creation process as shown on vms-tutorial, I ran the vfio-bind script that came with vms itself, added the nessecary vms config flags, enabled the iommu module through /etc/rc.d/local.rc and restarted my PC. I fire up VMS and it's spits out a directory not found error in /dev/vfio, I look through things only to find this in my startup.

specific init output
Code:
Unbinding old driver from 0000:07:00.0 ... [   31.261970] BUG: unable to handle kernel NULL pointer dereference at 0000000000000258
[   31.264826] IP: mutex_lock+0x19/0x30
[   31.267676] PGD 252dd9067 P4D 252dd9067 PUD 252dd8067 PMD 0
[   31.270617] Oops: 0002 [#1] SMP NOPTI
[   31.273455] Modules linked in: vfio_pci vfio_virqfd vfio_iommu_type1 vfio ipv6 cfg80211 8021q garp mrp stp llc fuse hid_generic usbhid snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_seq_device uas usb_storage hid amdkfd 
amd_iommu_v2 amdgpu radeon eeepc_wmi asus_wmi sparse_keymap rfkill video wmi_bmof kvm_amd ttm mxm_wmi i2c_dev drm_kms_helper kvm irqbypass crct10dif_pclmul crc32_pclmul evdev crc32c_intel drm fam15h_power agpgart k10temp xhci_pci 
ghash_clmulni_intel hwmon i2c_algo_bit r8169 mii fb_sys_fops syscopyarea sysfillrect sysimgblt ohci_pci xhci_hcd snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi shpchp ohci_hcd ehci_pci snd_hda_intel ehci_hcd wmi 
snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core button pcc_cpufreq acpi_cpufreq loop
[   31.286620] CPU: 0 PID: 1390 Comm: vfio-bind Not tainted 4.14.67 #1
[   31.290003] Hardware name: To be filled by O.E.M. To be filled by O.E.M./SABERTOOTH 990FX R2.0, BIOS 2901 05/04/2016
[   31.293466] task: ffff9d3192d41a80 task.stack: ffffadae413ac000
[   31.296928] RIP: 0010:mutex_lock+0x19/0x30
[   31.300409] RSP: 0018:ffffadae413afd10 EFLAGS: 00010246
[   31.303888] RAX: 0000000000000000 RBX: 0000000000000258 RCX: 0000000180200008
[   31.307359] RDX: ffff9d3192d41a80 RSI: ffff9d3192d7c520 RDI: 0000000000000258
[   31.310841] RBP: 0000000000000000 R08: ffff9d3192d7c800 R09: 0000000180200008
[   31.314291] R10: ffff9d3192d7c600 R11: ffff9d319ec1e124 R12: ffff9d3192d7c520
[   31.317691] R13: ffffffffc0ad7070 R14: 0000000000000060 R15: ffff9d318b214920
[   31.321089] FS:  00007f4201895740(0000) GS:ffff9d319ec00000(0000) knlGS:0000000000000000
[   31.324545] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   31.327970] CR2: 0000000000000258 CR3: 0000000252dca000 CR4: 00000000000406f0
[   31.331393] Call Trace:
[   31.334847]  drm_mode_object_unregister+0x1e/0x60 [drm]
[   31.338397]  amdgpu_fbdev_fini+0x51/0x80 [amdgpu]
[   31.341904]  amdgpu_device_fini+0x4c/0x171 [amdgpu]
[   31.345384]  amdgpu_driver_unload_kms+0x4a/0x90 [amdgpu]
[   31.348840]  drm_dev_unregister+0x3f/0xf0 [drm]
[   31.352329]  amdgpu_pci_remove+0x15/0x20 [amdgpu]
[   31.355662]  pci_device_remove+0x3b/0xb0
[   31.358989]  device_release_driver_internal+0x15a/0x220
[   31.362298]  unbind_store+0xa2/0x140
[   31.365682]  kernfs_fop_write+0x116/0x190
[   31.368993]  __vfs_write+0x26/0x150
[   31.372320]  ? set_close_on_exec+0x2a/0x60
[   31.375602]  ? do_fcntl+0x492/0x600
[   31.378973]  vfs_write+0xa5/0x1a0
[   31.382255]  SyS_write+0x3f/0xa0
[   31.385579]  do_syscall_64+0x6e/0x100
[   31.388855]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[   31.392152] RIP: 0033:0x7f4200f94414
[   31.395447] RSP: 002b:00007ffe4fec26e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[   31.398833] RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f4200f94414
[   31.402211] RDX: 000000000000000d RSI: 0000000001eed408 RDI: 0000000000000001
[   31.405574] RBP: 0000000001eed408 R08: 000000000000000a R09: 00007f4200feec10
[   31.408979] R10: 000000000000000a R11: 0000000000000246 R12: 00007f420126d760
[   31.412360] R13: 000000000000000d R14: 00007f42012692a0 R15: 00007f4201268760
[   31.415673] Code: 00 00 0f 1f 44 00 00 be 02 00 00 00 e9 61 fb ff ff 90 0f 1f 44 00 00 53 48 89 fb e8 b2 e8 ff ff 31 c0 65 48 8b 14 25 40 4d 01 00 <f0> 48 0f b1 13 48 85 c0 74 06 48 89 df 5b eb c7 5b c3 0f 1f 44
[   31.419229] RIP: mutex_lock+0x19/0x30 RSP: ffffadae413afd10
[   31.422669] CR2: 0000000000000258
[   31.426205] ---[ end trace 00ecbc5e881792c1 ]---
/etc/rc.d/rc.local: line 15:  1390 Killed                  /usr/sbin/vfio-bind 07:00.0
So I tried to rebuild my kernel, only to have it panic and spit out the same error as shown above.

When I shut down my PC on the prebuilt kernel, the kernel tries to shut down the virtualization, but hangs forever, and forces me to do a hard-shutdown.

Specific GPU output from Dmesg
Code:
[   31.241014] VFIO - User Level meta-driver version: 0.3
[   31.261206] [drm] amdgpu: finishing device.
[   31.261970] BUG: unable to handle kernel NULL pointer dereference at 0000000000000258
[   31.264826] IP: mutex_lock+0x19/0x30
[   31.267676] PGD 252dd9067 P4D 252dd9067 PUD 252dd8067 PMD 0 
[   31.270617] Oops: 0002 [#1] SMP NOPTI
[   31.273455] Modules linked in: vfio_pci vfio_virqfd vfio_iommu_type1 vfio ipv6 cfg80211 8021q garp mrp stp llc fuse hid_generic usbhid snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_seq_device uas usb_storage hid amdkfd amd_iommu_v2 amdgpu radeon eeepc_wmi asus_wmi sparse_keymap rfkill video wmi_bmof kvm_amd ttm m
xm_wmi i2c_dev drm_kms_helper kvm irqbypass crct10dif_pclmul crc32_pclmul evdev crc32c_intel drm fam15h_power agpgart k10temp xhci_pci ghash_clmulni_intel hwmon i2c_algo_bit r8169 mii fb_sys_fops syscopyarea sysfillrect sysimgblt ohci_pci xhci_hcd snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi shpchp
 ohci_hcd ehci_pci snd_hda_intel ehci_hcd wmi snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core button pcc_cpufreq acpi_cpufreq loop
[   31.286620] CPU: 0 PID: 1390 Comm: vfio-bind Not tainted 4.14.67 #1
[   31.290003] Hardware name: To be filled by O.E.M. To be filled by O.E.M./SABERTOOTH 990FX R2.0, BIOS 2901 05/04/2016
[   31.293466] task: ffff9d3192d41a80 task.stack: ffffadae413ac000
[   31.296928] RIP: 0010:mutex_lock+0x19/0x30
[   31.300409] RSP: 0018:ffffadae413afd10 EFLAGS: 00010246
[   31.303888] RAX: 0000000000000000 RBX: 0000000000000258 RCX: 0000000180200008
[   31.307359] RDX: ffff9d3192d41a80 RSI: ffff9d3192d7c520 RDI: 0000000000000258
[   31.310841] RBP: 0000000000000000 R08: ffff9d3192d7c800 R09: 0000000180200008
[   31.314291] R10: ffff9d3192d7c600 R11: ffff9d319ec1e124 R12: ffff9d3192d7c520
[   31.317691] R13: ffffffffc0ad7070 R14: 0000000000000060 R15: ffff9d318b214920
[   31.321089] FS:  00007f4201895740(0000) GS:ffff9d319ec00000(0000) knlGS:0000000000000000
[   31.324545] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   31.327970] CR2: 0000000000000258 CR3: 0000000252dca000 CR4: 00000000000406f0
[   31.331393] Call Trace:
[   31.334847]  drm_mode_object_unregister+0x1e/0x60 [drm]
[   31.338397]  amdgpu_fbdev_fini+0x51/0x80 [amdgpu]
[   31.341904]  amdgpu_device_fini+0x4c/0x171 [amdgpu]
[   31.345384]  amdgpu_driver_unload_kms+0x4a/0x90 [amdgpu]
[   31.348840]  drm_dev_unregister+0x3f/0xf0 [drm]
[   31.352329]  amdgpu_pci_remove+0x15/0x20 [amdgpu]
[   31.355662]  pci_device_remove+0x3b/0xb0
[   31.358989]  device_release_driver_internal+0x15a/0x220
[   31.362298]  unbind_store+0xa2/0x140
[   31.365682]  kernfs_fop_write+0x116/0x190
[   31.368993]  __vfs_write+0x26/0x150
[   31.372320]  ? set_close_on_exec+0x2a/0x60
[   31.375602]  ? do_fcntl+0x492/0x600
[   31.378973]  vfs_write+0xa5/0x1a0
[   31.382255]  SyS_write+0x3f/0xa0
[   31.385579]  do_syscall_64+0x6e/0x100
[   31.388855]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[   31.392152] RIP: 0033:0x7f4200f94414
[   31.395447] RSP: 002b:00007ffe4fec26e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[   31.398833] RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f4200f94414
[   31.402211] RDX: 000000000000000d RSI: 0000000001eed408 RDI: 0000000000000001
[   31.405574] RBP: 0000000001eed408 R08: 000000000000000a R09: 00007f4200feec10
[   31.408979] R10: 000000000000000a R11: 0000000000000246 R12: 00007f420126d760
[   31.412360] R13: 000000000000000d R14: 00007f42012692a0 R15: 00007f4201268760
[   31.415673] Code: 00 00 0f 1f 44 00 00 be 02 00 00 00 e9 61 fb ff ff 90 0f 1f 44 00 00 53 48 89 fb e8 b2 e8 ff ff 31 c0 65 48 8b 14 25 40 4d 01 00 <f0> 48 0f b1 13 48 85 c0 74 06 48 89 df 5b eb c7 5b c3 0f 1f 44 
[   31.419229] RIP: mutex_lock+0x19/0x30 RSP: ffffadae413afd10
[   31.422669] CR2: 0000000000000258
[   31.426205] ---[ end trace 00ecbc5e881792c1 ]---
[   98.254607] ------------[ cut here ]------------
[   98.258423] WARNING: CPU: 7 PID: 1439 at drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c:326 amdgpu_sa_bo_new+0x480/0x4a0 [amdgpu]
[   98.262273] Modules linked in: vfio_pci vfio_virqfd vfio_iommu_type1 vfio ipv6 cfg80211 8021q garp mrp stp llc fuse hid_generic usbhid snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_seq_device uas usb_storage hid amdkfd amd_iommu_v2 amdgpu radeon eeepc_wmi asus_wmi sparse_keymap rfkill video wmi_bmof kvm_amd ttm mxm_wmi i2c_dev drm_kms_helper kvm irqbypass crct10dif_pclmul crc32_pclmul evdev crc32c_intel drm fam15h_power agpgart k10temp xhci_pci ghash_clmulni_intel hwmon i2c_algo_bit r8169 mii fb_sys_fops syscopyarea sysfillrect sysimgblt ohci_pci xhci_hcd snd_hda_codec_realtek snd_hda_codec_generic snd_hda_codec_hdmi shpchp ohci_hcd ehci_pci snd_hda_intel ehci_hcd wmi snd_hda_codec snd_hda_core snd_hwdep snd_pcm snd_timer snd soundcore i2c_piix4 i2c_core button pcc_cpufreq acpi_cpufreq loop
[   98.278337] CPU: 7 PID: 1439 Comm: Xorg.wrap Tainted: G      D         4.14.67 #1
[   98.282154] Hardware name: To be filled by O.E.M. To be filled by O.E.M./SABERTOOTH 990FX R2.0, BIOS 2901 05/04/2016
[   98.286025] task: ffff9d3192d43500 task.stack: ffffadae40b48000
[   98.289964] RIP: 0010:amdgpu_sa_bo_new+0x480/0x4a0 [amdgpu]
[   98.293729] RSP: 0018:ffffadae40b4b770 EFLAGS: 00010297
[   98.297483] RAX: ffff9d3193060c00 RBX: ffff9d318d380000 RCX: 0000000000000100
[   98.301324] RDX: 0000000000000128 RSI: ffff9d3193060ee0 RDI: ffff9d318d383338
[   98.301324] RDX: 0000000000000128 RSI: ffff9d3193060ee0 RDI: ffff9d318d383338
[   98.305032] RBP: ffff9d3193060ee0 R08: 0000000000022580 R09: ffff9d3193060c00
[   98.308543] R10: 0000000000001800 R11: 0000000000000000 R12: 0000000000000000
[   98.311970] R13: 0000000000000000 R14: ffff9d318ea4ca28 R15: ffff9d318ea4c800
[   98.315309] FS:  00007f008a0ecb80(0000) GS:ffff9d319edc0000(0000) knlGS:0000000000000000
[   98.318567] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   98.321763] CR2: 00007f008935f600 CR3: 000000024a9d8000 CR4: 00000000000406e0
[   98.325024] Call Trace:
[   98.328301]  ? add_hole+0xc9/0xf0 [drm]
[   98.331575]  ? drm_mm_insert_node_in_range+0x35a/0x510 [drm]
[   98.334839]  ? amdgpu_vram_mgr_new+0x1e2/0x2c0 [amdgpu]
[   98.338127]  ? amdgpu_bo_move_notify+0x37/0xc0 [amdgpu]
[   98.341345]  ? ttm_bo_handle_move_mem+0x117/0x560 [ttm]
[   98.344596]  ? wait_woken+0x80/0x80
[   98.347840]  ? mempool_alloc+0x57/0x170
[   98.350983]  ? ttm_bo_validate+0x105/0x130 [ttm]
[   98.354176]  ? __kmalloc+0x1a6/0x210
[   98.357375]  ? amdgpu_job_alloc+0x37/0xb0 [amdgpu]
[   98.360529]  amdgpu_ib_get+0x31/0x90 [amdgpu]
[   98.363729]  amdgpu_job_alloc_with_ib+0x46/0x80 [amdgpu]
[   98.366871]  amdgpu_fill_buffer+0xc5/0x300 [amdgpu]
[   98.370048]  amdgpu_bo_create_restricted+0x31b/0x490 [amdgpu]
[   98.373260]  amdgpu_bo_create+0xbd/0x1b0 [amdgpu]
[   98.376370]  ? __getblk_gfp+0x2c/0x280
[   98.379609]  amdgpu_vm_init+0x1bf/0x360 [amdgpu]
[   98.382697]  ? kmem_cache_alloc_trace+0x150/0x1b0
[   98.385823]  ? amdgpu_driver_open_kms+0x55/0x170 [amdgpu]
[   98.388923]  amdgpu_driver_open_kms+0x6a/0x170 [amdgpu]
[   98.392048]  drm_open+0x213/0x450 [drm]
[   98.395152]  drm_stub_open+0xb6/0xf0 [drm]
[   98.398257]  chrdev_open+0x8e/0x190
[   98.401402]  ? cdev_put.part.3+0x20/0x20
[   98.404492]  do_dentry_open+0x1a8/0x2c0
[   98.407574]  path_openat+0x3f1/0x1520
[   98.410663]  ? page_add_file_rmap+0x11/0x160
[   98.413830]  ? alloc_set_pte+0x25c/0x5a0
[   98.416918]  ? filemap_map_pages+0x2eb/0x380
[   98.420020]  do_filp_open+0x80/0xd0
[   98.423060]  ? __check_object_size+0x9f/0x18e
[   98.426126]  ? __alloc_fd+0x3d/0x140
[   98.429201]  do_sys_open+0x168/0x1f0
[   98.432228]  do_syscall_64+0x6e/0x100
[   98.435235]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[   98.438241] RIP: 0033:0x7f00897098bd
[   98.441121] RSP: 002b:00007ffeca2175a0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
[   98.444013] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f00897098bd
[   98.446913] RDX: 0000000000000002 RSI: 00007ffeca217680 RDI: 00000000ffffff9c
[   98.449792] RBP: 00007ffeca217640 R08: 0000000000000000 R09: 0000000000000000
[   98.452707] R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffeca217680
[   98.455614] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[   98.458538] Code: 17 ff ff ff 44 89 f2 44 89 ee 48 89 df e8 09 f6 ff ff 84 c0 0f 84 35 fe ff ff e9 5d fe ff ff 0f 0b bd ea ff ff ff e9 f0 fe ff ff <0f> 0b bd ea ff ff ff e9 e4 fe ff ff bd f4 ff ff ff e9 da fe ff 
[   98.461723] ---[ end trace 00ecbc5e881792c2 ]---
[   98.464937] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[   98.652988] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[   98.715127] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[   98.717840] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[   98.805911] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[   98.805966] amdgpu 0000:07:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=none
[   98.805969] radeon 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=io+mem
[   98.806439] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[   98.806522] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[  100.026205] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[  101.375494] amdgpu 0000:07:00.0: failed to get a new IB (-22)
[  114.301079] retire_capture_urb: 2491 callbacks suppressed
I hope my hardware's fine, I worry that it's going bad.

Last edited by lawnm0wer; 09-13-2018 at 06:44 PM.
 
Old 09-14-2018, 05:08 AM   #2
ninikos
Member
 
Registered: Dec 2012
Posts: 56

Rep: Reputation: 29
From a quick duckduckgo search, it seems there is indeed a bug related to kernel module unloading.
https://bugs.freedesktop.org/show_bug.cgi?id=106993

Are you using the generic or the huge kernel? You should use the generic kernel.

I assume that you use the radeon driver for your Sapphire HD 6450. As a workaround, you can try to blacklist the amdgpu module, so it is not loaded at all during boot like this

Code:
echo 'blacklist amdgpu' > /etc/modprobe.d/gpus.conf
and restart
 
Old 09-14-2018, 05:12 AM   #3
ninikos
Member
 
Registered: Dec 2012
Posts: 56

Rep: Reputation: 29
Also, the HD 6450 should be the first graphics card that bios/efi uses. Your efi or bios should display via the HD 6450 during boot.
 
Old 09-14-2018, 09:07 PM   #4
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ninikos View Post
From a quick duckduckgo search, it seems there is indeed a bug related to kernel module unloading.
https://bugs.freedesktop.org/show_bug.cgi?id=106993

Are you using the generic or the huge kernel? You should use the generic kernel.

I assume that you use the radeon driver for your Sapphire HD 6450. As a workaround, you can try to blacklist the amdgpu module, so it is not loaded at all during boot like this

Code:
echo 'blacklist amdgpu' > /etc/modprobe.d/gpus.conf
and restart

Also, the HD 6450 should be the first graphics card that bios/efi uses. Your efi or bios should display via the HD 6450 during boot.
I presume that the kernel that comes with the slackware-current install .iso is indeed the generic kernel, if that is so then I am indeed running the generic kernel. My HD 6450 is currently the only GPU plugged into my monitor, which has been that way since I reinstalled slackware to the august slackware-current build.

I ran the command shown to blacklist amdgpu, and so far, everything looked fine, until I tried to run my win7 VM.

Code:
bash-4.4$ vms start win7
starting win7 ...qemu-system-x86_64: -device vfio-pci,host=07:00.0: VFIO_MAP_DMA: -12
qemu-system-x86_64: -device vfio-pci,host=07:00.0: vfio_dma_map(0x7f162e89ba00, 0x0, 0xa0000, 0x7f1478600000) = -12 (Cannot allocate memory)
qemu-system-x86_64: -device vfio-pci,host=07:00.0: VFIO_MAP_DMA: -12
qemu-system-x86_64: -device vfio-pci,host=07:00.0: vfio_dma_map(0x7f162e89ba00, 0x100000, 0xbff00000, 0x7f1478700000) = -12 (Cannot allocate memory)
qemu-system-x86_64: -device vfio-pci,host=07:00.0: VFIO_MAP_DMA: -12
qemu-system-x86_64: -device vfio-pci,host=07:00.0: vfio_dma_map(0x7f162e89ba00, 0x100000000, 0xef400000, 0x7f1538600000) = -12 (Cannot allocate memory)
qemu-system-x86_64: -device vfio-pci,host=07:00.0: vfio error: 0000:07:00.0: failed to setup container for group 22: memory listener initialization failed for container: Cannot allocate memory
I figured that since I was running the VM at almost full memory load (even though I have a disposable flash drive set up specifically as swap) that I could reduce the memory needed and everything will be fine.

It wasn't fine, it just changes the output to repeat the messages less. I don't understand if this is the GPU's problem, if qemu is being really stupid about this, or something in the kernel is still wrong.
 
Old 09-15-2018, 03:39 AM   #5
ninikos
Member
 
Registered: Dec 2012
Posts: 56

Rep: Reputation: 29
I think now it's a limits problem. You can try this (I assume you are in the audio group)

Code:
echo '@audio   -  memlock unlimited' >> /etc/security/limits.conf
And this

Code:
cp /sbin/initscript.sample /etc/initscript
and then edit /etc/initscript. The interesting section that I use here looks like this

Code:
# umask 022
  ulimit -c 2097151
  PATH=/bin:/sbin:/usr/bin:/usr/sbin
  export PATH

  # 
  #
  ulimit -l unlimited
  ulimit -f unlimited
  ulimit -r 99
  ulimit -Hn 1000000

  # Execute the program.
  eval exec "$4
and reboot.

Last edited by ninikos; 09-15-2018 at 03:40 AM.
 
Old 09-15-2018, 04:18 AM   #6
ninikos
Member
 
Registered: Dec 2012
Posts: 56

Rep: Reputation: 29
Quote:
Originally Posted by lawnm0wer View Post
I presume that the kernel that comes with the slackware-current install .iso is indeed the generic kernel, if that is so then I am indeed running the generic kernel.
By default, I think the slackware installer uses the huge kernel in /etc/lilo.conf

look for your entries at the end of /etc/lilo.conf and

Code:
ls -l /boot/vmlinuz*
to find out what you are using. You need an initrd.gz for the generic kernel. I usually set this up like this

Code:
slackpkg reinstall kernel-generic
/usr/share/mkinitrd/mkinitrd_command_generator.sh
/usr/share/mkinitrd/mkinitrd_command_generator.sh | bash
The first line is just a quick way to setup the soft links in /boot
The second line creates the command to create the initrd.gz. Watch out to not include amdgpu module for your case.
The third line creates the initrd.gz

Again, as an example, here /etc/lilo.conf looks like this
Code:
# Slackware 14.2
image = /boot/vmlinuz-generic
initrd = /boot/initrd.gz
label = Slackware-14.2
read-only

# Slackware 14.2 huge
image = /boot/vmlinuz-huge
root = "UUID=...."
label = SL14.2-huge
read-only
Notice that the generic kernel entry uses an initrd= line, while the huge uses a root= line

Last edited by ninikos; 09-15-2018 at 04:46 AM. Reason: fixed typo
 
Old 09-15-2018, 09:41 PM   #7
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ninikos View Post
I think now it's a limits problem. You can try this (I assume you are in the audio group)

(...)

and reboot.
we have a problem, our systems don't match.
Code:
bash-4.4$ su
Password: 
bash-4.4# echo '@audio   -  memlock unlimited' >> /etc/security/limits.conf
bash: /etc/security/limits.conf: No such file or directory
bash-4.4# cp /sbin/initscript.sample /etc/initscript
cp: cannot stat '/sbin/initscript.sample': No such file or directory
bash-4.4# ls /etc/initscript
ls: cannot access '/etc/initscript': No such file or directory
bash-4.4# slackpkg reinstall kernel-generic

Looking for kernel-generic in package list. Please wait... DONE

No packages match the pattern for reinstall. Try:

	/usr/sbin/slackpkg install|upgrade
what did you install to get your system to make these files and folders that don't exist on mine?

Last edited by lawnm0wer; 09-15-2018 at 10:08 PM.
 
Old 09-16-2018, 04:06 AM   #8
ninikos
Member
 
Registered: Dec 2012
Posts: 56

Rep: Reputation: 29
Quote:
Originally Posted by lawnm0wer View Post
we have a problem, our systems don't match.
Code:
bash-4.4$ su
Use
Code:
su -
to get a proper root login shell (notice the '-')

Quote:
bash-4.4# echo '@audio - memlock unlimited' >> /etc/security/limits.conf
bash: /etc/security/limits.conf: No such file or directory
Just do this for this file
Code:
mkdir /etc/security 
echo '@audio   -  memlock unlimited' >> /etc/security/limits.conf
Quote:
bash-4.4# cp /sbin/initscript.sample /etc/initscript
cp: cannot stat '/sbin/initscript.sample': No such file or directory
bash-4.4# ls /etc/initscript
ls: cannot access '/etc/initscript': No such file or directory
The initscript.sample file is part of the sysvinit package. For slackware 14.2
this is located in /sbin. For slackware current it is located at
/usr/doc/sysvinit-2.90/initscript.sample. So

Code:
cp /usr/doc/sysvinit-2.90/initscript.sample /etc/initscript
Then edit /etc/initscript as shown in the previous post

Quote:
bash-4.4# slackpkg reinstall kernel-generic
Looking for kernel-generic in package list. Please wait... DONE
No packages match the pattern for reinstall. Try:

/usr/sbin/slackpkg install|upgrade
Can you post the output of this
Code:
slackpkg search kernel

Last edited by ninikos; 09-16-2018 at 04:08 AM.
 
1 members found this post helpful.
Old 09-17-2018, 04:20 PM   #9
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Original Poster
Rep: Reputation: Disabled
OK! the process to adjust the ulimit did the trick, and I have a working qemu machine through VMS!

So far your questions about the kernel haven't felt like an issue anymore, but I'll post the results anyway.
Code:
bash-4.4# slackpkg search kernel

Looking for kernel in package list. Please wait... DONE

The list below shows all packages with name matching "kernel".

[  upgrade  ] - kernel-firmware-20180825_fea76a0-noarch-1 --> kernel-firmware-20180904_85c5d90-noarch-1
[  upgrade  ] - kernel-generic-4.14.67-x86_64-1 --> kernel-generic-4.14.69-x86_64-1
[  upgrade  ] - kernel-huge-4.14.67-x86_64-1 --> kernel-huge-4.14.69-x86_64-1
[  upgrade  ] - kernel-modules-4.14.67-x86_64-1 --> kernel-modules-4.14.69-x86_64-1
[  upgrade  ] - kernel-headers-4.14.67-x86-1 --> kernel-headers-4.14.69-x86-1
[  upgrade  ] - kernel-source-4.14.67-noarch-1 --> kernel-source-4.14.69-noarch-1

You can search specific files using "slackpkg file-search file".

bash-4.4$ ls -l /boot/vmlinuz*
lrwxrwxrwx 1 root root      20 Sep  4 19:30 /boot/vmlinuz -> vmlinuz-huge-4.14.67
lrwxrwxrwx 1 root root      23 Sep  4 19:21 /boot/vmlinuz-generic -> vmlinuz-generic-4.14.67
-rw-r--r-- 1 root root 5625616 Aug 24 17:03 /boot/vmlinuz-generic-4.14.67
lrwxrwxrwx 1 root root      20 Sep  4 19:21 /boot/vmlinuz-huge -> vmlinuz-huge-4.14.67
-rw-r--r-- 1 root root 8853264 Aug 24 17:02 /boot/vmlinuz-huge-4.14.67
-rw-r--r-- 1 root root 9193424 Sep 13 23:36 /boot/vmlinuz-vanilla-4.18.7

### and just because my machine is running elilo
bash-4.4$ ls -l /boot/efi/EFI/Slackware/vmlinuz*
-rwxr-xr-x 1 root root 8853264 Aug 24 21:02 /boot/efi/EFI/Slackware/vmlinuz
-rwxr-xr-x 1 root root 9347456 Dec  6  2017 /boot/efi/EFI/Slackware/vmlinuz-4.4.14
-rwxr-xr-x 1 root root 7973920 Dec 10  2017 /boot/efi/EFI/Slackware/vmlinuz-custom-4.9.67
-rwxr-xr-x 1 root root 4892960 Dec  5  2017 /boot/efi/EFI/Slackware/vmlinuz-generic-4.9.67
-rwxr-xr-x 1 root root 9193424 Sep 13 23:28 /boot/efi/EFI/Slackware/vmlinuz-vanilla-4.18.7
What are your recommendations for a post-install of windows 7 passthrough? GPU Drivers seem fairly obvious for me, but I otherwise do not know.

Last edited by lawnm0wer; 09-19-2018 at 11:39 AM.
 
Old 09-19-2018, 11:39 AM   #10
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Original Poster
Rep: Reputation: Disabled
OK, so I installed the drivers for my GPU through a minimal-install package, and the guest is having issues booting up. Either it freezes mid-start, or BSODs. Safe mode starts fine, device manager shows my GPU and a standard VGA.

In addition to trying to figure things out, I'm wanting to pass through a USB external hard drive so I can copy some games and a full package of GPU drivers to the VM. the problem is, this happens:
Code:
bash-4.4$ vms start win7
starting win7 ...libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/013/002: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
qemu-system-x86_64: -device usb-host,hostbus=13,hostaddr=2: failed to open host usb device 13:2
I will continue to try and diagnose things through the guest, what else am I missing or need to tweak?
 
Old 09-19-2018, 03:21 PM   #11
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,294

Rep: Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043
What groups are assigned to your user? I'm wondering if you're missing at least plugdev as I believe that handles USB permissions.
 
Old 09-19-2018, 08:39 PM   #12
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by bassmadrigal View Post
What groups are assigned to your user? I'm wondering if you're missing at least plugdev as I believe that handles USB permissions.
I tried to add it using # usermod -a -G plugdev -me- with "-me-" being my user account's name, and based on the below output from my user account itself... there's something I don't understand, with the display of groups.

Code:
bash-4.4# usermod -a -G plugdev -me-
bash-4.4# groups -me-
-me- : users audio plugdev
bash-4.4# exit
exit
bash-4.4$ groups
users lp floppy audio video cdrom scanner
bash-4.4$ groups -me-
-me- : users audio plugdev
bash-4.4$ groups
users lp floppy audio video cdrom scanner
did I do it right?

In addition, I'm suffering from a new problem that I've got because I was trying to fix my problem through what I found in this thread

I was stupid, ran these commands, and made things worse
Code:
# chown -R -me-:users "/run/media/-me-/My Passport"
# chmod 100 "/run/media/-me-/My Passport"
# chmod 100 /dev/bus/usb/013/002
# chmod 1000 /dev/bus/usb/013/002
I know I made things worse, because when I try to start VMS/Qemu, this is the only error I've been getting since I did those.

Code:
bash-4.4$ vms start win7
starting win7 ...qemu-system-x86_64: -device usb-mouse: drive with bus=0, unit=0 (index=0) exists
 error!
qemu error 1

Last edited by lawnm0wer; 09-19-2018 at 08:54 PM.
 
Old 09-19-2018, 09:01 PM   #13
ninikos
Member
 
Registered: Dec 2012
Posts: 56

Rep: Reputation: 29
Quote:
Originally Posted by lawnm0wer View Post
So far your questions about the kernel haven't felt like an issue anymore, but I'll post the results anyway.
First of all, make sure you are using the generic kernel along with an initrd.gz
As far as I understand, this is the proper slackware (linux??) way to run your machine.
See one of the posts above about how to do it. All the testing I have done so far
is by using the generic kernel. If I remember correctly, I had some issues with
passthrough with the huge kernel (some time around slackware 14.0).

Also, just to be sure, post
Code:
cat /proc/cmdline
Quote:
In addition to trying to figure things out, I'm wanting to pass through a USB external hard drive so I can copy some games and a full package of GPU drivers to the VM. the problem is, this happens:
One very simple way to share data between the host and a windows guest (assuming you are using networking on the guest) is via samba. Just make a network shared folder with read/write permissions on the windows guest and then you can access this folder quickly from the host via dolphin.

Quote:
OK, so I installed the drivers for my GPU through a minimal-install package, and the guest is having issues booting up. Either it freezes mid-start, or BSODs. Safe mode starts fine, device manager shows my GPU and a standard VGA.
Now, the real deal. First of all, you can send me an RX 580 to test . I haven't tried passthrough with this generation of AMD cards. From my experience, I think you are having subtle and weird gpu initialization issues. Below are some things you can try. Try the next steps one by one in the order that is written and test.

1. Pass through both the gpu and the audio device that comes with it. If the gpu is 07:00.0
then usually the audio device is 07:00.1

2. Use lilo (legacy bios emulation) instead of elilo, efi initialization might be an issue

3. Some cards (quadros for sure) have self modifying bios code and the binary proprietary drivers have problems initializing the card if the card is already initialized. The gpu is initialized during the host's boot sequence and the guest tries to initialize it again when the guest driver is loading. One workaround I use is dumping the bios in a file and use the following line

Code:
vm1[extra2]='-device vfio-pci,host=07:00.0,romfile=/path/to/rom.file
You can get a rom file from here https://www.techpowerup.com/vgabios/...emSize=&since=. Be sure to download the right rom for your gpu

Last edited by ninikos; 09-19-2018 at 09:03 PM.
 
Old 09-20-2018, 09:39 AM   #14
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,294

Rep: Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043Reputation: 3043
Quote:
Originally Posted by lawnm0wer View Post
I tried to add it using # usermod -a -G plugdev -me- with "-me-" being my user account's name, and based on the below output from my user account itself... there's something I don't understand, with the display of groups.

did I do it right?
I believe you need to log out and log back in for any group changes to take effect. However, it looks like you're missing a lot of standard groups, so just in case, let's make sure you're added to all of them (replacing $USER with your username).

Code:
usermod -a -G lp,floppy,audio,video,cdrom,plugdev,power,netdev,scanner $USER
Quote:
Originally Posted by lawnm0wer View Post
In addition, I'm suffering from a new problem that I've got because I was trying to fix my problem through what I found in this thread

I was stupid, ran these commands, and made things worse
Code:
# chown -R -me-:users "/run/media/-me-/My Passport"
# chmod 100 "/run/media/-me-/My Passport"
# chmod 100 /dev/bus/usb/013/002
# chmod 1000 /dev/bus/usb/013/002
I know I made things worse, because when I try to start VMS/Qemu, this is the only error I've been getting since I did those.

Code:
bash-4.4$ vms start win7
starting win7 ...qemu-system-x86_64: -device usb-mouse: drive with bus=0, unit=0 (index=0) exists
 error!
qemu error 1
Unfortunately, I don't have easy access to a system to find out what the permissions should be for /deb/bus/usb/013/002, but I would imagine you could match other usb device permissions. Like if there's /dev/bus/usb/013/001, you could see what the permissions are there and mirror them on the 002 device.
 
Old 09-20-2018, 09:45 PM   #15
lawnm0wer
Member
 
Registered: Nov 2017
Posts: 48

Original Poster
Rep: Reputation: Disabled
Well, what a trip.

@ninikos, I tried to do your instructions on getting the generic kernel working, and could not do that. So I made the mistake of doing # Slackpkg Upgrade Kernel-generic and not only screwing up my system, but repeating my mistake on my fresh install, thus having to reinstall my system twice. My first reinstall was the point I understood why /home is usually a seperate partition.

Code:
bash-4.4$ cat /proc/cmdline
BOOT_IMAGE=dev000:\EFI\Slackware\vmlinuz  root=/dev/sda2 vga=normal ro iommu=pt iommu=1 ro
On the upside, I now understand why you press up on the section for more groups when you use # adduser so that problem is resolved.
Quote:
Originally Posted by bassmadrigal
Unfortunately, I don't have easy access to a system to find out what the permissions should be for /deb/bus/usb/013/002, but I would imagine you could match other usb device permissions. Like if there's /dev/bus/usb/013/001, you could see what the permissions are there and mirror them on the 002 device.
How would I check and edit permissions on the device? I understand lsusb to check it, but not how to edit it. I tried reading up on udev, but I got stuck on wondering why the 70 on /etc/udev/rules.d/70-persistent-net.rules exists.

I want things to work, but I'm tired of doing stupid things and breaking things again.
 
  


Reply

Tags
kernel, kernel compile


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SAPPHIRE Radeon RX 580 NITRO+ 4 GB remma12 Linux - Hardware 1 10-14-2017 01:16 PM
Bind only 1 device to vfio driver that have same vendor/device id's Eusaphious Linux - General 1 05-19-2015 09:41 PM
[SOLVED] more bind issues (again) rbees Linux - Networking 9 05-05-2014 05:53 PM
BIND DNS issues joel112 Linux - Software 3 05-31-2006 04:03 AM
Issues with BIND gurusmaran Linux - Networking 7 09-14-2005 11:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration