VirtualBox

Opened 5 years ago

Last modified 5 years ago

#18204 new defect

PCI passthrough :invalid region

Reported by: svj Owned by:
Component: other Version: VirtualBox 6.0.0
Keywords: PCI passthrough Cc:
Guest type: Windows Host type: Linux

Description

Host: debian 9 amd64

CPU: AMD

Virtualbox: 5.2.x , 6.0.0

Guest: win7 64-bit

PCI passthrough : AMD GPU

lspci -vv -s1e:00.0

1e:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Device 687f (rev c1) (prog-if 00 [VGA controller])
        Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] Device 6b76
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin A routed to IRQ 41
        Region 0: Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Region 2: Memory at f0000000 (64-bit, prefetchable) [size=2M]
        Region 4: I/O ports at f000 [size=256]
        Region 5: Memory at f7800000 (32-bit, non-prefetchable) [size=512K]
        [virtual] Expansion ROM at f7880000 [disabled] [size=128K]
...

Second GPU: (not passthrough)

1b:00.0 VGA compatible controller: NVIDIA Corporation GP108 

dmesg

[10178.205401] vboxpci: detected device: 1002:687f at 1e:00.0, driver <none>
[10178.205458] pci-stub 0000:1e:00.0: claimed by stub
[10178.205486] vboxPciFileWrite: error -19
[10178.205560] vboxpci 0000:1e:00.0: vboxPciOsDevInit
[10178.205665] vboxpci 0000:1e:00.0: region 0: mmio e0000000+268435456
[10178.205668] vboxpci 0000:1e:00.0: region 2: mmio f0000000+2097152
[10178.205671] vboxpci 0000:1e:00.0: region 4: pio f000+256
[10178.205673] vboxpci 0000:1e:00.0: region 5: mmio f7800000+524288
[10178.205676] vboxpci 0000:1e:00.0: region 6: mmio f7880000+131072
[10178.205697] vboxpci 0000:1e:00.0: got irq 94
[10179.615799] vboxpci: created IOMMU domain ffff8a6575448a20
[10179.667123] vboxpci 0000:1e:00.0: PCIRAW_POWER_ON
[10179.667134] vboxpci 0000:1e:00.0: pci_reset_function() failed
[10179.667182] vboxpci 0000:1e:00.0: attached to IOMMU
[10179.673069] vboxpci 0000:1e:00.0: invalid region 5
[10179.673119] vboxpci 0000:1e:00.0: reg=0 start=e0000000 size=268435456
[10179.677495] vboxpci 0000:1e:00.0: invalid region 2
[10185.325467] vboxpci 0000:1e:00.0: reg=0 start=e0000000 size=268435456
[10185.327882] vboxpci 0000:1e:00.0: invalid region 2
[10185.327885] vboxpci 0000:1e:00.0: invalid region 5
[10186.596095] vboxpci: freeing IOMMU domain ffff8a699a958c20
[10187.832128] vboxpci 0000:1e:00.0: reg=0 start=e0000000 size=268435456
[10187.836709] vboxpci 0000:1e:00.0: invalid region 2
[10187.836714] vboxpci 0000:1e:00.0: invalid region 5
[10215.836023] vboxpci 0000:1e:00.0: PCIRAW_POWER_OFF
[10215.836071] vboxpci 0000:1e:00.0: detached from IOMMU
[10215.898276] traps: EMT-0[7904] general protection ip:7f1f36e5e1bf sp:7f1f6cff2db0 error:0
[10215.898284]  in VBoxPciRawR3.so[7f1f36e5b000+c000]
[10216.035409] vboxpci 0000:1e:00.0: freeing irq 94
[10216.035428] vboxpci 0000:1e:00.0: vboxPciOsDevDeinit
[10216.035612] vboxpci: freeing IOMMU domain ffff8a6575448a20
[10219.287799] vboxpci: created IOMMU domain ffff8a6a1c90cc20

Checking out from yours Subversion server.

I think problem is in file: src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c

Method: vboxPciOsDevMapRegion

Line:813

In commit:75599

if (!pPciDev || iRegion < 0 || iRegion > 0)

IMHO corect line is:

if (!pPciDev || iRegion < 0 || iRegion > 6)

svn diff -r58962:58963 (line 776 in 58962 vs line 787 in 58963)

Change History (2)

comment:1 by svj, 5 years ago

Checkout from SVN.

Change code to

if (!pPciDev || iRegion < 0 || iRegion > 6)

Build own version 6.0.0-r127422,install and run VM guest with PCI passthrough.

dmesg

[  275.431191] vboxpci: detected device: 1002:687f at 1e:00.0, driver <none>
[  275.431227] pci-stub 0000:1e:00.0: claimed by stub
[  275.431245] vboxPciFileWrite: error -19
[  275.431300] vboxpci 0000:1e:00.0: vboxPciOsDevInit
[  275.431382] vboxpci 0000:1e:00.0: region 0: mmio e0000000+268435456
[  275.431384] vboxpci 0000:1e:00.0: region 2: mmio f0000000+2097152
[  275.431386] vboxpci 0000:1e:00.0: region 4: pio f000+256
[  275.431387] vboxpci 0000:1e:00.0: region 5: mmio f7800000+524288
[  275.431389] vboxpci 0000:1e:00.0: region 6: mmio f7880000+131072
[  275.431406] vboxpci 0000:1e:00.0: got irq 94
[  276.994570] vboxpci: created IOMMU domain ffff97e3ecf2ec20
[  277.093681] device enp24s0 entered promiscuous mode
[  277.093893] vboxpci 0000:1e:00.0: PCIRAW_POWER_ON
[  277.093902] vboxpci 0000:1e:00.0: pci_reset_function() failed
[  277.093951] vboxpci 0000:1e:00.0: attached to IOMMU
[  277.099879] vboxdrv: ffffffffc01a0020 VBoxEhciR0.r0
[  277.099933] vboxpci 0000:1e:00.0: reg=5 start=f7800000 size=524288
[  277.100126] vboxpci 0000:1e:00.0: reg=0 start=e0000000 size=268435456
[  277.104974] vboxpci 0000:1e:00.0: reg=2 start=f0000000 size=2097152
[  282.391410] vboxpci 0000:1e:00.0: reg=0 start=e0000000 size=268435456
[  282.394934] vboxpci 0000:1e:00.0: reg=2 start=f0000000 size=2097152
[  282.394969] vboxpci 0000:1e:00.0: reg=5 start=f7800000 size=524288
[  284.841691] vboxpci 0000:1e:00.0: reg=0 start=e0000000 size=268435456
[  284.846153] vboxpci 0000:1e:00.0: reg=2 start=f0000000 size=2097152
[  284.846197] vboxpci 0000:1e:00.0: reg=5 start=f7800000 size=524288

No bug "invalid region" , but GPU still not working:-(.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use