Kernel OOPS attempting PCI passthru on Ubuntu 12.04

Discussions related to using VirtualBox on Linux hosts.
Post Reply
madarp
Posts: 2
Joined: 21. Aug 2014, 04:36
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: win7
Location: Fishers IN
Contact:

Kernel OOPS attempting PCI passthru on Ubuntu 12.04

Post by madarp »

Hello,
This is my first post here. I am seeking guidance with PCIe passthru on Ubuntu 12.04 32bit Intel i7 host system (8GB), to a Windows 7 32bit guest. I think I have met all hardware setup prerequisites according to chapter 9.6 of the online user guide, but I am having trouble starting up my guest system to begin the Windows installation. After enabling passthru with modifyvm "my machine" --pciattach 02:00.0 I get instant kernel "OOPS" with null ptr dereference in vboxpci module when I start the guest. If I detach the device (--pcidetach) then there is no problem starting the guest. I have tried with and without my PCIe device present in the host, and results are the same.

Details:
Using the currently released version of Virtualbox, 4.3.14 with no modifications.
Host system is Intel DQ77MK motherboard.
Guest machine is configured as 1 cpu, PAE=Y, VTx=Y, NestedPaging=Y, chipset=ICH9, IOAPIC=Y, mem=2048MB. Full guest config file is attached.

From this snipped host kernel log, I think I have intel IOMMU and DMAR setup correctly and vboxpci is attaching to it:

Code: Select all

[    0.000000] Linux version 3.8.0-44-generic (buildd@brownie) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #66~precise1-Ubuntu SMP Tue Jul 15 04:04:23 UTC 2014 (Ubuntu 3.8.0-44.66~precise1-generic 3.8.13.25)
...
[    0.000000] DMI:                  /DQ77MK, BIOS MKQ7710H.86A.0058.2013.0226.1541 02/26/2013
...
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.8.0-44-generic root=UUID=6202126d-bd2f-4e2a-a297-9d8f991cff00 ro 8250.nr_uarts=16 intel_iommu=on quiet splash vt.handoff=7
[    0.000000] Intel-IOMMU: enabled
...
[    0.173995] pci 0000:02:00.0: [5851:8008] type 00 class 0x040000
[    0.174010] pci 0000:02:00.0: reg 10: [mem 0xf7e00000-0xf7e00fff]
[    0.174022] pci 0000:02:00.0: reg 14: [mem 0xf1400000-0xf17fffff pref]
[    0.174034] pci 0000:02:00.0: reg 18: [mem 0xf1000000-0xf13fffff pref]
[    0.174045] pci 0000:02:00.0: reg 1c: [mem 0xf0800000-0xf0ffffff pref]
[    0.174057] pci 0000:02:00.0: reg 20: [mem 0xf0000000-0xf07fffff pref]
...
[    0.468349] dmar: Host address width 36
[    0.468351] dmar: DRHD base: 0x000000fed90000 flags: 0x0
[    0.468369] dmar: IOMMU 0: reg_base_addr fed90000 ver 1:0 cap c0000020e60262 ecap f0101a
[    0.468371] dmar: DRHD base: 0x000000fed91000 flags: 0x1
[    0.468377] dmar: IOMMU 1: reg_base_addr fed91000 ver 1:0 cap c9008020660262 ecap f0105a
[    0.468377] dmar: RMRR base: 0x000000d61b4000 end: 0x000000d61c0fff
[    0.468379] dmar: RMRR base: 0x000000d7800000 end: 0x000000df9fffff
[    0.468385] DMAR: No ATSR found
[    0.468406] IOMMU 0 0xfed90000: using Queued invalidation
[    0.468408] IOMMU 1 0xfed91000: using Queued invalidation
[    0.468410] IOMMU: Setting RMRR:
[    0.468418] IOMMU: Setting identity map for device 0000:00:02.0 [0xd7800000 - 0xdf9fffff]
[    0.469063] IOMMU: Setting identity map for device 0000:00:1d.0 [0xd61b4000 - 0xd61c0fff]
[    0.469078] IOMMU: Setting identity map for device 0000:00:1a.0 [0xd61b4000 - 0xd61c0fff]
[    0.469091] IOMMU: Setting identity map for device 0000:00:14.0 [0xd61b4000 - 0xd61c0fff]
[    0.469099] IOMMU: Prepare 0-16MiB unity mapping for LPC
[    0.469105] IOMMU: Setting identity map for device 0000:00:1f.0 [0x0 - 0xffffff]
[    0.469482] PCI-DMA: Intel(R) Virtualization Technology for Directed I/O
[    0.469862] Initialise module verification
Later, vboxdrv and vboxpci also seem happy:

