[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA Pass Through to Windows XP Home 32-bit HVM Virtual Machine with Intel Desktop Board DQ45CB


  • To: <enming.teo@xxxxxxxxxxxxxxx>, <weidong.han@xxxxxxxxx>
  • From: <djmagee@xxxxxxxxxxxx>
  • Date: Thu, 27 Aug 2009 14:28:31 -0400
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 27 Aug 2009 11:29:19 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcolnMU83uLVvJx8SzOGCqdGU4J5DgACUx9wAB/AgKAAAkHr4AAC5mngAADsWvAAHj128AADVa/gAAXjh3AAFB2nQAAF3OPQ
  • Thread-topic: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA Pass Through to Windows XP Home 32-bit HVM Virtual Machine with Intel Desktop Board DQ45CB

Tao,
        The DQ45CB does not support the configuration you are trying to use; it 
does not have enough PCIe lanes.  See the following reference: 
http://download.intel.com/support/motherboards/desktop/dq45cb/sb/e42785001us.pdf

In the block diagram on page 13, you'll see that motherboard uses 8 PCIe lanes 
to drive the two DVI outputs on the motherboard.  Those same lanes are used to 
drive an add-on PCIex16 graphics card.  They can't be used for both purposes at 
the same time.

On page 18, this is spelled out. Under the "Intel Q45 Graphics Subsystem" 
heading it reads, 
"The Intel Q45 Express chipset contains two separate, mutually exclusive 
graphics
options. Either the Intel Graphics Media Accelerator 4500 (Intel GMA 4500) 
graphics
controller (contained within the 82Q45 GMCH) is used, or a PCI Express x16 
add-in
card can be used. When a PCI Express x16 add-in card is installed, the Intel GMA
4500 graphics controller is disabled."

I believe at the very best, you can realize very basic, analog only output 
using a DVI-VGA adapter on the primary output, but I'm not even sure about that.

Doug Magee

-----Original Message-----
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@xxxxxxxxxxxxxxx] 
Sent: Thursday, August 27, 2009 12:18 PM
To: enming.teo@xxxxxxxxxxxxxxx; weidong.han@xxxxxxxxx; djmagee@xxxxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA Pass 
Through to Windows XP Home 32-bit HVM Virtual Machine with Intel Desktop Board 
DQ45CB

Dear Weidong,

I have read through the technical papers on VGA passthrough presented by the
University of Amsterdam and the University of Michigan and thus gained a
better understanding of VGA passthrough in Xen.

For my preferred setup, I would not be able to adopt the guidance provided
by the University of Amsterdam. I should adopt the guidance provided by the
University of Michigan. I want dom0 to have access to Intel GMA 4500 onboard
graphics while the Windows XP Home HVM domU to have access to PCI Express
x16 graphics.

I have taken the first step in examining the source code for disabling the
Cirrus emulated vga card bootup in Xen 3.5-unstable.

According to Beng Heng's UMICH technical paper, he referenced source file
tools/ioemu-remote/hw/pc.c for disabling emulated vga device.

I went to the xen-unstable mercurial reponsitory
http://xenbits.xensource.com/xen-unstable.hg and found tools/ioemu/hw/pc.c

Now, my objective is to disable the emulated/virtual vga card and load the
bios of my nvidia geforce 8400 gs pcie x16 graphics card.

Source code file
http://xenbits.xensource.com/xen-unstable.hg?file/18b41609a980/tools/ioemu/h
w/pc.c

=========================================================================

Line 862 says that if variable cirrus_vga_enabled returns true (having a
value of 1), the cirrus vga bios VGABIOS_CIRRUS_FILENAME will be loaded.
Otherwise, an alternative vga bios file VGABIOS_FILENAME will be loaded.

On line 30 VGABIOS_FILENAME is defined.

On line 31 VGABIOS_CIRRUS_FILENAME is defined. 

On line 24 a header file vl.h is referenced.

