Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2

James Neave
2011-03-01T20:54:36Z

On Mon, Feb 28, 2011 at 8:25 PM, James Neave <roboj1m@gmail.com> wrote:
> On Mon, Feb 28, 2011 at 3:31 PM, Chris Wright <chrisw@sous-sol.org> wrote:
>> * James Neave (roboj1m@gmail.com) wrote:
>>> HOLY CRAP IT WORKS!!!! 8@
>>
>>
>> Hey, great! ;)
>>
>>> ...almost...
>>>
>>> OK, "clear_emulator_capabilities=0" solved the IRQ problem (which was,
>>> as it turns out, the rawio problem)
>>> My VM came up, both the tuners were there and after the firmware
>>> install I was able to tune and watch the slowest TV in the world over
>>> VNC.
>>>
>>> Thank god for that, i was really starting to believe that slashing out
>>> a lot of cash on my 890FX board and the fancy DDR3 ram it needed was a
>>> collosal waste of money.
>>> "Sigh of relief"
>>>
>>> Well, thank you all so much for helping me to get to this point!
>>>
>>> And yes, I did say "almost works"
>>>
>>> Looks like I've run straight into Chris' ref counting problem when
>>> shutting the guest down.
>>> Some sort of critical error barf was on the servers' screen when I
>>> shut down the guest, appeared to be very similar to Chris' example, in
>>> amd_iommu.c
>>>
>>> I'd post it but the server locks up after it's been shown and needed
>>> resetting. No idea how I would post that bit of dmesg as it gets reset
>>> after each boot.
>>>
>>> Is there a solution for this at the moment or will I have to wait for
>>> it to be patched?
>>
>> No solution at the moment.  Will keep you posted.
>>
>> thanks,
>> -chris
>>
>
> Ah, I see, this is the side effect of detaching it from the domain,
> means it fails here:
>
> BUG_ON(!dev_data->domain);
>
> in __detach_device because now domain is null?
>
> I see what you mean about ref counting.
>
> I was thinking about just hacking in a "fake_detach" method that just
> knocks one off the device count for the moment so I can at least
> shutdown the VM and reboot the host cleanly without having to hit the
> reset button.
> Or maybe just comment out the BUG_ON lines (assuming this is what
> causes it to bomb out)
> At least until someone who knows what they are doing fixes it properly anyway!
>
> James.
>

Heh, well, funnily enough random hacking didn't work.
Think I'll give up and wait for someone who knows what they're doing!

I tried replacing two calls to BUG_ON with if() blocks that just
skipped that method instead of forcibly crashing the kernel.
Sadly it still crashes in amd_iommu_domain_destroy somewhere and I
don't understand how to read the stack trace.
I was hoping it would fail just enough that I would get back to the
command line for a clean reboot.
But I'm C# not C, although I can read it a little.

I wonder if there is any way to get past the "pci-stub" error without
detaching the PCI-PCI bridge from it's domain?

Regards,

James.