Code: Select all

Line 1069: [   12.564967] vboxdrv: Found 8 processor cores.
[   12.565102] vboxdrv: fAsync=0 offMin=0x23d offMax=0x2d04
[   12.565146] vboxdrv: TSC mode is 'synchronous', kernel timer mode is 'normal'.
[   12.565147] vboxdrv: Successfully loaded version 4.3.14 (interface 0x001a0007).
[   12.794025] vboxpci: IOMMU found
But when I attempt to start the guest OS, here comes the kernel OOPS:

Code: Select all

[   93.920191] vboxpci: vboxPciOsDevInit: dev=200
[   93.920205] vboxpci: detected device: 5851:8008 at 02:00.0, driver <none>
[   93.920248] pci-stub 0000:02:00.0: claimed by stub
[   93.920269] vboxPciFileWrite: error -19
[   93.920276] vboxpci: vboxPciOsDevInit: dev=200 pdev=f0072000
[   93.920347] pci-stub 0000:02:00.0: irq 51 for MSI/MSI-X
[   93.920361] vboxpci: enabled MSI
[   93.920429] 200: linux vboxPciOsDevGetRegionInfo: reg=0
[   93.920432] got mmio region: f7e00000:4096
[   93.920436] 200: linux vboxPciOsDevGetRegionInfo: reg=1
[   93.920438] got mmio region: f1400000:4194304
[   93.920441] 200: linux vboxPciOsDevGetRegionInfo: reg=2
[   93.920443] got mmio region: f1000000:4194304
[   93.920446] 200: linux vboxPciOsDevGetRegionInfo: reg=3
[   93.920448] got mmio region: f0800000:8388608
[   93.920451] 200: linux vboxPciOsDevGetRegionInfo: reg=4
[   93.920452] got mmio region: f0000000:8388608
[   93.920455] 200: linux vboxPciOsDevGetRegionInfo: reg=5
[   93.920458] 200: linux vboxPciOsDevGetRegionInfo: reg=6
[   93.923730] linux vboxPciOsDevMapRegion: reg=0 start=f7e00000 size=4096
[   93.923821] linux vboxPciOsDevMapRegion: reg=1 start=f1400000 size=4194304
[   93.924402] linux vboxPciOsDevMapRegion: reg=2 start=f1000000 size=4194304
[   93.924968] linux vboxPciOsDevMapRegion: reg=3 start=f0800000 size=8388608
[   93.925948] linux vboxPciOsDevMapRegion: reg=4 start=f0000000 size=8388608
[   94.124128] created IOMMU domain ee0a4740
[   94.124871] BUG: unable to handle kernel NULL pointer dereference at   (null)
[   94.124897] IP: [<f8dbc044>] vboxPciOsContigMemInfo+0x14/0x110 [vboxpci]
[   94.124921] *pdpt = 000000002fd00001 *pde = 0000000000000000 
[   94.124940] Oops: 0000 [#1] SMP 
[   94.124952] Modules linked in: vboxpci(OF) vboxnetadp(OF) vboxnetflt(OF) vboxdrv(OF) ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi rfcomm bnep bluetooth snd_hda_codec_hdmi snd_hda_codec_realtek coretemp asix usbnet ftdi_sio usbserial kvm_intel kvm lpc_ich snd_hda_intel snd_hda_codec snd_hwdep snd_pcm aesni_intel ablk_helper cryptd i915 lrw aes_i586 snd_timer snd xts drm_kms_helper gf128mul drm i2c_algo_bit soundcore tpm_tis snd_page_alloc microcode mac_hid mei video pci_stub lp parport hid_generic usbhid hid firewire_ohci ahci firewire_core libahci e1000e(OF) ptp crc_itu_t pps_core
[   94.125158] Pid: 2322, comm: EMT Tainted: GF          O 3.8.0-44-generic #66~precise1-Ubuntu                  /DQ77MK
[   94.125189] EIP: 0060:[<f8dbc044>] EFLAGS: 00010292 CPU: 5
[   94.125206] EIP is at vboxPciOsContigMemInfo+0x14/0x110 [vboxpci]
[   94.125224] EAX: 00000000 EBX: f8dbc030 ECX: 0b5fc000 EDX: f76f5324
[   94.125243] ESI: 00000002 EDI: 00000000 EBP: ed471d54 ESP: ed471d2c
[   94.125261]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[   94.125278] CR0: 80050033 CR2: 00000000 CR3: 2edfc000 CR4: 001427f0
[   94.125297] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[   94.125314] DR6: ffff0ff0 DR7: 00000400
[   94.125327] Process EMT (pid: 2322, ti=ed470000 task=ee1b59b0 task.ti=ed470000)
[   94.125348] Stack:
[   94.125355]  00000000 00000000 ed471d84 f8f6a261 f8dd5000 0000e000 00000000 f8dbc030
[   94.125382]  00000002 00000000 ed471da4 f8f02e31 f76f5324 0b5fc000 00000002 00000000
[   94.125408]  00000000 00001000 00000000 00000000 00000000 00000000 ed471da4 00000000
[   94.125435] Call Trace:
[   94.125446]  [<f8dbc030>] ? vboxPciOsIrqHandler+0x30/0x30 [vboxpci]
[   94.125469]  [<c11126d1>] ? generic_perform_write+0x141/0x1c0
[   94.125490]  [<c1167490>] ? __sb_start_write+0x50/0xf0
[   94.125506]  [<c1167401>] ? __sb_end_write+0x31/0x70
[   94.125523]  [<c11e9a42>] ? ext4_file_write+0xb2/0x100
[   94.125544]  [<f8ea0c75>] ? supdrvIOCtl+0x17a5/0x2eb0 [vboxdrv]
[   94.125568]  [<f8ea9021>] ? rtR0MemAllocEx+0xa1/0xf0 [vboxdrv]
[   94.125586]  [<c12fb382>] ? _copy_from_user+0x42/0x60
[   94.125605]  [<f8e9b42c>] ? VBoxDrvLinuxIOCtl_4_3_14+0xfc/0x1c0 [vboxdrv]
[   94.125627]  [<f8e9b330>] ? SUPR0Printf+0x70/0x70 [vboxdrv]
[   94.125645]  [<c117564f>] ? do_vfs_ioctl+0x7f/0x2f0
[   94.126534]  [<c1165120>] ? wait_on_retry_sync_kiocb+0x50/0x50
[   94.127472]  [<c1175930>] ? sys_ioctl+0x70/0x80
[   94.128427]  [<c1638b0d>] ? sysenter_do_call+0x12/0x28
[   94.129418] Code: 89 44 24 04 8b 82 98 00 00 00 89 04 24 ff d1 b8 01 00 00 00 c9 c3 90 55 89 e5 83 ec 28 89 5d f4 89 75 f8 89 7d fc 3e 8d 74 26 00 <8b> 00 89 d6 8b 55 08 89 cf 8b 40 04 8b 4d 10 89 55 ec 8b 55 18
[   94.130527] EIP: [<f8dbc044>] vboxPciOsContigMemInfo+0x14/0x110 [vboxpci] SS:ESP 0068:ed471d2c
[   94.131640] CR2: 0000000000000000
[   94.141760] ---[ end trace ae31a1381e744bfe ]---
I hope I supplied enough info here. I would greatly appreciate any guidance about what I am overlooking, from members who have working PCIe passthrough.

Regards,
madarp
Attachments
guest.log
Guest runtime log
(57.34 KiB) Downloaded 12 times
guest_config.log
Guest configuration
(4.18 KiB) Downloaded 25 times
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Kernel OOPS attempting PCI passthru on Ubuntu 12.04

Post by Perryg »

AFAIK pci passthrough only works ( or should I say only works for me ) with a Linux guest. Even then it is iffy
madarp
Posts: 2
Joined: 21. Aug 2014, 04:36
Primary OS: Ubuntu 12.04
VBox Version: OSE Debian
Guest OSses: win7
Location: Fishers IN
Contact:

Re: Kernel OOPS attempting PCI passthru on Ubuntu 12.04

Post by madarp »

Well I can definitely understand that support is 'iffy' for non-Linux guests, but this Oops is happening right when I flip the switch to start the guest. The host doesn't even know it's a windows machine yet. In fact, the guest doesn't even know it is a windows machine because it has not even made it to the point where Windows installer ISO starts running.
Post Reply