Source code file
http://xenbits.xensource.com/xen-unstable.hg?file/7eefe6399bcd/tools/ioemu/v
l.h

===========================================================================

On line 177 the integer variable cirrus_vga_enabled is declared but I could
not find any line where this variable is initialized to a value. But I found
file vl.c.

Source code file
http://xenbits.xensource.com/xen-unstable.hg?file/dade7f0bdc8d/tools/ioemu/v
l.c

============================================================================

On line 168 integer variable cirrus_vga_enabled is initialized to a value of
1. However, I want to disable cirrus vga and load my nvidia geforce 8400 gs
vga bios.

So I should change line 168 to "int cirrus_vga_enabled = 0;" in my case.

Hence line 865 in file pc.c would be executed.

After extracting the vga bios of my nvidia geforce 8400 gs pcie x16 graphics
card using the nvflash.exe utility and saving the firmware file as
nv-gf-8400-gs.bin, I should place this bios image file in the xen-unstable
sources directory on my PC. It should be in the same directory where files
vgabios.bin and vgabios-cirrus.bin are found.

Then I should change line 30 in file pc.c from '#define VGABIOS_FILENAME
"vgabios.bin"' to '#define VGABIOS_FILENAME nv-gf-8400-gs.bin' and then
recompile and install the source code.

Besides disabling the emulated cirrus vga card, may I know what other things
do I need to take care of? Does the pre-existing xen 3.5-unstable source
code already can take care of re-executing the geforce 8400 gs vga bios,
passing through the framebuffer and vga I/O ports, and intercepting the
values in the host bridge such that I do not have to hack the other relevant
source code files?

Thank you very much.

Regards,
 
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
BEng(Hons)(Mechanical Engineering) 
Technical Support Engineer 
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza 
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
Alma Maters: Singapore Polytechnic, National University of Singapore

-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Teo En Ming
(Zhang Enming)
Sent: Thursday, August 27, 2009 2:03 PM
To: enming.teo@xxxxxxxxxxxxxxx; weidong.han@xxxxxxxxx; djmagee@xxxxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA
PassThrough to Windows XP Home 32-bit HVM Virtual Machine withIntel Desktop
Board DQ45CB

I think I cannot use NiBiTor already as I don't have any native Windows
operating system running on my computer.

Instead, I should create a CD-ROM boot disc that contains nvflash.exe and
also loads USB drivers.

I will use nvflash.exe to extract out and save VGA BIOS to USB sticks.

NVIDIA GeForce BIOS Backup Guide: http://www.mvktech.net/content/view/14/37/

Motherboard Flash Boot CD from Linux Mini HOWTO:
http://www.nenie.org/misc/flashbootcd.html

DOS USB Drivers: http://www.bootdisk.com/usb.htm

Regards,
 
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
BEng(Hons)(Mechanical Engineering) 
Technical Support Engineer 
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza 
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Teo En Ming
(Zhang Enming)
Sent: Thursday, August 27, 2009 11:18 AM
To: weidong.han@xxxxxxxxx; djmagee@xxxxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA
PassThrough to Windows XP Home 32-bit HVM Virtual Machine withIntel Desktop
Board DQ45CB

Dear Weidong,

I will go for option 2.

> don't initialize emulated VGA in qemu, I I think you have seen the code.

I have not seen the source code. Though I have learnt simple structured C
before in Singapore Polytechnic some 11 years ago, I am not a programmer by
profession. So I would still need some instructions on how I can prevent
emulated VGA bios from loading and getting the vga bios of the real display
card to load.

Thank you.

Regards,
 
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
BEng(Hons)(Mechanical Engineering) 
Technical Support Engineer 
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza 
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx

-----Original Message-----
From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Han, Weidong
Sent: Thursday, August 27, 2009 10:01 AM
To: 'enming.teo@xxxxxxxxxxxxxxx'; 'djmagee@xxxxxxxxxxxx'
Cc: 'xen-devel@xxxxxxxxxxxxxxxxxxx'
Subject: RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA
PassThrough to Windows XP Home 32-bit HVM Virtual Machine with IntelDesktop
Board DQ45CB

