public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "André Weidemann" <Andre.Weidemann@web.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>,
	seabios@seabios.org, kvm@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>
Subject: Re: Graphics card pass-through working with two pass pci-initialization
Date: Fri, 27 May 2011 21:40:14 +0200	[thread overview]
Message-ID: <4DDFFE1E.1060900@web.de> (raw)
In-Reply-To: <4DDF867A.9040700@siemens.com>

Hi,

On 27.05.2011 13:09, Jan Kiszka wrote:
> On 2011-05-27 07:32, André Weidemann wrote:

>> Here is my setup:
>> Intel DX58SO
>> Core i7 920
>> Radeon HD 6950
>> Kernel 2.6.35.7
>> qemu-kvm git pull from May 26th

>> One thing that is not working is the pass-through of a second device, a
>> sound card in my case. As soon as I pass 2 devices to the VM, Windows
>> does not boot anymore.
>> If I continue and remove the second device from the command line the VM
>> does not boot anymore with the passed through gfx card. The graphics
>> card drivers crashes Windows, with the error message of not being able
>> to reset the graphics card. A reboot of the host cures this problem.
>
> Does it make a difference when you preserve the function address by
> specifying -device pci-assign,host=03:00.0,addr=XX.0 and -device
> pci-assign,host=03:00.1,addr=XX.1 (where XX is some free slot number in
> the guest)?

I did some further testing in assigning both the VGA and the sound card.
If I pass the devices to the VM like this:

-device pci-assign,host=03:00.0,addr=0x4 \ #VGA
-device pci-assign,host=00:1b.0,addr=0x5 \ #Sound

Windows boots up, but the sound card is not visible as a device inside 
the VM.

Running "info pci" in the monitor shows this:
   Bus  0, device   4, function 0:
     VGA controller: PCI device 1002:6719
       IRQ 11.
       BAR0: 32 bit prefetchable memory at 0xe0000000 [0xefffffff].
       BAR2: 32 bit memory at 0xfeba0000 [0xfebbffff].
       BAR4: I/O at 0xc000 [0xc0ff].
       BAR6: 32 bit memory at 0xffffffffffffffff [0x0001fffe].
       id ""
   Bus  0, device   5, function 0:
     Audio controller: PCI device 8086:3a3e
       IRQ 10.
       BAR0: 32 bit memory at 0xffffffffffffffff [0x00003ffe].
       id ""


If I switch the order of the two devices to this:

-device pci-assign,host=00:1b.0,addr=0x4 \ #Sound
-device pci-assign,host=03:00.0,addr=0x5 \ #VGA

I get the following error and kvm crashes:

http://pastebin.com/KmKEqhWK

It looks like the free PCI memory was not enough to assign the graphics 
card after assigning the sound card.


If I only assign the sound card, then "info pci" in the monitor looks 
like this:
   Bus  0, device   4, function 0:
     Audio controller: PCI device 8086:3a3e
       IRQ 10.
       BAR0: 32 bit memory at 0xfebf0000 [0xfebf3fff].
       id ""

The device is then visible inside the VM and working.


If I am not mistaken then the graphics card needs 2 bars, one with 256MB 
and one with 128K. The sound card then needs 1 bar with 16K of PCI memory.
How big is the PCI memory with seabios?
Is there really not enough space to "squeeze" in those extra 16K?

Regards
  André

  reply	other threads:[~2011-05-27 19:40 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1306227933-4880-1-git-send-email-kraxel@redhat.com>
     [not found] ` <1306227933-4880-2-git-send-email-kraxel@redhat.com>
     [not found]   ` <20110525023406.GG8517@valinux.co.jp>
     [not found]     ` <20110525043353.GH8517@valinux.co.jp>
     [not found]       ` <4DDCC7A5.60706@redhat.com>
     [not found]         ` <4DDCF9ED.5050208@redhat.com>
     [not found]           ` <4DDDDA8D.6080807@web.de>
     [not found]             ` <4DDDF62C.2010603@redhat.com>
2011-05-27  5:32               ` Graphics card pass-through working with two pass pci-initialization André Weidemann
2011-05-27 11:09                 ` Jan Kiszka
2011-05-27 19:40                   ` André Weidemann [this message]
2011-05-27 19:50                     ` André Weidemann
2011-05-26 21:19                       ` André Weidemann
2011-05-28  8:18                         ` Jan Kiszka
2010-05-28 18:49                           ` André Weidemann
2011-05-29 15:22                             ` Jan Kiszka
2011-05-29 15:33                               ` Avi Kivity
2011-05-29 19:30                               ` André Weidemann
2011-05-29 20:51                                 ` Jan Kiszka
2011-05-30  7:34                     ` Gerd Hoffmann
2011-05-30  9:58                       ` Gerd Hoffmann
2011-05-31  2:29                       ` [SeaBIOS] " Isaku Yamahata
2011-06-01  7:30                         ` Gerd Hoffmann
2011-06-01  9:56                           ` Alexander Graf
2011-06-01 10:20                             ` Rudolf Marek
2011-06-01 13:47                               ` Gerd Hoffmann
2011-06-01 14:40                                 ` Rudolf Marek
2011-06-01 22:15                                   ` Kevin O'Connor
2011-06-01 22:22                                     ` Yushu Yao
2011-06-01 11:13                             ` Avi Kivity
2011-06-01 11:16                               ` [SeaBIOS] " Alexander Graf
2011-06-01 11:18                                 ` Avi Kivity
2011-06-01 14:20                           ` [SeaBIOS] " Isaku Yamahata
2011-06-01 14:31                             ` Jan Kiszka
2011-06-01 14:36                               ` Alex Williamson
2011-06-01 22:34                             ` Kevin O'Connor
2011-06-06  6:30                               ` Gerd Hoffmann
2011-06-07  8:05                                 ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DDFFE1E.1060900@web.de \
    --to=andre.weidemann@web.de \
    --cc=alex.williamson@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox