WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] graphics passthrough with VT-d

To: enming.teo@xxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] graphics passthrough with VT-d
From: "Mr. Teo En Ming (Zhang Enming)" <enming.teo@xxxxxxxxxxxxxxx>
Date: Sat, 29 Aug 2009 21:20:36 +0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, timothy.moore@xxxxxxxxxxx
Delivery-date: Sat, 29 Aug 2009 06:21:43 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4A991E57.5030703@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7CB0A101731F44C391569BAEBF727CF9@ASOITIS16> <4A97FDE9.2060302@xxxxxxxxxxxxxxx> <4A980CDE.8060109@xxxxxxxxxxxxxxx> <4A983A73.80602@xxxxxxxxxxxxxxx> <14D9C9E2ED61ED41BC3B37ACDF4E880002CE4F3F9CE5@xxxxxxxxxxxxxxxxxxxxxxx> <4A988FD4.4080602@xxxxxxxxxxxxxxx> <4A98A51D.6070602@xxxxxxxxxxxxxxx> <4A98D1AD.5060703@xxxxxxxxxxxxxxx> <4A990AE9.1080303@xxxxxxxxxxxxxxx> <4A991E57.5030703@xxxxxxxxxxxxxxx>
Reply-to: enming.teo@xxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3
Dear All,

I have applied the following patches to xen 3.5-unstable

1) intel-gfx-passthru-patch01.patch
2) intel-gfx-passthru-patch02.patch
3) intel-gfx-passthru-patch03.patch
4) enming-patch04.patch

and compiled xen 3.5-unstable successfully (both hypervisor and tools).

i rebooted into this newly compiled Xen hypervisor which supports loading vga bios from firmware file of nVidia Geforce 8400 GS PCI Express x16.

After dom0 has booted up, I executed the following script to hide nVidia Geforce 8400 GS from dom0.

[enming@fedora11-x86-64-host scripts]$ cat bind-devices-pci-stub.sh
#!/bin/sh
echo "10de 06e4" > /sys/bus/pci/drivers/pci-stub/new_id
echo "0000:01:00.0" > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
echo "0000:01:00.0" > /sys/bus/pci/drivers/pci-stub/bind

I also assigned the nVidia Geforce 8400 GS to my Windows XP Home HVM domU.

pci = [ '01:00.0' ]

I also specified gfx_passthru=2.

Do note that I booted up with onboard Intel GMA4500 as the primary video adapter. Hence dom 0 has onboard graphics and Windows XP HVM domU has nvidia graphics.

Then I started Windows XP Home HVM DomU.

Very soon, my Dom 0's display was garbaged and X server on Dom 0 totally froze and became unresponsive. I cannot switch to any ttys.

However, I was still able to vnc into my Windows XP Home HVM Dom U. I had earlier installed a VNC server into my Windows XP guest. After remoting in to my Windows XP DomU through vnc, I found that NVIDIA Geforce 8400 GS cannot be initialized and no resources are available for this graphics card.

-- 
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
Company Website: http://www.asiasoft.sg/
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 08:25 PM, Mr. Teo En Ming (Zhang Enming) wrote:
Hi All,

I have solved the problem encountered below when building tools for xen 3.5-unstable. The compile problem exists because I downloaded and compiled the latest version of Intel ACPI Component Architecture compiler version 20090730. And I used this latest compiler during "make tools" for xen-unstable.

In original xen-unstable source codes cloned from xensoure mercurial repository, the header files ssdt_pm.h and ssdt_tpm.h in source directory tools/firmware/hvmloader/acpi/ are generated by

/*
 *
 * Intel ACPI Component Architecture
 * ASL Optimizing Compiler version 20061109 [May 18 2007]
 * Copyright (C) 2000 - 2006 Intel Corporation
 * Supports ACPI Specification Revision 3.0a
 *
 * Compilation of "ssdt_pm.asl" - Sun Oct 12 23:57:51 2008
 *
 * C source code output
 *
 */

In original ssdt_pm.h, it has "unsigned char AmlCode_PM[] =".

In original ssdt_tpm.h, it has "unsigned char AmlCode_TPM[] =".

Hence there was no problem with "make tools".

But, I downloaded, compiled and used

/*
 *
 * Intel ACPI Component Architecture
 * ASL Optimizing Compiler version 20090730 [Aug 29 2009]
 * Copyright (C) 2000 - 2009 Intel Corporation
 * Supports ACPI Specification Revision 4.0
 *
 * Compilation of "ssdt_pm.asl" - Sat Aug 29 18:55:40 2009
 *
 * C source code output
 *
 */