Teo En Ming (Zhang Enming) wrote:
> Hi Weidong,
> 
> Currently I am using the entire Xen 3.5-unstable branch and not using
> the posted pci-stub patch changeset 19893 to patch Xen 3.4.1-testing.
> I am using Xen 3.5-unstable in conjunction with pvops dom 0 kernel
> 2.6.31-rc6. 
> 
> Here are my questions:
> 
> 1) How do I extract out the VGA BIOS/firmware from the
> firmware/EEPROM chip on the Geforce 8400 GS VGA card? If it is not
> possible to extract, where can I download the firmware? NVIDIA does
> not provide display card firmware/BIOS files for public download on
> its website. 

There are 3 ways to load VGA bios to guest:
1. copy it from host 0xc0000, and map it to guest 0xc0000. This works for
primary gfx card, XCI does like this. But some VGA bios re-execution doesn't
work well.
2. dump VGA bios to a file first, then load it to guest: you can use NiBiTor
to dump VGA bios of Nvidia gfx cards to a file, then load it into guest roms
like what emulated VGA does in hvmloader. This works for all gfx cards, but
it involves manual steps.

3. load VGA bios from expansion rom: Intel iGFX doesn't have expansion rom

> 
> 2) How do I get the Geforce 8400 GS VGA BIOS to load instead of the
> emulated VGA BIOS? Which configuration files/source codes do I have to
> configure/patch?

don't initialize emulated VGA in qemu, I I think you have seen the code.

> 
> 3) What are physical MMIO, virtual MMIO Bars, dsdt.asl and 1:1 map? I
> am sorry but I am not a graphics card hardware engineer so I do not
> understand those terms. I would appreciate it if you could write out
> some steps that I could carry out or point me to already available
> documentation. 

When you use command 'lspci -v', you may see below messages under each
device:

...
Memory at d0000000 (32-bit, prefetchable) [size=256M]
Memory at ff900000 (32-bit, non-prefetchable) [size=1M]
...

They are MMIO BARs. 1:1 map means make these MMIO BARs in guest are equal to
the values in host.

> 
> 4) I don't mind using experimental code. Please post it on the
> xen-devel mailing list so that I could try it out.

we will post in near future. pls wait for a while.

Regards,
Weidong

> 
> Thank you very much.
> 
> Regards,
> 
> Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
> BEng(Hons)(Mechanical Engineering)
> Technical Support Engineer
> Information Technology Department
> Asiasoft Online Pte Ltd
> Tampines Central 1 #04-01 Tampines Plaza
> Singapore 529541
> Republic of Singapore
> Mobile: +65-9648-9798
> MSN: teoenming@xxxxxxxxxxx
> 
> -----Original Message-----
> From: Han, Weidong [mailto:weidong.han@xxxxxxxxx]
> Sent: Wednesday, August 26, 2009 6:56 PM
> To: 'enming.teo@xxxxxxxxxxxxxxx'; 'djmagee@xxxxxxxxxxxx'
> Cc: 'xen-devel@xxxxxxxxxxxxxxxxxxx'
> Subject: RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA
> Pass Through to Windows XP Home 32-bit HVM Virtual Machine with Intel
> Desktop Board DQ45CB
> 
> Teo En Ming (Zhang Enming) wrote:
>> Hi Weidong,
>> 
>> Could you share with us the hack codes for making Geforce 8400 GS
>> work and also how to let the Windows HVM guest boot up using the real
>> BIOS of Geforce 8400 GS instead of an emulated VGA BIOS?
>> 
> 
> What patch are you using now? Using real VGA bios of gfx card to
> replace emulatd VGA bios is the prerequisite of gfx passthrough. You
> can find it in posted gfx passthrough patches or XCI. For hack of
> making Geforce 8400, we reserve physical MMIO BARs in dsdt.asl, and
> make it 1:1 map between physical MMIO BARs and virtual MMIO BARs of
> the card. Currently our code is experimental, we will send out in
> mailing list after cleanup and more tests. 
> 
> Regards,
> Weidong
> 
>> Thank you.
>> 
>> Regards,
>> 
>> Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
>> BEng(Hons)(Mechanical Engineering)
>> Technical Support Engineer
>> Information Technology Department
>> Asiasoft Online Pte Ltd
>> Tampines Central 1 #04-01 Tampines Plaza
>> Singapore 529541
>> Republic of Singapore
>> Mobile: +65-9648-9798
>> MSN: teoenming@xxxxxxxxxxx
>> Alma Maters: Singapore Polytechnic, National University of Singapore
>> 
>> -----Original Message-----
>> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>> [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Han,
>> Weidong Sent: Wednesday, August 26, 2009 4:27 PM
>> To: 'djmagee@xxxxxxxxxxxx'; 'enming.teo@xxxxxxxxxxxxxxx'
>> Cc: 'xen-devel@xxxxxxxxxxxxxxxxxxx'
>> Subject: RE: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16
>> VGAPassThroughto Windows XP Home 32-bit HVM Virtual Machine with
>> IntelDesktop BoardDQ45CB 
>> 
>> I suppose you just use the patch posted in mailing list before.
>> nVidia Geforce 8400 passthrough needs extra hacks. We can make it
>> work in our experiments with 1:1 map of its MMIO BARs.
>> 
>> We are working on gfx passthrough on latest xen-unstable. Firstly, we
>> want to cook a simple patch including generic changes to support
>> passthrough of virtualization friendly gfx cards, such as Nvidia
>> FX3800. This patch is basically done. Then, we will add some hacks
>> for more gfx cards passthrough, such as iGFX and some Nvidia and ATI
>> cards. 
>> 
>> Regards,
>> Weidong
>> 
>> djmagee@xxxxxxxxxxxx wrote:
>>> As I've pointed out on this list before, there are not enough PCIe
>>> lanes on the DQ45CB to drive both the internal graphics adapter and
>>> the add-on adapter at the same time.  I believe the onboard one may
>>> be able to operate in some sort of VGA only mode when there is a
>>> card installed and used as the primary adapter.
>>> 
>>> I have a similar setup, using the same motherboard, and an ATI 4770.
>>> I used the VGA passthrough patches from an earlier posting (I saw
>>> you followed the same set of instructions), with limited success. 
>>> I've been using 3.4-testing, and 'xenified' 2.6.29.6 kernel.  I made
>>> modifications to the dom0 portion of the patches so they would apply
>>> to my xenified 2.6.29 kernel.  These patches include code that will
>>> copy the VGA bios to the guest bios instead of using the emulated
>>> vga bios.  I've had very little success, however.  I have only tried
>>> passing through the ATI adapter.  In all instances, the guest bios
>>> messages appear on my monitor, so this much works.  In some cases,
>>> the guest essentially stops there; xm list show's about 2sec CPU
>>> usage and nothing ever happens after that point.  In other cases,
>>> the guest (win xp/vista/7, as well as KNOPPIX 5.3.1 DVD) will boot
>>> all the way, but in very low res/color mode, and cannot properly
>>> initialize the video device.  Once or twice, it actually did
>>> recognize the device and had a reasonable default color/resolution
>>> combination.  In all cases where the guest actually boots, the
>>> system eventually freezes.  In some cases, I get endless streams of
>>> iommu page faults. 
>>> 
>>> I have 8GB ram installed.  In all cases I've limited dom0 memory to
>>> 2GB.  In all cases, my guest has been assigned 2GB of memory.
>>> 
>>> I have a dual core e6600.  I've tried allowing dom0 to use both
>>> cores, offlining one core (using xend dom0_vcpu setting) after boot,
>>> and restricting dom0 to only one core using the dom0_max_vcpus xen
>>> hypervisor parameter.  In all of these cases I've tried both one and
>>> two vcpus for the guest.  My success with VGA passthrough seems
>>> somewhat random and no combination of cpu assignment seems to have
>>> any effect. 
>>> 
>>> I have not tried with the 2.6.18-xen kernel as I haven't gotten it
>>> to boot on my hardware; it can never find my volume group, even if I
>>> create a initrd with all of the required modules, or build those
>>> drivers into the kernel.  I have not spent more than maybe a half an
>>> hour on this problem; I suspect it may have something to do with the
>>> version of mkinitrd I'm using (from Fedora 9 x64).
>>> 
>>> If anyone else has any insight or similar experience I'd also love
>>> to hear it. 
>>> 
>>> Doug Magee
>>> djmagee@xxxxxxxxxxxx
>>> 
>>> -----Original Message-----
>>> From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Mr. Teo
>>> En Ming (Zhang Enming) Sent: Tuesday, August 25, 2009 11:57 AM
>>> To: enming.teo@xxxxxxxxxxxxxxx
>>> Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
>>> Subject: Re: [Xen-devel] nVidia Geforce 8400 GS PCI Express x16 VGA
>>> PassThroughto Windows XP Home 32-bit HVM Virtual Machine with Intel
>>> Desktop BoardDQ45CB 
>>> 
>>> I have uninstalled Xen 3.4.1 and installed Xen 3.5-unstable as
>>> suggested by Weidong. 
>>> 
>>> 
>>> On 08/25/2009 11:47 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>>>> Dear All,
>>>> 
>>>> I have managed to do PCI-e VGA passthrough with the open source Xen
>>>> but the work is still in progress because although Windows XP guest
>>>> can see the REAL PCI-e x16 graphics card instead of an emulated
>>>> graphics driver, it cannot be initialized yet.
>>>> 
>>>> Thanks to Intel Engineer Han Weidong, Pasi Kärkkäinen, Boris
>>>> Derzhavets, Marc, Caz Yokoyama, and others who have helped me and
>>>> shared their knowledge with me along the way.
>>>> 
>>>> System Configuration:
>>>> 
>>>> Intel Desktop Board DQ45CB with BIOS upgraded to 0093
>>>> Onboard Intel GMA 4500 Graphics (IGD)
>>>> nVidia Geforce 8400 GS PCI Express x16 Graphics Card
>>>> 
>>>> Fedora 11 Linux 64-bit Xen paravirt operations Domain 0 Host
>>>> Operating System Xen 3.5 Unstable/Development Type 1 Hypervisor
>>>> Jeremy Fitzhardinge's Xen paravirt-ops domain 0 Kernel 2.6.31-rc6
>>>> Primary Video Adapter in BIOS: IGD
>>>> 
>>>> Please see the screenshots and my blog at the link here:
>>>> 
>>>> 
>> 
>
http://teo-en-ming-aka-zhang-enming.blogspot.com/2009/08/nvidia-geforce-8400
>> -gs-pci-express-x16.html
>>>> 
>>>> 
>>> 
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>> http://lists.xensource.com/xen-devel
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>>> http://lists.xensource.com/xen-devel
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel
>> 
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.392 / Virus Database: 270.13.65/2324 - Release Date:
>> 08/25/09 18:07:00 
>> 
>> No virus found in this outgoing message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.392 / Virus Database: 270.13.65/2324 - Release Date:
>> 08/25/09 18:07:00
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.392 / Virus Database: 270.13.65/2324 - Release Date:
> 08/25/09 18:07:00
> 
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.392 / Virus Database: 270.13.65/2324 - Release Date:
> 08/25/09 18:07:00


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.67/2326 - Release Date: 08/25/09
18:07:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.67/2326 - Release Date: 08/26/09
12:16:00



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.69/2328 - Release Date: 08/26/09
12:16:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.69/2328 - Release Date: 08/26/09
12:16:00



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.69/2328 - Release Date: 08/26/09
12:16:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 8.5.392 / Virus Database: 270.13.69/2328 - Release Date: 08/26/09
12:16:00



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.