So the *new* ssdt_pm.h contains:

/*
 *
 * Intel ACPI Component Architecture
 * ASL Optimizing Compiler version 20090730 [Aug 29 2009]
 * Copyright (C) 2000 - 2009 Intel Corporation
 * Supports ACPI Specification Revision 4.0
 *
 * Compilation of "ssdt_pm.asl" - Sat Aug 29 18:55:40 2009
 *
 * C source code output
 *
 */
unsigned char AmlCode[] =
{
    0x53,0x53,0x44,0x54,0xD6,0x05,0x00,0x00,  /* 00000000    "SSDT...." */
    0x02,0xB9,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
    0x48,0x56,0x4D,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "HVM....." */
    0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    0x30,0x07,0x09,0x20,0x10,0x41,0x5B,0x5C,  /* 00000020    "0.. .A[\" */
    0x5F,0x53,0x42,0x5F,0x5B,0x80,0x44,0x42,  /* 00000028    "_SB_[.DB" */
    0x47,0x41,0x01,0x0B,0x40,0xB0,0x01,0x5B,  /* 00000030    "GA..@..[" */
    0x81,0x0B,0x44,0x42,0x47,0x41,0x01,0x44,  /* 00000038    "..DBGA.D" */
    0x42,0x47,0x31,0x08,0x5B,0x80,0x44,0x42,  /* 00000040    "BG1.[.DB" */
    0x47,0x42,0x01,0x0B,0x44,0xB0,0x01,0x5B,  /* 00000048    "GB..D..[" */
    0x81,0x0B,0x44,0x42,0x47,0x42,0x01,0x44,  /* 00000050    "..DBGB.D" */
    0x42,0x47,0x32,0x08,0x5B,0x80,0x44,0x42,  /* 00000058    "BG2.[.DB" */
    0x47,0x43,0x01,0x0B,0x46,0xB0,0x01,0x5B,  /* 00000060    "GC..F..[" */
    0x81,0x0B,0x44,0x42,0x47,0x43,0x01,0x44,  /* 00000068    "..DBGC.D" */
    0x42,0x47,0x33,0x08,0x5B,0x80,0x44,0x42,  /* 00000070    "BG3.[.DB" */
    0x47,0x44,0x01,0x0B,0x48,0xB0,0x01,0x5B,  /* 00000078    "GD..H..[" */
    0x81,0x0B,0x44,0x42,0x47,0x44,0x01,0x44,  /* 00000080    "..DBGD.D" */
    0x42,0x47,0x34,0x08,0x5B,0x80,0x50,0x52,  /* 00000088    "BG4.[.PR" */
    0x54,0x31,0x01,0x0A,0xB2,0x0A,0x02,0x5B,  /* 00000090    "T1.....[" */
    0x81,0x10,0x50,0x52,0x54,0x31,0x01,0x50,  /* 00000098    "..PRT1.P" */
    0x42,0x32,0x5F,0x08,0x50,0x42,0x32,0x41,  /* 000000A0    "B2_.PB2A" */
    0x08,0x5B,0x80,0x50,0x52,0x54,0x32,0x01,  /* 000000A8    ".[.PRT2." */
    0x0A,0x86,0x01,0x5B,0x81,0x0B,0x50,0x52,  /* 000000B0    "...[..PR" */
    0x54,0x32,0x01,0x50,0x38,0x36,0x5F,0x08,  /* 000000B8    "T2.P86_." */
    0x5B,0x80,0x50,0x52,0x54,0x33,0x01,0x0A,  /* 000000C0    "[.PRT3.." */
    0x88,0x01,0x5B,0x81,0x0B,0x50,0x52,0x54,  /* 000000C8    "..[..PRT" */
    0x33,0x01,0x50,0x38,0x38,0x5F,0x08,0x5B,  /* 000000D0    "3.P88_.[" */
    0x01,0x53,0x59,0x4E,0x43,0x01,0x08,0x42,  /* 000000D8    ".SYNC..B" */
    0x55,0x46,0x30,0x11,0x04,0x0B,0x00,0x01,  /* 000000E0    "UF0....." */
    0x08,0x42,0x55,0x46,0x31,0x11,0x03,0x0A,  /* 000000E8    ".BUF1..." */
    0x08,0x8B,0x42,0x55,0x46,0x31,0x00,0x42,  /* 000000F0    "..BUF1.B" */
    0x55,0x46,0x41,0x8B,0x42,0x55,0x46,0x31,  /* 000000F8    "UFA.BUF1" */
    0x0A,0x04,0x42,0x55,0x46,0x42,0x14,0x14,  /* 00000100    "..BUFB.." */

And the *new* ssdt_tpm.h contains:

/*
 *
 * Intel ACPI Component Architecture
 * ASL Optimizing Compiler version 20090730 [Aug 29 2009]
 * Copyright (C) 2000 - 2009 Intel Corporation
 * Supports ACPI Specification Revision 4.0
 *
 * Compilation of "ssdt_tpm.asl" - Sat Aug 29 18:55:40 2009
 *
 * C source code output
 *
 */
unsigned char AmlCode[] =
{
    0x53,0x53,0x44,0x54,0x4C,0x00,0x00,0x00,  /* 00000000    "SSDTL..." */
    0x02,0x2A,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    ".*Xen..." */
    0x48,0x56,0x4D,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "HVM....." */
    0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    0x30,0x07,0x09,0x20,0x5B,0x82,0x26,0x54,  /* 00000020    "0.. [.&T" */
    0x50,0x4D,0x5F,0x08,0x5F,0x48,0x49,0x44,  /* 00000028    "PM_._HID" */
    0x0C,0x41,0xD0,0x0C,0x31,0x08,0x5F,0x43,  /* 00000030    ".A..1._C" */
    0x52,0x53,0x11,0x11,0x0A,0x0E,0x86,0x09,  /* 00000038    "RS......" */
    0x00,0x01,0x00,0x00,0xD4,0xFE,0x00,0x50,  /* 00000040    ".......P" */
    0x00,0x00,0x79,0x00,
};

which are both wrong.

In ssdt_pm.h, I have to change "unsigned char AmlCode[]" to "unsigned char AmlCode_PM[]".

In ssdt_tpm.h, I have to change "unsigned char AmlCode[]" to "unsigned char AmlCode_TPM[]".

Then "make tools" is able to complete successfully.

I have created a patch for anybody who may be using the *latest* version of Intel ACPI CA compiler version 20090730 and attached it here.

Patch file filename enming-patch04.patch:

<CODE>

Patch created by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 8:00 P.M. Singapore Time
Email #1: enming.teo@xxxxxxxxxxxxxxx
Email #2: space.time.universe@xxxxxxxxx
MSN: teoenming@xxxxxxxxxxx
Mobile Phone: +65-9648-9798

--- ssdt_pm.h    2009-08-29 19:54:52.653088000 +0800
+++ ssdt_pm.h    2009-08-29 19:56:51.813088550 +0800
@@ -10,7 +10,7 @@
  * C source code output
  *
  */
-unsigned char AmlCode[] =
+unsigned char AmlCode_PM[] =
 {
     0x53,0x53,0x44,0x54,0xD6,0x05,0x00,0x00,  /* 00000000    "SSDT...." */
     0x02,0xB9,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
--- ssdt_tpm.h    2009-08-29 19:55:44.578738954 +0800
+++ ssdt_tpm.h    2009-08-29 19:57:27.896638884 +0800
@@ -10,7 +10,7 @@
  * C source code output
  *
  */
-unsigned char AmlCode[] =
+unsigned char AmlCode_TPM[] =
 {
     0x53,0x53,0x44,0x54,0x4C,0x00,0x00,0x00,  /* 00000000    "SSDTL..." */
     0x02,0x2A,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    ".*Xen..." */

</CODE>

-- 
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
Company Website: http://www.asiasoft.sg/
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
Hi,

I cloned http://xenbits.xensource.com/xen-unstable.hg again today. I tried applying the three Intel gfx passthrough patches to xen-unstable. When I "make tools", I get the same error again:

make[7]: Entering directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader'
make -C acpi all
get-path: will use #!/usr/bin/python2.6 for python programs
make[8]: Entering directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader/acpi'
make iasl
get-path: will use #!/usr/bin/python2.6 for python programs
make[9]: Entering directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader/acpi'
make[9]: `/usr/local/bin/iasl' is up to date.
make[9]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader/acpi'
iasl -tc ssdt_tpm.asl

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20090730 [Aug 29 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 4.0

ASL Input:  ssdt_tpm.asl - 31 lines, 1111 bytes, 3 keywords
AML Output: SSDT_TPM.aml - 76 bytes, 3 named objects, 0 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
mv ssdt_tpm.hex ssdt_tpm.h
rm -f *.aml
make iasl
get-path: will use #!/usr/bin/python2.6 for python programs
make[9]: Entering directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader/acpi'
make[9]: `/usr/local/bin/iasl' is up to date.
make[9]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader/acpi'
iasl -tc ssdt_pm.asl

Intel ACPI Component Architecture
ASL Optimizing Compiler version 20090730 [Aug 29 2009]
Copyright (C) 2000 - 2009 Intel Corporation
Supports ACPI Specification Revision 4.0

ASL Input:  ssdt_pm.asl - 425 lines, 12754 bytes, 192 keywords
AML Output: SSDT_PM.aml - 1494 bytes, 64 named objects, 128 executable opcodes

Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 31 Optimizations
mv ssdt_pm.hex ssdt_pm.h
rm -f *.aml
gcc   -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m32 -march=i686 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .build.o.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs -Werror -fno-stack-protector -fno-builtin -msoft-float -I. -I.. -I../../../../tools/include -c -o build.o build.c
In file included from build.c:21:
ssdt_pm.h:13: error: redefinition of ‘AmlCode’
ssdt_tpm.h:13: note: previous definition of ‘AmlCode’ was here
build.c: In function ‘construct_secondary_tables’:
build.c:184: error: ‘AmlCode_PM’ undeclared (first use in this function)
build.c:184: error: (Each undeclared identifier is reported only once
build.c:184: error: for each function it appears in.)
build.c:194: error: ‘AmlCode_TPM’ undeclared (first use in this function)
make[8]: *** [build.o] Error 1
make[8]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader/acpi'
make[7]: *** [subdir-all-acpi] Error 2
make[7]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader'
make[6]: *** [subdirs-all] Error 2
make[6]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware/hvmloader'
make[5]: *** [subdir-all-hvmloader] Error 2
make[5]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware'
make[4]: *** [subdirs-all] Error 2
make[4]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools/firmware'
make[2]: *** [subdir-install-firmware] Error 2
make[2]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/usr/src/xen-unstable-new.hg-vgapt/tools'
make: *** [install-tools] Error 2

Any ideas about this Advanced Configuration and Power Interface code?

-- 
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
Company Website: http://www.asiasoft.sg/
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 02:58 PM, Mr. Teo En Ming (Zhang Enming) wrote:
Hi

Anybody available today? I know it's Saturday. :-)

-- 
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
Company Website: http://www.asiasoft.sg/
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 11:48 AM, Mr. Teo En Ming (Zhang Enming) wrote:

Dear All,

After applying Intel VGA passthrough patches 1, 2 and 3, I have no problems with "make xen", and "make install-xen". However, I have errors with "make tools".

Here is the error output:

msoft-float -I. -I.. -I../../../../tools/include -c -o build.o build.c
build.c: In function ‘construct_secondary_tables’:
build.c:194: error: ‘AmlCode_TPM’ undeclared (first use in this function)
build.c:194: error: (Each undeclared identifier is reported only once
build.c:194: error: for each function it appears in.)
make[8]: *** [build.o] Error 1
make[8]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader/acpi'
make[7]: *** [subdir-all-acpi] Error 2
make[7]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader'
make[6]: *** [subdirs-all] Error 2
make[6]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader'
make[5]: *** [subdir-all-hvmloader] Error 2
make[5]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware'
make[4]: *** [subdirs-all] Error 2
make[4]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware'
make[2]: *** [subdir-install-firmware] Error 2
make[2]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools'
make: *** [install-tools] Error 2

There is an undeclared identifier in tools/firmware/hvmloader/acpi/build.c source code. Could you guys help me resolve this issue?

I had no problems compiling xen 3.5-unstable before applying the Intel vga passthrough patches and before installing the Intel ACPI Component Architecture compiler.

I have also attached Intel graphics passthrough patches 1, 2 and 3 for your convenience here.

Thank you very much.

Hope I can get this working during the weekends.

-- 
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
Company Website: http://www.asiasoft.sg/
Mobile: +65-9648-9798
MSN: teoenming@xxxxxxxxxxx
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 10:17 AM, Mr. Teo En Ming (Zhang Enming) wrote:
Hi Tim,

I thought it should be gfx_passthru=2 in domU config?
-- 
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


On 08/29/2009 06:42 AM, Tim Moore wrote:

Teo,

 

I have also performed the same exercise as yourself and I now have successfully compiled all 3x patches into Xen, Qemu and the BIOS File Loading in the hvmloader, this all compiles find on my system. Suggest you do a "make clean" on the tools and start again !

 

After booting with the patched xen-unstable and adding the gfx-passthru=1 parameter to my HVM DomU, as I suspected - it still doesn't work.

 

I have both a 9500GT and GTX260(primary) in my Intel DX58SO machine, tried passing through either device and my primary display locks up ! (included hiding with pci-stub)

 

I verified that the DomU was functional beforehand, as It also booted successfully without the gfx-passthru parameter (and a vncviewer/cirrus display)

 

Unfortunately, I can't debug further as my Primary display corrupts as soon as the DomU starts. I did notice that in "xm debug" the "Loading Gfx BIOS File.." message was displayed and the DomU did continue to initialise the BIOS tables and such before finally locking. I then (blindly) typed on a corrupt Dom0 console and managed to start kdm and login, so the Dom0 was not completely trashed. But then after a few minutes, the machine totally froze and had to hit the reset switch.

 

I`m no specialist but this looks like the VGA BIOS Re-initialisation is playing havoc with the DomU and possibly the Dom0 graphics. I notice that both are also using IRQ11 which could play a major part. Furthermore, there was a lot of debug output in the qemu and xend.log indicating Base Address Register invalid access and therefore it seems there may be a second obstacle.

 

Hope you have a better success than me !

 

For now, I would try re-compiling a fresh xen-unstable with carefully applied patches .. oh! and don't forget to enable the pci-stub driver for Dom0 (it's not selected by default)

 

Tim

 

From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@xxxxxxxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@xxxxxxxxxxxxx; weidong.han@xxxxxxxxx; bengheng@xxxxxxxxxxxxxx
Subject: Re: [Xen-devel] [PATCH 2/2] graphics passthrough with VT-d

 

After applying the 1st and 2nd patch to xen-unstable successfully, I examined the source codes Makefile and hvmloader.c in tools/firmware/hvmloader, compared them to Weidong's 3rd patch and I generated my own 3rd patch. Then I used my own generated 3rd patch to apply patching for loading vga bios from firmware file.
 
Here is my own generated 3rd patch instead of using Weidong's 3rd patch:
 
--- Makefile    2009-08-29 03:24:52.413083774 +0800
+++ Makefile    2009-08-29 03:29:12.763299633 +0800
@@ -50,6 +50,7 @@
 roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin \
        ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../etherboot/eb-roms.h
        sh ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
+       sh ./mkhex vgabios_pt ../vgabios/vgabios-pt.bin >> roms.h
        sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
        sh ./mkhex vgabios_cirrusvga \
                ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
--- hvmloader.c 2009-08-29 03:26:06.911085797 +0800
+++ hvmloader.c 2009-08-29 03:31:43.172084995 +0800
@@ -688,9 +688,9 @@
         vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
         break;
     case VGA_pt:
-        printf("Loading VGABIOS of passthroughed gfx ...\n");
-        vgabios_sz =
-            round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
+       printf("Loading Gfx Video BIOS from file ...\n");
+       memcpy((void *)VGABIOS_PHYSICAL_ADDRESS, vgabios_pt, sizeof(vgabios_pt));
+       vgabios_sz = round_option_rom(sizeof(vgabios_pt));
         break;
     default:
         printf("No emulated VGA adaptor ...\n");
 
 
I can "make xen" successfully but when I proceeded to "make tools", errors were encountered.
 
Please see attached error output. How can I solve this problem?
 
 
-- 
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



On 08/29/2009 12:59 AM, Mr. Teo En Ming (Zhang Enming) wrote:

OK I believe the 3rd patch is not incomplete but there's a white space issue when I copied the code from the mailing list into my vi.
 
See http://www.htdig.org/mail/2000/11/0167.html
 
When I used the -l flag to patch using the 3rd patch, the number of errors was reduced.
 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# patch -l -p1 < intel-gfx-passthru-patch-3.patch 
patching file tools/firmware/hvmloader/Makefile
patching file tools/firmware/hvmloader/hvmloader.c
Hunk #1 FAILED at 688.
1 out of 1 hunk FAILED -- saving rejects to file tools/firmware/hvmloader/hvmloader.c.rej
 
Now patching tools/firmware/hvmloader/Makefile is successful but patching tools/firmware/hvmloader/hvmloader.c still failed.
 
-- 
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




On 08/28/2009 11:55 PM, Mr. Teo En Ming (Zhang Enming) wrote:

Dear Weidong,

A big big thanks for the vga passthrough patches for xen 3.5-unstable!!! These are eagerly anticipated patches. As I did not study computer science and computer architecture, I won't be able to write those patches you guys at Intel wrote.

I applied the following patches xen-gfx-passthrough.patch and qemu-gfx-passthrough.patch to xen 3.5-unstable without issues.

Then I tried to apply the 3rd patch you provided at http://lists.xensource.com/archives/html/xen-devel/2009-08/msg01047.html

I saved the following code

<CODE>

diff -r 494be76c1ad9 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile Thu Aug 27 16:54:33 2009 +0800
+++ b/tools/firmware/hvmloader/Makefile Thu Aug 27 17:22:01 2009 +0800
@@ -50,6 +50,7 @@ roms.h: ../rombios/BIOS-bochs-latest ../
 roms.h: ../rombios/BIOS-bochs-latest ../vgabios/VGABIOS-lgpl-latest.bin \
    ../vgabios/VGABIOS-lgpl-latest.cirrus.bin ../etherboot/eb-roms.h
    sh ./mkhex rombios ../rombios/BIOS-bochs-latest > roms.h
+   sh ./mkhex vgabios_pt ../vgabios/vgabios-pt.bin >> roms.h
    sh ./mkhex vgabios_stdvga ../vgabios/VGABIOS-lgpl-latest.bin >> roms.h
    sh ./mkhex vgabios_cirrusvga \
        ../vgabios/VGABIOS-lgpl-latest.cirrus.bin >> roms.h
diff -r 494be76c1ad9 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c  Thu Aug 27 16:54:33 2009 +0800
+++ b/tools/firmware/hvmloader/hvmloader.c  Thu Aug 27 17:23:00 2009 +0800
@@ -688,9 +688,9 @@ int main(void)
         vgabios_sz = round_option_rom(sizeof(vgabios_stdvga));
         break;
     case VGA_pt:
-        printf("Loading Gfx Video BIOS from 0xC0000 ...\n");
-        vgabios_sz =
-            round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
+         printf("Loading Gfx Video BIOS from file ...\n");
+         memcpy((void *)VGABIOS_PHYSICAL_ADDRESS, vgabios_pt, 
sizeof(vgabios_pt));
+         vgabios_sz = round_option_rom(sizeof(vgabios_pt));
         break;
     default:
         printf("No emulated VGA adaptor ...\n");
  
</CODE>
 
as intel-gfx-passthru-patch-3.patch and then I tried to apply the patch to xen 3.5-unstable. I got errors. I think it's because the 3rd patch you provided is incomplete.
 
Here's my patching process:
 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# find . -name vgabios
./tools/firmware/vgabios
./.hg/store/data/tools/firmware/vgabios
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# cp ~enming/vgabios-pt.bin tools/firmware/vgabios/
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# ls tools/firmware/vgabios/
biossums.c  clext.c      Makefile  TODO                 vbe.h            vgabios.h       vgatables.h
BUGS        COPYING      Notes     vbe.c                vbetables-gen.c  vgabios-pt.bin
ChangeLog   dataseghack  README    vbe_display_api.txt  vgabios.c        vgafonts.h
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# pwd
/usr/src/xen-unstable.hg-vgapt
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# wget http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin
--2009-08-28 23:18:21--  http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin
Resolving lists.xensource.com... 70.42.241.110
Connecting to lists.xensource.com|70.42.241.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12565 (12K) [application/octet-stream]
Saving to: `bincPiiAf0QWg.bin'
 
100%[======================================================================>] 12,565      30.7K/s   in 0.4s    
 
2009-08-28 23:18:22 (30.7 KB/s) - `bincPiiAf0QWg.bin' saved [12565/12565]
 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# mv bincPiiAf0QWg.bin xen-gfx-passthrough.patch
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# vi xen-gfx-passthrough.patch 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# patch < xen-gfx-passthrough.patch 
can't find file to patch at input line 4
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|diff -r 5d7e7a250267 tools/firmware/hvmloader/config.h
|--- a/tools/firmware/hvmloader/config.h      Wed Aug 26 18:28:44 2009 +0800
|+++ b/tools/firmware/hvmloader/config.h      Thu Aug 27 16:54:24 2009 +0800
--------------------------
File to patch: ^C
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# ex xen-gfx-passthrough.patch 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# patch -p1 < xen-gfx-passthrough.patch 
patching file tools/firmware/hvmloader/config.h
patching file tools/firmware/hvmloader/hvmloader.c
patching file tools/libxc/ia64/xc_ia64_hvm_build.c
patching file tools/libxc/xc_hvm_build.c
patching file tools/libxc/xc_linux.c
patching file tools/libxc/xenctrl.h
patching file tools/libxc/xenguest.h
patching file tools/python/xen/lowlevel/xc/xc.c
patching file tools/python/xen/xend/XendConfig.py
Hunk #1 succeeded at 174 (offset -1 lines).
patching file tools/python/xen/xend/image.py
Hunk #1 succeeded at 780 (offset -6 lines).
Hunk #3 succeeded at 895 (offset -6 lines).
patching file tools/python/xen/xm/create.py
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# wget http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin
--2009-08-28 23:21:35--  http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin
Resolving lists.xensource.com... 70.42.241.110
Connecting to lists.xensource.com|70.42.241.110|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9841 (9.6K) [application/octet-stream]
Saving to: `binglLqkeq4Rj.bin'
 
100%[======================================================================>] 9,841       24.3K/s   in 0.4s    
 
2009-08-28 23:21:36 (24.3 KB/s) - `binglLqkeq4Rj.bin' saved [9841/9841]
 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# mv binglLqkeq4Rj.bin qemu-gfx-passthrough.patch
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# vi qemu-gfx-passthrough.patch 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# find . -name hw
./tools/ioemu-remote/hw
./.hg/store/data/tools/ioemu/hw
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# mv qemu-gfx-passthrough.patch tools/ioemu-remote/
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# cd tools/ioemu-remote/
[root@fedora11-x86-64-host ioemu-remote]# patch -p1 < qemu-
qemu-aio.h                  qemu-img.c                  qemu-sockets.c
qemu-binfmt-conf.sh         qemu-img.texi               qemu-tech.texi
qemu-char.c                 qemu-lock.h                 qemu-timer.h
qemu-char.h                 qemu-log.h                  qemu-tool.c
qemu-common.h               qemu-malloc.c               qemu-xen.h
qemu-doc.texi               qemu-nbd.c                  
qemu-gfx-passthrough.patch  qemu-nbd.texi               
[root@fedora11-x86-64-host ioemu-remote]# patch -p1 < qemu-gfx-passthrough.patch 
patching file hw/pass-through.c
patching file hw/pass-through.h
patching file hw/pc.c
patching file vl.c
[root@fedora11-x86-64-host ioemu-remote]# cd ..
[root@fedora11-x86-64-host tools]# cd ..
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# vi intel-gfx-passthru-patch-3.patch
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# patch -p1 < intel-gfx-passthru-patch-3.patch 
patching file tools/firmware/hvmloader/Makefile
Hunk #1 FAILED at 50.
1 out of 1 hunk FAILED -- saving rejects to file tools/firmware/hvmloader/Makefile.rej
patching file tools/firmware/hvmloader/hvmloader.c
patch: **** malformed patch at line 24: sizeof(vgabios_pt));
 
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# vi intel-gfx-passthru-patch-3.patch 
 
For everybody's convenience, I have attached intel-gfx-passthru-patch-3.patch and the firmware for my nVidia GeForce 8400 GS PCI Express x16 graphics card in this email.
 
Please help me complete intel-gfx-passthru-patch-3.patch as I really need it.
 
Thank you very much!!!
  
-- 
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
This patch supports basic gfx passthrough on QEMU:
  - disable emulated VGA adpater if there is passthroughed gfx
  - register/unregister legacy VGA I/O ports and MMIOs for passthroughed gfx
 
Signed-off-by: Ben Lin <ben.y.lin@xxxxxxxxx>
Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx>
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.409 / Virus Database: 270.13.69/2328 - Release Date: 08/27/09
18:02:00
 
No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 8.5.409 / Virus Database: 270.13.71/2330 - Release Date: 08/27/09
18:02:00
  

 
_______________________________________________
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









_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>