All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] graphics passthrough with VT-d
@ 2009-08-28 15:34 Teo En Ming (Zhang Enming)
  2009-08-28 15:55 ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 1 reply; 66+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-08-28 15:34 UTC (permalink / raw)
  To: xen-devel
  Cc: 'Lin, Ben Y', 'Kay, Allen M',
	Keir.Fraser, 'Jean Guyader',
	bengheng

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

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@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
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

[-- Attachment #2: qemu-gfx-passthrough.patch --]
[-- Type: application/octet-stream, Size: 10140 bytes --]

>From fb818f1060e57dac6793187a70a79801a7c17e50 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Thu, 27 Aug 2009 16:51:01 +0800
Subject: [PATCH] qemu gfx passthrough support

support basic gfx passthrough:
  - 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@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 hw/pass-through.c |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pass-through.h |    6 +++++
 hw/pc.c           |   51 ++++++++++++++++++++++++------------------
 vl.c              |   32 +++++++++++++++++++++++---
 4 files changed, 126 insertions(+), 26 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..4a9e03a 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -93,6 +93,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
+extern int gfx_passthru;
+
 struct php_dev {
     struct pt_dev *pt_dev;
     uint8_t valid;
@@ -1781,12 +1783,57 @@ static int pt_dev_is_virtfn(struct pci_dev *dev)
     return rc;
 }
 
+/*
+ * register VGA resources for the domain with assigned gfx
+ */
+static int register_vga_regions(struct pt_dev *real_device)
+{
+    int ret = 0;
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+            0x3B0, 0xC, DPCI_ADD_MAPPING);
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+            0x3C0, 0x20, DPCI_ADD_MAPPING);
+
+    ret |= xc_domain_memory_mapping(xc_handle, domid,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0x20,
+            DPCI_ADD_MAPPING);
+
+    return ret;
+}
+
+/*
+ * unregister VGA resources for the domain with assigned gfx
+ */
+static int unregister_vga_regions(struct pt_dev *real_device)
+{
+    int ret = 0;
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+            0x3B0, 0xC, DPCI_REMOVE_MAPPING);
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+            0x3C0, 0x20, DPCI_REMOVE_MAPPING);
+
+    ret |= xc_domain_memory_mapping(xc_handle, domid,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0x20,
+            DPCI_REMOVE_MAPPING);
+
+    return ret;
+}
+
 static int pt_register_regions(struct pt_dev *assigned_device)
 {
     int i = 0;
     uint32_t bar_data = 0;
     struct pci_dev *pci_dev = assigned_device->pci_dev;
     PCIDevice *d = &assigned_device->dev;
+    int ret;
 
     /* Register PIO/MMIO BARs */
     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
@@ -1842,6 +1889,16 @@ static int pt_register_regions(struct pt_dev *assigned_device)
             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
     }
 
+    if ( gfx_passthru && (pci_dev->device_class == 0x0300) )
+    {
+        ret = register_vga_regions(assigned_device);
+        if ( ret != 0 )
+        {
+            PT_LOG("VGA region mapping failed\n");
+            return ret;
+        }
+    }
+
     return 0;
 }
 
@@ -1891,6 +1948,12 @@ static void pt_unregister_regions(struct pt_dev *assigned_device)
 
     }
 
+    if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+    {
+        ret = unregister_vga_regions(assigned_device);
+        if ( ret != 0 )
+            PT_LOG("VGA region unmapping failed\n");
+    }
 }
 
 static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
diff --git a/hw/pass-through.h b/hw/pass-through.h
index 028a03e..956e228 100644
--- a/hw/pass-through.h
+++ b/hw/pass-through.h
@@ -142,6 +142,12 @@ enum {
     GRP_TYPE_EMU,                               /* emul reg group */
 };
 
+enum {
+    GFX_NO_PASSTHRU = 0,                        /* No gfx pass-through */
+    GFX_IGD_PASSTHRU,                           /* IGD pass-through */
+    GFX_DISCRETE_PASSTHRU,                      /* Discrete gfx pass-through */
+};
+
 #define PT_GET_EMUL_SIZE(flag, r_size) do { \
     if (flag == PT_BAR_FLAG_MEM) {\
         r_size = (((r_size) + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1)); \
diff --git a/hw/pc.c b/hw/pc.c
index 129e9d9..53b59c0 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -41,6 +41,7 @@
 #include "virtio-balloon.h"
 #include "virtio-console.h"
 #include "hpet_emul.h"
+#include "pass-through.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -65,6 +66,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
 extern uint8_t *acpi_tables;
 extern size_t acpi_tables_len;
 
+extern int gfx_passthru;
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
@@ -983,30 +986,34 @@ vga_bios_error:
 
     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
 
-    if (cirrus_vga_enabled) {
-        if (pci_enabled) {
-            pci_cirrus_vga_init(pci_bus,
-                                phys_ram_base + vga_ram_addr,
-                                vga_ram_addr, vga_ram_size);
-        } else {
-            isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
-                                vga_ram_addr, vga_ram_size);
-        }
+    if (gfx_passthru == GFX_NO_PASSTHRU) {
+       if (cirrus_vga_enabled) {
+            fprintf(logfile,"cirrus_vga_enabled\n");
+            if (pci_enabled) {
+                pci_cirrus_vga_init(pci_bus,
+                                    phys_ram_base + vga_ram_addr,
+                                    vga_ram_addr, vga_ram_size);
+            } else {
+                isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
+                                    vga_ram_addr, vga_ram_size);
+            }
 #ifndef CONFIG_DM
-    } else if (vmsvga_enabled) {
-        if (pci_enabled)
-            pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
-                            vga_ram_addr, vga_ram_size);
-        else
-            fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+        } else if (vmsvga_enabled) {
+            if (pci_enabled)
+                pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
+                                vga_ram_addr, vga_ram_size);
+            else
+                fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
 #endif
-    } else if (std_vga_enabled) {
-        if (pci_enabled) {
-            pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
-                         vga_ram_addr, vga_ram_size, 0, 0);
-        } else {
-            isa_vga_init(phys_ram_base + vga_ram_addr,
-                         vga_ram_addr, vga_ram_size);
+        } else if (std_vga_enabled) {
+            fprintf(logfile,"std_vga_enabled\n");
+            if (pci_enabled) {
+                pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
+                             vga_ram_addr, vga_ram_size, 0, 0);
+            } else {
+                isa_vga_init(phys_ram_base + vga_ram_addr,
+                             vga_ram_addr, vga_ram_size);
+            }
         }
     }
 
diff --git a/vl.c b/vl.c
index 62bed05..72f3479 100644
--- a/vl.c
+++ b/vl.c
@@ -48,6 +48,7 @@
 #include <stdlib.h>
 
 #include "qemu-xen.h"
+#include "hw/pass-through.h"
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -213,6 +214,7 @@ static int rtc_date_offset = -1; /* -1 means no change */
 int cirrus_vga_enabled = 1;
 int std_vga_enabled = 0;
 int vmsvga_enabled = 0;
+int gfx_passthru = 0;
 #ifdef TARGET_SPARC
 int graphic_width = 1024;
 int graphic_height = 768;
@@ -4269,6 +4271,7 @@ enum {
     /* Xen tree: */
     QEMU_OPTION_disable_opengl,
     QEMU_OPTION_direct_pci,
+    QEMU_OPTION_gfx_passthru,
     QEMU_OPTION_pci_emulation,
     QEMU_OPTION_vncunused,
     QEMU_OPTION_videoram,
@@ -4447,6 +4450,7 @@ static const QEMUOption qemu_options[] = {
 #endif
     { "acpi", 0, QEMU_OPTION_acpi }, /* deprecated, for xend compatibility */
     { "direct_pci", HAS_ARG, QEMU_OPTION_direct_pci },
+    { "gfx_passthru", HAS_ARG, QEMU_OPTION_gfx_passthru},
     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
     { "vncunused", 0, QEMU_OPTION_vncunused },
     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
@@ -5484,6 +5488,22 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_runas:
                 run_as = optarg;
                 break;
+            case QEMU_OPTION_gfx_passthru:
+                gfx_passthru = atoi(optarg);
+                switch (gfx_passthru) {
+                case GFX_NO_PASSTHRU:
+                    break;
+                case GFX_IGD_PASSTHRU:
+                    fprintf(logfile, "IGD graphics card assignment\n");
+                    break;
+                case GFX_DISCRETE_PASSTHRU:
+                    fprintf(logfile, "Discrete graphics card assignment\n");
+                    break;
+                default:
+                    fprintf(stderr, "unsupported gfx_passthru option: %d\n",
+                            gfx_passthru);
+                }
+                break;
             }
         }
     }
@@ -5897,13 +5917,17 @@ int main(int argc, char **argv, char **envp)
                         exit(1);
 		    xenstore_write_vncport(vnc_display_port);
                 }
+
+                if (gfx_passthru == GFX_NO_PASSTHRU)
+                {
 #if defined(CONFIG_SDL)
-                if (sdl || !vnc_display)
-                    sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
+                    if (sdl || !vnc_display)
+                        sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
 #elif defined(CONFIG_COCOA)
-                if (sdl || !vnc_display)
-                    cocoa_display_init(ds, full_screen);
+                    if (sdl || !vnc_display)
+                        cocoa_display_init(ds, full_screen);
 #endif
+                }
             }
     }
     dpy_resize(ds);
-- 
1.6.0.4


[-- Attachment #3: ATT00185.txt --]
[-- Type: text/plain, Size: 138 bytes --]

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

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* Re: [PATCH 2/2] graphics passthrough with VT-d
  2009-08-28 15:34 [PATCH 2/2] graphics passthrough with VT-d Teo En Ming (Zhang Enming)
@ 2009-08-28 15:55 ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:08   ` Mr. Teo En Ming (Zhang Enming)
                     ` (2 more replies)
  0 siblings, 3 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 15:55 UTC (permalink / raw)
  To: weidong.han
  Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
	'Jean Guyader',
	Keir.Fraser, bengheng


[-- Attachment #1.1: Type: text/plain, Size: 9161 bytes --]

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 
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
and **qemu-gfx-passthrough.patch 
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
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@hotmail.com
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@intel.com>
> Signed-off-by: Weidong Han<weidong.han@intel.com>
> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    


[-- Attachment #1.2: Type: text/html, Size: 10827 bytes --]

[-- Attachment #2: intel-gfx-passthru-patch-3.patch --]
[-- Type: text/plain, Size: 1486 bytes --]

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");


[-- Attachment #3: nvidia-geforce-8400-gs-firmware.rom --]
[-- Type: application/octet-stream, Size: 62464 bytes --]

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 2/2] graphics passthrough with VT-d
  2009-08-28 15:55 ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-28 16:08   ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:10   ` [PATCH(es)] " Tim Moore
  2009-08-28 16:59   ` [PATCH 2/2] " Mr. Teo En Ming (Zhang Enming)
  2 siblings, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 16:08 UTC (permalink / raw)
  To: enming.teo
  Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
	'Jean Guyader',
	Keir.Fraser, weidong.han, bengheng


[-- Attachment #1.1: Type: text/plain, Size: 10370 bytes --]

The vga bios file for my nvidia geforce 8400 gs was extracted using 
nvflash.exe executed from a USB floppy drive. I couldn't run NiBiTor as 
I don't have a running native Windows operating system.

-- 
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@hotmail.com
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 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
> and **qemu-gfx-passthrough.patch 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
> 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]# wgethttp://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]# wgethttp://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@hotmail.com
> 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@intel.com>
>> Signed-off-by: Weidong Han<weidong.han@intel.com>
>> 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@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>    
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    



[-- Attachment #1.2: Type: text/html, Size: 12496 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 15:55 ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:08   ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-28 16:10   ` Tim Moore
  2009-08-28 16:19     ` Alan Cox
  2009-08-28 16:28     ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:59   ` [PATCH 2/2] " Mr. Teo En Ming (Zhang Enming)
  2 siblings, 2 replies; 66+ messages in thread
From: Tim Moore @ 2009-08-28 16:10 UTC (permalink / raw)
  To: 'enming.teo@asiasoftsea.net'; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 10904 bytes --]

Teo,

It looks like the patches that Wiedong has supplied already copy the VGA bios from the card and re-execute it within the DomU, therefore there should be no need to load it from a file.

I think you will have trouble for 2 reasons:
1) Bios re-execution, these Nvidia cards do not like having the BIOS re-executed (from memcpy or file)
2) the Base Address Registers (BARs) will require 1:1 mappings to the real addresses, which these patches dont cater for

If you want to make it work, you will need a card that works without the 1:1 mapping and is more friendly to virtualisation.

ie:



http://www.nvidia.com/object/sli_multi_os.html

(as Andrew Lyon describes)

Dual Quadro FX 5800, 4800, and 3800 professional graphics boards

Tm

From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 16:55
To: weidong.han@intel.com
Cc: xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2] graphics passthrough with VT-d

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel




[-- Attachment #1.2: Type: text/html, Size: 22462 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 16:10   ` [PATCH(es)] " Tim Moore
@ 2009-08-28 16:19     ` Alan Cox
  2009-08-28 16:22       ` Tim Moore
  2009-08-28 16:28     ` Mr. Teo En Ming (Zhang Enming)
  1 sibling, 1 reply; 66+ messages in thread
From: Alan Cox @ 2009-08-28 16:19 UTC (permalink / raw)
  To: Tim Moore; +Cc: xen-devel, 'enming.teo@asiasoftsea.net'

> If you want to make it work, you will need a card that works without the 1:1 mapping and is more friendly to virtualisation.

Or to do your own board initialisation code for a cheap board - there is
sufficient code in the Linux nvidia fb driver and/or the Nouveau codebase
for that for a fair number of boards.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 16:19     ` Alan Cox
@ 2009-08-28 16:22       ` Tim Moore
  0 siblings, 0 replies; 66+ messages in thread
From: Tim Moore @ 2009-08-28 16:22 UTC (permalink / raw)
  To: 'Alan Cox'; +Cc: xen-devel, 'enming.teo@asiasoftsea.net'

Thanks for the steer Alan, it would be ok for limited support and testing but I don't think it would be supportable to maintain Xen specific board initialisation code especially when the DomU is HVM running Windows OS .. you would want to use the Nvidia shipped drivers..

-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk] 
Sent: 28 August 2009 17:20
To: Tim Moore
Cc: 'enming.teo@asiasoftsea.net'; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] [PATCH(es)] graphics passthrough with VT-d

> If you want to make it work, you will need a card that works without the 1:1 mapping and is more friendly to virtualisation.

Or to do your own board initialisation code for a cheap board - there is
sufficient code in the Linux nvidia fb driver and/or the Nouveau codebase
for that for a fair number of boards.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 16:10   ` [PATCH(es)] " Tim Moore
  2009-08-28 16:19     ` Alan Cox
@ 2009-08-28 16:28     ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:31       ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:36       ` Alan Cox
  1 sibling, 2 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 16:28 UTC (permalink / raw)
  To: timothy.moore; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 12176 bytes --]

Dear Tim,

I am using onboard Intel GMA 4500 for my Dom 0 and nVidia Geforce 8400 
GS for passthrough to Windows XP HVM domU.

I believe the VGA BIOS in the physical memory region 0xC0000 to 0xC7FFF 
is the vga bios of onboard Intel graphics, and not my Geforce 8400 GS. 
Hence I would need to extract out the firmware file for my Geforce 8400 
GS card.

As for nvidia professional graphics cards, they are too expensive for me 
for home use.

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 12:10 AM, Tim Moore wrote:
>
> Teo,
>
> It looks like the patches that Wiedong has supplied already copy the 
> VGA bios from the card and re-execute it within the DomU, therefore 
> there should be no need to load it from a file.
>
> I think you will have trouble for 2 reasons:
>
> 1) Bios re-execution, these Nvidia cards do not like having the BIOS 
> re-executed (from memcpy or file)
>
> 2) the Base Address Registers (BARs) will require 1:1 mappings to the 
> real addresses, which these patches dont cater for
>
> If you want to make it work, you will need a card that works without 
> the 1:1 mapping and is more friendly to virtualisation.
>
> ie:
>
> http://www.nvidia.com/object/sli_multi_os.html
>
> (as Andrew Lyon describes)
>
> Dual Quadro FX 5800, 4800, and 3800 professional graphics boards
>
> Tm
>
> *From:* xen-devel-bounces@lists.xensource.com 
> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo 
> En Ming (Zhang Enming)
> *Sent:* 28 August 2009 16:55
> *To:* weidong.han@intel.com
> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
> *Subject:* Re: [Xen-devel] [PATCH 2/2] graphics passthrough with VT-d
>
> 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 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
> and qemu-gfx-passthrough.patch 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>
>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>
>     No virus found in this incoming message.
>
>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>
>     http://lists.xensource.com/xen-devel
>
>        
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    



[-- Attachment #1.2: Type: text/html, Size: 25746 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 16:28     ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-28 16:31       ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:36       ` Alan Cox
  1 sibling, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 16:31 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 13291 bytes --]

I believe Weidong mentioned he will release 1:1 mapping patches in a 
future date. Let's hope he will release it tomorrow. :-)

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 12:28 AM, Mr. Teo En Ming (Zhang Enming) wrote:
> Dear Tim,
>
> I am using onboard Intel GMA 4500 for my Dom 0 and nVidia Geforce 8400 
> GS for passthrough to Windows XP HVM domU.
>
> I believe the VGA BIOS in the physical memory region 0xC0000 to 
> 0xC7FFF is the vga bios of onboard Intel graphics, and not my Geforce 
> 8400 GS. Hence I would need to extract out the firmware file for my 
> Geforce 8400 GS card.
>
> As for nvidia professional graphics cards, they are too expensive for 
> me for home use.
>
> -- 
> 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@hotmail.com
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
>
> On 08/29/2009 12:10 AM, Tim Moore wrote:
>>
>> Teo,
>>
>> It looks like the patches that Wiedong has supplied already copy the 
>> VGA bios from the card and re-execute it within the DomU, therefore 
>> there should be no need to load it from a file.
>>
>> I think you will have trouble for 2 reasons:
>>
>> 1) Bios re-execution, these Nvidia cards do not like having the BIOS 
>> re-executed (from memcpy or file)
>>
>> 2) the Base Address Registers (BARs) will require 1:1 mappings to the 
>> real addresses, which these patches dont cater for
>>
>> If you want to make it work, you will need a card that works without 
>> the 1:1 mapping and is more friendly to virtualisation.
>>
>> ie:
>>
>> http://www.nvidia.com/object/sli_multi_os.html
>>
>> (as Andrew Lyon describes)
>>
>> Dual Quadro FX 5800, 4800, and 3800 professional graphics boards
>>
>> Tm
>>
>> *From:* xen-devel-bounces@lists.xensource.com 
>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo 
>> En Ming (Zhang Enming)
>> *Sent:* 28 August 2009 16:55
>> *To:* weidong.han@intel.com
>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
>> *Subject:* Re: [Xen-devel] [PATCH 2/2] graphics passthrough with VT-d
>>
>> 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 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>> and qemu-gfx-passthrough.patch 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>
>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>
>>     No virus found in this incoming message.
>>
>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>
>>     http://lists.xensource.com/xen-devel
>>
>>        
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>    
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    



[-- Attachment #1.2: Type: text/html, Size: 27655 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 16:28     ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:31       ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-28 16:36       ` Alan Cox
  2009-08-28 16:39         ` Mr. Teo En Ming (Zhang Enming)
  1 sibling, 1 reply; 66+ messages in thread
From: Alan Cox @ 2009-08-28 16:36 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore

> I believe the VGA BIOS in the physical memory region 0xC0000 to 0xC7FFF 
> is the vga bios of onboard Intel graphics, and not my Geforce 8400 GS. 

If that was your boot video device. To extract the video BIOS for the
Nvidia you either need to map it and read it out or boot with the Nvidia
as the boot video device to acquire it and then switch back. That ought
to work.

Alan

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH(es)] graphics passthrough with VT-d
  2009-08-28 16:36       ` Alan Cox
@ 2009-08-28 16:39         ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 16:39 UTC (permalink / raw)
  To: alan; +Cc: xen-devel, timothy.moore

Dear Alan,

When I extracted the vga bios for my nvidia geforce 8400 gs, i went into 
BIOS to set PEG as the primary video adapter. Then I booted using nvidia 
gfx and extracted the vga bios using nvflash.exe.

I believe it is possible to use a hex editor to examine the vga firmware 
file to see if it's the vga bios for nvidia.

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 12:36 AM, Alan Cox wrote:
>> I believe the VGA BIOS in the physical memory region 0xC0000 to 0xC7FFF
>> is the vga bios of onboard Intel graphics, and not my Geforce 8400 GS.
>>      
> If that was your boot video device. To extract the video BIOS for the
> Nvidia you either need to map it and read it out or boot with the Nvidia
> as the boot video device to acquire it and then switch back. That ought
> to work.
>
> Alan
>    

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 2/2] graphics passthrough with VT-d
  2009-08-28 15:55 ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:08   ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 16:10   ` [PATCH(es)] " Tim Moore
@ 2009-08-28 16:59   ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 20:13     ` Mr. Teo En Ming (Zhang Enming)
  2 siblings, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 16:59 UTC (permalink / raw)
  To: enming.teo
  Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
	'Jean Guyader',
	Keir.Fraser, weidong.han, bengheng


[-- Attachment #1.1: Type: text/plain, Size: 10883 bytes --]

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@hotmail.com
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 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
> and **qemu-gfx-passthrough.patch 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
> 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]# wgethttp://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]# wgethttp://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@hotmail.com
> 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@intel.com>
>> Signed-off-by: Weidong Han<weidong.han@intel.com>
>> 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@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>    
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    



[-- Attachment #1.2: Type: text/html, Size: 13149 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: [PATCH 2/2] graphics passthrough with VT-d
  2009-08-28 16:59   ` [PATCH 2/2] " Mr. Teo En Ming (Zhang Enming)
@ 2009-08-28 20:13     ` Mr. Teo En Ming (Zhang Enming)
  2009-08-28 22:42       ` Tim Moore
  0 siblings, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-28 20:13 UTC (permalink / raw)
  To: enming.teo
  Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
	'Jean Guyader',
	Keir.Fraser, weidong.han, bengheng


[-- Attachment #1.1: Type: text/plain, Size: 13399 bytes --]

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@hotmail.com
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.
>
> Seehttp://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@hotmail.com
> 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 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>> and **qemu-gfx-passthrough.patch 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>> 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]# wgethttp://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]# wgethttp://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@hotmail.com
>> 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@intel.com>
>>> Signed-off-by: Weidong Han<weidong.han@intel.com>
>>> 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@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>>    
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>    
>
>



[-- Attachment #1.2: Type: text/html, Size: 15865 bytes --]

[-- Attachment #2: error.output.txt --]
[-- Type: text/plain, Size: 35781 bytes --]

rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
rm -rf *.ilg *.log *.ind *.toc *.bak core
rm -rf  ps pdf html
rm -rf api
rm -rf man5
rm -rf man1
make[1]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/docs'
[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]# cp ~enming/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]# cp ~enming/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-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]# ls
buildconfigs  Config.mk  dist  extras      Makefile  stubdom  unmodified_drivers  xen-gfx-passthrough.patch
config        COPYING    docs  install.sh  README    tools    xen
[root@fedora11-x86-64-host xen-unstable.hg-vgapt]# cd tools/firmware/hvmloader/
[root@fedora11-x86-64-host hvmloader]# cp Makefile Makefile.new
[root@fedora11-x86-64-host hvmloader]# vi Makefile.new 
[root@fedora11-x86-64-host hvmloader]# cp hvmloader.c hvmloader.c.new
[root@fedora11-x86-64-host hvmloader]# vi hvmloader.c.new 
[root@fedora11-x86-64-host hvmloader]# man diff
[root@fedora11-x86-64-host hvmloader]# diff -u Makefile Makefile.new > intel-gfx-passthru-patch-3.patch
[root@fedora11-x86-64-host hvmloader]# vi intel-gfx-passthru-patch-3.patch 
[root@fedora11-x86-64-host hvmloader]# diff -u hvmloader.c hvmloader.c.new >> intel-gfx-passthru-patch-3.patch 
[root@fedora11-x86-64-host hvmloader]# vi intel-gfx-passthru-patch-3.patch 
[root@fedora11-x86-64-host hvmloader]# vi ~enming/intel-gfx-passthru-patch-3.patch 
[root@fedora11-x86-64-host hvmloader]# rm ~enming/intel-gfx-passthru-patch-3.patch 
rm: remove regular file `/home/enming/intel-gfx-passthru-patch-3.patch'? y
[root@fedora11-x86-64-host hvmloader]# vi intel-gfx-passthru-patch-3.patch 
[root@fedora11-x86-64-host hvmloader]# patch < intel-gfx-passthru-patch-3.patch 
patching file Makefile
patching file hvmloader.c
[root@fedora11-x86-64-host hvmloader]# vi Makefile
[root@fedora11-x86-64-host hvmloader]# vi hvmloader.c
[root@fedora11-x86-64-host hvmloader]# cd ..
You have new mail in /var/spool/mail/root
[root@fedora11-x86-64-host firmware]# cd ..
[root@fedora11-x86-64-host tools]# cd ..

make iasl
make[9]: Entering directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader/acpi'

ACPI ASL compiler (iasl) is needed
Download and install Intel ACPI CA from
http://acpica.org/downloads/

make[9]: *** [iasl] Error 1
make[9]: Leaving directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader/acpi'
make[8]: *** [dsdt.c] Error 2
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

acpica-unix-20090730/executer/exsystem.c
acpica-unix-20090730/executer/exutils.c
acpica-unix-20090730/generate/
acpica-unix-20090730/generate/lint/
acpica-unix-20090730/generate/lint/files.lnt
acpica-unix-20090730/generate/lint/lint.bat
acpica-unix-20090730/generate/lint/lset.bat
acpica-unix-20090730/generate/lint/options.lnt
acpica-unix-20090730/generate/lint/readme.txt
acpica-unix-20090730/generate/lint/std16.lnt
acpica-unix-20090730/generate/lint/std32.lnt
acpica-unix-20090730/generate/lint/std64.lnt
acpica-unix-20090730/hardware/
acpica-unix-20090730/hardware/hwacpi.c
acpica-unix-20090730/hardware/hwgpe.c
acpica-unix-20090730/hardware/hwregs.c
acpica-unix-20090730/hardware/hwsleep.c
acpica-unix-20090730/hardware/hwtimer.c
acpica-unix-20090730/hardware/hwvalid.c
acpica-unix-20090730/hardware/hwxface.c
acpica-unix-20090730/include/
acpica-unix-20090730/include/acapps.h
acpica-unix-20090730/include/accommon.h
acpica-unix-20090730/include/acconfig.h
acpica-unix-20090730/include/acdebug.h
acpica-unix-20090730/include/acdisasm.h
acpica-unix-20090730/include/acdispat.h
acpica-unix-20090730/include/acevents.h
acpica-unix-20090730/include/acexcep.h
acpica-unix-20090730/include/acglobal.h
acpica-unix-20090730/include/achware.h
acpica-unix-20090730/include/acinterp.h
acpica-unix-20090730/include/aclocal.h
acpica-unix-20090730/include/acmacros.h
acpica-unix-20090730/include/acnames.h
acpica-unix-20090730/include/acnamesp.h
acpica-unix-20090730/include/acobject.h
acpica-unix-20090730/include/acopcode.h
acpica-unix-20090730/include/acoutput.h
acpica-unix-20090730/include/acparser.h
acpica-unix-20090730/include/acpi.h
acpica-unix-20090730/include/acpiosxf.h
acpica-unix-20090730/include/acpixf.h
acpica-unix-20090730/include/acpredef.h
acpica-unix-20090730/include/acresrc.h
acpica-unix-20090730/include/acrestyp.h
acpica-unix-20090730/include/acstruct.h
acpica-unix-20090730/include/actables.h
acpica-unix-20090730/include/actbl.h
acpica-unix-20090730/include/actbl1.h
acpica-unix-20090730/include/actbl2.h
acpica-unix-20090730/include/actypes.h
acpica-unix-20090730/include/acutils.h
acpica-unix-20090730/include/amlcode.h
acpica-unix-20090730/include/amlresrc.h
acpica-unix-20090730/include/platform/
acpica-unix-20090730/include/platform/accygwin.h
acpica-unix-20090730/include/platform/acefi.h
acpica-unix-20090730/include/platform/acenv.h
acpica-unix-20090730/include/platform/acfreebsd.h
acpica-unix-20090730/include/platform/acgcc.h
acpica-unix-20090730/include/platform/acintel.h
acpica-unix-20090730/include/platform/aclinux.h
acpica-unix-20090730/include/platform/acmsvc.h
acpica-unix-20090730/include/platform/acnetbsd.h
acpica-unix-20090730/include/platform/acos2.h
acpica-unix-20090730/include/platform/acwin.h
acpica-unix-20090730/include/platform/acwin64.h
acpica-unix-20090730/namespace/
acpica-unix-20090730/namespace/nsaccess.c
acpica-unix-20090730/namespace/nsalloc.c
acpica-unix-20090730/namespace/nsdump.c
acpica-unix-20090730/namespace/nsdumpdv.c
acpica-unix-20090730/namespace/nseval.c
acpica-unix-20090730/namespace/nsinit.c
acpica-unix-20090730/namespace/nsload.c
acpica-unix-20090730/namespace/nsnames.c
acpica-unix-20090730/namespace/nsobject.c
acpica-unix-20090730/namespace/nsparse.c
acpica-unix-20090730/namespace/nspredef.c
acpica-unix-20090730/namespace/nsrepair.c
acpica-unix-20090730/namespace/nssearch.c
acpica-unix-20090730/namespace/nsutils.c
acpica-unix-20090730/namespace/nswalk.c
acpica-unix-20090730/namespace/nsxfeval.c
acpica-unix-20090730/namespace/nsxfname.c
acpica-unix-20090730/namespace/nsxfobj.c
acpica-unix-20090730/osunixxf.c
acpica-unix-20090730/os_specific/
acpica-unix-20090730/os_specific/service_layers/
acpica-unix-20090730/os_specific/service_layers/osunixdir.c
acpica-unix-20090730/os_specific/service_layers/osunixxf.c
acpica-unix-20090730/os_specific/service_layers/oswindir.c
acpica-unix-20090730/os_specific/service_layers/oswintbl.c
acpica-unix-20090730/os_specific/service_layers/oswinxf.c
acpica-unix-20090730/parser/
acpica-unix-20090730/parser/psargs.c
acpica-unix-20090730/parser/psloop.c
acpica-unix-20090730/parser/psopcode.c
acpica-unix-20090730/parser/psparse.c
acpica-unix-20090730/parser/psscope.c
acpica-unix-20090730/parser/pstree.c
acpica-unix-20090730/parser/psutils.c
acpica-unix-20090730/parser/pswalk.c
acpica-unix-20090730/parser/psxface.c
acpica-unix-20090730/README
acpica-unix-20090730/resources/
acpica-unix-20090730/resources/rsaddr.c
acpica-unix-20090730/resources/rscalc.c
acpica-unix-20090730/resources/rscreate.c
acpica-unix-20090730/resources/rsdump.c
acpica-unix-20090730/resources/rsinfo.c
acpica-unix-20090730/resources/rsio.c
acpica-unix-20090730/resources/rsirq.c
acpica-unix-20090730/resources/rslist.c
acpica-unix-20090730/resources/rsmemory.c
acpica-unix-20090730/resources/rsmisc.c
acpica-unix-20090730/resources/rsutils.c
acpica-unix-20090730/resources/rsxface.c
acpica-unix-20090730/tables/
acpica-unix-20090730/tables/tbfadt.c
acpica-unix-20090730/tables/tbfind.c
acpica-unix-20090730/tables/tbinstal.c
acpica-unix-20090730/tables/tbutils.c
acpica-unix-20090730/tables/tbxface.c
acpica-unix-20090730/tables/tbxfroot.c
acpica-unix-20090730/tools/
acpica-unix-20090730/tools/acpiexec/
acpica-unix-20090730/tools/acpiexec/aecommon.h
acpica-unix-20090730/tools/acpiexec/aeexec.c
acpica-unix-20090730/tools/acpiexec/aehandlers.c
acpica-unix-20090730/tools/acpiexec/aemain.c
acpica-unix-20090730/tools/acpiexec/aetables.c
acpica-unix-20090730/tools/acpiexec/Makefile
acpica-unix-20090730/tools/acpiexec/osunixdir.c
acpica-unix-20090730/tools/acpisrc/
acpica-unix-20090730/tools/acpisrc/acpisrc.h
acpica-unix-20090730/tools/acpisrc/ascase.c
acpica-unix-20090730/tools/acpisrc/asconvrt.c
acpica-unix-20090730/tools/acpisrc/asfile.c
acpica-unix-20090730/tools/acpisrc/asmain.c
acpica-unix-20090730/tools/acpisrc/asremove.c
acpica-unix-20090730/tools/acpisrc/astable.c
acpica-unix-20090730/tools/acpisrc/asutils.c
acpica-unix-20090730/tools/acpisrc/Makefile
acpica-unix-20090730/tools/acpisrc/osunixdir.c
acpica-unix-20090730/tools/acpixtract/
acpica-unix-20090730/tools/acpixtract/acpixtract.c
acpica-unix-20090730/tools/acpixtract/Makefile
acpica-unix-20090730/tools/examples/
acpica-unix-20090730/tools/examples/examples.c
acpica-unix-20090730/utilities/
acpica-unix-20090730/utilities/utalloc.c
acpica-unix-20090730/utilities/utcache.c
acpica-unix-20090730/utilities/utclib.c
acpica-unix-20090730/utilities/utcopy.c
acpica-unix-20090730/utilities/utdebug.c
acpica-unix-20090730/utilities/utdelete.c
acpica-unix-20090730/utilities/uteval.c
acpica-unix-20090730/utilities/utglobal.c
acpica-unix-20090730/utilities/utids.c
acpica-unix-20090730/utilities/utinit.c
acpica-unix-20090730/utilities/utlock.c
acpica-unix-20090730/utilities/utmath.c
acpica-unix-20090730/utilities/utmisc.c
acpica-unix-20090730/utilities/utmutex.c
acpica-unix-20090730/utilities/utobject.c
acpica-unix-20090730/utilities/utresrc.c
acpica-unix-20090730/utilities/utstate.c
acpica-unix-20090730/utilities/uttrack.c
acpica-unix-20090730/utilities/utxface.c
[root@fedora11-x86-64-host src]# cd acpica-unix-20090730
[root@fedora11-x86-64-host acpica-unix-20090730]# cd compiler/
[root@fedora11-x86-64-host compiler]# make
bison -v -d -y -pAslCompiler aslcompiler.y
cp y.tab.c aslcompilerparse.c
cp y.tab.h aslcompiler.y.h
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslcompilerparse.o aslcompilerparse.c
flex -i -PAslCompiler -oaslcompilerlex.c aslcompiler.l
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslcompilerlex.o aslcompilerlex.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslanalyze.o aslanalyze.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslcodegen.o aslcodegen.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslcompile.o aslcompile.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslerror.o aslerror.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslfiles.o aslfiles.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o asllength.o asllength.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o asllisting.o asllisting.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslload.o aslload.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o asllookup.o asllookup.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslmain.o aslmain.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslmap.o aslmap.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslopcodes.o aslopcodes.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o asloperands.o asloperands.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslresource.o aslresource.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslrestype1.o aslrestype1.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslrestype2.o aslrestype2.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslstartup.o aslstartup.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o asltree.o asltree.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslutils.o aslutils.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o asltransform.o asltransform.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslfold.o aslfold.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslstubs.o aslstubs.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o aslopt.o aslopt.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/getopt.o ../common/getopt.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utalloc.o ../utilities/utalloc.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utcache.o ../utilities/utcache.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utcopy.o ../utilities/utcopy.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utdebug.o ../utilities/utdebug.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utdelete.o ../utilities/utdelete.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utglobal.o ../utilities/utglobal.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utinit.o ../utilities/utinit.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utlock.o ../utilities/utlock.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utobject.o ../utilities/utobject.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utmisc.o ../utilities/utmisc.c
../utilities/utmisc.c: In function ‘AcpiUtIsAmlTable’:
../utilities/utmisc.c:269: warning: dereferencing type-punned pointer will break strict-aliasing rules
../utilities/utmisc.c:270: warning: dereferencing type-punned pointer will break strict-aliasing rules
../utilities/utmisc.c:271: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utmath.o ../utilities/utmath.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utmutex.o ../utilities/utmutex.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utresrc.o ../utilities/utresrc.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utstate.o ../utilities/utstate.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../utilities/utxface.o ../utilities/utxface.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsaccess.o ../namespace/nsaccess.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsalloc.o ../namespace/nsalloc.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsdump.o ../namespace/nsdump.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsnames.o ../namespace/nsnames.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsobject.o ../namespace/nsobject.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsparse.o ../namespace/nsparse.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nssearch.o ../namespace/nssearch.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsutils.o ../namespace/nsutils.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nswalk.o ../namespace/nswalk.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../namespace/nsxfobj.o ../namespace/nsxfobj.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/psargs.o ../parser/psargs.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/psloop.o ../parser/psloop.c
../parser/psloop.c: In function ‘AcpiPsGetArguments’:
../parser/psloop.c:624: warning: format ‘%.4X’ expects type ‘unsigned int’, but argument 5 has type ‘long unsigned int’
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/psopcode.o ../parser/psopcode.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/psparse.o ../parser/psparse.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/psscope.o ../parser/psscope.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/pstree.o ../parser/pstree.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/psutils.o ../parser/psutils.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../parser/pswalk.o ../parser/pswalk.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dswscope.o ../dispatcher/dswscope.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dswstate.o ../dispatcher/dswstate.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dsfield.o ../dispatcher/dsfield.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dsobject.o ../dispatcher/dsobject.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dsopcode.o ../dispatcher/dsopcode.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dsutils.o ../dispatcher/dsutils.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dswexec.o ../dispatcher/dswexec.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../dispatcher/dswload.o ../dispatcher/dswload.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exconvrt.o ../executer/exconvrt.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/excreate.o ../executer/excreate.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exdump.o ../executer/exdump.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exmisc.o ../executer/exmisc.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exmutex.o ../executer/exmutex.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exnames.o ../executer/exnames.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exoparg1.o ../executer/exoparg1.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exoparg2.o ../executer/exoparg2.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exoparg3.o ../executer/exoparg3.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exoparg6.o ../executer/exoparg6.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exprep.o ../executer/exprep.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exregion.o ../executer/exregion.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exresnte.o ../executer/exresnte.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exresolv.o ../executer/exresolv.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exresop.o ../executer/exresop.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exstore.o ../executer/exstore.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exstoren.o ../executer/exstoren.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exstorob.o ../executer/exstorob.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exsystem.o ../executer/exsystem.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../executer/exutils.o ../executer/exutils.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/adfile.o ../common/adfile.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/adisasm.o ../common/adisasm.c
../common/adisasm.c: In function ‘AdCreateTableHeader’:
../common/adisasm.c:753: warning: dereferencing type-punned pointer will break strict-aliasing rules
../common/adisasm.c: In function ‘AdGetLocalTables’:
../common/adisasm.c:1082: warning: dereferencing type-punned pointer will break strict-aliasing rules
../common/adisasm.c:1095: warning: dereferencing type-punned pointer will break strict-aliasing rules
../common/adisasm.c:1116: warning: dereferencing type-punned pointer will break strict-aliasing rules
../common/adisasm.c:1130: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/adwalk.o ../common/adwalk.c
../common/adwalk.c: In function ‘AcpiDmLoadDescendingOp’:
../common/adwalk.c:691: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/dmrestag.o ../common/dmrestag.c
../common/dmrestag.c: In function ‘AcpiDmUpdateResourceName’:
../common/dmrestag.c:732: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/dmtable.o ../common/dmtable.c
../common/dmtable.c: In function ‘AcpiDmDumpDataTable’:
../common/dmtable.c:383: warning: dereferencing type-punned pointer will break strict-aliasing rules
../common/dmtable.c:388: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/dmtbinfo.o ../common/dmtbinfo.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../common/dmtbdump.o ../common/dmtbdump.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../debugger/dbfileio.o ../debugger/dbfileio.c
../debugger/dbfileio.c: In function ‘AcpiDbReadTable’:
../debugger/dbfileio.c:351: warning: dereferencing type-punned pointer will break strict-aliasing rules
../debugger/dbfileio.c:352: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmbuffer.o ../disassembler/dmbuffer.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmnames.o ../disassembler/dmnames.c
../disassembler/dmnames.c: In function ‘AcpiDmDumpName’:
../disassembler/dmnames.c:162: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmopcode.o ../disassembler/dmopcode.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmobject.o ../disassembler/dmobject.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmresrc.o ../disassembler/dmresrc.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmresrcl.o ../disassembler/dmresrcl.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmresrcs.o ../disassembler/dmresrcs.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmutils.o ../disassembler/dmutils.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../disassembler/dmwalk.o ../disassembler/dmwalk.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../tables/tbfadt.o ../tables/tbfadt.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../tables/tbinstal.o ../tables/tbinstal.c
../tables/tbinstal.c: In function ‘AcpiTbStoreTable’:
../tables/tbinstal.c:448: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../tables/tbutils.o ../tables/tbutils.c
../tables/tbutils.c: In function ‘AcpiTbPrintTableHeader’:
../tables/tbutils.c:282: warning: dereferencing type-punned pointer will break strict-aliasing rules
../tables/tbutils.c:290: warning: dereferencing type-punned pointer will break strict-aliasing rules
../tables/tbutils.c: In function ‘AcpiTbInstallTable’:
../tables/tbutils.c:445: warning: dereferencing type-punned pointer will break strict-aliasing rules
../tables/tbutils.c:447: warning: dereferencing type-punned pointer will break strict-aliasing rules
../tables/tbutils.c:485: warning: dereferencing type-punned pointer will break strict-aliasing rules
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../tables/tbxface.o ../tables/tbxface.c
cc -Wall -O2 -Wstrict-prototypes -D_LINUX -DACPI_ASL_COMPILER -I../include    -c -o ../osunixxf.o ../osunixxf.c
cc  aslcompilerparse.o aslcompilerlex.o aslanalyze.o aslcodegen.o aslcompile.o aslerror.o aslfiles.o asllength.o asllisting.o aslload.o asllookup.o aslmain.o aslmap.o aslopcodes.o asloperands.o aslresource.o aslrestype1.o aslrestype2.o aslstartup.o asltree.o aslutils.o asltransform.o aslfold.o aslstubs.o aslopt.o ../common/getopt.o ../utilities/utalloc.o ../utilities/utcache.o ../utilities/utcopy.o ../utilities/utdebug.o ../utilities/utdelete.o ../utilities/utglobal.o ../utilities/utinit.o ../utilities/utlock.o ../utilities/utobject.o ../utilities/utmisc.o ../utilities/utmath.o ../utilities/utmutex.o ../utilities/utresrc.o ../utilities/utstate.o ../utilities/utxface.o ../namespace/nsaccess.o ../namespace/nsalloc.o ../namespace/nsdump.o ../namespace/nsnames.o ../namespace/nsobject.o ../namespace/nsparse.o ../namespace/nssearch.o ../namespace/nsutils.o ../namespace/nswalk.o ../namespace/nsxfobj.o ../parser/psargs.o ../parser/psloop.o ../parser/psopcode.o ../parser/psparse.o ../parser/psscope.o ../parser/pstree.o ../parser/psutils.o ../parser/pswalk.o ../dispatcher/dswscope.o ../dispatcher/dswstate.o ../dispatcher/dsfield.o ../dispatcher/dsobject.o ../dispatcher/dsopcode.o ../dispatcher/dsutils.o ../dispatcher/dswexec.o ../dispatcher/dswload.o ../executer/exconvrt.o ../executer/excreate.o ../executer/exdump.o ../executer/exmisc.o ../executer/exmutex.o ../executer/exnames.o ../executer/exoparg1.o ../executer/exoparg2.o ../executer/exoparg3.o ../executer/exoparg6.o ../executer/exprep.o ../executer/exregion.o ../executer/exresnte.o ../executer/exresolv.o ../executer/exresop.o ../executer/exstore.o ../executer/exstoren.o ../executer/exstorob.o ../executer/exsystem.o ../executer/exutils.o ../common/adfile.o ../common/adisasm.o ../common/adwalk.o ../common/dmrestag.o ../common/dmtable.o ../common/dmtbinfo.o ../common/dmtbdump.o ../debugger/dbfileio.o ../disassembler/dmbuffer.o ../disassembler/dmnames.o ../disassembler/dmopcode.o ../disassembler/dmobject.o ../disassembler/dmresrc.o ../disassembler/dmresrcl.o ../disassembler/dmresrcs.o ../disassembler/dmutils.o ../disassembler/dmwalk.o ../tables/tbfadt.o ../tables/tbinstal.o ../tables/tbutils.o ../tables/tbxface.o ../osunixxf.o \
		 -lpthread -lrt -o iasl
You have new mail in /var/spool/mail/root
[root@fedora11-x86-64-host compiler]# make install
make: *** No rule to make target `install'.  Stop.
[root@fedora11-x86-64-host compiler]# make help
make: *** No rule to make target `help'.  Stop.
[root@fedora11-x86-64-host compiler]# vi Makefile 
[root@fedora11-x86-64-host compiler]# cd ..
[root@fedora11-x86-64-host acpica-unix-20090730]# ls
changes.txt  debugger      events    hardware   os_specific  parser     tables
common       disassembler  executer  include    osunixxf.c   README     tools
compiler     dispatcher    generate  namespace  osunixxf.o   resources  utilities
[root@fedora11-x86-64-host acpica-unix-20090730]# vi README 
[root@fedora11-x86-64-host acpica-unix-20090730]# cd compiler/
[root@fedora11-x86-64-host compiler]# ls
aslanalyze.c      aslcompilerlex.o    aslfiles.o    aslload.o     asloperands.c  aslrestype2.o   asltypes.h
aslanalyze.o      aslcompilerparse.c  aslfold.c     asllookup.c   asloperands.o  aslstartup.c    aslutils.c
aslcodegen.c      aslcompilerparse.o  aslfold.o     asllookup.o   aslopt.c       aslstartup.o    aslutils.o
aslcodegen.o      aslcompiler.y       aslglobal.h   aslmain.c     aslopt.o       aslstubs.c      iasl
aslcompile.c      aslcompiler.y.h     asllength.c   aslmain.o     aslresource.c  aslstubs.o      Makefile
aslcompile.o      asldefine.h         asllength.o   aslmap.c      aslresource.o  asltransform.c  readme.txt
aslcompiler.h     aslerror.c          asllisting.c  aslmap.o      aslrestype1.c  asltransform.o  y.output
aslcompiler.l     aslerror.o          asllisting.o  aslopcodes.c  aslrestype1.o  asltree.c       y.tab.c
aslcompilerlex.c  aslfiles.c          aslload.c     aslopcodes.o  aslrestype2.c  asltree.o       y.tab.h
[root@fedora11-x86-64-host compiler]# file iasl 
iasl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
[root@fedora11-x86-64-host compiler]# echo $PATH
/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@fedora11-x86-64-host compiler]# cp iasl /usr/local/bin/

make -C acpi all
make[8]: Entering directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader/acpi'
make iasl
make[9]: Entering directory `/usr/src/xen-unstable.hg-vgapt/tools/firmware/hvmloader/acpi'
make[9]: `/usr/local/bin/iasl' is up to date.
make[9]: Leaving directory `/usr/src/xen-unstable.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
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
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


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: graphics passthrough with VT-d
  2009-08-28 20:13     ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-28 22:42       ` Tim Moore
  2009-08-29  2:17         ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 1 reply; 66+ messages in thread
From: Tim Moore @ 2009-08-28 22:42 UTC (permalink / raw)
  To: 'enming.teo@asiasoftsea.net'; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 15969 bytes --]

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@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@asiasoftsea.net
Cc: xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com; weidong.han@intel.com; bengheng@eecs.umich.edu
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel








________________________________






_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel









[-- Attachment #1.2: Type: text/html, Size: 30521 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-28 22:42       ` Tim Moore
@ 2009-08-29  2:17         ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29  3:48           ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29  2:17 UTC (permalink / raw)
  To: timothy.moore; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 16699 bytes --]

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@hotmail.com
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@lists.xensource.com 
> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo 
> En Ming (Zhang Enming)
> *Sent:* 28 August 2009 21:14
> *To:* enming.teo@asiasoftsea.net
> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; weidong.han@intel.com; 
> bengheng@eecs.umich.edu
> *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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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.
>   
> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
> and qemu-gfx-passthrough.patch 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>
>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>
>     No virus found in this incoming message.
>
>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>
>     http://lists.xensource.com/xen-devel
>
>        
>
>
>
> ------------------------------------------------------------------------
>
>
>    
>   
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
> http://lists.xensource.com/xen-devel
>    
>
>
>
>
>   


[-- Attachment #1.2: Type: text/html, Size: 33578 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29  2:17         ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29  3:48           ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29  6:58             ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 10:41             ` Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4 Boris Derzhavets
  0 siblings, 2 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29  3:48 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 19754 bytes --]


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@hotmail.com
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@hotmail.com
> 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@lists.xensource.com 
>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo 
>> En Ming (Zhang Enming)
>> *Sent:* 28 August 2009 21:14
>> *To:* enming.teo@asiasoftsea.net
>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; weidong.han@intel.com; 
>> bengheng@eecs.umich.edu
>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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.
>>   
>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>> and qemu-gfx-passthrough.patch 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>
>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>
>>     No virus found in this incoming message.
>>
>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>
>>     http://lists.xensource.com/xen-devel
>>
>>        
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>    
>>   
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>> http://lists.xensource.com/xen-devel
>>    
>>
>>
>>
>>
>>   
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    



[-- Attachment #1.2: Type: text/html, Size: 37585 bytes --]

[-- Attachment #2: intel-gfx-passthru-patch01.patch --]
[-- Type: text/plain, Size: 12565 bytes --]

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
@@ -15,7 +15,7 @@
 #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
 
 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
-#define PCI_MEM_START       0xf0000000
+#define PCI_MEM_START       0xe0000000
 #define PCI_MEM_END         0xfc000000
 extern unsigned long pci_mem_start, pci_mem_end;
 
diff -r 5d7e7a250267 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/firmware/hvmloader/hvmloader.c	Fri Aug 28 14:41:22 2009 +0800
@@ -113,7 +113,7 @@ unsigned long pci_mem_start = PCI_MEM_ST
 unsigned long pci_mem_start = PCI_MEM_START;
 unsigned long pci_mem_end = PCI_MEM_END;
 
-static enum { VGA_none, VGA_std, VGA_cirrus } virtual_vga = VGA_none;
+static enum { VGA_none, VGA_std, VGA_cirrus, VGA_pt } virtual_vga = VGA_none;
 
 static void init_hypercalls(void)
 {
@@ -212,8 +212,10 @@ static void pci_setup(void)
         case 0x0300:
             if ( (vendor_id == 0x1234) && (device_id == 0x1111) )
                 virtual_vga = VGA_std;
-            if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
+            else if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
                 virtual_vga = VGA_cirrus;
+            else
+                virtual_vga = VGA_pt;
             break;
         case 0x0680:
             /* PIIX4 ACPI PM. Special device with special PCI config space. */
@@ -684,6 +686,11 @@ int main(void)
         memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
                vgabios_stdvga, sizeof(vgabios_stdvga));
         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);
         break;
     default:
         printf("No emulated VGA adaptor ...\n");
diff -r 5d7e7a250267 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Aug 27 16:54:24 2009 +0800
@@ -1109,7 +1109,9 @@ int xc_hvm_build_target_mem(int xc_handl
                             uint32_t domid,
                             int memsize,
                             int target,
-                            const char *image_name)
+                            const char *image_name,
+                            int gfx_passthru)
+
 {
     /* XXX:PoD isn't supported yet */
     return xc_hvm_build(xc_handle, domid, target, image_name);
diff -r 5d7e7a250267 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xc_hvm_build.c	Thu Aug 27 16:54:24 2009 +0800
@@ -64,6 +64,67 @@ static void build_hvm_info(void *hvm_inf
     for ( i = 0, sum = 0; i < hvm_info->length; i++ )
         sum += ((uint8_t *)hvm_info)[i];
     hvm_info->checksum = -sum;
+}
+
+static int init_vgabios(int xc_handle, uint32_t dom,
+                        unsigned char *buffer, uint32_t bios_size)
+{
+    char *va_bios = NULL;
+    uint32_t va_size = 0;
+
+    va_size = bios_size + bios_size % XC_PAGE_SIZE;
+    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
+                                   PROT_READ | PROT_WRITE, 0xC0);
+    if ( !va_bios )
+    {
+        IPRINTF("Unable to map vga bios!\n");
+        return -1;
+    }
+
+    if ( buffer != NULL )
+        memcpy(va_bios, buffer, bios_size);
+    else
+        memset(va_bios, 0, bios_size);
+
+    munmap(va_bios, va_size);
+    return 0;
+}
+
+static int setup_vga_pt(int xc_handle, uint32_t dom)
+{
+    int                 rc = 0;
+    unsigned char       *bios = NULL;
+    int                 bios_size = 0;
+    char                *c = NULL;
+    char                checksum = 0;
+
+    /* Allocated 64K for the vga bios */
+    if (!(bios = malloc(64 * 1024)))
+        return -1;
+
+#ifdef __linux__
+    bios_size = xc_get_vgabios(bios, 64 * 1024);
+#else
+    bios_size = 0;
+#endif /* __linux__ */
+
+    if (bios_size == 0)
+    {
+        IPRINTF("vga bios size is 0!\n");
+        rc = -1;
+        goto error;
+    }
+
+    /* Adjust the bios checksum */
+    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+        checksum += *c;
+    if (checksum)
+        bios[bios_size - 1] -= checksum;
+
+    init_vgabios(xc_handle, dom, bios, bios_size);
+error:
+    free(bios);
+    return rc;
 }
 
 static int loadelfimage(
@@ -381,7 +442,8 @@ int xc_hvm_build_target_mem(int xc_handl
                            uint32_t domid,
                            int memsize,
                            int target,
-                           const char *image_name)
+                           const char *image_name,
+                           int gfx_passthru)
 {
     char *image;
     int  sts;
@@ -392,6 +454,11 @@ int xc_hvm_build_target_mem(int xc_handl
         return -1;
 
     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
+
+    if ( gfx_passthru )
+        sts |= setup_vga_pt(xc_handle, domid);
+    else
+        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
 
     free(image);
 
diff -r 5d7e7a250267 tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xc_linux.c	Thu Aug 27 16:54:24 2009 +0800
@@ -638,6 +638,56 @@ err:
     return gnt;
 }
 
+int xc_get_vgabios(unsigned char        *buf,
+                   int                  len)
+{
+    int         mem;
+    uint32_t    start, size = 0;
+    uint16_t    magic = 0;
+
+    start = 0xC0000;
+    if (len < size)
+        return 0;
+    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
+        return 0;
+
+    /*
+    ** Check if it a real bios extension.
+    ** The magic number is 0xAA55.
+    */
+    if (start != lseek(mem, start, SEEK_SET))
+        goto out;
+    if (read(mem, &magic, 2) != 2)
+        goto out;
+    if (magic != 0xAA55)
+        goto out;
+    /* Find the size of the rom extension */
+    if (start != lseek(mem, start, SEEK_SET))
+        goto out;
+    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
+        goto out;
+    if (read(mem, &size, 1) != 1)
+        goto out;
+    /* This size is in 512K */
+    size *= 512;
+
+    /*
+    ** Set the file to the begining of the rombios,
+    ** to start the copy.
+    */
+    if (start != lseek(mem, start, SEEK_SET))
+    {
+        size = 0;
+        goto out;
+    }
+    if (size != read(mem, buf, size))
+        size = 0;
+
+out:
+    close(mem);
+    return size;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 5d7e7a250267 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xenctrl.h	Thu Aug 27 16:54:24 2009 +0800
@@ -1285,4 +1285,6 @@ int xc_tmem_restore(int xc_handle, int d
 int xc_tmem_restore(int xc_handle, int dom, int fd);
 int xc_tmem_restore_extra(int xc_handle, int dom, int fd);
 
+int xc_get_vgabios(unsigned char *bios, int len);
+
 #endif /* XENCTRL_H */
diff -r 5d7e7a250267 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xenguest.h	Thu Aug 27 16:54:24 2009 +0800
@@ -135,7 +135,8 @@ int xc_hvm_build_target_mem(int xc_handl
                             uint32_t domid,
                             int memsize,
                             int target,
-                            const char *image_name);
+                            const char *image_name,
+                            int gfx_passthru);
 
 int xc_hvm_build_mem(int xc_handle,
                      uint32_t domid,
diff -r 5d7e7a250267 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/lowlevel/xc/xc.c	Thu Aug 27 16:54:24 2009 +0800
@@ -894,21 +894,21 @@ static PyObject *pyxc_hvm_build(XcObject
     int i;
 #endif
     char *image;
-    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
+    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, gfx_passthru = 0;
 
     static char *kwd_list[] = { "domid",
                                 "memsize", "image", "target", "vcpus", "acpi",
-                                "apic", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
+                                "apic", "gfx_passthru", NULL };
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
                                       &dom, &memsize, &image, &target, &vcpus,
-                                      &acpi, &apic) )
+                                      &acpi, &apic, &gfx_passthru) )
         return NULL;
 
     if ( target == -1 )
         target = memsize;
 
     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
-                                 target, image) != 0 )
+                                 target, image, gfx_passthru) != 0 )
         return pyxc_error_to_exception();
 
 #if !defined(__ia64__)
diff -r 5d7e7a250267 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xend/XendConfig.py	Thu Aug 27 16:54:24 2009 +0800
@@ -175,6 +175,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
     'pci_msitranslate': int,
     'pci_power_mgmt': int,
     'xen_platform_pci': int,
+    "gfx_passthru": int,
 }
 
 # Xen API console 'other_config' keys.
diff -r 5d7e7a250267 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xend/image.py	Thu Aug 27 16:54:24 2009 +0800
@@ -786,7 +786,7 @@ class HVMImageHandler(ImageHandler):
         self.apic = int(vmConfig['platform'].get('apic', 0))
         self.acpi = int(vmConfig['platform'].get('acpi', 0))
         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
-
+        self.gfx_passthru = int(vmConfig['platform'].get('gfx_passthru', 0))
 
     # Return a list of cmd line args to the device models based on the
     # xm config file
@@ -807,7 +807,7 @@ class HVMImageHandler(ImageHandler):
 
         dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
                    'localtime', 'serial', 'stdvga', 'isa',
-                   'acpi', 'usb', 'usbdevice' ]
+                   'acpi', 'usb', 'usbdevice', 'gfx_passthru' ]
 
         for a in dmargs:
             v = vmConfig['platform'].get(a)
@@ -901,6 +901,7 @@ class HVMImageHandler(ImageHandler):
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
         log.debug("acpi           = %d", self.acpi)
         log.debug("apic           = %d", self.apic)
+        log.debug("gfx_passthru   = %d", self.gfx_passthru)
 
         rc = xc.hvm_build(domid          = self.vm.getDomid(),
                           image          = self.loader,
@@ -908,7 +909,8 @@ class HVMImageHandler(ImageHandler):
                           target         = mem_mb,
                           vcpus          = self.vm.getVCpuCount(),
                           acpi           = self.acpi,
-                          apic           = self.apic)
+                          apic           = self.apic,
+                          gfx_passthru   = self.gfx_passthru)
         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
 
         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
diff -r 5d7e7a250267 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xm/create.py	Thu Aug 27 16:54:24 2009 +0800
@@ -546,6 +546,10 @@ gopts.var('sdl', val='',
 gopts.var('sdl', val='',
           fn=set_value, default=None,
           use="""Should the device model use SDL?""")
+
+gopts.var('gfx_passthru', val='',
+          fn=set_value, default=None,
+          use="""Passthrough graphics card?""")
 
 gopts.var('opengl', val='',
           fn=set_value, default=None,
@@ -957,7 +961,8 @@ def configure_hvm(config_image, vals):
              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
-             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
+             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
+             'gfx_passthru' ]
 
     for a in args:
         if a in vals.__dict__ and vals.__dict__[a] is not None:

[-- Attachment #3: intel-gfx-passthru-patch02.patch --]
[-- Type: text/plain, Size: 9842 bytes --]

>From fb818f1060e57dac6793187a70a79801a7c17e50 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Thu, 27 Aug 2009 16:51:01 +0800
Subject: [PATCH] qemu gfx passthrough support

support basic gfx passthrough:
  - 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@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 hw/pass-through.c |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pass-through.h |    6 +++++
 hw/pc.c           |   51 ++++++++++++++++++++++++------------------
 vl.c              |   32 +++++++++++++++++++++++---
 4 files changed, 126 insertions(+), 26 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..4a9e03a 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -93,6 +93,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
+extern int gfx_passthru;
+
 struct php_dev {
     struct pt_dev *pt_dev;
     uint8_t valid;
@@ -1781,12 +1783,57 @@ static int pt_dev_is_virtfn(struct pci_dev *dev)
     return rc;
 }
 
+/*
+ * register VGA resources for the domain with assigned gfx
+ */
+static int register_vga_regions(struct pt_dev *real_device)
+{
+    int ret = 0;
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+            0x3B0, 0xC, DPCI_ADD_MAPPING);
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+            0x3C0, 0x20, DPCI_ADD_MAPPING);
+
+    ret |= xc_domain_memory_mapping(xc_handle, domid,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0x20,
+            DPCI_ADD_MAPPING);
+
+    return ret;
+}
+
+/*
+ * unregister VGA resources for the domain with assigned gfx
+ */
+static int unregister_vga_regions(struct pt_dev *real_device)
+{
+    int ret = 0;
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+            0x3B0, 0xC, DPCI_REMOVE_MAPPING);
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+            0x3C0, 0x20, DPCI_REMOVE_MAPPING);
+
+    ret |= xc_domain_memory_mapping(xc_handle, domid,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0x20,
+            DPCI_REMOVE_MAPPING);
+
+    return ret;
+}
+
 static int pt_register_regions(struct pt_dev *assigned_device)
 {
     int i = 0;
     uint32_t bar_data = 0;
     struct pci_dev *pci_dev = assigned_device->pci_dev;
     PCIDevice *d = &assigned_device->dev;
+    int ret;
 
     /* Register PIO/MMIO BARs */
     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
@@ -1842,6 +1889,16 @@ static int pt_register_regions(struct pt_dev *assigned_device)
             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
     }
 
+    if ( gfx_passthru && (pci_dev->device_class == 0x0300) )
+    {
+        ret = register_vga_regions(assigned_device);
+        if ( ret != 0 )
+        {
+            PT_LOG("VGA region mapping failed\n");
+            return ret;
+        }
+    }
+
     return 0;
 }
 
@@ -1891,6 +1948,12 @@ static void pt_unregister_regions(struct pt_dev *assigned_device)
 
     }
 
+    if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+    {
+        ret = unregister_vga_regions(assigned_device);
+        if ( ret != 0 )
+            PT_LOG("VGA region unmapping failed\n");
+    }
 }
 
 static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
diff --git a/hw/pass-through.h b/hw/pass-through.h
index 028a03e..956e228 100644
--- a/hw/pass-through.h
+++ b/hw/pass-through.h
@@ -142,6 +142,12 @@ enum {
     GRP_TYPE_EMU,                               /* emul reg group */
 };
 
+enum {
+    GFX_NO_PASSTHRU = 0,                        /* No gfx pass-through */
+    GFX_IGD_PASSTHRU,                           /* IGD pass-through */
+    GFX_DISCRETE_PASSTHRU,                      /* Discrete gfx pass-through */
+};
+
 #define PT_GET_EMUL_SIZE(flag, r_size) do { \
     if (flag == PT_BAR_FLAG_MEM) {\
         r_size = (((r_size) + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1)); \
diff --git a/hw/pc.c b/hw/pc.c
index 129e9d9..53b59c0 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -41,6 +41,7 @@
 #include "virtio-balloon.h"
 #include "virtio-console.h"
 #include "hpet_emul.h"
+#include "pass-through.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -65,6 +66,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
 extern uint8_t *acpi_tables;
 extern size_t acpi_tables_len;
 
+extern int gfx_passthru;
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
@@ -983,30 +986,34 @@ vga_bios_error:
 
     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
 
-    if (cirrus_vga_enabled) {
-        if (pci_enabled) {
-            pci_cirrus_vga_init(pci_bus,
-                                phys_ram_base + vga_ram_addr,
-                                vga_ram_addr, vga_ram_size);
-        } else {
-            isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
-                                vga_ram_addr, vga_ram_size);
-        }
+    if (gfx_passthru == GFX_NO_PASSTHRU) {
+       if (cirrus_vga_enabled) {
+            fprintf(logfile,"cirrus_vga_enabled\n");
+            if (pci_enabled) {
+                pci_cirrus_vga_init(pci_bus,
+                                    phys_ram_base + vga_ram_addr,
+                                    vga_ram_addr, vga_ram_size);
+            } else {
+                isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
+                                    vga_ram_addr, vga_ram_size);
+            }
 #ifndef CONFIG_DM
-    } else if (vmsvga_enabled) {
-        if (pci_enabled)
-            pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
-                            vga_ram_addr, vga_ram_size);
-        else
-            fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+        } else if (vmsvga_enabled) {
+            if (pci_enabled)
+                pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
+                                vga_ram_addr, vga_ram_size);
+            else
+                fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
 #endif
-    } else if (std_vga_enabled) {
-        if (pci_enabled) {
-            pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
-                         vga_ram_addr, vga_ram_size, 0, 0);
-        } else {
-            isa_vga_init(phys_ram_base + vga_ram_addr,
-                         vga_ram_addr, vga_ram_size);
+        } else if (std_vga_enabled) {
+            fprintf(logfile,"std_vga_enabled\n");
+            if (pci_enabled) {
+                pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
+                             vga_ram_addr, vga_ram_size, 0, 0);
+            } else {
+                isa_vga_init(phys_ram_base + vga_ram_addr,
+                             vga_ram_addr, vga_ram_size);
+            }
         }
     }
 
diff --git a/vl.c b/vl.c
index 62bed05..72f3479 100644
--- a/vl.c
+++ b/vl.c
@@ -48,6 +48,7 @@
 #include <stdlib.h>
 
 #include "qemu-xen.h"
+#include "hw/pass-through.h"
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -213,6 +214,7 @@ static int rtc_date_offset = -1; /* -1 means no change */
 int cirrus_vga_enabled = 1;
 int std_vga_enabled = 0;
 int vmsvga_enabled = 0;
+int gfx_passthru = 0;
 #ifdef TARGET_SPARC
 int graphic_width = 1024;
 int graphic_height = 768;
@@ -4269,6 +4271,7 @@ enum {
     /* Xen tree: */
     QEMU_OPTION_disable_opengl,
     QEMU_OPTION_direct_pci,
+    QEMU_OPTION_gfx_passthru,
     QEMU_OPTION_pci_emulation,
     QEMU_OPTION_vncunused,
     QEMU_OPTION_videoram,
@@ -4447,6 +4450,7 @@ static const QEMUOption qemu_options[] = {
 #endif
     { "acpi", 0, QEMU_OPTION_acpi }, /* deprecated, for xend compatibility */
     { "direct_pci", HAS_ARG, QEMU_OPTION_direct_pci },
+    { "gfx_passthru", HAS_ARG, QEMU_OPTION_gfx_passthru},
     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
     { "vncunused", 0, QEMU_OPTION_vncunused },
     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
@@ -5484,6 +5488,22 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_runas:
                 run_as = optarg;
                 break;
+            case QEMU_OPTION_gfx_passthru:
+                gfx_passthru = atoi(optarg);
+                switch (gfx_passthru) {
+                case GFX_NO_PASSTHRU:
+                    break;
+                case GFX_IGD_PASSTHRU:
+                    fprintf(logfile, "IGD graphics card assignment\n");
+                    break;
+                case GFX_DISCRETE_PASSTHRU:
+                    fprintf(logfile, "Discrete graphics card assignment\n");
+                    break;
+                default:
+                    fprintf(stderr, "unsupported gfx_passthru option: %d\n",
+                            gfx_passthru);
+                }
+                break;
             }
         }
     }
@@ -5897,13 +5917,17 @@ int main(int argc, char **argv, char **envp)
                         exit(1);
 		    xenstore_write_vncport(vnc_display_port);
                 }
+
+                if (gfx_passthru == GFX_NO_PASSTHRU)
+                {
 #if defined(CONFIG_SDL)
-                if (sdl || !vnc_display)
-                    sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
+                    if (sdl || !vnc_display)
+                        sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
 #elif defined(CONFIG_COCOA)
-                if (sdl || !vnc_display)
-                    cocoa_display_init(ds, full_screen);
+                    if (sdl || !vnc_display)
+                        cocoa_display_init(ds, full_screen);
 #endif
+                }
             }
     }
     dpy_resize(ds);
-- 
1.6.0.4


[-- Attachment #4: intel-gfx-passthru-patch03.patch --]
[-- Type: text/plain, Size: 1431 bytes --]

Manually generated by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 11:10 A.M. Singapore Time
Email #1: enming.teo@asiasoftsea.net
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com

--- Makefile	2009-08-29 10:57:28.072084001 +0800
+++ Makefile	2009-08-29 11:03:30.650209241 +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 10:58:52.679084845 +0800
+++ hvmloader.c	2009-08-29 11:07:40.763119203 +0800
@@ -688,10 +688,10 @@
         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);
-        break;
+        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");
         break;

[-- Attachment #5: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29  3:48           ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29  6:58             ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 11:03               ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 10:41             ` Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4 Boris Derzhavets
  1 sibling, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29  6:58 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 20792 bytes --]

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@hotmail.com
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@hotmail.com
> 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@hotmail.com
>> 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@lists.xensource.com 
>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. 
>>> Teo En Ming (Zhang Enming)
>>> *Sent:* 28 August 2009 21:14
>>> *To:* enming.teo@asiasoftsea.net
>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
>>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; weidong.han@intel.com; 
>>> bengheng@eecs.umich.edu
>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>> 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.
>>>   
>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>> 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 
>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>> and qemu-gfx-passthrough.patch 
>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>
>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>
>>>     No virus found in this incoming message.
>>>
>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>
>>>     http://lists.xensource.com/xen-devel
>>>
>>>        
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>>
>>>    
>>>   
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>> http://lists.xensource.com/xen-devel
>>>    
>>>
>>>
>>>
>>>
>>>   
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>    
>
>


[-- Attachment #1.2: Type: text/html, Size: 39248 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4
  2009-08-29  3:48           ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29  6:58             ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 10:41             ` Boris Derzhavets
  2009-08-29 11:05               ` Boris Derzhavets
  2009-08-29 15:17               ` Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
  1 sibling, 2 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-29 10:41 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1358 bytes --]

make xen OK
make stubtom OK
make tools :-
. . . . . .
gcc  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .xc_core.o.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -I../../xen/common/libelf -Werror -Wmissing-prototypes  -I. -I../xenstore -I../include -c -o xc_core.o xc_core.c
cc1: warnings being treated as errors
In file included from /usr/include/string.h:640,
                 from xg_private.h:9,
                 from xc_core.c:52:
In function ‘memset’,
    inlined from ‘xc_domain_dumpcore_via_callback’ at xc_core.c:324:
/usr/include/bits/string3.h:82: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters
make[4]: *** [xc_core.o] Error 1
make[4]: Leaving directory `/usr/src/xen-3.4.1/tools/libxc'
make[3]: *** [build] Error 2
make[3]: Leaving directory `/usr/src/xen-3.4.1/tools/libxc'
make[2]: *** [subdir-install-libxc] Error 2
make[2]: Leaving directory `/usr/src/xen-3.4.1/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/usr/src/xen-3.4.1/tools'
make: *** [install-tools] Error 2

Boris.





      

[-- Attachment #1.2: Type: text/html, Size: 1685 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29  6:58             ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 11:03               ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 12:25                 ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 11:03 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 25653 bytes --]

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@hotmail.com
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@hotmail.com
> 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@hotmail.com
>> 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@hotmail.com
>>> 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@lists.xensource.com 
>>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. 
>>>> Teo En Ming (Zhang Enming)
>>>> *Sent:* 28 August 2009 21:14
>>>> *To:* enming.teo@asiasoftsea.net
>>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
>>>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; weidong.han@intel.com; 
>>>> bengheng@eecs.umich.edu
>>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>> 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.
>>>>   
>>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>> 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 
>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>>> and qemu-gfx-passthrough.patch 
>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>>
>>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>>
>>>>     No virus found in this incoming message.
>>>>
>>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>
>>>>     http://lists.xensource.com/xen-devel
>>>>
>>>>        
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>>
>>>>    
>>>>   
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>> http://lists.xensource.com/xen-devel
>>>>    
>>>>
>>>>
>>>>
>>>>
>>>>   
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>>    
>>
>>
>



[-- Attachment #1.2: Type: text/html, Size: 44855 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4
  2009-08-29 10:41             ` Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4 Boris Derzhavets
@ 2009-08-29 11:05               ` Boris Derzhavets
  2009-08-29 15:17               ` Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
  1 sibling, 0 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-29 11:05 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2031 bytes --]

I just commented out line 354 - memset (....) in xc_core.c and was able to
build tools. Not sure was it acceptable step or no.
Boris.

--- On Sat, 8/29/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: [Xen-devel] Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Date: Saturday, August 29, 2009, 6:41 AM

make xen OK
make stubtom OK
make tools :-
. . . . . .
gcc  -O2 -fomit-frame-pointer -m64 -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement  -D__XEN_TOOLS__ -MMD -MF .xc_core.o.d  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -I../../xen/common/libelf -Werror -Wmissing-prototypes  -I. -I../xenstore -I../include -c -o xc_core.o xc_core.c
cc1: warnings being treated as errors
In file included from /usr/include/string.h:640,
                 from xg_private.h:9,
                 from xc_core.c:52:
In function ‘memset’,
    inlined from ‘xc_domain_dumpcore_via_callback’ at
 xc_core.c:324:
/usr/include/bits/string3.h:82: error: call to ‘__warn_memset_zero_len’ declared with attribute warning: memset used with constant zero length parameter; this could be due to transposed parameters
make[4]: *** [xc_core.o] Error 1
make[4]: Leaving directory `/usr/src/xen-3.4.1/tools/libxc'
make[3]: *** [build] Error 2
make[3]: Leaving directory `/usr/src/xen-3.4.1/tools/libxc'
make[2]: *** [subdir-install-libxc] Error 2
make[2]: Leaving directory `/usr/src/xen-3.4.1/tools'
make[1]: *** [subdirs-install] Error 2
make[1]: Leaving directory `/usr/src/xen-3.4.1/tools'
make: *** [install-tools] Error 2

Boris.







      
-----Inline Attachment Follows-----

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



      

[-- Attachment #1.2: Type: text/html, Size: 3081 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 11:03               ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 12:25                 ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 13:20                   ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 12:25 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 33500 bytes --]

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@asiasoftsea.net
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
> Hi,
>
> I clonedhttp://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@hotmail.com
> 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@hotmail.com
>> 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@hotmail.com
>>> 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@hotmail.com
>>>> 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@lists.xensource.com 
>>>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. 
>>>>> Teo En Ming (Zhang Enming)
>>>>> *Sent:* 28 August 2009 21:14
>>>>> *To:* enming.teo@asiasoftsea.net
>>>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen M'; 
>>>>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com; weidong.han@intel.com; 
>>>>> bengheng@eecs.umich.edu
>>>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>> 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.
>>>>>   
>>>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>> 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 
>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>>>> and qemu-gfx-passthrough.patch 
>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>>>
>>>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>>>
>>>>>     No virus found in this incoming message.
>>>>>
>>>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>
>>>>>     http://lists.xensource.com/xen-devel
>>>>>
>>>>>        
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>>
>>>>>    
>>>>>   
>>>>> _______________________________________________
>>>>> Xen-devel mailing list
>>>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>> http://lists.xensource.com/xen-devel
>>>>>    
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>   
>>>>
>>>> ------------------------------------------------------------------------
>>>>
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@lists.xensource.com
>>>> http://lists.xensource.com/xen-devel
>>>>    
>>>
>>>
>>
>
>



[-- Attachment #1.2: Type: text/html, Size: 56033 bytes --]

[-- Attachment #2: enming-patch04.patch --]
[-- Type: text/plain, Size: 964 bytes --]

Patch created by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 8:00 P.M. Singapore Time 
Email #1: enming.teo@asiasoftsea.net
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com
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..." */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 12:25                 ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 13:20                   ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 13:29                     ` Tim Moore
  2009-08-29 13:46                     ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 2 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 13:20 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 36373 bytes --]

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@hotmail.com
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@asiasoftsea.net
> Email #2: space.time.universe@gmail.com
> MSN: teoenming@hotmail.com
> 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@hotmail.com
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
>
> On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>> Hi,
>>
>> I clonedhttp://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@hotmail.com
>> 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@hotmail.com
>>> 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@hotmail.com
>>>> 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@hotmail.com
>>>>> 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@lists.xensource.com 
>>>>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. 
>>>>>> Teo En Ming (Zhang Enming)
>>>>>> *Sent:* 28 August 2009 21:14
>>>>>> *To:* enming.teo@asiasoftsea.net
>>>>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen 
>>>>>> M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com; 
>>>>>> weidong.han@intel.com; bengheng@eecs.umich.edu
>>>>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>> 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.
>>>>>>   
>>>>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>> 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 
>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>>>>> and qemu-gfx-passthrough.patch 
>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>>>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>>>>
>>>>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>>>>
>>>>>>     No virus found in this incoming message.
>>>>>>
>>>>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>
>>>>>>     http://lists.xensource.com/xen-devel
>>>>>>
>>>>>>        
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>    
>>>>>>   
>>>>>> _______________________________________________
>>>>>> Xen-devel mailing list
>>>>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>> http://lists.xensource.com/xen-devel
>>>>>>    
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>   
>>>>>
>>>>> ------------------------------------------------------------------------
>>>>>
>>>>> _______________________________________________
>>>>> Xen-devel mailing list
>>>>> Xen-devel@lists.xensource.com
>>>>> http://lists.xensource.com/xen-devel
>>>>>    
>>>>
>>>>
>>>
>>
>>
>
>



[-- Attachment #1.2: Type: text/html, Size: 59501 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: graphics passthrough with VT-d
  2009-08-29 13:20                   ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 13:29                     ` Tim Moore
  2009-08-29 14:12                       ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 13:46                     ` Mr. Teo En Ming (Zhang Enming)
  1 sibling, 1 reply; 66+ messages in thread
From: Tim Moore @ 2009-08-29 13:29 UTC (permalink / raw)
  To: 'enming.teo@asiasoftsea.net'; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 35416 bytes --]

Teo,

Did you rename your Nvidia BIOS and copy it into the hvmloader source tree as required ?

It should get compiled into roms.h in the hvmloader folder - I made sure it was there as the xen buildroot seems to delete it randomly ...

I think we are now up against the Base Address Register issue where the Nvidia driver is expecting to see the card at the Physical BAR Addresses and in the DomU these are re-mapped to different address space ... this is a problem with the Nvidia binary driver and therefore a workaround in xen is maybe needed.

That said, I'm not sure if the Nvidia BIOS likes to be re-executed and may also be an issue ...

Tim

From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 29 August 2009 14:21
To: enming.teo@asiasoftsea.net
Cc: Tim Moore; xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] graphics passthrough with VT-d

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@hotmail.com<mailto:teoenming@hotmail.com>

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..@..["<mailto:GA..@..%5B> */
    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@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Email #2: space.time.universe@gmail.com<mailto:space.time.universe@gmail.com>
MSN: teoenming@hotmail.com<mailto:teoenming@hotmail.com>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com<mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel









________________________________












_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel















________________________________






_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel








[-- Attachment #1.2: Type: text/html, Size: 61168 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 13:20                   ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 13:29                     ` Tim Moore
@ 2009-08-29 13:46                     ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 14:39                       ` Mr. Teo En Ming (Zhang Enming)
  1 sibling, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 13:46 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 38371 bytes --]

Dear All,

I have attached the patchset to xen-unstable and also the nvidia geforce 
8400 gs firmware file here for your convenience.

You can refer to the screenshots at my blog here: 
http://teo-en-ming-aka-zhang-enming.blogspot.com/2009/08/windows-xp-home-domu-test-results-after.html

It shows that the emulated virtual VGA card is now disabled (not 
appearing in Windows XP Home DomU's device manager) and only the nVidia 
Geforce 8400 GS VGA BIOS gets loaded.

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 09:20 PM, Mr. Teo En Ming (Zhang Enming) wrote:
> 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@hotmail.com
> 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@asiasoftsea.net
>> Email #2: space.time.universe@gmail.com
>> MSN: teoenming@hotmail.com
>> 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@hotmail.com
>> Alma Maters: Singapore Polytechnic, National University of Singapore
>>
>>
>> On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>>> Hi,
>>>
>>> I clonedhttp://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@hotmail.com
>>> 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@hotmail.com
>>>> 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@hotmail.com
>>>>> 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@hotmail.com
>>>>>> 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@lists.xensource.com 
>>>>>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of 
>>>>>>> *Mr. Teo En Ming (Zhang Enming)
>>>>>>> *Sent:* 28 August 2009 21:14
>>>>>>> *To:* enming.teo@asiasoftsea.net
>>>>>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen 
>>>>>>> M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com; 
>>>>>>> weidong.han@intel.com; bengheng@eecs.umich.edu
>>>>>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>> 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.
>>>>>>>   
>>>>>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>> 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 
>>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>>>>>> and qemu-gfx-passthrough.patch 
>>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>>>>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>>>>>
>>>>>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>>>>>
>>>>>>>     No virus found in this incoming message.
>>>>>>>
>>>>>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>>
>>>>>>>     http://lists.xensource.com/xen-devel
>>>>>>>
>>>>>>>        
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>    
>>>>>>>   
>>>>>>> _______________________________________________
>>>>>>> Xen-devel mailing list
>>>>>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>> http://lists.xensource.com/xen-devel
>>>>>>>    
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>
>>>>>> ------------------------------------------------------------------------
>>>>>>
>>>>>> _______________________________________________
>>>>>> Xen-devel mailing list
>>>>>> Xen-devel@lists.xensource.com
>>>>>> http://lists.xensource.com/xen-devel
>>>>>>    
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>>
>
>


[-- Attachment #1.2: Type: text/html, Size: 61834 bytes --]

[-- Attachment #2: intel-gfx-passthru-patch01.patch --]
[-- Type: text/plain, Size: 12565 bytes --]

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
@@ -15,7 +15,7 @@
 #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
 
 /* MMIO hole: Hardcoded defaults, which can be dynamically expanded. */
-#define PCI_MEM_START       0xf0000000
+#define PCI_MEM_START       0xe0000000
 #define PCI_MEM_END         0xfc000000
 extern unsigned long pci_mem_start, pci_mem_end;
 
diff -r 5d7e7a250267 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/firmware/hvmloader/hvmloader.c	Fri Aug 28 14:41:22 2009 +0800
@@ -113,7 +113,7 @@ unsigned long pci_mem_start = PCI_MEM_ST
 unsigned long pci_mem_start = PCI_MEM_START;
 unsigned long pci_mem_end = PCI_MEM_END;
 
-static enum { VGA_none, VGA_std, VGA_cirrus } virtual_vga = VGA_none;
+static enum { VGA_none, VGA_std, VGA_cirrus, VGA_pt } virtual_vga = VGA_none;
 
 static void init_hypercalls(void)
 {
@@ -212,8 +212,10 @@ static void pci_setup(void)
         case 0x0300:
             if ( (vendor_id == 0x1234) && (device_id == 0x1111) )
                 virtual_vga = VGA_std;
-            if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
+            else if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
                 virtual_vga = VGA_cirrus;
+            else
+                virtual_vga = VGA_pt;
             break;
         case 0x0680:
             /* PIIX4 ACPI PM. Special device with special PCI config space. */
@@ -684,6 +686,11 @@ int main(void)
         memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
                vgabios_stdvga, sizeof(vgabios_stdvga));
         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);
         break;
     default:
         printf("No emulated VGA adaptor ...\n");
diff -r 5d7e7a250267 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Aug 27 16:54:24 2009 +0800
@@ -1109,7 +1109,9 @@ int xc_hvm_build_target_mem(int xc_handl
                             uint32_t domid,
                             int memsize,
                             int target,
-                            const char *image_name)
+                            const char *image_name,
+                            int gfx_passthru)
+
 {
     /* XXX:PoD isn't supported yet */
     return xc_hvm_build(xc_handle, domid, target, image_name);
diff -r 5d7e7a250267 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xc_hvm_build.c	Thu Aug 27 16:54:24 2009 +0800
@@ -64,6 +64,67 @@ static void build_hvm_info(void *hvm_inf
     for ( i = 0, sum = 0; i < hvm_info->length; i++ )
         sum += ((uint8_t *)hvm_info)[i];
     hvm_info->checksum = -sum;
+}
+
+static int init_vgabios(int xc_handle, uint32_t dom,
+                        unsigned char *buffer, uint32_t bios_size)
+{
+    char *va_bios = NULL;
+    uint32_t va_size = 0;
+
+    va_size = bios_size + bios_size % XC_PAGE_SIZE;
+    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
+                                   PROT_READ | PROT_WRITE, 0xC0);
+    if ( !va_bios )
+    {
+        IPRINTF("Unable to map vga bios!\n");
+        return -1;
+    }
+
+    if ( buffer != NULL )
+        memcpy(va_bios, buffer, bios_size);
+    else
+        memset(va_bios, 0, bios_size);
+
+    munmap(va_bios, va_size);
+    return 0;
+}
+
+static int setup_vga_pt(int xc_handle, uint32_t dom)
+{
+    int                 rc = 0;
+    unsigned char       *bios = NULL;
+    int                 bios_size = 0;
+    char                *c = NULL;
+    char                checksum = 0;
+
+    /* Allocated 64K for the vga bios */
+    if (!(bios = malloc(64 * 1024)))
+        return -1;
+
+#ifdef __linux__
+    bios_size = xc_get_vgabios(bios, 64 * 1024);
+#else
+    bios_size = 0;
+#endif /* __linux__ */
+
+    if (bios_size == 0)
+    {
+        IPRINTF("vga bios size is 0!\n");
+        rc = -1;
+        goto error;
+    }
+
+    /* Adjust the bios checksum */
+    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+        checksum += *c;
+    if (checksum)
+        bios[bios_size - 1] -= checksum;
+
+    init_vgabios(xc_handle, dom, bios, bios_size);
+error:
+    free(bios);
+    return rc;
 }
 
 static int loadelfimage(
@@ -381,7 +442,8 @@ int xc_hvm_build_target_mem(int xc_handl
                            uint32_t domid,
                            int memsize,
                            int target,
-                           const char *image_name)
+                           const char *image_name,
+                           int gfx_passthru)
 {
     char *image;
     int  sts;
@@ -392,6 +454,11 @@ int xc_hvm_build_target_mem(int xc_handl
         return -1;
 
     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
+
+    if ( gfx_passthru )
+        sts |= setup_vga_pt(xc_handle, domid);
+    else
+        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
 
     free(image);
 
diff -r 5d7e7a250267 tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xc_linux.c	Thu Aug 27 16:54:24 2009 +0800
@@ -638,6 +638,56 @@ err:
     return gnt;
 }
 
+int xc_get_vgabios(unsigned char        *buf,
+                   int                  len)
+{
+    int         mem;
+    uint32_t    start, size = 0;
+    uint16_t    magic = 0;
+
+    start = 0xC0000;
+    if (len < size)
+        return 0;
+    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
+        return 0;
+
+    /*
+    ** Check if it a real bios extension.
+    ** The magic number is 0xAA55.
+    */
+    if (start != lseek(mem, start, SEEK_SET))
+        goto out;
+    if (read(mem, &magic, 2) != 2)
+        goto out;
+    if (magic != 0xAA55)
+        goto out;
+    /* Find the size of the rom extension */
+    if (start != lseek(mem, start, SEEK_SET))
+        goto out;
+    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
+        goto out;
+    if (read(mem, &size, 1) != 1)
+        goto out;
+    /* This size is in 512K */
+    size *= 512;
+
+    /*
+    ** Set the file to the begining of the rombios,
+    ** to start the copy.
+    */
+    if (start != lseek(mem, start, SEEK_SET))
+    {
+        size = 0;
+        goto out;
+    }
+    if (size != read(mem, buf, size))
+        size = 0;
+
+out:
+    close(mem);
+    return size;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 5d7e7a250267 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xenctrl.h	Thu Aug 27 16:54:24 2009 +0800
@@ -1285,4 +1285,6 @@ int xc_tmem_restore(int xc_handle, int d
 int xc_tmem_restore(int xc_handle, int dom, int fd);
 int xc_tmem_restore_extra(int xc_handle, int dom, int fd);
 
+int xc_get_vgabios(unsigned char *bios, int len);
+
 #endif /* XENCTRL_H */
diff -r 5d7e7a250267 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/libxc/xenguest.h	Thu Aug 27 16:54:24 2009 +0800
@@ -135,7 +135,8 @@ int xc_hvm_build_target_mem(int xc_handl
                             uint32_t domid,
                             int memsize,
                             int target,
-                            const char *image_name);
+                            const char *image_name,
+                            int gfx_passthru);
 
 int xc_hvm_build_mem(int xc_handle,
                      uint32_t domid,
diff -r 5d7e7a250267 tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/lowlevel/xc/xc.c	Thu Aug 27 16:54:24 2009 +0800
@@ -894,21 +894,21 @@ static PyObject *pyxc_hvm_build(XcObject
     int i;
 #endif
     char *image;
-    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
+    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, gfx_passthru = 0;
 
     static char *kwd_list[] = { "domid",
                                 "memsize", "image", "target", "vcpus", "acpi",
-                                "apic", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
+                                "apic", "gfx_passthru", NULL };
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
                                       &dom, &memsize, &image, &target, &vcpus,
-                                      &acpi, &apic) )
+                                      &acpi, &apic, &gfx_passthru) )
         return NULL;
 
     if ( target == -1 )
         target = memsize;
 
     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
-                                 target, image) != 0 )
+                                 target, image, gfx_passthru) != 0 )
         return pyxc_error_to_exception();
 
 #if !defined(__ia64__)
diff -r 5d7e7a250267 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xend/XendConfig.py	Thu Aug 27 16:54:24 2009 +0800
@@ -175,6 +175,7 @@ XENAPI_PLATFORM_CFG_TYPES = {
     'pci_msitranslate': int,
     'pci_power_mgmt': int,
     'xen_platform_pci': int,
+    "gfx_passthru": int,
 }
 
 # Xen API console 'other_config' keys.
diff -r 5d7e7a250267 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xend/image.py	Thu Aug 27 16:54:24 2009 +0800
@@ -786,7 +786,7 @@ class HVMImageHandler(ImageHandler):
         self.apic = int(vmConfig['platform'].get('apic', 0))
         self.acpi = int(vmConfig['platform'].get('acpi', 0))
         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
-
+        self.gfx_passthru = int(vmConfig['platform'].get('gfx_passthru', 0))
 
     # Return a list of cmd line args to the device models based on the
     # xm config file
@@ -807,7 +807,7 @@ class HVMImageHandler(ImageHandler):
 
         dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
                    'localtime', 'serial', 'stdvga', 'isa',
-                   'acpi', 'usb', 'usbdevice' ]
+                   'acpi', 'usb', 'usbdevice', 'gfx_passthru' ]
 
         for a in dmargs:
             v = vmConfig['platform'].get(a)
@@ -901,6 +901,7 @@ class HVMImageHandler(ImageHandler):
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
         log.debug("acpi           = %d", self.acpi)
         log.debug("apic           = %d", self.apic)
+        log.debug("gfx_passthru   = %d", self.gfx_passthru)
 
         rc = xc.hvm_build(domid          = self.vm.getDomid(),
                           image          = self.loader,
@@ -908,7 +909,8 @@ class HVMImageHandler(ImageHandler):
                           target         = mem_mb,
                           vcpus          = self.vm.getVCpuCount(),
                           acpi           = self.acpi,
-                          apic           = self.apic)
+                          apic           = self.apic,
+                          gfx_passthru   = self.gfx_passthru)
         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
 
         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
diff -r 5d7e7a250267 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py	Wed Aug 26 18:28:44 2009 +0800
+++ b/tools/python/xen/xm/create.py	Thu Aug 27 16:54:24 2009 +0800
@@ -546,6 +546,10 @@ gopts.var('sdl', val='',
 gopts.var('sdl', val='',
           fn=set_value, default=None,
           use="""Should the device model use SDL?""")
+
+gopts.var('gfx_passthru', val='',
+          fn=set_value, default=None,
+          use="""Passthrough graphics card?""")
 
 gopts.var('opengl', val='',
           fn=set_value, default=None,
@@ -957,7 +961,8 @@ def configure_hvm(config_image, vals):
              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
-             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
+             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
+             'gfx_passthru' ]
 
     for a in args:
         if a in vals.__dict__ and vals.__dict__[a] is not None:

[-- Attachment #3: intel-gfx-passthru-patch02.patch --]
[-- Type: text/plain, Size: 9842 bytes --]

>From fb818f1060e57dac6793187a70a79801a7c17e50 Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Thu, 27 Aug 2009 16:51:01 +0800
Subject: [PATCH] qemu gfx passthrough support

support basic gfx passthrough:
  - 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@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 hw/pass-through.c |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pass-through.h |    6 +++++
 hw/pc.c           |   51 ++++++++++++++++++++++++------------------
 vl.c              |   32 +++++++++++++++++++++++---
 4 files changed, 126 insertions(+), 26 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..4a9e03a 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -93,6 +93,8 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
+extern int gfx_passthru;
+
 struct php_dev {
     struct pt_dev *pt_dev;
     uint8_t valid;
@@ -1781,12 +1783,57 @@ static int pt_dev_is_virtfn(struct pci_dev *dev)
     return rc;
 }
 
+/*
+ * register VGA resources for the domain with assigned gfx
+ */
+static int register_vga_regions(struct pt_dev *real_device)
+{
+    int ret = 0;
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+            0x3B0, 0xC, DPCI_ADD_MAPPING);
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+            0x3C0, 0x20, DPCI_ADD_MAPPING);
+
+    ret |= xc_domain_memory_mapping(xc_handle, domid,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0x20,
+            DPCI_ADD_MAPPING);
+
+    return ret;
+}
+
+/*
+ * unregister VGA resources for the domain with assigned gfx
+ */
+static int unregister_vga_regions(struct pt_dev *real_device)
+{
+    int ret = 0;
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3B0,
+            0x3B0, 0xC, DPCI_REMOVE_MAPPING);
+
+    ret |= xc_domain_ioport_mapping(xc_handle, domid, 0x3C0,
+            0x3C0, 0x20, DPCI_REMOVE_MAPPING);
+
+    ret |= xc_domain_memory_mapping(xc_handle, domid,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0xa0000 >> XC_PAGE_SHIFT,
+            0x20,
+            DPCI_REMOVE_MAPPING);
+
+    return ret;
+}
+
 static int pt_register_regions(struct pt_dev *assigned_device)
 {
     int i = 0;
     uint32_t bar_data = 0;
     struct pci_dev *pci_dev = assigned_device->pci_dev;
     PCIDevice *d = &assigned_device->dev;
+    int ret;
 
     /* Register PIO/MMIO BARs */
     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
@@ -1842,6 +1889,16 @@ static int pt_register_regions(struct pt_dev *assigned_device)
             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
     }
 
+    if ( gfx_passthru && (pci_dev->device_class == 0x0300) )
+    {
+        ret = register_vga_regions(assigned_device);
+        if ( ret != 0 )
+        {
+            PT_LOG("VGA region mapping failed\n");
+            return ret;
+        }
+    }
+
     return 0;
 }
 
@@ -1891,6 +1948,12 @@ static void pt_unregister_regions(struct pt_dev *assigned_device)
 
     }
 
+    if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+    {
+        ret = unregister_vga_regions(assigned_device);
+        if ( ret != 0 )
+            PT_LOG("VGA region unmapping failed\n");
+    }
 }
 
 static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
diff --git a/hw/pass-through.h b/hw/pass-through.h
index 028a03e..956e228 100644
--- a/hw/pass-through.h
+++ b/hw/pass-through.h
@@ -142,6 +142,12 @@ enum {
     GRP_TYPE_EMU,                               /* emul reg group */
 };
 
+enum {
+    GFX_NO_PASSTHRU = 0,                        /* No gfx pass-through */
+    GFX_IGD_PASSTHRU,                           /* IGD pass-through */
+    GFX_DISCRETE_PASSTHRU,                      /* Discrete gfx pass-through */
+};
+
 #define PT_GET_EMUL_SIZE(flag, r_size) do { \
     if (flag == PT_BAR_FLAG_MEM) {\
         r_size = (((r_size) + XC_PAGE_SIZE - 1) & ~(XC_PAGE_SIZE - 1)); \
diff --git a/hw/pc.c b/hw/pc.c
index 129e9d9..53b59c0 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -41,6 +41,7 @@
 #include "virtio-balloon.h"
 #include "virtio-console.h"
 #include "hpet_emul.h"
+#include "pass-through.h"
 
 /* output Bochs bios info messages */
 //#define DEBUG_BIOS
@@ -65,6 +66,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
 extern uint8_t *acpi_tables;
 extern size_t acpi_tables_len;
 
+extern int gfx_passthru;
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
@@ -983,30 +986,34 @@ vga_bios_error:
 
     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
 
-    if (cirrus_vga_enabled) {
-        if (pci_enabled) {
-            pci_cirrus_vga_init(pci_bus,
-                                phys_ram_base + vga_ram_addr,
-                                vga_ram_addr, vga_ram_size);
-        } else {
-            isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
-                                vga_ram_addr, vga_ram_size);
-        }
+    if (gfx_passthru == GFX_NO_PASSTHRU) {
+       if (cirrus_vga_enabled) {
+            fprintf(logfile,"cirrus_vga_enabled\n");
+            if (pci_enabled) {
+                pci_cirrus_vga_init(pci_bus,
+                                    phys_ram_base + vga_ram_addr,
+                                    vga_ram_addr, vga_ram_size);
+            } else {
+                isa_cirrus_vga_init(phys_ram_base + vga_ram_addr,
+                                    vga_ram_addr, vga_ram_size);
+            }
 #ifndef CONFIG_DM
-    } else if (vmsvga_enabled) {
-        if (pci_enabled)
-            pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
-                            vga_ram_addr, vga_ram_size);
-        else
-            fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+        } else if (vmsvga_enabled) {
+            if (pci_enabled)
+                pci_vmsvga_init(pci_bus, phys_ram_base + vga_ram_addr,
+                                vga_ram_addr, vga_ram_size);
+            else
+                fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
 #endif
-    } else if (std_vga_enabled) {
-        if (pci_enabled) {
-            pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
-                         vga_ram_addr, vga_ram_size, 0, 0);
-        } else {
-            isa_vga_init(phys_ram_base + vga_ram_addr,
-                         vga_ram_addr, vga_ram_size);
+        } else if (std_vga_enabled) {
+            fprintf(logfile,"std_vga_enabled\n");
+            if (pci_enabled) {
+                pci_vga_init(pci_bus, phys_ram_base + vga_ram_addr,
+                             vga_ram_addr, vga_ram_size, 0, 0);
+            } else {
+                isa_vga_init(phys_ram_base + vga_ram_addr,
+                             vga_ram_addr, vga_ram_size);
+            }
         }
     }
 
diff --git a/vl.c b/vl.c
index 62bed05..72f3479 100644
--- a/vl.c
+++ b/vl.c
@@ -48,6 +48,7 @@
 #include <stdlib.h>
 
 #include "qemu-xen.h"
+#include "hw/pass-through.h"
 
 #include <unistd.h>
 #include <fcntl.h>
@@ -213,6 +214,7 @@ static int rtc_date_offset = -1; /* -1 means no change */
 int cirrus_vga_enabled = 1;
 int std_vga_enabled = 0;
 int vmsvga_enabled = 0;
+int gfx_passthru = 0;
 #ifdef TARGET_SPARC
 int graphic_width = 1024;
 int graphic_height = 768;
@@ -4269,6 +4271,7 @@ enum {
     /* Xen tree: */
     QEMU_OPTION_disable_opengl,
     QEMU_OPTION_direct_pci,
+    QEMU_OPTION_gfx_passthru,
     QEMU_OPTION_pci_emulation,
     QEMU_OPTION_vncunused,
     QEMU_OPTION_videoram,
@@ -4447,6 +4450,7 @@ static const QEMUOption qemu_options[] = {
 #endif
     { "acpi", 0, QEMU_OPTION_acpi }, /* deprecated, for xend compatibility */
     { "direct_pci", HAS_ARG, QEMU_OPTION_direct_pci },
+    { "gfx_passthru", HAS_ARG, QEMU_OPTION_gfx_passthru},
     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
     { "vncunused", 0, QEMU_OPTION_vncunused },
     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
@@ -5484,6 +5488,22 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_runas:
                 run_as = optarg;
                 break;
+            case QEMU_OPTION_gfx_passthru:
+                gfx_passthru = atoi(optarg);
+                switch (gfx_passthru) {
+                case GFX_NO_PASSTHRU:
+                    break;
+                case GFX_IGD_PASSTHRU:
+                    fprintf(logfile, "IGD graphics card assignment\n");
+                    break;
+                case GFX_DISCRETE_PASSTHRU:
+                    fprintf(logfile, "Discrete graphics card assignment\n");
+                    break;
+                default:
+                    fprintf(stderr, "unsupported gfx_passthru option: %d\n",
+                            gfx_passthru);
+                }
+                break;
             }
         }
     }
@@ -5897,13 +5917,17 @@ int main(int argc, char **argv, char **envp)
                         exit(1);
 		    xenstore_write_vncport(vnc_display_port);
                 }
+
+                if (gfx_passthru == GFX_NO_PASSTHRU)
+                {
 #if defined(CONFIG_SDL)
-                if (sdl || !vnc_display)
-                    sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
+                    if (sdl || !vnc_display)
+                        sdl_display_init(ds, full_screen, no_frame, opengl_enabled);
 #elif defined(CONFIG_COCOA)
-                if (sdl || !vnc_display)
-                    cocoa_display_init(ds, full_screen);
+                    if (sdl || !vnc_display)
+                        cocoa_display_init(ds, full_screen);
 #endif
+                }
             }
     }
     dpy_resize(ds);
-- 
1.6.0.4


[-- Attachment #4: intel-gfx-passthru-patch03.patch --]
[-- Type: text/plain, Size: 1431 bytes --]

Manually generated by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 11:10 A.M. Singapore Time
Email #1: enming.teo@asiasoftsea.net
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com

--- Makefile	2009-08-29 10:57:28.072084001 +0800
+++ Makefile	2009-08-29 11:03:30.650209241 +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 10:58:52.679084845 +0800
+++ hvmloader.c	2009-08-29 11:07:40.763119203 +0800
@@ -688,10 +688,10 @@
         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);
-        break;
+        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");
         break;

[-- Attachment #5: enming-patch04.patch --]
[-- Type: text/plain, Size: 964 bytes --]

Patch created by Teo En Ming (Zhang Enming) on 29 August 2009 Saturday at 8:00 P.M. Singapore Time 
Email #1: enming.teo@asiasoftsea.net
Email #2: space.time.universe@gmail.com
MSN: teoenming@hotmail.com
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..." */

[-- Attachment #6: nvidia-geforce-8400-gs-firmware.rom --]
[-- Type: application/octet-stream, Size: 62464 bytes --]

[-- Attachment #7: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 13:29                     ` Tim Moore
@ 2009-08-29 14:12                       ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 14:48                         ` Mr. Teo En Ming (Zhang Enming)
  2009-08-31  8:47                         ` Han, Weidong
  0 siblings, 2 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 14:12 UTC (permalink / raw)
  To: timothy.moore; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 36650 bytes --]

Hi Timothy,

Yes, I renamed the firmware file of nVidia Geforce 8400 GS to 
vgabios-pt.bin and placed it in the source directory tools/firmware/vgabios.

Weidong had said Intel has the 1:1 mapping patches. Let's hope he will 
release the patch soon to do pBAR:vBAR.

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 09:29 PM, Tim Moore wrote:
>
> Teo,
>
> Did you rename your Nvidia BIOS and copy it into the hvmloader source 
> tree as required ?
>
> It should get compiled into roms.h in the hvmloader folder - I made 
> sure it was there as the xen buildroot seems to delete it randomly ...
>
> I think we are now up against the Base Address Register issue where 
> the Nvidia driver is expecting to see the card at the Physical BAR 
> Addresses and in the DomU these are re-mapped to different address 
> space ... this is a problem with the Nvidia binary driver and 
> therefore a workaround in xen is maybe needed.
>
> That said, I'm not sure if the Nvidia BIOS likes to be re-executed and 
> may also be an issue ...
>
> Tim
>
> *From:* Mr. Teo En Ming (Zhang Enming) 
> [mailto:enming.teo@asiasoftsea.net]
> *Sent:* 29 August 2009 14:21
> *To:* enming.teo@asiasoftsea.net
> *Cc:* Tim Moore; xen-devel@lists.xensource.com
> *Subject:* Re: [Xen-devel] graphics passthrough with VT-d
>
> 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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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..@..[" 
> <mailto:GA..@..%5B> */
>     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@asiasoftsea.net <mailto:enming.teo@asiasoftsea.net>
> Email #2: space.time.universe@gmail.com 
> <mailto:space.time.universe@gmail.com>
> MSN: teoenming@hotmail.com <mailto:teoenming@hotmail.com>
> 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@hotmail.com  <mailto:teoenming@hotmail.com>
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
>
>
> On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>
> Hi,
>   
> I clonedhttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@lists.xensource.com 
> <mailto:xen-devel-bounces@lists.xensource.com> 
> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo 
> En Ming (Zhang Enming)
> *Sent:* 28 August 2009 21:14
> *To:* enming.teo@asiasoftsea.net <mailto:enming.teo@asiasoftsea.net>
> *Cc:* xen-devel@lists.xensource.com 
> <mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 
> 'Jean Guyader'; Keir.Fraser@eu.citrix.com 
> <mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com 
> <mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu 
> <mailto:bengheng@eecs.umich.edu>
> *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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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.
>   
> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
> and qemu-gfx-passthrough.patch 
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>
>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>
>     No virus found in this incoming message.
>
>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>
>     http://lists.xensource.com/xen-devel
>
>        
>
>
>
>
> ------------------------------------------------------------------------
>
>
>    
>   
>   
>    
>   
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
> http://lists.xensource.com/xen-devel
>    
>
>
>
>
>
>   
>
>
>
> ------------------------------------------------------------------------
>
>
>    
>   
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
> http://lists.xensource.com/xen-devel
>    
>



[-- Attachment #1.2: Type: text/html, Size: 64994 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 13:46                     ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 14:39                       ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 15:06                         ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 1 reply; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 14:39 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 56189 bytes --]

Dear All,

Here is my "xm dmesg" output:

linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff8166b200
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff81009000
(XEN) elf_xen_parse_note: FEATURES = "!writable_page_tables|pae_pgdir_above_4gb"
(XEN) elf_xen_parse_note: PAE_MODE = "yes"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_parse_note: HV_START_LOW = 0xffff800000000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0x0
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0x0
(XEN)     virt_offset      = 0xffffffff80000000
(XEN)     virt_kstart      = 0xffffffff81000000
(XEN)     virt_kend        = 0xffffffff81911000
(XEN)     virt_entry       = 0xffffffff8166b200
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 ->  0x1911000
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   00000001f0000000->00000001f4000000 (1470696 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff81000000->ffffffff81911000
(XEN)  Init. ramdisk: ffffffff81911000->ffffffff82085400
(XEN)  Phys-Mach map: ffffffff82086000->ffffffff82bde740
(XEN)  Start info:    ffffffff82bdf000->ffffffff82bdf4b4
(XEN)  Page tables:   ffffffff82be0000->ffffffff82bfb000
(XEN)  Boot stack:    ffffffff82bfb000->ffffffff82bfc000
(XEN)  TOTAL:         ffffffff80000000->ffffffff83000000
(XEN)  ENTRY ADDRESS: ffffffff8166b200
(XEN) Dom0 has maximum 2 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 ->  0xffffffff815bb000
(XEN) elf_load_binary: phdr 1 at 0xffffffff815bb000 ->  0xffffffff8165efe0
(XEN) elf_load_binary: phdr 2 at 0xffffffff8165f000 ->  0xffffffff8165f888
(XEN) elf_load_binary: phdr 3 at 0xffffffff81660000 ->  0xffffffff8179c200
(XEN) elf_load_binary: phdr 4 at 0xffffffff8179d000 ->  0xffffffff817b2c60
(XEN) elf_load_binary: phdr 5 at 0xffffffff817b3000 ->  0xffffffff817b4000
(XEN) Scrubbing Free RAM: .done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input ->  DOM0 (type \047CTRL-a\047 three times to switch input to Xen)
(XEN) Freed 128kB init memory.
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=0, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=1, old_irq=1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000928, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=2, old_irq=0, new_irq=0
(XEN) ioapic_guest_write: old_entry=000009f0, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=3, old_irq=3, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000930, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2262:
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=0
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to remove IO-APIC pin of in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=5, old_irq=5, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000938, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=6, old_irq=6, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000940, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=7, old_irq=7, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000948, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=8, old_irq=8, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000950, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=9, old_irq=9, new_irq=0
(XEN) ioapic_guest_write: old_entry=00018958, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=10, old_irq=10, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000960, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=11, old_irq=11, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000968, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=12, old_irq=12, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000970, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=13, old_irq=13, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000978, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=14, old_irq=14, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000988, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=15, old_irq=15, new_irq=0
(XEN) ioapic_guest_write: old_entry=00000990, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=16, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=17, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=18, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=19, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=20, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=21, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=22, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=23, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=0, old_irq=-1, new_irq=0
(XEN) ioapic_guest_write: old_entry=00010000, new_entry=00000900
(XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=00000904
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:871:d0 MCE: wr MC1_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC2_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC3_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC4_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC5_STATUS 0
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:871:d0 MCE: wr MC1_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC2_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC3_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC4_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC5_STATUS 0
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=00000904
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=19, old_irq=19, new_irq=19
(XEN) ioapic_guest_write: old_entry=0000a9c8, new_entry=0001a913
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
(XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=23, old_irq=23, new_irq=23
(XEN) ioapic_guest_write: old_entry=0000a9d8, new_entry=0001a917
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=19, old_irq=19, new_irq=19
(XEN) ioapic_guest_write: old_entry=0000a9c8, new_entry=0001a913
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
(XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
(XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
(XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=16, old_irq=16, new_irq=16
(XEN) ioapic_guest_write: old_entry=0000a9b8, new_entry=0001a910
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) io_apic.c:2275:
(XEN) ioapic_guest_write: apic=0, pin=22, old_irq=22, new_irq=22
(XEN) ioapic_guest_write: old_entry=0000a931, new_entry=0001a916
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
(XEN) [VT-D]iommu.c:1288:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1174:d0 domain_context_mapping:PCIe: bdf = 1:0.0
(XEN) domctl.c:887:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=c
(XEN) domctl.c:887:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:836:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]io.c:284:d0 VT-d irq bind: m_irq = 1f device = 4 intx = 0
(XEN) HVM1: HVM Loader
(XEN) HVM1: Detected Xen v3.5-unstable
(XEN) HVM1: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom1 PCI link 0 changed 0 ->  5
(XEN) HVM1: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom1 PCI link 1 changed 0 ->  10
(XEN) HVM1: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom1 PCI link 2 changed 0 ->  11
(XEN) HVM1: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom1 PCI link 3 changed 0 ->  5
(XEN) HVM1: PCI-ISA link 3 routed to IRQ5
(XEN) HVM1: pci dev 01:2 INTD->IRQ5
(XEN) HVM1: pci dev 01:3 INTA->IRQ10
(XEN) HVM1: pci dev 02:0 INTA->IRQ11
(XEN) HVM1: pci dev 03:0 INTA->IRQ5
(XEN) HVM1: pci dev 04:0 INTA->IRQ5
(XEN) HVM1: pci dev 04:0 bar 14 size 10000000: e000000c
(XEN) domctl.c:836:d0 memory_map:add: gfn=e0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=f0000 mfn=d0000 nr_mfns=2000
(XEN) HVM1: pci dev 04:0 bar 1c size 02000000: f0000004
(XEN) HVM1: pci dev 02:0 bar 14 size 01000000: f2000008
(XEN) domctl.c:836:d0 memory_map:add: gfn=f3000 mfn=d2000 nr_mfns=1000
(XEN) HVM1: pci dev 04:0 bar 10 size 01000000: f3000000
(XEN) HVM1: pci dev 04:0 bar 30 size 00020000: f4000000
(XEN) HVM1: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM1: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM1: pci dev 03:0 bar 14 size 00000100: f4020000
(XEN) HVM1: pci dev 04:0 bar 24 size 00000080: 0000c201
(XEN) domctl.c:887:d0 ioport_map:add f_gport=c200 f_mport=d000 np=80
(XEN) HVM1: pci dev 01:2 bar 20 size 00000020: 0000c281
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c2a1
(XEN) HVM1: Multiprocessor initialisation:
(XEN) HVM1:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM1: Testing HVM environment:
(XEN) HVM1:  - REP INSB across page boundaries ... passed
(XEN) HVM1:  - GS base MSRs and SWAPGS ... passed
(XEN) HVM1: Passed 2 of 2 tests
(XEN) HVM1: Writing SMBIOS tables ...
(XEN) HVM1: Loading ROMBIOS ...
(XEN) HVM1: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM1:   Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM1: Creating MP tables ...
(XEN) HVM1: Loading Gfx Video BIOS from file ...
(XEN) HVM1: Loading PCI Option ROM ...
(XEN) HVM1:  - Manufacturer: http://etherboot.org
(XEN) HVM1:  - Product name: gPXE
(XEN) HVM1: Loading ACPI ...
(XEN) HVM1:  - Lo data: 000ea020-000ea04f
(XEN) HVM1:  - Hi data: fc003000-fc0125cf
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1:  c8000-d47ff: Etherboot ROM
(XEN) HVM1:  eb000-eb14e: SMBIOS tables
(XEN) HVM1:  f0000-fffff: Main BIOS
(XEN) HVM1: Invoking ROMBIOS ...
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Bochs BIOS - build: 06/23/99
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Options: apmbios pcibios eltorito PMM
(XEN) HVM1:
(XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (51200 MBytes)
(XEN) HVM1: IDE time out
(XEN) HVM1: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
(XEN) HVM1: IDE time out
(XEN) HVM1:
(XEN) HVM1:
(XEN) HVM1:
(XEN) HVM1: Press F12 for boot menu.
(XEN) HVM1:
(XEN) HVM1: Booting from Hard Disk...
(XEN) HVM1: Booting from 0000:7c00
(XEN) HVM1: int13_harddisk: function 15, unmapped device for ELDL=81
(XEN) HVM1: *** int 15h function AX=e980, BX=006e not yet supported!
(XEN) mce.c:694:d1 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:714:d1 MCE: rdmsr MC0_CTL 0xffffffffffffffff
(XEN) mce.c:694:d1 MCE: rdmsr MCG_CAP 0x806
(XEN) irq.c:243: Dom1 PCI link 0 changed 5 ->  0
(XEN) irq.c:243: Dom1 PCI link 1 changed 10 ->  0
(XEN) irq.c:243: Dom1 PCI link 2 changed 11 ->  0
(XEN) irq.c:243: Dom1 PCI link 3 changed 5 ->  0
(XEN) domctl.c:846:d0 memory_map:remove: gfn=f3000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=e0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=f0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:911:d0 ioport_map:remove f_gport=c200 f_mport=d000 np=80
(XEN) domctl.c:836:d0 memory_map:add: gfn=f3000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=e0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=f0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=c200 f_mport=d000 np=80
(XEN) domctl.c:846:d0 memory_map:remove: gfn=f3000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=e0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=f0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:911:d0 ioport_map:remove f_gport=c200 f_mport=d000 np=80
(XEN) domctl.c:836:d0 memory_map:add: gfn=f3000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=e0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=f0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=c200 f_mport=d000 np=80
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 09:46 PM, Mr. Teo En Ming (Zhang Enming) wrote:
> Dear All,
>
> I have attached the patchset to xen-unstable and also the nvidia 
> geforce 8400 gs firmware file here for your convenience.
>
> You can refer to the screenshots at my blog here: 
> http://teo-en-ming-aka-zhang-enming.blogspot.com/2009/08/windows-xp-home-domu-test-results-after.html
>
> It shows that the emulated virtual VGA card is now disabled (not 
> appearing in Windows XP Home DomU's device manager) and only the 
> nVidia Geforce 8400 GS VGA BIOS gets loaded.
>
> -- 
> 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@hotmail.com
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
>
> On 08/29/2009 09:20 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>> 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@hotmail.com
>> 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@asiasoftsea.net
>>> Email #2: space.time.universe@gmail.com
>>> MSN: teoenming@hotmail.com
>>> 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@hotmail.com
>>> Alma Maters: Singapore Polytechnic, National University of Singapore
>>>
>>>
>>> On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>>>> Hi,
>>>>
>>>> I clonedhttp://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@hotmail.com
>>>> 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@hotmail.com
>>>>> 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@hotmail.com
>>>>>> 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@hotmail.com
>>>>>>> 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@lists.xensource.com 
>>>>>>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of 
>>>>>>>> *Mr. Teo En Ming (Zhang Enming)
>>>>>>>> *Sent:* 28 August 2009 21:14
>>>>>>>> *To:* enming.teo@asiasoftsea.net
>>>>>>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen 
>>>>>>>> M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com; 
>>>>>>>> weidong.han@intel.com; bengheng@eecs.umich.edu
>>>>>>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>>> 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.
>>>>>>>>   
>>>>>>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>>> 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 
>>>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>>>>>>> and qemu-gfx-passthrough.patch 
>>>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>>>>>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>>>>>>
>>>>>>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>>>>>>
>>>>>>>>     No virus found in this incoming message.
>>>>>>>>
>>>>>>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>>>
>>>>>>>>     http://lists.xensource.com/xen-devel
>>>>>>>>
>>>>>>>>        
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>>>    
>>>>>>>>   
>>>>>>>> _______________________________________________
>>>>>>>> Xen-devel mailing list
>>>>>>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>>> http://lists.xensource.com/xen-devel
>>>>>>>>    
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   
>>>>>>>
>>>>>>> ------------------------------------------------------------------------
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Xen-devel mailing list
>>>>>>> Xen-devel@lists.xensource.com
>>>>>>> http://lists.xensource.com/xen-devel
>>>>>>>    
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>



[-- Attachment #1.2: Type: text/html, Size: 80238 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 14:12                       ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 14:48                         ` Mr. Teo En Ming (Zhang Enming)
  2009-08-31  8:47                         ` Han, Weidong
  1 sibling, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 14:48 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 38575 bytes --]

I am wondering if there are any cheap consumer ATI PCIe x16 graphics card that does not depend on 1:1 BAR mapping?

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/29/2009 10:12 PM, Mr. Teo En Ming (Zhang Enming) wrote:
> Hi Timothy,
>
> Yes, I renamed the firmware file of nVidia Geforce 8400 GS to 
> vgabios-pt.bin and placed it in the source directory 
> tools/firmware/vgabios.
>
> Weidong had said Intel has the 1:1 mapping patches. Let's hope he will 
> release the patch soon to do pBAR:vBAR.
>
> -- 
> 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@hotmail.com
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
>
> On 08/29/2009 09:29 PM, Tim Moore wrote:
>>
>> Teo,
>>
>> Did you rename your Nvidia BIOS and copy it into the hvmloader source 
>> tree as required ?
>>
>> It should get compiled into roms.h in the hvmloader folder - I made 
>> sure it was there as the xen buildroot seems to delete it randomly ...
>>
>> I think we are now up against the Base Address Register issue where 
>> the Nvidia driver is expecting to see the card at the Physical BAR 
>> Addresses and in the DomU these are re-mapped to different address 
>> space ... this is a problem with the Nvidia binary driver and 
>> therefore a workaround in xen is maybe needed.
>>
>> That said, I'm not sure if the Nvidia BIOS likes to be re-executed 
>> and may also be an issue ...
>>
>> Tim
>>
>> *From:* Mr. Teo En Ming (Zhang Enming) 
>> [mailto:enming.teo@asiasoftsea.net]
>> *Sent:* 29 August 2009 14:21
>> *To:* enming.teo@asiasoftsea.net
>> *Cc:* Tim Moore; xen-devel@lists.xensource.com
>> *Subject:* Re: [Xen-devel] graphics passthrough with VT-d
>>
>> 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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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..@..[" 
>> <mailto:GA..@..%5B> */
>>     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@asiasoftsea.net <mailto:enming.teo@asiasoftsea.net>
>> Email #2: space.time.universe@gmail.com 
>> <mailto:space.time.universe@gmail.com>
>> MSN: teoenming@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com  <mailto:teoenming@hotmail.com>
>> Alma Maters: Singapore Polytechnic, National University of Singapore
>>
>>
>>
>> On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>>
>> Hi,
>>   
>> I clonedhttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@lists.xensource.com 
>> <mailto:xen-devel-bounces@lists.xensource.com> 
>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo 
>> En Ming (Zhang Enming)
>> *Sent:* 28 August 2009 21:14
>> *To:* enming.teo@asiasoftsea.net <mailto:enming.teo@asiasoftsea.net>
>> *Cc:* xen-devel@lists.xensource.com 
>> <mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 
>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com 
>> <mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com 
>> <mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu 
>> <mailto:bengheng@eecs.umich.edu>
>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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.
>>   
>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>> and qemu-gfx-passthrough.patch 
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>
>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>
>>     No virus found in this incoming message.
>>
>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>
>>     http://lists.xensource.com/xen-devel
>>
>>        
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>    
>>   
>>   
>>    
>>   
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>> http://lists.xensource.com/xen-devel
>>    
>>
>>
>>
>>
>>
>>   
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>    
>>   
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>> http://lists.xensource.com/xen-devel
>>    
>>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    



[-- Attachment #1.2: Type: text/html, Size: 67675 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-29 14:39                       ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-29 15:06                         ` Mr. Teo En Ming (Zhang Enming)
  0 siblings, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-29 15:06 UTC (permalink / raw)
  To: enming.teo; +Cc: xen-devel, timothy.moore


[-- Attachment #1.1: Type: text/plain, Size: 58290 bytes --]

On 08/29/2009 10:39 PM, Mr. Teo En Ming (Zhang Enming) wrote:
> Dear All,
>
> Here is my "xm dmesg" output:
>
> linux"
> (XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
> (XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
> (XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
> (XEN) elf_xen_parse_note: ENTRY = 0xffffffff8166b200
> (XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff81009000
> (XEN) elf_xen_parse_note: FEATURES = "!writable_page_tables|pae_pgdir_above_4gb"
> (XEN) elf_xen_parse_note: PAE_MODE = "yes"
> (XEN) elf_xen_parse_note: LOADER = "generic"
> (XEN) elf_xen_parse_note: unknown xen elf note (0xd)
> (XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
> (XEN) elf_xen_parse_note: HV_START_LOW = 0xffff800000000000
> (XEN) elf_xen_parse_note: PADDR_OFFSET = 0x0
> (XEN) elf_xen_addr_calc_check: addresses:
> (XEN)     virt_base        = 0xffffffff80000000
> (XEN)     elf_paddr_offset = 0x0
> (XEN)     virt_offset      = 0xffffffff80000000
> (XEN)     virt_kstart      = 0xffffffff81000000
> (XEN)     virt_kend        = 0xffffffff81911000
> (XEN)     virt_entry       = 0xffffffff8166b200
> (XEN)     p2m_base         = 0xffffffffffffffff
> (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 ->  0x1911000
> (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (XEN)  Dom0 alloc.:   00000001f0000000->00000001f4000000 (1470696 pages to be allocated)
> (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (XEN)  Loaded kernel: ffffffff81000000->ffffffff81911000
> (XEN)  Init. ramdisk: ffffffff81911000->ffffffff82085400
> (XEN)  Phys-Mach map: ffffffff82086000->ffffffff82bde740
> (XEN)  Start info:    ffffffff82bdf000->ffffffff82bdf4b4
> (XEN)  Page tables:   ffffffff82be0000->ffffffff82bfb000
> (XEN)  Boot stack:    ffffffff82bfb000->ffffffff82bfc000
> (XEN)  TOTAL:         ffffffff80000000->ffffffff83000000
> (XEN)  ENTRY ADDRESS: ffffffff8166b200
> (XEN) Dom0 has maximum 2 VCPUs
> (XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 ->  0xffffffff815bb000
> (XEN) elf_load_binary: phdr 1 at 0xffffffff815bb000 ->  0xffffffff8165efe0
> (XEN) elf_load_binary: phdr 2 at 0xffffffff8165f000 ->  0xffffffff8165f888
> (XEN) elf_load_binary: phdr 3 at 0xffffffff81660000 ->  0xffffffff8179c200
> (XEN) elf_load_binary: phdr 4 at 0xffffffff8179d000 ->  0xffffffff817b2c60
> (XEN) elf_load_binary: phdr 5 at 0xffffffff817b3000 ->  0xffffffff817b4000
> (XEN) Scrubbing Free RAM: .done.
> (XEN) Xen trace buffers: disabled
> (XEN) Std. Loglevel: All
> (XEN) Guest Loglevel: All
> (XEN) *** Serial input ->  DOM0 (type \047CTRL-a\047 three times to switch input to Xen)
> (XEN) Freed 128kB init memory.
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=0, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=1, old_irq=1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000928, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=2, old_irq=0, new_irq=0
> (XEN) ioapic_guest_write: old_entry=000009f0, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=3, old_irq=3, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000930, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2262:
> (XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=0
> (XEN) ioapic_guest_write: old_entry=000009f1, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to remove IO-APIC pin of in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=5, old_irq=5, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000938, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=6, old_irq=6, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000940, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=7, old_irq=7, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000948, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=8, old_irq=8, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000950, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=9, old_irq=9, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00018958, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=10, old_irq=10, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000960, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=11, old_irq=11, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000968, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=12, old_irq=12, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000970, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=13, old_irq=13, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000978, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=14, old_irq=14, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000988, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=15, old_irq=15, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00000990, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=16, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=17, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=18, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=19, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=20, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=21, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=22, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=23, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00010900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=0, old_irq=-1, new_irq=0
> (XEN) ioapic_guest_write: old_entry=00010000, new_entry=00000900
> (XEN) ioapic_guest_write: Attempt to add IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
> (XEN) ioapic_guest_write: old_entry=000009f1, new_entry=00000904
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:871:d0 MCE: wr MC1_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC2_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC3_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC4_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC5_STATUS 0
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:871:d0 MCE: wr MC1_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC2_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC3_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC4_STATUS 0
> (XEN) mce.c:871:d0 MCE: wr MC5_STATUS 0
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
> (XEN) ioapic_guest_write: old_entry=000009f1, new_entry=00000904
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=19, old_irq=19, new_irq=19
> (XEN) ioapic_guest_write: old_entry=0000a9c8, new_entry=0001a913
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
> (XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=23, old_irq=23, new_irq=23
> (XEN) ioapic_guest_write: old_entry=0000a9d8, new_entry=0001a917
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=19, old_irq=19, new_irq=19
> (XEN) ioapic_guest_write: old_entry=0000a9c8, new_entry=0001a913
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
> (XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
> (XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=18, old_irq=18, new_irq=18
> (XEN) ioapic_guest_write: old_entry=0000a9d0, new_entry=0001a912
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=16, old_irq=16, new_irq=16
> (XEN) ioapic_guest_write: old_entry=0000a9b8, new_entry=0001a910
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) io_apic.c:2275:
> (XEN) ioapic_guest_write: apic=0, pin=22, old_irq=22, new_irq=22
> (XEN) ioapic_guest_write: old_entry=0000a931, new_entry=0001a916
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> (XEN) [VT-D]iommu.c:1288:d0 domain_context_unmap:PCIe: bdf = 1:0.0
> (XEN) [VT-D]iommu.c:1174:d0 domain_context_mapping:PCIe: bdf = 1:0.0
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=c
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
> (XEN) domctl.c:836:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
> (XEN) [VT-D]io.c:284:d0 VT-d irq bind: m_irq = 1f device = 4 intx = 0
> (XEN) HVM1: HVM Loader
> (XEN) HVM1: Detected Xen v3.5-unstable
> (XEN) HVM1: CPU speed is 2800 MHz
> (XEN) irq.c:243: Dom1 PCI link 0 changed 0 ->  5
> (XEN) HVM1: PCI-ISA link 0 routed to IRQ5
> (XEN) irq.c:243: Dom1 PCI link 1 changed 0 ->  10
> (XEN) HVM1: PCI-ISA link 1 routed to IRQ10
> (XEN) irq.c:243: Dom1 PCI link 2 changed 0 ->  11
> (XEN) HVM1: PCI-ISA link 2 routed to IRQ11
> (XEN) irq.c:243: Dom1 PCI link 3 changed 0 ->  5
> (XEN) HVM1: PCI-ISA link 3 routed to IRQ5
> (XEN) HVM1: pci dev 01:2 INTD->IRQ5
> (XEN) HVM1: pci dev 01:3 INTA->IRQ10
> (XEN) HVM1: pci dev 02:0 INTA->IRQ11
> (XEN) HVM1: pci dev 03:0 INTA->IRQ5
> (XEN) HVM1: pci dev 04:0 INTA->IRQ5
> (XEN) HVM1: pci dev 04:0 bar 14 size 10000000: e000000c
> (XEN) domctl.c:836:d0 memory_map:add: gfn=e0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=f0000 mfn=d0000 nr_mfns=2000
> (XEN) HVM1: pci dev 04:0 bar 1c size 02000000: f0000004
> (XEN) HVM1: pci dev 02:0 bar 14 size 01000000: f2000008
> (XEN) domctl.c:836:d0 memory_map:add: gfn=f3000 mfn=d2000 nr_mfns=1000
> (XEN) HVM1: pci dev 04:0 bar 10 size 01000000: f3000000
> (XEN) HVM1: pci dev 04:0 bar 30 size 00020000: f4000000
> (XEN) HVM1: pci dev 02:0 bar 10 size 00000100: 0000c001
> (XEN) HVM1: pci dev 03:0 bar 10 size 00000100: 0000c101
> (XEN) HVM1: pci dev 03:0 bar 14 size 00000100: f4020000
> (XEN) HVM1: pci dev 04:0 bar 24 size 00000080: 0000c201
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=c200 f_mport=d000 np=80
> (XEN) HVM1: pci dev 01:2 bar 20 size 00000020: 0000c281
> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c2a1
> (XEN) HVM1: Multiprocessor initialisation:
> (XEN) HVM1:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
> (XEN) HVM1: Testing HVM environment:
> (XEN) HVM1:  - REP INSB across page boundaries ... passed
> (XEN) HVM1:  - GS base MSRs and SWAPGS ... passed
> (XEN) HVM1: Passed 2 of 2 tests
> (XEN) HVM1: Writing SMBIOS tables ...
> (XEN) HVM1: Loading ROMBIOS ...
> (XEN) HVM1: 11900 bytes of ROMBIOS high-memory extensions:
> (XEN) HVM1:   Relocating to 0xfc000000-0xfc002e7c ... done
> (XEN) HVM1: Creating MP tables ...
> (XEN) HVM1: Loading Gfx Video BIOS from file ...
> (XEN) HVM1: Loading PCI Option ROM ...
> (XEN) HVM1:  - Manufacturer:http://etherboot.org
> (XEN) HVM1:  - Product name: gPXE
> (XEN) HVM1: Loading ACPI ...
> (XEN) HVM1:  - Lo data: 000ea020-000ea04f
> (XEN) HVM1:  - Hi data: fc003000-fc0125cf
> (XEN) HVM1: vm86 TSS at fc012800
> (XEN) HVM1: BIOS map:
> (XEN) HVM1:  c8000-d47ff: Etherboot ROM
> (XEN) HVM1:  eb000-eb14e: SMBIOS tables
> (XEN) HVM1:  f0000-fffff: Main BIOS
> (XEN) HVM1: Invoking ROMBIOS ...
> (XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
> (XEN) HVM1: Bochs BIOS - build: 06/23/99
> (XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
> (XEN) HVM1: Options: apmbios pcibios eltorito PMM
> (XEN) HVM1:
> (XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
> (XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (51200 MBytes)
> (XEN) HVM1: IDE time out
> (XEN) HVM1: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
> (XEN) HVM1: IDE time out
> (XEN) HVM1:
> (XEN) HVM1:
> (XEN) HVM1:
> (XEN) HVM1: Press F12 for boot menu.
> (XEN) HVM1:
> (XEN) HVM1: Booting from Hard Disk...
> (XEN) HVM1: Booting from 0000:7c00
> (XEN) HVM1: int13_harddisk: function 15, unmapped device for ELDL=81
> (XEN) HVM1: *** int 15h function AX=e980, BX=006e not yet supported!
> (XEN) mce.c:694:d1 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:714:d1 MCE: rdmsr MC0_CTL 0xffffffffffffffff
> (XEN) mce.c:694:d1 MCE: rdmsr MCG_CAP 0x806
> (XEN) irq.c:243: Dom1 PCI link 0 changed 5 ->  0
> (XEN) irq.c:243: Dom1 PCI link 1 changed 10 ->  0
> (XEN) irq.c:243: Dom1 PCI link 2 changed 11 ->  0
> (XEN) irq.c:243: Dom1 PCI link 3 changed 5 ->  0
> (XEN) domctl.c:846:d0 memory_map:remove: gfn=f3000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:846:d0 memory_map:remove: gfn=e0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:846:d0 memory_map:remove: gfn=f0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:911:d0 ioport_map:remove f_gport=c200 f_mport=d000 np=80
> (XEN) domctl.c:836:d0 memory_map:add: gfn=f3000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=e0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=f0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=c200 f_mport=d000 np=80
> (XEN) domctl.c:846:d0 memory_map:remove: gfn=f3000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:846:d0 memory_map:remove: gfn=e0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:846:d0 memory_map:remove: gfn=f0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:911:d0 ioport_map:remove f_gport=c200 f_mport=d000 np=80
> (XEN) domctl.c:836:d0 memory_map:add: gfn=f3000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=e0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=f0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=c200 f_mport=d000 np=80
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
>
> -- 
> 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@hotmail.com
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
> On 08/29/2009 09:46 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>> Dear All,
>>
>> I have attached the patchset to xen-unstable and also the nvidia 
>> geforce 8400 gs firmware file here for your convenience.
>>
>> You can refer to the screenshots at my blog here: 
>> http://teo-en-ming-aka-zhang-enming.blogspot.com/2009/08/windows-xp-home-domu-test-results-after.html
>>
>> It shows that the emulated virtual VGA card is now disabled (not 
>> appearing in Windows XP Home DomU's device manager) and only the 
>> nVidia Geforce 8400 GS VGA BIOS gets loaded.
>>
>> -- 
>> 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@hotmail.com
>> Alma Maters: Singapore Polytechnic, National University of Singapore
>>
>>
>> On 08/29/2009 09:20 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>>> 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@hotmail.com
>>> 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@asiasoftsea.net
>>>> Email #2: space.time.universe@gmail.com
>>>> MSN: teoenming@hotmail.com
>>>> 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@hotmail.com
>>>> Alma Maters: Singapore Polytechnic, National University of Singapore
>>>>
>>>>
>>>> On 08/29/2009 07:03 PM, Mr. Teo En Ming (Zhang Enming) wrote:
>>>>> Hi,
>>>>>
>>>>> I clonedhttp://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@hotmail.com
>>>>> 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@hotmail.com
>>>>>> 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@hotmail.com
>>>>>>> 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@hotmail.com
>>>>>>>> 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@lists.xensource.com 
>>>>>>>>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of 
>>>>>>>>> *Mr. Teo En Ming (Zhang Enming)
>>>>>>>>> *Sent:* 28 August 2009 21:14
>>>>>>>>> *To:* enming.teo@asiasoftsea.net
>>>>>>>>> *Cc:* xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay, Allen 
>>>>>>>>> M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com; 
>>>>>>>>> weidong.han@intel.com; bengheng@eecs.umich.edu
>>>>>>>>> *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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>>>> 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.
>>>>>>>>>   
>>>>>>>>> Seehttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>>>> 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 
>>>>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> 
>>>>>>>>> and qemu-gfx-passthrough.patch 
>>>>>>>>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 
>>>>>>>>> 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]# wgethttp://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]# wgethttp://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@hotmail.com  <mailto:teoenming@hotmail.com>
>>>>>>>>> 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@intel.com>  <mailto:ben.y.lin@intel.com>
>>>>>>>>>
>>>>>>>>>     Signed-off-by: Weidong Han<weidong.han@intel.com>  <mailto:weidong.han@intel.com>
>>>>>>>>>
>>>>>>>>>     No virus found in this incoming message.
>>>>>>>>>
>>>>>>>>>     Checked by AVG -www.avg.com  <http://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  <http://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@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>>>>
>>>>>>>>>     http://lists.xensource.com/xen-devel
>>>>>>>>>
>>>>>>>>>        
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>    
>>>>>>>>>   
>>>>>>>>> _______________________________________________
>>>>>>>>> Xen-devel mailing list
>>>>>>>>> Xen-devel@lists.xensource.com  <mailto:Xen-devel@lists.xensource.com>
>>>>>>>>> http://lists.xensource.com/xen-devel
>>>>>>>>>    
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Xen-devel mailing list
>>>>>>>> Xen-devel@lists.xensource.com
>>>>>>>> http://lists.xensource.com/xen-devel
>>>>>>>>    
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>
>
My Dom 0 is working fine as long as I don't start X server.

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore


[-- Attachment #1.2: Type: text/html, Size: 82026 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-29 10:41             ` Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4 Boris Derzhavets
  2009-08-29 11:05               ` Boris Derzhavets
@ 2009-08-29 15:17               ` Boris Derzhavets
  2009-08-30  9:32                 ` Boris Derzhavets
  2009-08-30 13:26                 ` Christian Tramnitz
  1 sibling, 2 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-29 15:17 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 630 bytes --]

Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
Attempt to build Xen from source and xenified kernel succeeded.
Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.

Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
 
 Xen 3.4.1 Ubuntu 9.10 {
multiboot (hd0,1)/xen-3.4.gz
module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
module    (hd0,1)/initrd-2.6.30.2.img
}

Failure when waiting for /dev/sda2 and dropping to grub prompt

HVM itself loads fine.

Boris.





      

[-- Attachment #1.2: Type: text/html, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-29 15:17               ` Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
@ 2009-08-30  9:32                 ` Boris Derzhavets
  2009-08-30 12:44                   ` Keir Fraser
  2009-08-30 13:26                 ` Christian Tramnitz
  1 sibling, 1 reply; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30  9:32 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2098 bytes --]

  I've got same problems after setup Xen 3.4.1 Xen Dom0 ( with 2.6.31-rc5 pvops) on
top of Ubuntu 9.10 Server,had been installed on bare metal.

   It appears to be known issue with Grub2 when loading Xen host and came up
already on Debian Lenny.

 In case of Ubuntu 9.10 Server Xen host loading started and dropped to grub prompt
after gave up waiting for root device.

menuentry "Xen 3.4.1 Ubuntu 9.10"  {
set root (hd0,1)
multiboot (hd0,1)/xen-3.4.gz
module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
module    (hd0,1)/initrd-2.6.30.2.img
}

generated via /etc/grub.d/40_custom editing and running update-grub

Directive "root=UUID=...." switched off via editing /etc/default/grub and update-grub
run.
Seems to be Grub2's  multiboot implementation issue. 
 Grub2 breaks backward compatibility in meantime per my opinion.
Please, advise if i am wrong about that.

Boris

--- On Sat, 8/29/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: [Xen-devel] Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Date: Saturday, August 29, 2009, 11:17 AM

Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
Attempt to build Xen from source and xenified kernel succeeded.
Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.

Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
 
 Xen 3.4.1 Ubuntu 9.10 {
multiboot (hd0,1)/xen-3.4.gz
module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
module    (hd0,1)/initrd-2.6.30.2.img
}

Failure when waiting for /dev/sda2 and dropping to grub prompt

HVM itself loads fine.

Boris.







      
-----Inline Attachment Follows-----

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



      

[-- Attachment #1.2: Type: text/html, Size: 3136 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30  9:32                 ` Boris Derzhavets
@ 2009-08-30 12:44                   ` Keir Fraser
  2009-08-30 13:19                     ` Boris Derzhavets
  2009-08-30 17:55                     ` Ian Pratt
  0 siblings, 2 replies; 66+ messages in thread
From: Keir Fraser @ 2009-08-30 12:44 UTC (permalink / raw)
  To: Boris Derzhavets, xen-devel

On 30/08/2009 10:32, "Boris Derzhavets" <bderzhavets@yahoo.com> wrote:

> Directive "root=UUID=...." switched off via editing /etc/default/grub and
> update-grub
> run.
> Seems to be Grub2's  multiboot implementation issue.
>  Grub2 breaks backward compatibility in meantime per my opinion.
> Please, advise if i am wrong about that.

Well, it might be a bug in Xen's interpretation of the multiboot spec of
course. The basic issue is that no Xen developer has tested GRUB2, and no
GRUB2 developer has tested Xen. :-) No doubt this will get fixed if GRUB2
gains traction.

 -- Keir

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 12:44                   ` Keir Fraser
@ 2009-08-30 13:19                     ` Boris Derzhavets
  2009-08-30 17:55                     ` Ian Pratt
  1 sibling, 0 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 13:19 UTC (permalink / raw)
  To: xen-devel, Keir Fraser


[-- Attachment #1.1: Type: text/plain, Size: 1529 bytes --]

> no Xen developer has tested GRUB2

Googling clearly shows , that a lot of Xen USERS have
been experienced similar issues on Debian 5 aka Lenny.
However , workaround seems to be Debian dependent  -
-  http://www.mail-archive.com/grub-devel@gnu.org/msg10870.html

For now i just add to kernel boot command line :-
 
 grub-installer/grub_2_instead_of_grub_legacy=false

pressing F6 at startup menu allows to modify linux boot command line
and get Ubuntu 9.10 Server installed with legacy grub.

Boris.

--- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:

From: Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: [Xen-devel] Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9..10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: "Boris Derzhavets" <bderzhavets@yahoo.com>, "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Date: Sunday, August 30, 2009, 8:44 AM

On 30/08/2009 10:32, "Boris Derzhavets" <bderzhavets@yahoo.com> wrote:

> Directive "root=UUID=...." switched off via editing /etc/default/grub and
> update-grub
> run.
> Seems to be Grub2's  multiboot implementation issue.
>  Grub2 breaks backward compatibility in meantime per my opinion.
> Please, advise if i am wrong about that.

Well, it might be a bug in Xen's interpretation of the multiboot spec of
course. The basic issue is that no Xen developer has tested GRUB2, and no
GRUB2 developer has tested Xen. :-) No doubt this will get fixed if GRUB2
gains traction.

 -- Keir





      

[-- Attachment #1.2: Type: text/html, Size: 2056 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-29 15:17               ` Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
  2009-08-30  9:32                 ` Boris Derzhavets
@ 2009-08-30 13:26                 ` Christian Tramnitz
  2009-08-30 15:17                   ` Boris Derzhavets
                                     ` (3 more replies)
  1 sibling, 4 replies; 66+ messages in thread
From: Christian Tramnitz @ 2009-08-30 13:26 UTC (permalink / raw)
  To: xen-devel

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro 
console=tty0" to the kernel in multiboot/module combination. I have seen 
the same problem on gentoo/grub2 and also read about this before. (This 
is not really Xen specific, but multiboot related).
My workaround was to compile the kernel options as static cmdline into 
the kernel itself...

Best regards,
    Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  
> switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>  
>  Xen 3.4.1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 13:26                 ` Christian Tramnitz
@ 2009-08-30 15:17                   ` Boris Derzhavets
  2009-08-30 15:53                     ` Boris Derzhavets
  2009-08-30 15:50                   ` Keir Fraser
                                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 15:17 UTC (permalink / raw)
  To: xen-devel, Christian Tramnitz


[-- Attachment #1.1: Type: text/plain, Size: 1924 bytes --]

>My workaround was to compile the kernel options as static cmdline into 
> the kernel itself...

Never did it, but your idea is very clear.
Could you provide any link ( manual ) how to build linux kernel with static command line ? Might be somewhere in menuconfig ?

Thanks any way.
Boris.
P.S. I've already made sure that Karmic Server works fine with legacy
grub installed.


--- On Sun, 8/30/09, Christian Tramnitz <chris.ace@gmx.net> wrote:

From: Christian Tramnitz <chris.ace@gmx.net>
Subject: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9..10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com
Date: Sunday, August 30, 2009, 9:26 AM

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro console=tty0" to the kernel in multiboot/module combination. I have seen the same problem on gentoo/grub2 and also read about this before. (This is not really Xen specific, but multiboot related).
My workaround was to compile the kernel options as static cmdline into the kernel itself...

Best regards,
   Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>   Xen 3.4.1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.


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



      

[-- Attachment #1.2: Type: text/html, Size: 2594 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 13:26                 ` Christian Tramnitz
  2009-08-30 15:17                   ` Boris Derzhavets
@ 2009-08-30 15:50                   ` Keir Fraser
  2009-08-30 16:22                     ` Boris Derzhavets
  2009-08-30 18:14                   ` Failure to start Xen >3.4.1 and xen-3.5-unstable Dom0 using GRUB2 Tim Moore
  2009-08-30 18:19                   ` Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
  3 siblings, 1 reply; 66+ messages in thread
From: Keir Fraser @ 2009-08-30 15:50 UTC (permalink / raw)
  To: Christian Tramnitz, xen-devel

On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net> wrote:

> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
> console=tty0" to the kernel in multiboot/module combination. I have seen
> the same problem on gentoo/grub2 and also read about this before. (This
> is not really Xen specific, but multiboot related).

Okay, that would clearly be a GRUB regression I think. But there is a simple
enough less ugly workaround than you suggest...

> My workaround was to compile the kernel options as static cmdline into
> the kernel itself...

Better solution would be to append dom0's options to Xen's own command line,
separated by --. E.g.,
multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0

 -- Keir

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 15:17                   ` Boris Derzhavets
@ 2009-08-30 15:53                     ` Boris Derzhavets
  0 siblings, 0 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 15:53 UTC (permalink / raw)
  To: xen-devel, Christian Tramnitz


[-- Attachment #1.1: Type: text/plain, Size: 2809 bytes --]

 [*] Built-in kernel command line                                                       │ │  
  │ │                (root=/dev/sda14 ro console=tty0) Built-in kernel command string  

I believe i am close

Boris.
--- On Sun, 8/30/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com, "Christian Tramnitz" <chris.ace@gmx.net>
Date: Sunday, August 30, 2009, 11:17 AM

>My workaround was to compile the kernel options as static cmdline into 
> the kernel itself...

Never did it, but your idea is very clear.
Could you provide any link ( manual ) how to build linux kernel with static command line ? Might be somewhere in menuconfig ?

Thanks any way.
Boris.
P.S. I've already made sure that Karmic Server works fine with legacy
grub installed.


--- On Sun, 8/30/09, Christian Tramnitz <chris.ace@gmx.net> wrote:

From: Christian Tramnitz <chris.ace@gmx.net>
Subject: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9..10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com
Date: Sunday, August 30, 2009, 9:26
 AM

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro console=tty0" to the kernel in multiboot/module combination. I have seen the same problem on gentoo/grub2 and also read about this before. (This is not really Xen specific, but multiboot related)..
My workaround was to compile the kernel options as static cmdline into the kernel itself...

Best regards,
   Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3..4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>   Xen 3.4..1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module 
   (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.


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





      
-----Inline Attachment Follows-----

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



      

[-- Attachment #1.2: Type: text/html, Size: 4416 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 15:50                   ` Keir Fraser
@ 2009-08-30 16:22                     ` Boris Derzhavets
  2009-08-30 16:41                       ` Keir Fraser
  0 siblings, 1 reply; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 16:22 UTC (permalink / raw)
  To: Christian Tramnitz, xen-devel, Keir Fraser


[-- Attachment #1.1: Type: text/plain, Size: 1420 bytes --]

I've tested both options.

Chris's one works with Grub2, Keir's doesn't. 
Distro Ubuntu 9.10 Server (alpha 4.)

Thanks.
Boris.

--- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:

From: Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: "Christian Tramnitz" <chris.ace@gmx.net>, "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Date: Sunday, August 30, 2009, 11:50 AM

On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net> wrote:

> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
> console=tty0" to the kernel in multiboot/module combination. I have seen
> the same problem on gentoo/grub2 and also read about this before. (This
> is not really Xen specific, but multiboot related).

Okay, that would clearly be a GRUB regression I think. But there is a simple
enough less ugly workaround than you suggest...

> My workaround was to compile the kernel options as static cmdline into
> the kernel itself...

Better solution would be to append dom0's options to Xen's own command line,
separated by --. E.g.,
multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0

 -- Keir



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



      

[-- Attachment #1.2: Type: text/html, Size: 2119 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 16:22                     ` Boris Derzhavets
@ 2009-08-30 16:41                       ` Keir Fraser
  2009-08-30 16:55                         ` Keir Fraser
  0 siblings, 1 reply; 66+ messages in thread
From: Keir Fraser @ 2009-08-30 16:41 UTC (permalink / raw)
  To: Boris Derzhavets, Christian Tramnitz, xen-devel

Mine should, if GRUB2 passes through Xen's command line.

 -- Keir

On 30/08/2009 17:22, "Boris Derzhavets" <bderzhavets@yahoo.com> wrote:

> I've tested both options.
> 
> Chris's one works with Grub2, Keir's doesn't.
> Distro Ubuntu 9.10 Server (alpha 4.)
> 
> Thanks.
> Boris.
> 
> --- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
>> 
>> From: Keir Fraser <keir.fraser@eu.citrix.com>
>> Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu
>> 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
>> To: "Christian Tramnitz" <chris.ace@gmx.net>, "xen-devel@lists.xensource.com"
>> <xen-devel@lists.xensource.com>
>> Date: Sunday, August 30, 2009, 11:50 AM
>> 
>> On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net
>> </mc/compose?to=chris.ace@gmx.net> > wrote:
>> 
>>> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
>>> console=tty0" to the kernel in multiboot/module combination. I have seen
>>> the same problem on gentoo/grub2 and also read about this before. (This
>>> is not really Xen specific, but multiboot related).
>> 
>> Okay, that would clearly be a GRUB regression I think. But there is a simple
>> enough less ugly workaround than you suggest...
>> 
>>> My workaround was to compile the kernel options as static cmdline into
>>> the kernel itself...
>> 
>> Better solution would be to append dom0's options to Xen's own command line,
>> separated by --. E.g.,
>> multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0
>> 
>>  -- Keir
>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com </mc/compose?to=Xen-devel@lists.xensource.com>
>> http://lists.xensource.com/xen-devel
> 
>  

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 16:41                       ` Keir Fraser
@ 2009-08-30 16:55                         ` Keir Fraser
  2009-08-30 17:10                           ` Boris Derzhavets
  0 siblings, 1 reply; 66+ messages in thread
From: Keir Fraser @ 2009-08-30 16:55 UTC (permalink / raw)
  To: Keir Fraser, Boris Derzhavets, Christian Tramnitz, xen-devel

Perhaps we've got the grub.cfg syntax for specifying multiboot kernel/module
command-line options wrong. Unfortunately I can't find any documentation
describing what the syntax is for multiboot config entries.

 -- Keir

On 30/08/2009 17:41, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:

> Mine should, if GRUB2 passes through Xen's command line.
> 
>  -- Keir
> 
> On 30/08/2009 17:22, "Boris Derzhavets" <bderzhavets@yahoo.com> wrote:
> 
>> I've tested both options.
>> 
>> Chris's one works with Grub2, Keir's doesn't.
>> Distro Ubuntu 9.10 Server (alpha 4.)
>> 
>> Thanks.
>> Boris.
>> 
>> --- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
>>> 
>>> From: Keir Fraser <keir.fraser@eu.citrix.com>
>>> Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of
>>> Ubuntu
>>> 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
>>> To: "Christian Tramnitz" <chris.ace@gmx.net>,
>>> "xen-devel@lists.xensource.com"
>>> <xen-devel@lists.xensource.com>
>>> Date: Sunday, August 30, 2009, 11:50 AM
>>> 
>>> On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net
>>> </mc/compose?to=chris.ace@gmx.net> > wrote:
>>> 
>>>> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
>>>> console=tty0" to the kernel in multiboot/module combination. I have seen
>>>> the same problem on gentoo/grub2 and also read about this before. (This
>>>> is not really Xen specific, but multiboot related).
>>> 
>>> Okay, that would clearly be a GRUB regression I think. But there is a simple
>>> enough less ugly workaround than you suggest...
>>> 
>>>> My workaround was to compile the kernel options as static cmdline into
>>>> the kernel itself...
>>> 
>>> Better solution would be to append dom0's options to Xen's own command line,
>>> separated by --. E.g.,
>>> multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0
>>> 
>>>  -- Keir
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com </mc/compose?to=Xen-devel@lists.xensource.com>
>>> http://lists.xensource.com/xen-devel
>> 
>>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 16:55                         ` Keir Fraser
@ 2009-08-30 17:10                           ` Boris Derzhavets
  2009-08-30 17:49                             ` Keir Fraser
  0 siblings, 1 reply; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 17:10 UTC (permalink / raw)
  To: Keir Fraser, Christian Tramnitz, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2989 bytes --]

I believe passing parameters via xen.gz command line will become extremely important for any distro with grub2 like  Ubuntu Karmic Server.

Boris.

--- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:

From: Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: "Keir Fraser" <keir.fraser@eu.citrix.com>, "Boris Derzhavets" <bderzhavets@yahoo.com>, "Christian Tramnitz" <chris.ace@gmx.net>, "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Date: Sunday, August 30, 2009, 12:55 PM

Perhaps we've got the grub.cfg syntax for specifying multiboot kernel/module
command-line options wrong. Unfortunately I can't find any documentation
describing what the syntax is for multiboot config entries.

 -- Keir

On 30/08/2009 17:41, "Keir Fraser" <keir.fraser@eu.citrix.com> wrote:

> Mine should, if GRUB2 passes through Xen's command line.
> 
>  -- Keir
> 
> On 30/08/2009 17:22, "Boris Derzhavets" <bderzhavets@yahoo.com> wrote:
> 
>> I've tested both options.
>> 
>> Chris's one works with Grub2, Keir's doesn't.
>> Distro Ubuntu 9.10 Server (alpha 4.)
>> 
>> Thanks.
>> Boris.
>> 
>> --- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
>>> 
>>> From: Keir Fraser <keir.fraser@eu.citrix.com>
>>> Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of
>>> Ubuntu
>>> 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
>>> To: "Christian Tramnitz" <chris.ace@gmx.net>,
>>> "xen-devel@lists.xensource.com"
>>> <xen-devel@lists.xensource.com>
>>> Date: Sunday, August 30, 2009, 11:50 AM
>>> 
>>> On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net
>>> </mc/compose?to=chris.ace@gmx.net> > wrote:
>>> 
>>>> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
>>>> console=tty0" to the kernel in multiboot/module combination. I have seen
>>>> the same problem on gentoo/grub2 and also read about this before. (This
>>>> is not really Xen specific, but multiboot related).
>>> 
>>> Okay, that would clearly be a GRUB regression I think. But there is a simple
>>> enough less ugly workaround than you suggest...
>>> 
>>>> My workaround was to compile the kernel options as static cmdline into
>>>> the kernel itself...
>>> 
>>> Better solution would be to append dom0's options to Xen's own command line,
>>> separated by --. E.g.,
>>> multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0
>>> 
>>>  -- Keir
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com </mc/compose?to=Xen-devel@lists.xensource.com>
>>> http://lists.xensource.com/xen-devel
>> 
>>  
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel





      

[-- Attachment #1.2: Type: text/html, Size: 5283 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 17:10                           ` Boris Derzhavets
@ 2009-08-30 17:49                             ` Keir Fraser
  0 siblings, 0 replies; 66+ messages in thread
From: Keir Fraser @ 2009-08-30 17:49 UTC (permalink / raw)
  To: Boris Derzhavets, Christian Tramnitz, xen-devel

Well, yeah... Good point ;-)

 -- Keir

On 30/08/2009 18:10, "Boris Derzhavets" <bderzhavets@yahoo.com> wrote:

> I believe passing parameters via xen.gz command line will become extremely
> important for any distro with grub2 like  Ubuntu Karmic Server.
> 
> Boris.
> 
> --- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:
>> 
>> From: Keir Fraser <keir.fraser@eu.citrix.com>
>> Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu
>> 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
>> To: "Keir Fraser" <keir.fraser@eu.citrix.com>, "Boris Derzhavets"
>> <bderzhavets@yahoo.com>, "Christian Tramnitz" <chris.ace@gmx.net>,
>> "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
>> Date: Sunday, August 30, 2009, 12:55 PM
>> 
>> Perhaps we've got the grub.cfg syntax for specifying multiboot kernel/module
>> command-line options wrong. Unfortunately I can't find any documentation
>> describing what the syntax is for multiboot config entries.
>> 
>>  -- Keir
>> 
>> On 30/08/2009 17:41, "Keir Fraser" <keir.fraser@eu.citrix.com
>> </mc/compose?to=keir.fraser@eu.citrix.com> > wrote:
>> 
>>> Mine should, if GRUB2 passes through Xen's command line.
>>> 
>>>  -- Keir
>>> 
>>> On 30/08/2009 17:22, "Boris Derzhavets" <bderzhavets@yahoo.com
>>> </mc/compose?to=bderzhavets@yahoo.com> > wrote:
>>> 
>>>> I've tested both options.
>>>> 
>>>> Chris's one works with Grub2, Keir's doesn't.
>>>> Distro Ubuntu 9.10 Server (alpha 4.)
>>>> 
>>>> Thanks.
>>>> Boris.
>>>> 
>>>> --- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com
>>>> </mc/compose?to=keir..fraser@eu.citrix.com> > wrote:
>>>>> 
>>>>> From: Keir Fraser <keir.fraser@eu.citrix.com
>>>>> </mc/compose?to=keir.fraser@eu.citrix.com> >
>>>>> Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of
>>>>> Ubuntu
>>>>> 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
>>>>> To: "Christian Tramnitz" <chris.ace@gmx.net
>>>>> </mc/compose?to=chris.ace@gmx.net> >,
>>>>> "xen-devel@lists.xensource.com
>>>>> </mc/compose?to=xen-devel@lists.xensource.com> "
>>>>> <xen-devel@lists.xensource.com
>>>>> </mc/compose?to=xen-devel@lists.xensource.com> >
>>>>> Date: Sunday, August 30, 2009, 11:50 AM
>>>>> 
>>>>> On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net
>>>>> </mc/compose?to=chris..ace@gmx.net>
>>>>> </mc/compose?to=chris.ace@gmx.net </mc/compose?to=chris.ace@gmx.net> > >
>>>>> wrote:
>>>>> 
>>>>>> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
>>>>>> console=tty0" to the kernel in multiboot/module combination. I have seen
>>>>>> the same problem on gentoo/grub2 and also read about this before. (This
>>>>>> is not really Xen specific, but multiboot related).
>>>>> 
>>>>> Okay, that would clearly be a GRUB regression I think. But there is a
>>>>> simple
>>>>> enough less ugly workaround than you suggest...
>>>>> 
>>>>>> My workaround was to compile the kernel options as static cmdline into
>>>>>> the kernel itself...
>>>>> 
>>>>> Better solution would be to append dom0's options to Xen's own command
>>>>> line,
>>>>> separated by --. E.g.,
>>>>> multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0
>>>>> 
>>>>>  -- Keir
>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Xen-devel mailing list
>>>>> Xen-devel@lists.xensource.com
>>>>> </mc/compose?to=Xen-devel@lists.xensource.com>
>>>>> </mc/compose?to=Xen-devel@lists.xensource.com
>>>>> </mc/compose?to=Xen-devel@lists.xensource.com> >
>>>>> http://lists.xensource.com/xen-devel
>>>> 
>>>>  
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com </mc/compose?to=Xen-devel@lists.xensource.com>
>>> http://lists.xensource.com/xen-devel
>> 
>> 
> 
>  

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 12:44                   ` Keir Fraser
  2009-08-30 13:19                     ` Boris Derzhavets
@ 2009-08-30 17:55                     ` Ian Pratt
  2009-08-30 18:17                       ` Tim Moore
  1 sibling, 1 reply; 66+ messages in thread
From: Ian Pratt @ 2009-08-30 17:55 UTC (permalink / raw)
  To: Keir Fraser, Boris Derzhavets, xen-devel; +Cc: Ian Pratt

> > Directive "root=UUID=...." switched off via editing /etc/default/grub
> and
> > update-grub
> > run.
> > Seems to be Grub2's  multiboot implementation issue.
> >  Grub2 breaks backward compatibility in meantime per my opinion.
> > Please, advise if i am wrong about that.
> 
> Well, it might be a bug in Xen's interpretation of the multiboot spec of
> course. The basic issue is that no Xen developer has tested GRUB2, and no
> GRUB2 developer has tested Xen. :-) No doubt this will get fixed if GRUB2
> gains traction.

The xen client XCI tree uses grub2. I seem to recall there was a bug that needed fixing in grub2 to make it work reliably, but I thought this was up-streamed. It's worth looking to see if there are any grub2 related patches in the XCI tree, though.

Ian 

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Failure to start Xen >3.4.1 and xen-3.5-unstable Dom0 using GRUB2
  2009-08-30 13:26                 ` Christian Tramnitz
  2009-08-30 15:17                   ` Boris Derzhavets
  2009-08-30 15:50                   ` Keir Fraser
@ 2009-08-30 18:14                   ` Tim Moore
  2009-08-30 18:19                   ` Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
  3 siblings, 0 replies; 66+ messages in thread
From: Tim Moore @ 2009-08-30 18:14 UTC (permalink / raw)
  To: 'xen-devel@lists.xensource.com'; +Cc: 'Christian Tramnitz'

[-- Attachment #1: Type: text/plain, Size: 2520 bytes --]

Hi Christian/All,

I have a similar issue with GRUB2 .. I was using grub-legacy for a while, until I switched to using XCI (Xen Client Initiative) which comes as standard with a GRUB2. (no option for alternative, as XCI uses LVM so must use GRUB2)

Then I also try GRUB2 multiboot with latest xen-unstable/pvops and received the attached error .. (jpg)
"Cannot access memory beyond the end of bootstrap direct-map area"

Therefore I have switched back to grub-legacy (0.97) and xen-unstable/pvops boots fine !

ATMO I am unable to boot XCI as grub-legacy does not support LVM - I am now looking to chainload GRUB>GRUB2 to enable me to start XCI.

With earlier version of xen-unstable, I was able to boot successfully. There has been a change in XEN that has broken compatibility with the (incomplete) GRUB2 multiboot specification. I would therefore say that GRUB2 needs the bugfix, but its XEN that actually broke compatibility.

Rgds,
Tim

-----Original Message-----
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Christian Tramnitz
Sent: 30 August 2009 14:26
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro 
console=tty0" to the kernel in multiboot/module combination. I have seen 
the same problem on gentoo/grub2 and also read about this before. (This 
is not really Xen specific, but multiboot related).
My workaround was to compile the kernel options as static cmdline into 
the kernel itself...

Best regards,
    Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  
> switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>  
>  Xen 3.4.1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.


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

[-- Attachment #2: boot_with_grub2.jpg --]
[-- Type: image/jpeg, Size: 154000 bytes --]

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 17:55                     ` Ian Pratt
@ 2009-08-30 18:17                       ` Tim Moore
  2009-08-30 18:32                         ` Keir Fraser
  0 siblings, 1 reply; 66+ messages in thread
From: Tim Moore @ 2009-08-30 18:17 UTC (permalink / raw)
  To: 'Ian Pratt', Keir Fraser, Boris Derzhavets, xen-devel

I use grub2 from XCI and still have boot issue ..
"Cannot access memory beyond the end of bootstrap direct-map area"

grub-legacy is fine ..

-----Original Message-----
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ian Pratt
Sent: 30 August 2009 18:55
To: Keir Fraser; Boris Derzhavets; xen-devel@lists.xensource.com
Cc: Ian Pratt
Subject: RE: [Xen-devel] Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)

> > Directive "root=UUID=...." switched off via editing /etc/default/grub
> and
> > update-grub
> > run.
> > Seems to be Grub2's  multiboot implementation issue.
> >  Grub2 breaks backward compatibility in meantime per my opinion.
> > Please, advise if i am wrong about that.
> 
> Well, it might be a bug in Xen's interpretation of the multiboot spec of
> course. The basic issue is that no Xen developer has tested GRUB2, and no
> GRUB2 developer has tested Xen. :-) No doubt this will get fixed if GRUB2
> gains traction.

The xen client XCI tree uses grub2. I seem to recall there was a bug that needed fixing in grub2 to make it work reliably, but I thought this was up-streamed. It's worth looking to see if there are any grub2 related patches in the XCI tree, though.

Ian 

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 13:26                 ` Christian Tramnitz
                                     ` (2 preceding siblings ...)
  2009-08-30 18:14                   ` Failure to start Xen >3.4.1 and xen-3.5-unstable Dom0 using GRUB2 Tim Moore
@ 2009-08-30 18:19                   ` Boris Derzhavets
  2009-08-31  7:17                     ` Boris Derzhavets
  3 siblings, 1 reply; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 18:19 UTC (permalink / raw)
  To: xen-devel, Christian Tramnitz


[-- Attachment #1.1: Type: text/plain, Size: 1746 bytes --]

It does help for 2.6.30.2  xenified aka Suse kernel( via Andy Lyon's Patch Set V.3)  and doesn't help for 2.6.31-rc5 pvops enabled kernel.
I can't build  fresh 2-6-31-rc6 at the moment. Make fails.

Boris.

--- On Sun, 8/30/09, Christian Tramnitz <chris.ace@gmx.net> wrote:

From: Christian Tramnitz <chris.ace@gmx.net>
Subject: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9..10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com
Date: Sunday, August 30, 2009, 9:26 AM

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro console=tty0" to the kernel in multiboot/module combination. I have seen the same problem on gentoo/grub2 and also read about this before. (This is not really Xen specific, but multiboot related).
My workaround was to compile the kernel options as static cmdline into the kernel itself...

Best regards,
   Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>   Xen 3.4.1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.


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



      

[-- Attachment #1.2: Type: text/html, Size: 2403 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 18:17                       ` Tim Moore
@ 2009-08-30 18:32                         ` Keir Fraser
  0 siblings, 0 replies; 66+ messages in thread
From: Keir Fraser @ 2009-08-30 18:32 UTC (permalink / raw)
  To: Tim Moore, Ian Pratt, Boris Derzhavets, xen-devel

Do you use 32-bit Xen? Could you use 64-bit Xen instead? I think the latter
will work for you, and if it doesn't then we'll fix it, whereas this may not
get fixed for 32-bit Xen.

 -- Keir

On 30/08/2009 19:17, "Tim Moore" <timothy.moore@expidas.net> wrote:

> I use grub2 from XCI and still have boot issue ..
> "Cannot access memory beyond the end of bootstrap direct-map area"
> 
> grub-legacy is fine ..
> 
> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ian Pratt
> Sent: 30 August 2009 18:55
> To: Keir Fraser; Boris Derzhavets; xen-devel@lists.xensource.com
> Cc: Ian Pratt
> Subject: RE: [Xen-devel] Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10
> Server HVM DomU ( 2.6.30.2 xenified kernel)
> 
>>> Directive "root=UUID=...." switched off via editing /etc/default/grub
>> and
>>> update-grub
>>> run.
>>> Seems to be Grub2's  multiboot implementation issue.
>>>  Grub2 breaks backward compatibility in meantime per my opinion.
>>> Please, advise if i am wrong about that.
>> 
>> Well, it might be a bug in Xen's interpretation of the multiboot spec of
>> course. The basic issue is that no Xen developer has tested GRUB2, and no
>> GRUB2 developer has tested Xen. :-) No doubt this will get fixed if GRUB2
>> gains traction.
> 
> The xen client XCI tree uses grub2. I seem to recall there was a bug that
> needed fixing in grub2 to make it work reliably, but I thought this was
> up-streamed. It's worth looking to see if there are any grub2 related patches
> in the XCI tree, though.
> 
> Ian 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
  2009-08-30 18:19                   ` Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
@ 2009-08-31  7:17                     ` Boris Derzhavets
  0 siblings, 0 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-31  7:17 UTC (permalink / raw)
  To: xen-devel, Christian Tramnitz


[-- Attachment #1.1: Type: text/plain, Size: 2484 bytes --]

The most recent build 2.6.31-rc6 compiled with static cmd line per Chris
works as well as xenified kernels via GRUB2 menuentry on Ubuntu 9.10 Server (alpha 4)

Boris

--- On Sun, 8/30/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com, "Christian Tramnitz" <chris.ace@gmx.net>
Date: Sunday, August 30, 2009, 2:19 PM

It does help for 2.6.30.2  xenified aka Suse kernel( via Andy Lyon's Patch Set V.3)  and doesn't help for 2.6.31-rc5 pvops enabled kernel.
I can't build  fresh 2-6-31-rc6 at the moment. Make fails.

Boris.

--- On Sun, 8/30/09, Christian Tramnitz <chris.ace@gmx.net> wrote:

From: Christian Tramnitz <chris.ace@gmx.net>
Subject: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9..10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com
Date: Sunday, August 30, 2009, 9:26 AM

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro console=tty0" to the kernel in multiboot/module combination. I have seen the same problem on
 gentoo/grub2 and also read about this before. (This is not really Xen specific, but multiboot related).
My workaround was to compile the kernel options as static cmdline into the kernel itself...

Best regards,
   Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>   Xen 3.4.1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping
 to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.


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



      
-----Inline Attachment Follows-----

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



      

[-- Attachment #1.2: Type: text/html, Size: 3802 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: graphics passthrough with VT-d
  2009-08-29 14:12                       ` Mr. Teo En Ming (Zhang Enming)
  2009-08-29 14:48                         ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-31  8:47                         ` Han, Weidong
  2009-08-31 14:54                           ` Mr. Teo En Ming (Zhang Enming)
                                             ` (2 more replies)
  1 sibling, 3 replies; 66+ messages in thread
From: Han, Weidong @ 2009-08-31  8:47 UTC (permalink / raw)
  To: 'enming.teo@asiasoftsea.net',
	'timothy.moore@expidas.net'
  Cc: 'xen-devel@lists.xensource.com'


[-- Attachment #1.1: Type: text/plain, Size: 37443 bytes --]

Teo,

I attached some experimental patches for you to try to sthorugh Geforce 8400 GS.

Based on my patches posted last Friday, pls follow below instructions:
1. apply xen-load-vbios-file.patch to xen-unstable.hg
    this patch supports to load vga bios from a file.
2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
    this patch is used to 1:1 map between vBAR and pBAR
3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
    this patch is used to 1:1 map between vBAR and pBAR on qemu side
4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
    it's needed if you want to assign the secondary gfx to guest.
5. cd xen-unstable.hg
6. make clean
7. copy the vga bios file to xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
8. make; make install
9. reboot the system. or xend restart. then passthrough gfx to guest ...


Regards,
Weidong


________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 2009年8月29日 22:13
To: timothy.moore@expidas.net
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] graphics passthrough with VT-d

Hi Timothy,

Yes, I renamed the firmware file of nVidia Geforce 8400 GS to vgabios-pt.bin and placed it in the source directory tools/firmware/vgabios.

Weidong had said Intel has the 1:1 mapping patches. Let's hope he will release the patch soon to do pBAR:vBAR.


--
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@hotmail.com<mailto:teoenming@hotmail.com>
Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 09:29 PM, Tim Moore wrote:
Teo,
Did you rename your Nvidia BIOS and copy it into the hvmloader source tree as required ?
It should get compiled into roms.h in the hvmloader folder - I made sure it was there as the xen buildroot seems to delete it randomly ...
I think we are now up against the Base Address Register issue where the Nvidia driver is expecting to see the card at the Physical BAR Addresses and in the DomU these are re-mapped to different address space ... this is a problem with the Nvidia binary driver and therefore a workaround in xen is maybe needed.
That said, I'm not sure if the Nvidia BIOS likes to be re-executed and may also be an issue ...
Tim
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 29 August 2009 14:21
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: Tim Moore; xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] graphics passthrough with VT-d
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@hotmail.com<mailto:teoenming@hotmail.com>

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..@..["<mailto:GA..@..%5B> */
    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@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Email #2: space.time.universe@gmail.com<mailto:space.time.universe@gmail.com>
MSN: teoenming@hotmail.com<mailto:teoenming@hotmail.com>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com<mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel






________________________________












_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel











________________________________






_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel





[-- Attachment #1.2: Type: text/html, Size: 67567 bytes --]

[-- Attachment #2: xen-load-vbios-file.patch --]
[-- Type: application/octet-stream, Size: 2132 bytes --]

diff -r 4f13590588e3 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile	Fri Aug 28 14:41:36 2009 +0800
+++ b/tools/firmware/hvmloader/Makefile	Mon Aug 31 12:39:45 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 4f13590588e3 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Fri Aug 28 14:41:36 2009 +0800
+++ b/tools/firmware/hvmloader/hvmloader.c	Mon Aug 31 12:41:21 2009 +0800
@@ -115,6 +115,9 @@ unsigned long pci_mem_end = PCI_MEM_END;
 
 static enum { VGA_none, VGA_std, VGA_cirrus, VGA_pt } virtual_vga = VGA_none;
 
+/* virtual BDF of pass-throughed gfx */
+static uint8_t gfx_bdf;
+
 static void init_hypercalls(void)
 {
     uint32_t eax, ebx, ecx, edx;
@@ -215,7 +218,10 @@ static void pci_setup(void)
             else if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
                 virtual_vga = VGA_cirrus;
             else
+            {
                 virtual_vga = VGA_pt;
+                gfx_bdf = devfn;
+            }
             break;
         case 0x0680:
             /* PIIX4 ACPI PM. Special device with special PCI config space. */
@@ -689,8 +695,10 @@ int main(void)
         break;
     case VGA_pt:
         printf("Loading VGABIOS of passthroughed gfx ...\n");
-        vgabios_sz =
-            round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
+        memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
+               vgabios_pt, sizeof(vgabios_pt));
+        *(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS + sizeof(vgabios_pt)) = gfx_bdf;
+        vgabios_sz = round_option_rom(sizeof(vgabios_pt) + 1);
         break;
     default:
         printf("No emulated VGA adaptor ...\n");

[-- Attachment #3: xen-vBAR-pBAR.patch --]
[-- Type: application/octet-stream, Size: 3505 bytes --]

diff -r 96b634bf65c3 tools/firmware/hvmloader/acpi/dsdt.asl
--- a/tools/firmware/hvmloader/acpi/dsdt.asl	Mon Aug 31 13:14:47 2009 +0800
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Mon Aug 31 16:03:27 2009 +0800
@@ -175,6 +175,34 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                         0x000BFFFF,
                         0x00000000,
                         0x00020000)
+
+                    /* reserve MMIO BARs of gfx for 1:1 mapping */
+                    DWordMemory(
+                        ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                        Cacheable, ReadWrite,
+                        0x00000000,
+                        0xE0000000,
+                        0xEFFFFFFF,
+                        0x00000000,
+                        0x10000000)
+
+                    DWordMemory(
+                        ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                        NonCacheable, ReadWrite,
+                        0x00000000,
+                        0xC0000000,
+                        0xC1FFFFFF,
+                        0x00000000,
+                        0x02000000)
+
+                    DWordMemory(
+                        ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                        NonCacheable, ReadWrite,
+                        0x00000000,
+                        0xC2000000,
+                        0xC2FFFFFF,
+                        0x00000000,
+                        0x01000000)
 
                     DWordMemory(
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
--- a/tools/firmware/hvmloader/hvmloader.c	Mon Aug 31 13:14:47 2009 +0800
+++ b/tools/firmware/hvmloader/hvmloader.c	Mon Aug 31 15:46:48 2009 +0800
@@ -221,6 +221,40 @@ static void pci_setup(void)
             {
                 virtual_vga = VGA_pt;
                 gfx_bdf = devfn;
+
+                /* Make vBAR=pBAR */
+                printf("Make vBAR = pBAR of assigned gfx\n");
+                for ( bar = 0; bar < 7; bar++ )
+                {
+                    bar_reg = PCI_BASE_ADDRESS_0 + 4*bar;
+                    if ( bar == 6 )
+                            bar_reg = PCI_ROM_ADDRESS;
+                    /* When first time read, it will return physical address */
+                    bar_data = pci_readl(devfn, bar_reg);
+                    pci_writel(devfn, bar_reg, bar_data);
+
+                    /* Now enable the memory or I/O mapping. */
+                    cmd = pci_readw(devfn, PCI_COMMAND);
+                    if ( (bar_reg == PCI_ROM_ADDRESS) ||
+                             ((bar_data & PCI_BASE_ADDRESS_SPACE) ==
+                              PCI_BASE_ADDRESS_SPACE_MEMORY) )
+                          cmd |= PCI_COMMAND_MEMORY;
+                    else
+                          cmd |= PCI_COMMAND_IO;
+                    cmd |= PCI_COMMAND_MASTER;
+                    pci_writew(devfn, PCI_COMMAND, cmd);
+               }
+
+                /* Map the interrupt. */
+                pin = pci_readb(devfn, PCI_INTERRUPT_PIN);
+                if ( pin != 0 )
+                {
+                    /* This is the barber's pole mapping used by Xen. */
+                    link = ((pin - 1) + (devfn >> 3)) & 3;
+                    isa_irq = pci_readb(PCI_ISA_DEVFN, 0x60 + link);
+                    pci_writeb(devfn, PCI_INTERRUPT_LINE, isa_irq);
+                }
+                continue;
             }
             break;
         case 0x0680:

[-- Attachment #4: qemu-change-for-vBAR-pBAR.patch --]
[-- Type: application/octet-stream, Size: 1287 bytes --]

From 9cf295ed48542ce58a6484d64d45ba9a35d311fd Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Mon, 31 Aug 2009 16:10:03 +0800
Subject: [PATCH] qemu change for vBAR=pBAR

Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 hw/pass-through.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 4a9e03a..dfd592b 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -3174,6 +3174,7 @@ static int pt_cmd_reg_read(struct pt_dev *ptdev,
 }
 
 /* read BAR */
+static int gfx_first_read_BAR[7] = {1, 1, 1, 1, 1, 1, 1};
 static int pt_bar_reg_read(struct pt_dev *ptdev,
         struct pt_reg_tbl *cfg_entry,
         uint32_t *value, uint32_t valid_mask)
@@ -3196,6 +3197,16 @@ static int pt_bar_reg_read(struct pt_dev *ptdev,
     /* use fixed-up value from kernel sysfs */
     *value = ptdev->pci_dev->base_addr[index];
 
+    if ( ptdev->pci_dev->device_class == 0x300 )
+    {
+        if ( gfx_first_read_BAR[index] == 1 )
+        {
+            gfx_first_read_BAR[index] = 0;
+            PT_LOG("first read BARs of gfx\n");
+            return 0;
+        }
+    }
+
     /* set emulate mask depend on BAR flag */
     switch (ptdev->bases[index].bar_flag)
     {
-- 
1.6.0.4


[-- Attachment #5: qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch --]
[-- Type: application/octet-stream, Size: 3657 bytes --]

From 76d1d7aaedfc1ca450503ae77e19dce48db3bbba Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Mon, 31 Aug 2009 16:30:25 +0800
Subject: [PATCH] claim vga cycle for secondary gfx passthrough

Signed-off-by: Weidong Han <weidong.han@intel.com>
---
 hw/pass-through.c |   76 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 76 insertions(+), 0 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index dfd592b..656392e 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -1783,6 +1783,75 @@ static int pt_dev_is_virtfn(struct pci_dev *dev)
     return rc;
 }
 
+#define PCI_HEADER_TYPE_ADDR        0x0e
+#define PCI_BRIDGE_FLAG             0x01
+
+#define PCI_CLASS_CODE_ADDR_0       0x09
+#define PCI_CLASS_CODE_ADDR_1       0x0a
+#define PCI_CLASS_CODE_ADDR_2       0x0b
+#define PCI_CLASS_CODE_DATA_0       0x060000
+#define PCI_CLASS_CODE_DATA_1       0x0600
+#define PCI_CLASS_CODE_DATA_2       0x06
+
+#define PCI_SECOND_BUS_NUMBER_ADDR  0x19
+
+#define PCI_BRIDGE_CONTROL_ADDR     0x3e
+#define PCI_BRIDGE_VGA_ENABLE       0x18
+
+#define PCI_GRAPHIC_CONTROL_ADDR    0x52
+#define PCI_HOST_BRIDGE_IGD_VGA_DISABLE 0x02
+
+/*
+ * Claim vga cycle for the graphics card pass-through
+ */
+static uint32_t gfx_claim_vga_cycle(struct pci_access *pci_access,
+       uint32_t bus, uint32_t devfn, uint32_t func)
+{
+    struct pci_dev *pci_dev;
+
+    for ( pci_dev = pci_access->devices; pci_dev != NULL; pci_dev = pci_dev->next )
+    {
+        /* Check whether this is a ordinary bridge */
+        if ( pci_read_byte(pci_dev, PCI_HEADER_TYPE_ADDR) == PCI_BRIDGE_FLAG )
+        {
+            unsigned sec_bus_num = pci_read_byte(pci_dev, PCI_SECOND_BUS_NUMBER_ADDR);
+            unsigned ubrg = pci_read_byte(pci_dev, PCI_BRIDGE_CONTROL_ADDR);
+
+            PT_LOG("bridge for bus %d, previous bridge control is %x\n", sec_bus_num, ubrg);
+            PT_LOG("bus=0x%d, dev=0x%x, func=0x%x\n",pci_dev->bus,pci_dev->dev,pci_dev->func);
+
+            if ( sec_bus_num == bus ) /* VGA device's bridge */
+                ubrg |= PCI_BRIDGE_VGA_ENABLE;
+            else /* Other device's bridge */
+                ubrg &= ~PCI_BRIDGE_VGA_ENABLE;
+
+            pci_write_byte(pci_dev, PCI_BRIDGE_CONTROL_ADDR, ubrg);
+            PT_LOG("bridge for bus %d, updated bridge control is %x\n", sec_bus_num, ubrg);
+        }
+    }
+
+    for ( pci_dev = pci_access->devices; pci_dev != NULL; pci_dev = pci_dev->next )
+    {
+        /* Check host bridge */
+        if ( pci_read_word(pci_dev, PCI_CLASS_CODE_ADDR_1) == PCI_CLASS_CODE_DATA_1 )
+        {
+            unsigned uigd = pci_read_byte(pci_dev, PCI_GRAPHIC_CONTROL_ADDR);
+
+            PT_LOG("previous igd control is %x\n", uigd);
+
+            if ( bus == 0 )
+                uigd &= ~PCI_HOST_BRIDGE_IGD_VGA_DISABLE;
+            else
+                uigd |= PCI_HOST_BRIDGE_IGD_VGA_DISABLE;
+
+            pci_write_byte(pci_dev, PCI_GRAPHIC_CONTROL_ADDR, uigd);
+            PT_LOG("updated igd control is %x\n", uigd);
+        }
+    }
+
+    return 0;
+}
+
 /*
  * register VGA resources for the domain with assigned gfx
  */
@@ -4197,6 +4266,13 @@ static struct pt_dev * register_real_device(PCIBus *e_bus,
     /* Handle real device's MMIO/PIO BARs */
     pt_register_regions(assigned_device);
 
+    if ( pci_dev->device_class == 0x0300 )
+    {
+        rc = gfx_claim_vga_cycle(pci_access, r_bus, r_dev, r_func);
+        if ( rc != 0 )
+            return NULL;
+    }
+
     /* reinitialize each config register to be emulated */
     rc = pt_config_init(assigned_device);
     if ( rc < 0 ) {
-- 
1.6.0.4


[-- Attachment #6: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-31  8:47                         ` Han, Weidong
@ 2009-08-31 14:54                           ` Mr. Teo En Ming (Zhang Enming)
  2009-08-31 16:48                           ` Christian Tramnitz
  2009-08-31 19:35                           ` Tim Moore
  2 siblings, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-31 14:54 UTC (permalink / raw)
  To: weidong.han
  Cc: 'xen-devel@lists.xensource.com',
	'timothy.moore@expidas.net'


[-- Attachment #1.1: Type: text/plain, Size: 40024 bytes --]

Dear Weidong,

Thank you for releasing the experimental patches for vga passthrough.

I have patched xen-unstable with your initial 2 patches and the patches which you released today.

However, it can't work. It caused my Dom 0 to crash and Dom U cannot start.

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 08/31/2009 04:47 PM, Han, Weidong wrote:
> Teo,
> I attached some experimental patches for you to try to sthorugh
> Geforce 8400 GS.
> Based on my patches posted last Friday, pls follow below instructions:
> 1. apply xen-load-vbios-file.patch to xen-unstable.hg
> this patch supports to load vga bios from a file.
> 2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
> this patch is used to 1:1 map between vBAR and pBAR
> 3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
> this patch is used to 1:1 map between vBAR and pBAR on qemu side
> 4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
> it's needed if you want to assign the secondary gfx to guest.
> 5. cd xen-unstable.hg
> 6. make clean
> 7. copy the vga bios file to
> xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
> 8. make; make install
> 9. reboot the system. or xend restart. then passthrough gfx to guest ...
> Regards,
> Weidong
>
> ------------------------------------------------------------------------
> *From:* xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo
> En Ming (Zhang Enming)
> *Sent:* 2009年8月29日 22:13
> *To:* timothy.moore@expidas.net
> *Cc:* xen-devel@lists.xensource.com
> *Subject:* Re: [Xen-devel] graphics passthrough with VT-d
>
> Hi Timothy,
>
> Yes, I renamed the firmware file of nVidia Geforce 8400 GS to
> vgabios-pt.bin and placed it in the source directory
> tools/firmware/vgabios.
>
> Weidong had said Intel has the 1:1 mapping patches. Let's hope he will
> release the patch soon to do pBAR:vBAR.
>
> -- 
> 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@hotmail.com
> Alma Maters: Singapore Polytechnic, National University of Singapore
>
>
> On 08/29/2009 09:29 PM, Tim Moore wrote:
>>
>> Teo,
>>
>> Did you rename your Nvidia BIOS and copy it into the hvmloader source
>> tree as required ?
>>
>> It should get compiled into roms.h in the hvmloader folder - I made
>> sure it was there as the xen buildroot seems to delete it randomly ...
>>
>> I think we are now up against the Base Address Register issue where
>> the Nvidia driver is expecting to see the card at the Physical BAR
>> Addresses and in the DomU these are re-mapped to different address
>> space ... this is a problem with the Nvidia binary driver and
>> therefore a workaround in xen is maybe needed.
>>
>> That said, I'm not sure if the Nvidia BIOS likes to be re-executed
>> and may also be an issue ...
>>
>> Tim
>>
>> *From:* Mr. Teo En Ming (Zhang Enming)
>> [mailto:enming.teo@asiasoftsea.net]
>> *Sent:* 29 August 2009 14:21
>> *To:* enming.teo@asiasoftsea.net
>> *Cc:* Tim Moore; xen-devel@lists.xensource.com
>> *Subject:* Re: [Xen-devel] graphics passthrough with VT-d
>>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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..@..["
>> <mailto:GA..@..%5B> */
>> 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@asiasoftsea.net <mailto:enming.teo@asiasoftsea.net>
>> Email #2: space.time.universe@gmail.com
>> <mailto:space.time.universe@gmail.com>
>> MSN: teoenming@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@lists.xensource.com
>> <mailto:xen-devel-bounces@lists.xensource.com>
>> [mailto:xen-devel-bounces@lists.xensource.com] *On Behalf Of *Mr. Teo
>> En Ming (Zhang Enming)
>> *Sent:* 28 August 2009 21:14
>> *To:* enming.teo@asiasoftsea.net <mailto:enming.teo@asiasoftsea.net>
>> *Cc:* xen-devel@lists.xensource.com
>> <mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M';
>> 'Jean Guyader'; Keir.Fraser@eu.citrix.com
>> <mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com
>> <mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu
>> <mailto:bengheng@eecs.umich.edu>
>> *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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin>
>> and qemu-gfx-passthrough.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin>
>> 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@hotmail.com <mailto:teoenming@hotmail.com>
>> 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@intel.com> <mailto:ben.y.lin@intel.com>
>>
>>     Signed-off-by: Weidong Han <weidong.han@intel.com> <mailto:weidong.han@intel.com>
>>
>>     No virus found in this incoming message.
>>
>>     Checked by AVG - www.avg.com <http://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 <http://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@lists.xensource.com <mailto:Xen-devel@lists.xensource.com>
>>
>>     http://lists.xensource.com/xen-devel
>>
>>       
>>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>   
>>  
>>  
>>   
>>  
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com <mailto:Xen-devel@lists.xensource.com>
>> http://lists.xensource.com/xen-devel
>>   
>>
>>
>>
>>
>>
>>  
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>>   
>>  
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com <mailto:Xen-devel@lists.xensource.com>
>> http://lists.xensource.com/xen-devel
>>   
>>
>
>



[-- Attachment #1.2: Type: text/html, Size: 72419 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-31  8:47                         ` Han, Weidong
  2009-08-31 14:54                           ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-31 16:48                           ` Christian Tramnitz
  2009-08-31 17:03                             ` djmagee
  2009-08-31 19:35                           ` Tim Moore
  2 siblings, 1 reply; 66+ messages in thread
From: Christian Tramnitz @ 2009-08-31 16:48 UTC (permalink / raw)
  To: xen-devel

I took a snapshot from xen-unstable and applied those patches.
However when trying to create a HVM domU the following error comes up:
# xm create test2.xm
Error: local variable 'str' referenced before assignment
Using config file "/etc/xen/test2.xm".

And xend-debug.log gives some more info:
[2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:99)
XendDomainInfo.create(['vm', ['name', 'TEST2'], ['memory', 4096],
['vcpus', 8], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'],
['uuid', '06ed00ff-1162-4fc4-b5d8-11993ee4a8c0'], ['image', ['hvm',
['kernel', '/usr/lib/xen/boot/hvmloader'], ['videoram', 4],
['device_model', '/usr/lib/xen/bin/qemu-dm'], ['pae', 1], ['vcpus', 8],
['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 1],
['localtime', 0], ['serial', ''], ['stdvga', 0], ['isa', 0],
['nographic', 0], ['soundhw', ''], ['vncunused', 1], ['display',
':0.0'], ['xauthority', '/root/.xauthPdEBhy'], ['rtc_timeoffset', 0],
['monitor', 0], ['acpi', 1], ['apic', 1], ['usb', 0], ['usbdevice', ''],
['keymap', ''], ['pci', [['0x0000', '0x03', '0x00', '0x0', '0x100', [],
'03:00.0']]], ['hpet', 0], ['guest_os_type', 'default'], ['hap', 1],
['cpuid', []], ['cpuid_check', []], ['viridian', 0],
['pci_msitranslate', 1], ['vpt_align', 1], ['pci_power_mgmt', 0],
['xen_platform_pci', 1], ['gfx_passthru', 2]]], ['s3_integrity', 1],
['device', ['vbd', ['uname', 'phy:vgtest/test2'], ['dev', 'xvda'],
['mode', 'w']]], ['device', ['pci', ['dev', ['slot', '0x00'], ['domain',
'0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'],
['func', '0x0']]]], ['device', ['vif', ['bridge', 'eth0'], ['mac',
'00:16:3e:00:00:22'], ['type', 'netfront']]]])
[2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:2366)
XendDomainInfo.constructDomain
[2009-08-31 18:10:23 6189] DEBUG (balloon:181) Balloon: 4101688 KiB
free; need 4096; done.
[2009-08-31 18:10:23 6189] ERROR (XendDomainInfo:467) VM start failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
line 452, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/site-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
line 2470, in _constructDomain
    pci_str = str(pci)
UnboundLocalError: local variable 'str' referenced before assignment


Is this error related to the patches or is something else broken? I have
to admit that I've not been using xen-unstable for some time, only
release-3.4.1 and recently Xenclient, so I don't know if this is also a
problem on unpatched xen-unstable.
The error disappears when I omit the "pci=" line, but obviously this is
not a good scenario to test gfx passthrough ;-)


My config file for the test-domU:
kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 4096
name = "TEST2"
vcpus=8
vif = [ 'type=netfront, mac=00:16:3e:ff:ff:22, bridge=eth0' ]
disk = [ 'phy:vgtest/test2,xvda,w' ]
#viridian = 1
device_model = '/usr/lib/xen/bin/qemu-dm'
#boot="cd"
#sdl=0
#opengl=0
#vnc=1
#vnclisten="127.0.0.1"
#vncdisplay=1
#vncpasswd=''
#stdvga=0
gfx_passthru=2
pci=['03:00.0']


Thanks,
   Christian


Han, Weidong wrote:
> Teo,
>  
> I attached some experimental patches for you to try to sthorugh Geforce 
> 8400 GS.
>  
> Based on my patches posted last Friday, pls follow below instructions:
> 1. apply xen-load-vbios-file.patch to xen-unstable.hg
>     this patch supports to load vga bios from a file.
> 2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
>     this patch is used to 1:1 map between vBAR and pBAR
> 3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
>     this patch is used to 1:1 map between vBAR and pBAR on qemu side
> 4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
>     it's needed if you want to assign the secondary gfx to guest.
> 5. cd xen-unstable.hg
> 6. make clean
> 7. copy the vga bios file to 
> xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
> 8. make; make install
> 9. reboot the system. or xend restart. then passthrough gfx to guest ...
>  
>  
> Regards,
> Weidong

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Re: graphics passthrough with VT-d
  2009-08-31 16:48                           ` Christian Tramnitz
@ 2009-08-31 17:03                             ` djmagee
  2009-08-31 17:18                               ` Keir Fraser
  0 siblings, 1 reply; 66+ messages in thread
From: djmagee @ 2009-08-31 17:03 UTC (permalink / raw)
  To: Christian Tramnitz, xen-devel

I had the same problem with unpatched xen-unstable that was up-to-date
this morning.  This was simply in trying to pass through a usb
controller, to test xen-unstable before I went ahead and applied the gfx
passthrough patches.

This seems like a bug in xen-unstable.

-----Original Message-----
From: xen-devel-bounces@lists.xensource.com
[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Christian
Tramnitz
Sent: Monday, August 31, 2009 12:48 PM
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Re: graphics passthrough with VT-d

I took a snapshot from xen-unstable and applied those patches.
However when trying to create a HVM domU the following error comes up:
# xm create test2.xm
Error: local variable 'str' referenced before assignment
Using config file "/etc/xen/test2.xm".

And xend-debug.log gives some more info:
[2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:99)
XendDomainInfo.create(['vm', ['name', 'TEST2'], ['memory', 4096],
['vcpus', 8], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'],
['uuid', '06ed00ff-1162-4fc4-b5d8-11993ee4a8c0'], ['image', ['hvm',
['kernel', '/usr/lib/xen/boot/hvmloader'], ['videoram', 4],
['device_model', '/usr/lib/xen/bin/qemu-dm'], ['pae', 1], ['vcpus', 8],
['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 1],
['localtime', 0], ['serial', ''], ['stdvga', 0], ['isa', 0],
['nographic', 0], ['soundhw', ''], ['vncunused', 1], ['display',
':0.0'], ['xauthority', '/root/.xauthPdEBhy'], ['rtc_timeoffset', 0],
['monitor', 0], ['acpi', 1], ['apic', 1], ['usb', 0], ['usbdevice', ''],
['keymap', ''], ['pci', [['0x0000', '0x03', '0x00', '0x0', '0x100', [],
'03:00.0']]], ['hpet', 0], ['guest_os_type', 'default'], ['hap', 1],
['cpuid', []], ['cpuid_check', []], ['viridian', 0],
['pci_msitranslate', 1], ['vpt_align', 1], ['pci_power_mgmt', 0],
['xen_platform_pci', 1], ['gfx_passthru', 2]]], ['s3_integrity', 1],
['device', ['vbd', ['uname', 'phy:vgtest/test2'], ['dev', 'xvda'],
['mode', 'w']]], ['device', ['pci', ['dev', ['slot', '0x00'], ['domain',
'0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'],
['func', '0x0']]]], ['device', ['vif', ['bridge', 'eth0'], ['mac',
'00:16:3e:00:00:22'], ['type', 'netfront']]]])
[2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:2366)
XendDomainInfo.constructDomain
[2009-08-31 18:10:23 6189] DEBUG (balloon:181) Balloon: 4101688 KiB
free; need 4096; done.
[2009-08-31 18:10:23 6189] ERROR (XendDomainInfo:467) VM start failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
line 452, in start
    XendTask.log_progress(0, 30, self._constructDomain)
  File "/usr/lib/python2.6/site-packages/xen/xend/XendTask.py", line
209, in log_progress
    retval = func(*args, **kwds)
  File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
line 2470, in _constructDomain
    pci_str = str(pci)
UnboundLocalError: local variable 'str' referenced before assignment


Is this error related to the patches or is something else broken? I have
to admit that I've not been using xen-unstable for some time, only
release-3.4.1 and recently Xenclient, so I don't know if this is also a
problem on unpatched xen-unstable.
The error disappears when I omit the "pci=" line, but obviously this is
not a good scenario to test gfx passthrough ;-)


My config file for the test-domU:
kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
memory = 4096
name = "TEST2"
vcpus=8
vif = [ 'type=netfront, mac=00:16:3e:ff:ff:22, bridge=eth0' ]
disk = [ 'phy:vgtest/test2,xvda,w' ]
#viridian = 1
device_model = '/usr/lib/xen/bin/qemu-dm'
#boot="cd"
#sdl=0
#opengl=0
#vnc=1
#vnclisten="127.0.0.1"
#vncdisplay=1
#vncpasswd=''
#stdvga=0
gfx_passthru=2
pci=['03:00.0']


Thanks,
   Christian


Han, Weidong wrote:
> Teo,
>  
> I attached some experimental patches for you to try to sthorugh
Geforce 
> 8400 GS.
>  
> Based on my patches posted last Friday, pls follow below instructions:
> 1. apply xen-load-vbios-file.patch to xen-unstable.hg
>     this patch supports to load vga bios from a file.
> 2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
>     this patch is used to 1:1 map between vBAR and pBAR
> 3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
>     this patch is used to 1:1 map between vBAR and pBAR on qemu side
> 4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
>     it's needed if you want to assign the secondary gfx to guest.
> 5. cd xen-unstable.hg
> 6. make clean
> 7. copy the vga bios file to 
> xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
> 8. make; make install
> 9. reboot the system. or xend restart. then passthrough gfx to guest
...
>  
>  
> Regards,
> Weidong


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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: graphics passthrough with VT-d
  2009-08-31 17:03                             ` djmagee
@ 2009-08-31 17:18                               ` Keir Fraser
  2009-08-31 17:22                                 ` Mr. Teo En Ming (Zhang Enming)
  2009-08-31 21:14                                 ` Christian Tramnitz
  0 siblings, 2 replies; 66+ messages in thread
From: Keir Fraser @ 2009-08-31 17:18 UTC (permalink / raw)
  To: djmagee, Christian Tramnitz, xen-devel

This is probably due to c/s 20137 and now fixed by c/s 20141.

 Thanks,
 Keir

On 31/08/2009 18:03, "djmagee@mageenet.net" <djmagee@mageenet.net> wrote:

> I had the same problem with unpatched xen-unstable that was up-to-date
> this morning.  This was simply in trying to pass through a usb
> controller, to test xen-unstable before I went ahead and applied the gfx
> passthrough patches.
> 
> This seems like a bug in xen-unstable.
> 
> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Christian
> Tramnitz
> Sent: Monday, August 31, 2009 12:48 PM
> To: xen-devel@lists.xensource.com
> Subject: [Xen-devel] Re: graphics passthrough with VT-d
> 
> I took a snapshot from xen-unstable and applied those patches.
> However when trying to create a HVM domU the following error comes up:
> # xm create test2.xm
> Error: local variable 'str' referenced before assignment
> Using config file "/etc/xen/test2.xm".
> 
> And xend-debug.log gives some more info:
> [2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:99)
> XendDomainInfo.create(['vm', ['name', 'TEST2'], ['memory', 4096],
> ['vcpus', 8], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'],
> ['uuid', '06ed00ff-1162-4fc4-b5d8-11993ee4a8c0'], ['image', ['hvm',
> ['kernel', '/usr/lib/xen/boot/hvmloader'], ['videoram', 4],
> ['device_model', '/usr/lib/xen/bin/qemu-dm'], ['pae', 1], ['vcpus', 8],
> ['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 1],
> ['localtime', 0], ['serial', ''], ['stdvga', 0], ['isa', 0],
> ['nographic', 0], ['soundhw', ''], ['vncunused', 1], ['display',
> ':0.0'], ['xauthority', '/root/.xauthPdEBhy'], ['rtc_timeoffset', 0],
> ['monitor', 0], ['acpi', 1], ['apic', 1], ['usb', 0], ['usbdevice', ''],
> ['keymap', ''], ['pci', [['0x0000', '0x03', '0x00', '0x0', '0x100', [],
> '03:00.0']]], ['hpet', 0], ['guest_os_type', 'default'], ['hap', 1],
> ['cpuid', []], ['cpuid_check', []], ['viridian', 0],
> ['pci_msitranslate', 1], ['vpt_align', 1], ['pci_power_mgmt', 0],
> ['xen_platform_pci', 1], ['gfx_passthru', 2]]], ['s3_integrity', 1],
> ['device', ['vbd', ['uname', 'phy:vgtest/test2'], ['dev', 'xvda'],
> ['mode', 'w']]], ['device', ['pci', ['dev', ['slot', '0x00'], ['domain',
> '0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'],
> ['func', '0x0']]]], ['device', ['vif', ['bridge', 'eth0'], ['mac',
> '00:16:3e:00:00:22'], ['type', 'netfront']]]])
> [2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:2366)
> XendDomainInfo.constructDomain
> [2009-08-31 18:10:23 6189] DEBUG (balloon:181) Balloon: 4101688 KiB
> free; need 4096; done.
> [2009-08-31 18:10:23 6189] ERROR (XendDomainInfo:467) VM start failed
> Traceback (most recent call last):
>   File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
> line 452, in start
>     XendTask.log_progress(0, 30, self._constructDomain)
>   File "/usr/lib/python2.6/site-packages/xen/xend/XendTask.py", line
> 209, in log_progress
>     retval = func(*args, **kwds)
>   File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
> line 2470, in _constructDomain
>     pci_str = str(pci)
> UnboundLocalError: local variable 'str' referenced before assignment
> 
> 
> Is this error related to the patches or is something else broken? I have
> to admit that I've not been using xen-unstable for some time, only
> release-3.4.1 and recently Xenclient, so I don't know if this is also a
> problem on unpatched xen-unstable.
> The error disappears when I omit the "pci=" line, but obviously this is
> not a good scenario to test gfx passthrough ;-)
> 
> 
> My config file for the test-domU:
> kernel = "/usr/lib/xen/boot/hvmloader"
> builder='hvm'
> memory = 4096
> name = "TEST2"
> vcpus=8
> vif = [ 'type=netfront, mac=00:16:3e:ff:ff:22, bridge=eth0' ]
> disk = [ 'phy:vgtest/test2,xvda,w' ]
> #viridian = 1
> device_model = '/usr/lib/xen/bin/qemu-dm'
> #boot="cd"
> #sdl=0
> #opengl=0
> #vnc=1
> #vnclisten="127.0.0.1"
> #vncdisplay=1
> #vncpasswd=''
> #stdvga=0
> gfx_passthru=2
> pci=['03:00.0']
> 
> 
> Thanks,
>    Christian
> 
> 
> Han, Weidong wrote:
>> Teo,
>>  
>> I attached some experimental patches for you to try to sthorugh
> Geforce 
>> 8400 GS.
>>  
>> Based on my patches posted last Friday, pls follow below instructions:
>> 1. apply xen-load-vbios-file.patch to xen-unstable.hg
>>     this patch supports to load vga bios from a file.
>> 2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
>>     this patch is used to 1:1 map between vBAR and pBAR
>> 3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
>>     this patch is used to 1:1 map between vBAR and pBAR on qemu side
>> 4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
>>     it's needed if you want to assign the secondary gfx to guest.
>> 5. cd xen-unstable.hg
>> 6. make clean
>> 7. copy the vga bios file to
>> xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
>> 8. make; make install
>> 9. reboot the system. or xend restart. then passthrough gfx to guest
> ...
>>  
>>  
>> Regards,
>> Weidong
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: graphics passthrough with VT-d
  2009-08-31 17:18                               ` Keir Fraser
@ 2009-08-31 17:22                                 ` Mr. Teo En Ming (Zhang Enming)
  2009-08-31 21:14                                 ` Christian Tramnitz
  1 sibling, 0 replies; 66+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-08-31 17:22 UTC (permalink / raw)
  To: keir.fraser; +Cc: Christian Tramnitz, xen-devel, djmagee

Hi Guys,

Do you have any success after applying Weidong's gfx passthrough and 1:1 
bar mapping patches to xen-unstable?

-- 
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@hotmail.com
Alma Maters: Singapore Polytechnic, National University of Singapore



On 09/01/2009 01:18 AM, Keir Fraser wrote:
> This is probably due to c/s 20137 and now fixed by c/s 20141.
>
>   Thanks,
>   Keir
>
> On 31/08/2009 18:03, "djmagee@mageenet.net"<djmagee@mageenet.net>  wrote:
>
>    
>> I had the same problem with unpatched xen-unstable that was up-to-date
>> this morning.  This was simply in trying to pass through a usb
>> controller, to test xen-unstable before I went ahead and applied the gfx
>> passthrough patches.
>>
>> This seems like a bug in xen-unstable.
>>
>> -----Original Message-----
>> From: xen-devel-bounces@lists.xensource.com
>> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Christian
>> Tramnitz
>> Sent: Monday, August 31, 2009 12:48 PM
>> To: xen-devel@lists.xensource.com
>> Subject: [Xen-devel] Re: graphics passthrough with VT-d
>>
>> I took a snapshot from xen-unstable and applied those patches.
>> However when trying to create a HVM domU the following error comes up:
>> # xm create test2.xm
>> Error: local variable 'str' referenced before assignment
>> Using config file "/etc/xen/test2.xm".
>>
>> And xend-debug.log gives some more info:
>> [2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:99)
>> XendDomainInfo.create(['vm', ['name', 'TEST2'], ['memory', 4096],
>> ['vcpus', 8], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'],
>> ['uuid', '06ed00ff-1162-4fc4-b5d8-11993ee4a8c0'], ['image', ['hvm',
>> ['kernel', '/usr/lib/xen/boot/hvmloader'], ['videoram', 4],
>> ['device_model', '/usr/lib/xen/bin/qemu-dm'], ['pae', 1], ['vcpus', 8],
>> ['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 1],
>> ['localtime', 0], ['serial', ''], ['stdvga', 0], ['isa', 0],
>> ['nographic', 0], ['soundhw', ''], ['vncunused', 1], ['display',
>> ':0.0'], ['xauthority', '/root/.xauthPdEBhy'], ['rtc_timeoffset', 0],
>> ['monitor', 0], ['acpi', 1], ['apic', 1], ['usb', 0], ['usbdevice', ''],
>> ['keymap', ''], ['pci', [['0x0000', '0x03', '0x00', '0x0', '0x100', [],
>> '03:00.0']]], ['hpet', 0], ['guest_os_type', 'default'], ['hap', 1],
>> ['cpuid', []], ['cpuid_check', []], ['viridian', 0],
>> ['pci_msitranslate', 1], ['vpt_align', 1], ['pci_power_mgmt', 0],
>> ['xen_platform_pci', 1], ['gfx_passthru', 2]]], ['s3_integrity', 1],
>> ['device', ['vbd', ['uname', 'phy:vgtest/test2'], ['dev', 'xvda'],
>> ['mode', 'w']]], ['device', ['pci', ['dev', ['slot', '0x00'], ['domain',
>> '0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'],
>> ['func', '0x0']]]], ['device', ['vif', ['bridge', 'eth0'], ['mac',
>> '00:16:3e:00:00:22'], ['type', 'netfront']]]])
>> [2009-08-31 18:10:23 6189] DEBUG (XendDomainInfo:2366)
>> XendDomainInfo.constructDomain
>> [2009-08-31 18:10:23 6189] DEBUG (balloon:181) Balloon: 4101688 KiB
>> free; need 4096; done.
>> [2009-08-31 18:10:23 6189] ERROR (XendDomainInfo:467) VM start failed
>> Traceback (most recent call last):
>>    File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
>> line 452, in start
>>      XendTask.log_progress(0, 30, self._constructDomain)
>>    File "/usr/lib/python2.6/site-packages/xen/xend/XendTask.py", line
>> 209, in log_progress
>>      retval = func(*args, **kwds)
>>    File "/usr/lib/python2.6/site-packages/xen/xend/XendDomainInfo.py",
>> line 2470, in _constructDomain
>>      pci_str = str(pci)
>> UnboundLocalError: local variable 'str' referenced before assignment
>>
>>
>> Is this error related to the patches or is something else broken? I have
>> to admit that I've not been using xen-unstable for some time, only
>> release-3.4.1 and recently Xenclient, so I don't know if this is also a
>> problem on unpatched xen-unstable.
>> The error disappears when I omit the "pci=" line, but obviously this is
>> not a good scenario to test gfx passthrough ;-)
>>
>>
>> My config file for the test-domU:
>> kernel = "/usr/lib/xen/boot/hvmloader"
>> builder='hvm'
>> memory = 4096
>> name = "TEST2"
>> vcpus=8
>> vif = [ 'type=netfront, mac=00:16:3e:ff:ff:22, bridge=eth0' ]
>> disk = [ 'phy:vgtest/test2,xvda,w' ]
>> #viridian = 1
>> device_model = '/usr/lib/xen/bin/qemu-dm'
>> #boot="cd"
>> #sdl=0
>> #opengl=0
>> #vnc=1
>> #vnclisten="127.0.0.1"
>> #vncdisplay=1
>> #vncpasswd=''
>> #stdvga=0
>> gfx_passthru=2
>> pci=['03:00.0']
>>
>>
>> Thanks,
>>     Christian
>>
>>
>> Han, Weidong wrote:
>>      
>>> Teo,
>>>
>>> I attached some experimental patches for you to try to sthorugh
>>>        
>> Geforce
>>      
>>> 8400 GS.
>>>
>>> Based on my patches posted last Friday, pls follow below instructions:
>>> 1. apply xen-load-vbios-file.patch to xen-unstable.hg
>>>      this patch supports to load vga bios from a file.
>>> 2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
>>>      this patch is used to 1:1 map between vBAR and pBAR
>>> 3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
>>>      this patch is used to 1:1 map between vBAR and pBAR on qemu side
>>> 4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
>>>      it's needed if you want to assign the secondary gfx to guest.
>>> 5. cd xen-unstable.hg
>>> 6. make clean
>>> 7. copy the vga bios file to
>>> xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
>>> 8. make; make install
>>> 9. reboot the system. or xend restart. then passthrough gfx to guest
>>>        
>> ...
>>      
>>>
>>>
>>> Regards,
>>> Weidong
>>>        
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>      
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>    

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: graphics passthrough with VT-d
  2009-08-31  8:47                         ` Han, Weidong
  2009-08-31 14:54                           ` Mr. Teo En Ming (Zhang Enming)
  2009-08-31 16:48                           ` Christian Tramnitz
@ 2009-08-31 19:35                           ` Tim Moore
  2009-09-01  1:07                             ` Han, Weidong
  2009-09-01  7:12                             ` Han, Weidong
  2 siblings, 2 replies; 66+ messages in thread
From: Tim Moore @ 2009-08-31 19:35 UTC (permalink / raw)
  To: 'Han, Weidong'
  Cc: 'xen-devel@lists.xensource.com',
	'enming.teo@asiasoftsea.net'


[-- Attachment #1.1: Type: text/plain, Size: 38718 bytes --]

Hi Weidong,

Here are my findings so far, it still doesn’t work but I have not experienced a crash or Dom0 lockup, and I have switched to 2.6.18-Dom0 which may also help ...

64bit Hypervisor (xen-unstable.hg 31/08/09)
Dom0 - 2.6.18-xen-dom0 (from xenbits)
Patches applied:
./qemu-gfx-passthrough.patch
./qemu-change-for-vBAR-pBAR.patch
./qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
./xen-vBAR-pBAR.patch
./xen-gfx-passthrough.patch
./xen-load-vbios-file.patch

02:00.0 - Primary GFX (Dom0) Console: NVidia Geforce GTX260
03:00.0 - Secondary GFX (DomU): NVidia Geforce 9500GT

Qemu:
Warning: attempted read from physical address 0xe0000000 in xen platform mmio space
And
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]

Hope this helps,
Tim

From: Han, Weidong [mailto:weidong.han@intel.com]
Sent: 31 August 2009 09:47
To: 'enming.teo@asiasoftsea.net'; Tim Moore
Cc: 'xen-devel@lists.xensource.com'
Subject: RE: [Xen-devel] graphics passthrough with VT-d

Teo,

I attached some experimental patches for you to try to sthorugh Geforce 8400 GS.

Based on my patches posted last Friday, pls follow below instructions:
1. apply xen-load-vbios-file.patch to xen-unstable.hg
    this patch supports to load vga bios from a file.
2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
    this patch is used to 1:1 map between vBAR and pBAR
3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
    this patch is used to 1:1 map between vBAR and pBAR on qemu side
4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
    it's needed if you want to assign the secondary gfx to guest.
5. cd xen-unstable.hg
6. make clean
7. copy the vga bios file to xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
8. make; make install
9. reboot the system. or xend restart. then passthrough gfx to guest ...


Regards,
Weidong


________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 2009年8月29日 22:13
To: timothy.moore@expidas.net
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] graphics passthrough with VT-d
Hi Timothy,

Yes, I renamed the firmware file of nVidia Geforce 8400 GS to vgabios-pt.bin and placed it in the source directory tools/firmware/vgabios.

Weidong had said Intel has the 1:1 mapping patches. Let's hope he will release the patch soon to do pBAR:vBAR.



--

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@hotmail.com<mailto:teoenming@hotmail.com>

Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 09:29 PM, Tim Moore wrote:
Teo,
Did you rename your Nvidia BIOS and copy it into the hvmloader source tree as required ?
It should get compiled into roms.h in the hvmloader folder - I made sure it was there as the xen buildroot seems to delete it randomly ...
I think we are now up against the Base Address Register issue where the Nvidia driver is expecting to see the card at the Physical BAR Addresses and in the DomU these are re-mapped to different address space ... this is a problem with the Nvidia binary driver and therefore a workaround in xen is maybe needed.
That said, I'm not sure if the Nvidia BIOS likes to be re-executed and may also be an issue ...
Tim
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 29 August 2009 14:21
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: Tim Moore; xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] graphics passthrough with VT-d
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@hotmail.com<mailto:teoenming@hotmail.com>

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..@..["<mailto:GA..@..%5B> */
    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@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Email #2: space.time.universe@gmail.com<mailto:space.time.universe@gmail.com>
MSN: teoenming@hotmail.com<mailto:teoenming@hotmail.com>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com<mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel










________________________________


















_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel
















________________________________












_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel




[-- Attachment #1.2: Type: text/html, Size: 69529 bytes --]

[-- Attachment #2: qemu-dm-WinXP.log --]
[-- Type: application/octet-stream, Size: 5756 bytes --]

domid: 1
qemu: the number of cpus is 1
Discrete graphics card assignment
config qemu network with xen bridge for  tap1.0 xenbr0
Watching /local/domain/0/device-model/1/logdirty/next-active
Watching /local/domain/0/device-model/1/command
char device redirected to /dev/pts/1
qemu_map_cache_init nr_buckets = 10000 size 4194304
shared page at pfn feffd
buffered io page at pfn feffb
Guest uuid = 3f3da690-84db-e24a-4831-e385fbfe6de3
Time offset set 0
Register xen platform.
Done register platform.
xs_read(/vm/3f3da690-84db-e24a-4831-e385fbfe6de3/log-throttling): read error
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
xs_read(/local/domain/0/device-model/1/xen_extended_power_mgmt): read error
xs_read(): vncpasswd get error. /vm/3f3da690-84db-e24a-4831-e385fbfe6de3/vncpasswd.
medium change watch on `hdc' (index: 1): 
I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0
dm-command: hot insert pass-through pci dev 
register_real_device: Assigning real physical device 03:00.0 ...
pt_iomul_init: Error: pt_iomul_init: No such device: setup io multiplexing failed! 0x3:0x0.0x0
pt_register_regions: IO region registered (size=0x01000000 base_addr=0xb2000000)
pt_register_regions: IO region registered (size=0x20000000 base_addr=0xc000000c)
pt_register_regions: IO region registered (size=0x02000000 base_addr=0xb0000004)
pt_register_regions: IO region registered (size=0x00000080 base_addr=0x00002001)
gfx_claim_vga_cycle: bridge for bus 1, previous bridge control is 0
gfx_claim_vga_cycle: bus=0x0, dev=0x1, func=0x0
gfx_claim_vga_cycle: bridge for bus 1, updated bridge control is 0
gfx_claim_vga_cycle: bridge for bus 2, previous bridge control is 18
gfx_claim_vga_cycle: bus=0x0, dev=0x3, func=0x0
gfx_claim_vga_cycle: bridge for bus 2, updated bridge control is 0
gfx_claim_vga_cycle: bridge for bus 3, previous bridge control is 0
gfx_claim_vga_cycle: bus=0x0, dev=0x7, func=0x0
gfx_claim_vga_cycle: bridge for bus 3, updated bridge control is 18
gfx_claim_vga_cycle: bridge for bus 7, previous bridge control is 0
gfx_claim_vga_cycle: bus=0x0, dev=0x1e, func=0x0
gfx_claim_vga_cycle: bridge for bus 7, updated bridge control is 0
gfx_claim_vga_cycle: previous igd control is d1
gfx_claim_vga_cycle: updated igd control is d3
pt_msi_setup: msi mapped with pirq 1f
register_real_device: Real physical device 03:00.0 registered successfuly!
IRQ type = MSI-INTx
pt_bar_reg_read: first read BARs of gfx
pt_iomem_map: e_phys=b2000000 maddr=b2000000 type=0 len=16777216 index=0 first_map=1
pt_bar_reg_read: first read BARs of gfx
pt_iomem_map: e_phys=c0000000 maddr=c0000000 type=8 len=536870912 index=1 first_map=1
pt_bar_reg_read: first read BARs of gfx
pt_bar_reg_read: first read BARs of gfx
pt_iomem_map: e_phys=b0000000 maddr=b0000000 type=0 len=33554432 index=3 first_map=1
pt_bar_reg_read: first read BARs of gfx
pt_bar_reg_read: first read BARs of gfx
pt_ioport_map: e_phys=2000 pio_base=2000 len=128 index=5 first_map=1
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.
pt_iomem_map: e_phys=ffffffff maddr=b2000000 type=0 len=16777216 index=0 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=c0000000 type=8 len=536870912 index=1 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=0 len=33554432 index=3 first_map=0
pt_ioport_map: e_phys=ffff pio_base=2000 len=128 index=5 first_map=0
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]
pt_iomem_map: e_phys=b2000000 maddr=b2000000 type=0 len=16777216 index=0 first_map=0
pt_iomem_map: e_phys=c0000000 maddr=c0000000 type=8 len=536870912 index=1 first_map=0
pt_iomem_map: e_phys=b0000000 maddr=b0000000 type=0 len=33554432 index=3 first_map=0
pt_ioport_map: e_phys=2000 pio_base=2000 len=128 index=5 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=b2000000 type=0 len=16777216 index=0 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=c0000000 type=8 len=536870912 index=1 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=0 len=33554432 index=3 first_map=0
pt_ioport_map: e_phys=ffff pio_base=2000 len=128 index=5 first_map=0
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]
pt_iomem_map: e_phys=b2000000 maddr=b2000000 type=0 len=16777216 index=0 first_map=0
pt_iomem_map: e_phys=c0000000 maddr=c0000000 type=8 len=536870912 index=1 first_map=0
pt_iomem_map: e_phys=b0000000 maddr=b0000000 type=0 len=33554432 index=3 first_map=0
pt_ioport_map: e_phys=2000 pio_base=2000 len=128 index=5 first_map=0
Warning: attempted read from physical address 0xe0000000 in xen platform mmio space
pt_iomem_map: e_phys=ffffffff maddr=b2000000 type=0 len=16777216 index=0 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=c0000000 type=8 len=536870912 index=1 first_map=0
pt_iomem_map: e_phys=ffffffff maddr=b0000000 type=0 len=33554432 index=3 first_map=0
pt_ioport_map: e_phys=ffff pio_base=2000 len=128 index=5 first_map=0
pt_iomem_map: e_phys=b2000000 maddr=b2000000 type=0 len=16777216 index=0 first_map=0
pt_iomem_map: e_phys=c0000000 maddr=c0000000 type=8 len=536870912 index=1 first_map=0
pt_iomem_map: e_phys=b0000000 maddr=b0000000 type=0 len=33554432 index=3 first_map=0
pt_ioport_map: e_phys=2000 pio_base=2000 len=128 index=5 first_map=0
Warning: attempted read from physical address 0xe0000000 in xen platform mmio space

[-- Attachment #3: xend.log --]
[-- Type: application/octet-stream, Size: 17516 bytes --]

[2009-08-31 21:05:08 4851] INFO (SrvDaemon:332) Xend Daemon started
[2009-08-31 21:05:08 4851] INFO (SrvDaemon:336) Xend changeset: Thu Aug 27 11:25:34 2009 +0100 20128:e8004f6c254a.
[2009-08-31 21:05:08 4851] DEBUG (XendDomainInfo:147) XendDomainInfo.recreate({'max_vcpu_id': 7, 'cpu_time': 5873639544L, 'ssidref': 0, 'hvm': 0, 'shutdown_reason': 0, 'dying': 0, 'online_vcpus': 8, 'domid': 0, 'paused': 0, 'crashed': 0, 'running': 1, 'maxmem_kb': 17179869180L, 'shutdown': 0, 'mem_kb': 2095872L, 'handle': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'blocked': 0, 'name': 'Domain-0'})
[2009-08-31 21:05:08 4851] INFO (XendDomainInfo:165) Recreating domain 0, UUID 00000000-0000-0000-0000-000000000000. at /local/domain/0
[2009-08-31 21:05:08 4851] DEBUG (XendDomainInfo:3150) Storing VM details: {'on_xend_stop': 'ignore', 'shadow_memory': '0', 'uuid': '00000000-0000-0000-0000-000000000000', 'on_reboot': 'restart', 'image': '(linux (kernel ) (superpages 0))', 'on_poweroff': 'destroy', 'bootloader_args': '', 'on_xend_start': 'ignore', 'on_crash': 'restart', 'xend/restart_count': '0', 'vcpus': '8', 'vcpu_avail': '255', 'bootloader': '', 'name': 'Domain-0'}
[2009-08-31 21:05:08 4851] DEBUG (XendDomainInfo:1685) Storing domain details: {'cpu/3/availability': 'online', 'name': 'Domain-0', 'console/limit': '1048576', 'memory/target': '2095872', 'cpu/2/availability': 'online', 'vm': '/vm/00000000-0000-0000-0000-000000000000', 'domid': '0', 'cpu/7/availability': 'online', 'cpu/0/availability': 'online', 'cpu/1/availability': 'online', 'cpu/5/availability': 'online', 'control/platform-feature-multiprocessor-suspend': '1', 'cpu/6/availability': 'online', 'console/type': 'xenconsoled', 'cpu/4/availability': 'online'}
[2009-08-31 21:05:08 4851] DEBUG (XendDomain:452) Adding Domain: 0
[2009-08-31 21:05:08 4851] DEBUG (XendDomain:386) number of vcpus to use is 0
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VBD.set_device not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VBD.set_type not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: session.get_all_records not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: event.get_record not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: event.get_all not found
[2009-08-31 21:05:09 4851] DEBUG (XendDomainInfo:1772) XendDomainInfo.handleShutdownWatch
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.get_network not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.set_device not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.set_MAC not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.set_MTU not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: debug.get_all not found
[2009-08-31 21:05:09 4851] INFO (XMLRPCServer:156) Opening Unix domain socket XML-RPC server on /var/run/xend/xen-api.sock; authentication has been disabled for this server.
[2009-08-31 21:05:09 4851] INFO (XMLRPCServer:156) Opening Unix domain socket XML-RPC server on /var/run/xend/xmlrpc.sock.
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:99) XendDomainInfo.create(['vm', ['name', 'WinXP'], ['memory', 2048], ['vcpus', 1], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'], ['image', ['hvm', ['kernel', 'hvmloader'], ['videoram', 4], ['device_model', 'qemu-dm'], ['pae', 1], ['vcpus', 1], ['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 1], ['localtime', 0], ['serial', 'pty'], ['stdvga', 0], ['isa', 0], ['nographic', 0], ['soundhw', ''], ['vnc', 1], ['vncunused', 1], ['sdl', 0], ['xauthority', '/root/.Xauthority'], ['rtc_timeoffset', 0], ['monitor', 0], ['acpi', 1], ['apic', 1], ['usb', 0], ['usbdevice', ''], ['keymap', ''], ['pci', [['0x0000', '0x03', '0x00', '0x0', '0x100', [], '03:00.0']]], ['hpet', 0], ['guest_os_type', 'default'], ['hap', 1], ['opengl', 1], ['cpuid', []], ['cpuid_check', []], ['viridian', 0], ['pci_msitranslate', 1], ['vpt_align', 1], ['pci_power_mgmt', 0], ['xen_platform_pci', 1], ['gfx_passthru', 2], ['vncpasswd', 'XXXXXXXX']]], ['s3_integrity', 1], ['device', ['vbd', ['uname', 'phy:/dev/xenclient/storage'], ['dev', 'hda'], ['mode', 'w']]], ['device', ['vbd', ['uname', ''], ['dev', 'hdc:cdrom'], ['mode', 'r']]], ['device', ['pci', ['dev', ['slot', '0x00'], ['domain', '0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'], ['func', '0x0']]]], ['device', ['vif', ['bridge', 'xenbr0'], ['mac', '00:16:3e:00:00:12'], ['type', 'ioemu']]]])
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:2366) XendDomainInfo.constructDomain
[2009-08-31 21:06:27 4851] DEBUG (balloon:181) Balloon: 4083012 KiB free; need 4096; done.
[2009-08-31 21:06:27 4851] DEBUG (XendDomain:452) Adding Domain: 1
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:2591) XendDomainInfo.initDomain: 1 256
[2009-08-31 21:06:27 4851] DEBUG (image:338) No VNC passwd configured for vfb access
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: boot, val: c
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: fda, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: fdb, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: soundhw, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: localtime, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: serial, val: ['pty']
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: std-vga, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: isa, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: acpi, val: 1
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: usb, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: usbdevice, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: gfx_passthru, val: 2
[2009-08-31 21:06:27 4851] INFO (image:779) Need to create platform device.[domid:1]
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:2618) _initDomain:shadow_memory=0x0, memory_static_max=0x80000000, memory_static_min=0x0.
[2009-08-31 21:06:27 4851] DEBUG (balloon:181) Balloon: 4081592 KiB free; need 2126848; done.
[2009-08-31 21:06:27 4851] INFO (image:181) buildDomain os=hvm dom=1 vcpus=1
[2009-08-31 21:06:27 4851] DEBUG (image:896) domid          = 1
[2009-08-31 21:06:27 4851] DEBUG (image:897) image          = /usr/lib/xen/boot/hvmloader
[2009-08-31 21:06:27 4851] DEBUG (image:898) store_evtchn   = 2
[2009-08-31 21:06:27 4851] DEBUG (image:899) memsize        = 2048
[2009-08-31 21:06:27 4851] DEBUG (image:900) target         = 2048
[2009-08-31 21:06:27 4851] DEBUG (image:901) vcpus          = 1
[2009-08-31 21:06:27 4851] DEBUG (image:902) acpi           = 1
[2009-08-31 21:06:27 4851] DEBUG (image:903) apic           = 1
[2009-08-31 21:06:27 4851] DEBUG (image:904) gfx_passthru   = 2
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vfb : {'vncunused': 1, 'other_config': {'vncunused': 1, 'vnc': '1'}, 'vnc': '1', 'uuid': '01dd4b4c-0ddf-2e20-3f48-f8c985e6d378'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vfb/1/0'} to /local/domain/1/device/vfb/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'vncunused': '1', 'domain': 'WinXP', 'frontend': '/local/domain/1/device/vfb/0', 'uuid': '01dd4b4c-0ddf-2e20-3f48-f8c985e6d378', 'frontend-id': '1', 'state': '1', 'online': '1', 'vnc': '1'} to /local/domain/0/backend/vfb/1/0.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vbd : {'uuid': 'f43b3ea1-bc58-437a-b609-0856e5cdb082', 'bootable': 1, 'driver': 'paravirtualised', 'dev': 'hda', 'uname': 'phy:/dev/xenclient/storage', 'mode': 'w'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'backend-id': '0', 'virtual-device': '768', 'device-type': 'disk', 'state': '1', 'backend': '/local/domain/0/backend/vbd/1/768'} to /local/domain/1/device/vbd/768.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'frontend': '/local/domain/1/device/vbd/768', 'uuid': 'f43b3ea1-bc58-437a-b609-0856e5cdb082', 'bootable': '1', 'dev': 'hda', 'state': '1', 'params': '/dev/xenclient/storage', 'mode': 'w', 'online': '1', 'frontend-id': '1', 'type': 'phy'} to /local/domain/0/backend/vbd/1/768.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vbd : {'uuid': '3e6e4b3e-7cf5-04b4-a7e0-47446ddfb956', 'bootable': 0, 'driver': 'paravirtualised', 'dev': 'hdc:cdrom', 'uname': '', 'mode': 'r'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'backend-id': '0', 'virtual-device': '5632', 'device-type': 'cdrom', 'state': '1', 'backend': '/local/domain/0/backend/vbd/1/5632'} to /local/domain/1/device/vbd/5632.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'frontend': '/local/domain/1/device/vbd/5632', 'uuid': '3e6e4b3e-7cf5-04b4-a7e0-47446ddfb956', 'bootable': '0', 'dev': 'hdc', 'state': '1', 'params': '', 'mode': 'r', 'online': '1', 'frontend-id': '1', 'type': ''} to /local/domain/0/backend/vbd/1/5632.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vif : {'bridge': 'xenbr0', 'mac': '00:16:3e:00:00:12', 'type': 'ioemu', 'uuid': '330c58f8-2917-6ee5-f2ed-3ec0776e5080'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vif/1/0'} to /local/domain/1/device/vif/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'bridge': 'xenbr0', 'domain': 'WinXP', 'handle': '0', 'uuid': '330c58f8-2917-6ee5-f2ed-3ec0776e5080', 'script': '/etc/xen/scripts/vif-bridge', 'mac': '00:16:3e:00:00:12', 'frontend-id': '1', 'state': '1', 'online': '1', 'frontend': '/local/domain/1/device/vif/0', 'type': 'ioemu'} to /local/domain/0/backend/vif/1/0.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: pci : {'devs': [{'slot': '0x00', 'domain': '0x0000', 'key': '03:00.0', 'bus': '0x03', 'vdevfn': '0x100', 'func': '0x0', 'uuid': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07'}], 'uuid': 'b189db77-4a72-1f06-2fd8-a0328bb95d42'}
[2009-08-31 21:06:28 4851] DEBUG (pciif:449) pci: register aer watch /local/domain/0/backend/pci/1/0/aerState
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/pci/1/0'} to /local/domain/1/device/pci/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'key-0': '03:00.0', 'vdevfn-0': '100', 'uuid': 'b189db77-4a72-1f06-2fd8-a0328bb95d42', 'power_mgmt': '0', 'msitranslate': '1', 'dev-0': '0000:03:00.0', 'frontend-id': '1', 'state': '1', 'online': '1', 'frontend': '/local/domain/1/device/pci/0', 'uuid-0': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07', 'num_devs': '1'} to /local/domain/0/backend/pci/1/0.
[2009-08-31 21:06:28 4851] INFO (image:410) spawning device models: /usr/lib/xen/bin/qemu-dm ['/usr/lib/xen/bin/qemu-dm', '-d', '1', '-domain-name', 'WinXP', '-videoram', '4', '-vnc', '0.0.0.0:0', '-vncunused', '-vcpus', '1', '-boot', 'c', '-serial', 'pty', '-acpi', '-gfx_passthru', '2', '-net', 'nic,vlan=1,macaddr=00:16:3e:00:00:12,model=rtl8139', '-net', 'tap,vlan=1,ifname=tap1.0,bridge=xenbr0', '-M', 'xenfv']
[2009-08-31 21:06:28 4851] INFO (image:459) device model pid: 5360
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:837) XendDomainInfo.pci_device_configure: ['pci', ['dev', ['slot', '0x00'], ['domain', '0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'], ['func', '0x0'], ['uuid', 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07']], ['state', 'Initialising'], ['sub_state', 'Booting']]
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:740) XendDomainInfo.hvm_pci_device_insert: {'devs': [{'slot': '0x00', 'domain': '0x0000', 'key': '03:00.0', 'bus': '0x03', 'vdevfn': '0x100', 'func': '0x0', 'uuid': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07'}], 'states': ['Initialising']}
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:751) XendDomainInfo.hvm_pci_device_insert_dev: {'slot': '0x00', 'domain': '0x0000', 'key': '03:00.0', 'bus': '0x03', 'vdevfn': '0x100', 'func': '0x0', 'uuid': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07'}
[2009-08-31 21:06:28 4851] INFO (image:561) waiting for sentinel_fifo
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:760) XendDomainInfo.hvm_pci_device_insert_dev: 0000:03:00.0@100
[2009-08-31 21:06:28 4851] DEBUG (image:479) signalDeviceModel: orig_state is None, retrying
[2009-08-31 21:06:28 4851] DEBUG (image:479) signalDeviceModel: orig_state is None, retrying
[2009-08-31 21:06:28 4851] INFO (image:509) signalDeviceModel:restore dm state to running
[2009-08-31 21:06:28 4851] DEBUG (pciif:151) Reconfiguring PCI device 0000:03:00.0.
[2009-08-31 21:06:28 4851] INFO (pciquirk:92) NO quirks found for PCI device [10de:0640:0000:0000]
[2009-08-31 21:06:28 4851] DEBUG (pciquirk:135) Permissive mode NOT enabled for PCI device [10de:0640:0000:0000]
[2009-08-31 21:06:28 4851] DEBUG (pciif:312) pci: enabling ioport 0x2000/0x80
[2009-08-31 21:06:28 4851] DEBUG (pciif:326) pci: enabling iomem 0xb2000000/0x1000000 pfn 0xb2000/0x1000
[2009-08-31 21:06:28 4851] DEBUG (pciif:326) pci: enabling iomem 0xc0000000/0x20000000 pfn 0xc0000/0x20000
[2009-08-31 21:06:28 4851] DEBUG (pciif:326) pci: enabling iomem 0xb0000000/0x2000000 pfn 0xb0000/0x2000
[2009-08-31 21:06:28 4851] DEBUG (pciif:355) pci: enabling irq 16
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:3150) Storing VM details: {'on_xend_stop': 'ignore', 'shadow_memory': '17', 'uuid': '3f3da690-84db-e24a-4831-e385fbfe6de3', 'on_reboot': 'restart', 'start_time': '1251749188.71', 'on_poweroff': 'destroy', 'bootloader_args': '', 'on_xend_start': 'ignore', 'on_crash': 'restart', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'bootloader': '', 'image': '(hvm (kernel ) (superpages 0) (videoram 4) (hpet 0) (stdvga 0) (loader /usr/lib/xen/boot/hvmloader) (serial pty) (vncunused 1) (xen_platform_pci 1) (opengl 1) (gfx_passthru 2) (boot c) (rtc_timeoffset 0) (pci ((0x0000 0x03 0x00 0x0 0x100 ()))) (pae 1) (vpt_align 1) (hap 1) (viridian 0) (acpi 1) (localtime 0) (timer_mode 1) (vnc 1) (nographic 0) (guest_os_type default) (pci_msitranslate 1) (apic 1) (sdl 0) (monitor 0) (device_model /usr/lib/xen/bin/qemu-dm) (pci_power_mgmt 0) (usb 0) (xauthority /root/.Xauthority) (isa 0) (notes (SUSPEND_CANCEL 1)))', 'name': 'WinXP'}
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:1685) Storing domain details: {'console/port': '3', 'name': 'WinXP', 'console/limit': '1048576', 'store/port': '2', 'vm': '/vm/3f3da690-84db-e24a-4831-e385fbfe6de3', 'domid': '1', 'image/suspend-cancel': '1', 'cpu/0/availability': 'online', 'memory/target': '2097152', 'control/platform-feature-multiprocessor-suspend': '1', 'store/ring-ref': '1044476', 'console/type': 'ioemu'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/console/1/0'} to /local/domain/1/device/console/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'frontend': '/local/domain/1/device/console/0', 'uuid': '700c7645-83c8-b254-013c-d2f30e2f04bb', 'frontend-id': '1', 'state': '1', 'location': '3', 'online': '1', 'protocol': 'vt100'} to /local/domain/0/backend/console/1/0.
[2009-08-31 21:06:28 4851] DEBUG (pciif:453) XendDomainInfo.handleAerStateWatch
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices tap2.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vif.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 0.
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:1772) XendDomainInfo.handleShutdownWatch
[2009-08-31 21:06:28 4851] DEBUG (DevController:628) hotplugStatusCallback /local/domain/0/backend/vif/1/0/hotplug-status.
[2009-08-31 21:06:28 4851] DEBUG (DevController:642) hotplugStatusCallback 1.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vscsi.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vbd.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 768.
[2009-08-31 21:06:28 4851] DEBUG (DevController:628) hotplugStatusCallback /local/domain/0/backend/vbd/1/768/hotplug-status.
[2009-08-31 21:06:28 4851] DEBUG (DevController:642) hotplugStatusCallback 1.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 5632.
[2009-08-31 21:06:28 4851] DEBUG (DevController:628) hotplugStatusCallback /local/domain/0/backend/vbd/1/5632/hotplug-status.
[2009-08-31 21:06:28 4851] DEBUG (DevController:642) hotplugStatusCallback 1.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices irq.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vkbd.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vfb.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices console.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices pci.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices ioports.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices tap.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vtpm.
[2009-08-31 21:06:28 4851] INFO (XendDomain:1180) Domain WinXP (1) unpaused.

[-- Attachment #4: xm_dmesg.log --]
[-- Type: application/octet-stream, Size: 16384 bytes --]

d0 MCE: wrmsr MCG_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC0_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC1_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC2_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC3_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC4_STATUS 0
(XEN) mce.c:871:d0 MCE: wr MC5_STATUS 0
(XEN) PCI add device 00:00.0
(XEN) PCI add device 00:01.0
(XEN) PCI add device 00:03.0
(XEN) PCI add device 00:07.0
(XEN) PCI add device 00:10.0
(XEN) PCI add device 00:10.1
(XEN) PCI add device 00:14.0
(XEN) PCI add device 00:14.1
(XEN) PCI add device 00:14.2
(XEN) PCI add device 00:14.3
(XEN) PCI add device 00:19.0
(XEN) PCI add device 00:1a.0
(XEN) PCI add device 00:1a.1
(XEN) PCI add device 00:1a.2
(XEN) PCI add device 00:1a.7
(XEN) PCI add device 00:1b.0
(XEN) PCI add device 00:1c.0
(XEN) PCI add device 00:1c.1
(XEN) PCI add device 00:1c.4
(XEN) PCI add device 00:1d.0
(XEN) PCI add device 00:1d.1
(XEN) PCI add device 00:1d.2
(XEN) PCI add device 00:1d.7
(XEN) PCI add device 00:1e.0
(XEN) PCI add device 00:1f.0
(XEN) PCI add device 00:1f.2
(XEN) PCI add device 00:1f.3
(XEN) PCI add device 01:00.0
(XEN) PCI add device 02:00.0
(XEN) PCI add device 03:00.0
(XEN) PCI add device 06:00.0
(XEN) PCI add device 07:03.0
(XEN) PCI add device 00:19.0
(XEN) PCI add device 06:00.0
(XEN) PCI add device 00:1f.2
(XEN) PCI add device 00:1a.0
(XEN) PCI add device 00:1a.1
(XEN) PCI add device 00:1a.2
(XEN) PCI add device 00:1d.0
(XEN) PCI add device 00:1d.1
(XEN) PCI add device 00:1d.2
(XEN) Set CPU acpi_id(0) cpuid(0) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(0) cpuid(0) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) xen_pminfo: @acpi_cpufreq_cpu_init,HARDWARE addr space
(XEN) CPU 0 initialization completed
(XEN) Set CPU acpi_id(1) cpuid(1) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(1) cpuid(1) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 1
(XEN) Set CPU acpi_id(2) cpuid(2) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(2) cpuid(2) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 2
(XEN) Set CPU acpi_id(3) cpuid(3) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(3) cpuid(3) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 3
(XEN) Set CPU acpi_id(4) cpuid(4) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(4) cpuid(4) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 4
(XEN) Set CPU acpi_id(5) cpuid(5) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(5) cpuid(5) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 5
(XEN) Set CPU acpi_id(6) cpuid(6) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(6) cpuid(6) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 6
(XEN) Set CPU acpi_id(7) cpuid(7) Px State info:
(XEN) 	_PPC: 0
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-1 state
(XEN) cpuid.MWAIT[.eax=40, .ebx=40, .ecx=3, .edx=1120]
(XEN) Monitor-Mwait will be used to enter C-3 state
(XEN) Set CPU acpi_id(7) cpuid(7) Px State info:
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=64, bit_offset=0, reserved=0, address=409
(XEN) 	_PCT: descriptor=130, length=12, space_id=127, bit_width=16, bit_offset=0, reserved=0, address=408
(XEN) 	_PSS: state_count=10
(XEN) 	State0: 2661MHz 90000mW 10us 10us 0x15 0x15
(XEN) 	State1: 2660MHz 90000mW 10us 10us 0x14 0x14
(XEN) 	State2: 2527MHz 80000mW 10us 10us 0x13 0x13
(XEN) 	State3: 2394MHz 70000mW 10us 10us 0x12 0x12
(XEN) 	State4: 2261MHz 60000mW 10us 10us 0x11 0x11
(XEN) 	State5: 2128MHz 50000mW 10us 10us 0x10 0x10
(XEN) 	State6: 1995MHz 40000mW 10us 10us 0xf 0xf
(XEN) 	State7: 1862MHz 30000mW 10us 10us 0xe 0xe
(XEN) 	State8: 1729MHz 20000mW 10us 10us 0xd 0xd
(XEN) 	State9: 1596MHz 10000mW 10us 10us 0xc 0xc
(XEN) 	_PSD: num_entries=5 rev=0 domain=0 coord_type=252 num_processors=8
(XEN) 	_PPC: 0
(XEN) adding CPU 7
(XEN) [VT-D]iommu.c:1288:d0 domain_context_unmap:PCIe: bdf = 3:0.0
(XEN) [VT-D]iommu.c:1174:d0 domain_context_mapping:PCIe: bdf = 3:0.0
(XEN) domctl.c:887:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=c
(XEN) domctl.c:887:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:836:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]io.c:284:d0 VT-d irq bind: m_irq = 1f device = 4 intx = 0
(XEN) HVM1: HVM Loader
(XEN) HVM1: Detected Xen v3.5-unstable
(XEN) HVM1: CPU speed is 2667 MHz
(XEN) irq.c:243: Dom1 PCI link 0 changed 0 -> 5
(XEN) HVM1: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom1 PCI link 1 changed 0 -> 10
(XEN) HVM1: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom1 PCI link 2 changed 0 -> 11
(XEN) HVM1: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom1 PCI link 3 changed 0 -> 5
(XEN) HVM1: PCI-ISA link 3 routed to IRQ5
(XEN) HVM1: pci dev 01:3 INTA->IRQ10
(XEN) HVM1: pci dev 02:0 INTA->IRQ11
(XEN) HVM1: pci dev 03:0 INTA->IRQ5
(XEN) HVM1: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:836:d0 memory_map:add: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=2000 f_mport=2000 np=80
(XEN) HVM1: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM1: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM1: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM1: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c201
(XEN) HVM1: Multiprocessor initialisation:
(XEN) HVM1:  - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM1: Testing HVM environment:
(XEN) HVM1:  - REP INSB across page boundaries ... passed
(XEN) HVM1:  - GS base MSRs and SWAPGS ... passed
(XEN) HVM1: Passed 2 of 2 tests
(XEN) HVM1: Writing SMBIOS tables ...
(XEN) HVM1: Loading ROMBIOS ...
(XEN) HVM1: 9660 bytes of ROMBIOS high-memory extensions:
(XEN) HVM1:   Relocating to 0xfc000000-0xfc0025bc ... done
(XEN) HVM1: Creating MP tables ...
(XEN) HVM1: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM1: Loading PCI Option ROM ...
(XEN) HVM1:  - Manufacturer: http://etherboot.org
(XEN) HVM1:  - Product name: gPXE
(XEN) HVM1: Loading ACPI ...
(XEN) HVM1:  - Lo data: 000ea020-000ea04f
(XEN) HVM1:  - Hi data: fc002800-fc011e1f
(XEN) HVM1: vm86 TSS at fc012000
(XEN) HVM1: BIOS map:
(XEN) HVM1:  c0000-c07ff: VGA BIOS
(XEN) HVM1:  c8000-d47ff: Etherboot ROM
(XEN) HVM1:  eb000-eb14e: SMBIOS tables
(XEN) HVM1:  f0000-fffff: Main BIOS
(XEN) HVM1: Invoking ROMBIOS ...
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Bochs BIOS - build: 06/23/99
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Options: apmbios pcibios eltorito PMM 
(XEN) HVM1: 
(XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (38912 MBytes)
(XEN) HVM1: IDE time out
(XEN) HVM1: ata1 master: QEMU DVD-ROM ATAPI-4 CD-Rom/DVD-Rom
(XEN) HVM1: IDE time out
(XEN) HVM1: 
(XEN) HVM1: 
(XEN) HVM1: 
(XEN) HVM1: Press F12 for boot menu.
(XEN) HVM1: 
(XEN) HVM1: Booting from Hard Disk...
(XEN) HVM1: Booting from 0000:7c00
(XEN) HVM1: int13_harddisk: function 15, unmapped device for ELDL=81
(XEN) HVM1: *** int 15h function AX=e980, BX=006e not yet supported!
(XEN) mce.c:694:d1 MCE: rdmsr MCG_CAP 0x1809
(XEN) mce.c:714:d1 MCE: rdmsr MC0_CTL 0xffffffffffffffff
(XEN) mce.c:694:d1 MCE: rdmsr MCG_CAP 0x1809
(XEN) domctl.c:846:d0 memory_map:remove: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:911:d0 ioport_map:remove f_gport=2000 f_mport=2000 np=80
(XEN) domctl.c:836:d0 memory_map:add: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:836:d0 memory_map:add: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=2000 f_mport=2000 np=80
(XEN) domctl.c:846:d0 memory_map:remove: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:911:d0 ioport_map:remove f_gport=2000 f_mport=2000 np=80
(XEN) domctl.c:836:d0 memory_map:add: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:836:d0 memory_map:add: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=2000 f_mport=2000 np=80
(XEN) irq.c:243: Dom1 PCI link 0 changed 5 -> 0
(XEN) irq.c:243: Dom1 PCI link 0 changed 0 -> 5
(XEN) domctl.c:846:d0 memory_map:remove: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:846:d0 memory_map:remove: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:911:d0 ioport_map:remove f_gport=2000 f_mport=2000 np=80
(XEN) domctl.c:836:d0 memory_map:add: gfn=b2000 mfn=b2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=20000
(XEN) domctl.c:836:d0 memory_map:add: gfn=b0000 mfn=b0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=2000 f_mport=2000 np=80
(XEN) irq.c:243: Dom1 PCI link 0 changed 5 -> 0

[-- Attachment #5: xend.log --]
[-- Type: application/octet-stream, Size: 17516 bytes --]

[2009-08-31 21:05:08 4851] INFO (SrvDaemon:332) Xend Daemon started
[2009-08-31 21:05:08 4851] INFO (SrvDaemon:336) Xend changeset: Thu Aug 27 11:25:34 2009 +0100 20128:e8004f6c254a.
[2009-08-31 21:05:08 4851] DEBUG (XendDomainInfo:147) XendDomainInfo.recreate({'max_vcpu_id': 7, 'cpu_time': 5873639544L, 'ssidref': 0, 'hvm': 0, 'shutdown_reason': 0, 'dying': 0, 'online_vcpus': 8, 'domid': 0, 'paused': 0, 'crashed': 0, 'running': 1, 'maxmem_kb': 17179869180L, 'shutdown': 0, 'mem_kb': 2095872L, 'handle': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'blocked': 0, 'name': 'Domain-0'})
[2009-08-31 21:05:08 4851] INFO (XendDomainInfo:165) Recreating domain 0, UUID 00000000-0000-0000-0000-000000000000. at /local/domain/0
[2009-08-31 21:05:08 4851] DEBUG (XendDomainInfo:3150) Storing VM details: {'on_xend_stop': 'ignore', 'shadow_memory': '0', 'uuid': '00000000-0000-0000-0000-000000000000', 'on_reboot': 'restart', 'image': '(linux (kernel ) (superpages 0))', 'on_poweroff': 'destroy', 'bootloader_args': '', 'on_xend_start': 'ignore', 'on_crash': 'restart', 'xend/restart_count': '0', 'vcpus': '8', 'vcpu_avail': '255', 'bootloader': '', 'name': 'Domain-0'}
[2009-08-31 21:05:08 4851] DEBUG (XendDomainInfo:1685) Storing domain details: {'cpu/3/availability': 'online', 'name': 'Domain-0', 'console/limit': '1048576', 'memory/target': '2095872', 'cpu/2/availability': 'online', 'vm': '/vm/00000000-0000-0000-0000-000000000000', 'domid': '0', 'cpu/7/availability': 'online', 'cpu/0/availability': 'online', 'cpu/1/availability': 'online', 'cpu/5/availability': 'online', 'control/platform-feature-multiprocessor-suspend': '1', 'cpu/6/availability': 'online', 'console/type': 'xenconsoled', 'cpu/4/availability': 'online'}
[2009-08-31 21:05:08 4851] DEBUG (XendDomain:452) Adding Domain: 0
[2009-08-31 21:05:08 4851] DEBUG (XendDomain:386) number of vcpus to use is 0
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VBD.set_device not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VBD.set_type not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: session.get_all_records not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: event.get_record not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: event.get_all not found
[2009-08-31 21:05:09 4851] DEBUG (XendDomainInfo:1772) XendDomainInfo.handleShutdownWatch
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.get_network not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.set_device not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.set_MAC not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: VIF.set_MTU not found
[2009-08-31 21:05:09 4851] WARNING (XendAPI:701) API call: debug.get_all not found
[2009-08-31 21:05:09 4851] INFO (XMLRPCServer:156) Opening Unix domain socket XML-RPC server on /var/run/xend/xen-api.sock; authentication has been disabled for this server.
[2009-08-31 21:05:09 4851] INFO (XMLRPCServer:156) Opening Unix domain socket XML-RPC server on /var/run/xend/xmlrpc.sock.
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:99) XendDomainInfo.create(['vm', ['name', 'WinXP'], ['memory', 2048], ['vcpus', 1], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'], ['image', ['hvm', ['kernel', 'hvmloader'], ['videoram', 4], ['device_model', 'qemu-dm'], ['pae', 1], ['vcpus', 1], ['boot', 'c'], ['fda', ''], ['fdb', ''], ['timer_mode', 1], ['localtime', 0], ['serial', 'pty'], ['stdvga', 0], ['isa', 0], ['nographic', 0], ['soundhw', ''], ['vnc', 1], ['vncunused', 1], ['sdl', 0], ['xauthority', '/root/.Xauthority'], ['rtc_timeoffset', 0], ['monitor', 0], ['acpi', 1], ['apic', 1], ['usb', 0], ['usbdevice', ''], ['keymap', ''], ['pci', [['0x0000', '0x03', '0x00', '0x0', '0x100', [], '03:00.0']]], ['hpet', 0], ['guest_os_type', 'default'], ['hap', 1], ['opengl', 1], ['cpuid', []], ['cpuid_check', []], ['viridian', 0], ['pci_msitranslate', 1], ['vpt_align', 1], ['pci_power_mgmt', 0], ['xen_platform_pci', 1], ['gfx_passthru', 2], ['vncpasswd', 'XXXXXXXX']]], ['s3_integrity', 1], ['device', ['vbd', ['uname', 'phy:/dev/xenclient/storage'], ['dev', 'hda'], ['mode', 'w']]], ['device', ['vbd', ['uname', ''], ['dev', 'hdc:cdrom'], ['mode', 'r']]], ['device', ['pci', ['dev', ['slot', '0x00'], ['domain', '0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'], ['func', '0x0']]]], ['device', ['vif', ['bridge', 'xenbr0'], ['mac', '00:16:3e:00:00:12'], ['type', 'ioemu']]]])
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:2366) XendDomainInfo.constructDomain
[2009-08-31 21:06:27 4851] DEBUG (balloon:181) Balloon: 4083012 KiB free; need 4096; done.
[2009-08-31 21:06:27 4851] DEBUG (XendDomain:452) Adding Domain: 1
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:2591) XendDomainInfo.initDomain: 1 256
[2009-08-31 21:06:27 4851] DEBUG (image:338) No VNC passwd configured for vfb access
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: boot, val: c
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: fda, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: fdb, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: soundhw, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: localtime, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: serial, val: ['pty']
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: std-vga, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: isa, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: acpi, val: 1
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: usb, val: 0
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: usbdevice, val: None
[2009-08-31 21:06:27 4851] DEBUG (image:843) args: gfx_passthru, val: 2
[2009-08-31 21:06:27 4851] INFO (image:779) Need to create platform device.[domid:1]
[2009-08-31 21:06:27 4851] DEBUG (XendDomainInfo:2618) _initDomain:shadow_memory=0x0, memory_static_max=0x80000000, memory_static_min=0x0.
[2009-08-31 21:06:27 4851] DEBUG (balloon:181) Balloon: 4081592 KiB free; need 2126848; done.
[2009-08-31 21:06:27 4851] INFO (image:181) buildDomain os=hvm dom=1 vcpus=1
[2009-08-31 21:06:27 4851] DEBUG (image:896) domid          = 1
[2009-08-31 21:06:27 4851] DEBUG (image:897) image          = /usr/lib/xen/boot/hvmloader
[2009-08-31 21:06:27 4851] DEBUG (image:898) store_evtchn   = 2
[2009-08-31 21:06:27 4851] DEBUG (image:899) memsize        = 2048
[2009-08-31 21:06:27 4851] DEBUG (image:900) target         = 2048
[2009-08-31 21:06:27 4851] DEBUG (image:901) vcpus          = 1
[2009-08-31 21:06:27 4851] DEBUG (image:902) acpi           = 1
[2009-08-31 21:06:27 4851] DEBUG (image:903) apic           = 1
[2009-08-31 21:06:27 4851] DEBUG (image:904) gfx_passthru   = 2
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vfb : {'vncunused': 1, 'other_config': {'vncunused': 1, 'vnc': '1'}, 'vnc': '1', 'uuid': '01dd4b4c-0ddf-2e20-3f48-f8c985e6d378'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vfb/1/0'} to /local/domain/1/device/vfb/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'vncunused': '1', 'domain': 'WinXP', 'frontend': '/local/domain/1/device/vfb/0', 'uuid': '01dd4b4c-0ddf-2e20-3f48-f8c985e6d378', 'frontend-id': '1', 'state': '1', 'online': '1', 'vnc': '1'} to /local/domain/0/backend/vfb/1/0.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vbd : {'uuid': 'f43b3ea1-bc58-437a-b609-0856e5cdb082', 'bootable': 1, 'driver': 'paravirtualised', 'dev': 'hda', 'uname': 'phy:/dev/xenclient/storage', 'mode': 'w'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'backend-id': '0', 'virtual-device': '768', 'device-type': 'disk', 'state': '1', 'backend': '/local/domain/0/backend/vbd/1/768'} to /local/domain/1/device/vbd/768.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'frontend': '/local/domain/1/device/vbd/768', 'uuid': 'f43b3ea1-bc58-437a-b609-0856e5cdb082', 'bootable': '1', 'dev': 'hda', 'state': '1', 'params': '/dev/xenclient/storage', 'mode': 'w', 'online': '1', 'frontend-id': '1', 'type': 'phy'} to /local/domain/0/backend/vbd/1/768.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vbd : {'uuid': '3e6e4b3e-7cf5-04b4-a7e0-47446ddfb956', 'bootable': 0, 'driver': 'paravirtualised', 'dev': 'hdc:cdrom', 'uname': '', 'mode': 'r'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'backend-id': '0', 'virtual-device': '5632', 'device-type': 'cdrom', 'state': '1', 'backend': '/local/domain/0/backend/vbd/1/5632'} to /local/domain/1/device/vbd/5632.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'frontend': '/local/domain/1/device/vbd/5632', 'uuid': '3e6e4b3e-7cf5-04b4-a7e0-47446ddfb956', 'bootable': '0', 'dev': 'hdc', 'state': '1', 'params': '', 'mode': 'r', 'online': '1', 'frontend-id': '1', 'type': ''} to /local/domain/0/backend/vbd/1/5632.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: vif : {'bridge': 'xenbr0', 'mac': '00:16:3e:00:00:12', 'type': 'ioemu', 'uuid': '330c58f8-2917-6ee5-f2ed-3ec0776e5080'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/vif/1/0'} to /local/domain/1/device/vif/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'bridge': 'xenbr0', 'domain': 'WinXP', 'handle': '0', 'uuid': '330c58f8-2917-6ee5-f2ed-3ec0776e5080', 'script': '/etc/xen/scripts/vif-bridge', 'mac': '00:16:3e:00:00:12', 'frontend-id': '1', 'state': '1', 'online': '1', 'frontend': '/local/domain/1/device/vif/0', 'type': 'ioemu'} to /local/domain/0/backend/vif/1/0.
[2009-08-31 21:06:28 4851] INFO (XendDomainInfo:2237) createDevice: pci : {'devs': [{'slot': '0x00', 'domain': '0x0000', 'key': '03:00.0', 'bus': '0x03', 'vdevfn': '0x100', 'func': '0x0', 'uuid': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07'}], 'uuid': 'b189db77-4a72-1f06-2fd8-a0328bb95d42'}
[2009-08-31 21:06:28 4851] DEBUG (pciif:449) pci: register aer watch /local/domain/0/backend/pci/1/0/aerState
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/pci/1/0'} to /local/domain/1/device/pci/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'key-0': '03:00.0', 'vdevfn-0': '100', 'uuid': 'b189db77-4a72-1f06-2fd8-a0328bb95d42', 'power_mgmt': '0', 'msitranslate': '1', 'dev-0': '0000:03:00.0', 'frontend-id': '1', 'state': '1', 'online': '1', 'frontend': '/local/domain/1/device/pci/0', 'uuid-0': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07', 'num_devs': '1'} to /local/domain/0/backend/pci/1/0.
[2009-08-31 21:06:28 4851] INFO (image:410) spawning device models: /usr/lib/xen/bin/qemu-dm ['/usr/lib/xen/bin/qemu-dm', '-d', '1', '-domain-name', 'WinXP', '-videoram', '4', '-vnc', '0.0.0.0:0', '-vncunused', '-vcpus', '1', '-boot', 'c', '-serial', 'pty', '-acpi', '-gfx_passthru', '2', '-net', 'nic,vlan=1,macaddr=00:16:3e:00:00:12,model=rtl8139', '-net', 'tap,vlan=1,ifname=tap1.0,bridge=xenbr0', '-M', 'xenfv']
[2009-08-31 21:06:28 4851] INFO (image:459) device model pid: 5360
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:837) XendDomainInfo.pci_device_configure: ['pci', ['dev', ['slot', '0x00'], ['domain', '0x0000'], ['key', '03:00.0'], ['bus', '0x03'], ['vdevfn', '0x100'], ['func', '0x0'], ['uuid', 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07']], ['state', 'Initialising'], ['sub_state', 'Booting']]
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:740) XendDomainInfo.hvm_pci_device_insert: {'devs': [{'slot': '0x00', 'domain': '0x0000', 'key': '03:00.0', 'bus': '0x03', 'vdevfn': '0x100', 'func': '0x0', 'uuid': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07'}], 'states': ['Initialising']}
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:751) XendDomainInfo.hvm_pci_device_insert_dev: {'slot': '0x00', 'domain': '0x0000', 'key': '03:00.0', 'bus': '0x03', 'vdevfn': '0x100', 'func': '0x0', 'uuid': 'a3b3e9fd-6347-fa3f-9c38-52a105b5bc07'}
[2009-08-31 21:06:28 4851] INFO (image:561) waiting for sentinel_fifo
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:760) XendDomainInfo.hvm_pci_device_insert_dev: 0000:03:00.0@100
[2009-08-31 21:06:28 4851] DEBUG (image:479) signalDeviceModel: orig_state is None, retrying
[2009-08-31 21:06:28 4851] DEBUG (image:479) signalDeviceModel: orig_state is None, retrying
[2009-08-31 21:06:28 4851] INFO (image:509) signalDeviceModel:restore dm state to running
[2009-08-31 21:06:28 4851] DEBUG (pciif:151) Reconfiguring PCI device 0000:03:00.0.
[2009-08-31 21:06:28 4851] INFO (pciquirk:92) NO quirks found for PCI device [10de:0640:0000:0000]
[2009-08-31 21:06:28 4851] DEBUG (pciquirk:135) Permissive mode NOT enabled for PCI device [10de:0640:0000:0000]
[2009-08-31 21:06:28 4851] DEBUG (pciif:312) pci: enabling ioport 0x2000/0x80
[2009-08-31 21:06:28 4851] DEBUG (pciif:326) pci: enabling iomem 0xb2000000/0x1000000 pfn 0xb2000/0x1000
[2009-08-31 21:06:28 4851] DEBUG (pciif:326) pci: enabling iomem 0xc0000000/0x20000000 pfn 0xc0000/0x20000
[2009-08-31 21:06:28 4851] DEBUG (pciif:326) pci: enabling iomem 0xb0000000/0x2000000 pfn 0xb0000/0x2000
[2009-08-31 21:06:28 4851] DEBUG (pciif:355) pci: enabling irq 16
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:3150) Storing VM details: {'on_xend_stop': 'ignore', 'shadow_memory': '17', 'uuid': '3f3da690-84db-e24a-4831-e385fbfe6de3', 'on_reboot': 'restart', 'start_time': '1251749188.71', 'on_poweroff': 'destroy', 'bootloader_args': '', 'on_xend_start': 'ignore', 'on_crash': 'restart', 'xend/restart_count': '0', 'vcpus': '1', 'vcpu_avail': '1', 'bootloader': '', 'image': '(hvm (kernel ) (superpages 0) (videoram 4) (hpet 0) (stdvga 0) (loader /usr/lib/xen/boot/hvmloader) (serial pty) (vncunused 1) (xen_platform_pci 1) (opengl 1) (gfx_passthru 2) (boot c) (rtc_timeoffset 0) (pci ((0x0000 0x03 0x00 0x0 0x100 ()))) (pae 1) (vpt_align 1) (hap 1) (viridian 0) (acpi 1) (localtime 0) (timer_mode 1) (vnc 1) (nographic 0) (guest_os_type default) (pci_msitranslate 1) (apic 1) (sdl 0) (monitor 0) (device_model /usr/lib/xen/bin/qemu-dm) (pci_power_mgmt 0) (usb 0) (xauthority /root/.Xauthority) (isa 0) (notes (SUSPEND_CANCEL 1)))', 'name': 'WinXP'}
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:1685) Storing domain details: {'console/port': '3', 'name': 'WinXP', 'console/limit': '1048576', 'store/port': '2', 'vm': '/vm/3f3da690-84db-e24a-4831-e385fbfe6de3', 'domid': '1', 'image/suspend-cancel': '1', 'cpu/0/availability': 'online', 'memory/target': '2097152', 'control/platform-feature-multiprocessor-suspend': '1', 'store/ring-ref': '1044476', 'console/type': 'ioemu'}
[2009-08-31 21:06:28 4851] DEBUG (DevController:95) DevController: writing {'state': '1', 'backend-id': '0', 'backend': '/local/domain/0/backend/console/1/0'} to /local/domain/1/device/console/0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:97) DevController: writing {'domain': 'WinXP', 'frontend': '/local/domain/1/device/console/0', 'uuid': '700c7645-83c8-b254-013c-d2f30e2f04bb', 'frontend-id': '1', 'state': '1', 'location': '3', 'online': '1', 'protocol': 'vt100'} to /local/domain/0/backend/console/1/0.
[2009-08-31 21:06:28 4851] DEBUG (pciif:453) XendDomainInfo.handleAerStateWatch
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices tap2.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vif.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 0.
[2009-08-31 21:06:28 4851] DEBUG (XendDomainInfo:1772) XendDomainInfo.handleShutdownWatch
[2009-08-31 21:06:28 4851] DEBUG (DevController:628) hotplugStatusCallback /local/domain/0/backend/vif/1/0/hotplug-status.
[2009-08-31 21:06:28 4851] DEBUG (DevController:642) hotplugStatusCallback 1.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vscsi.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vbd.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 768.
[2009-08-31 21:06:28 4851] DEBUG (DevController:628) hotplugStatusCallback /local/domain/0/backend/vbd/1/768/hotplug-status.
[2009-08-31 21:06:28 4851] DEBUG (DevController:642) hotplugStatusCallback 1.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 5632.
[2009-08-31 21:06:28 4851] DEBUG (DevController:628) hotplugStatusCallback /local/domain/0/backend/vbd/1/5632/hotplug-status.
[2009-08-31 21:06:28 4851] DEBUG (DevController:642) hotplugStatusCallback 1.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices irq.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vkbd.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vfb.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices console.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices pci.
[2009-08-31 21:06:28 4851] DEBUG (DevController:144) Waiting for 0.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices ioports.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices tap.
[2009-08-31 21:06:28 4851] DEBUG (DevController:139) Waiting for devices vtpm.
[2009-08-31 21:06:28 4851] INFO (XendDomain:1180) Domain WinXP (1) unpaused.

[-- Attachment #6: lspci_primary.log --]
[-- Type: application/octet-stream, Size: 1872 bytes --]

02:00.0 VGA compatible controller: nVidia Corporation GT200 [GeForce GTX 260] (rev a1) (prog-if 00 [VGA controller])
	Subsystem: nVidia Corporation Device 068e
	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-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at b6000000 (32-bit, non-prefetchable) [size=16M]
	Region 1: Memory at e0000000 (64-bit, prefetchable) [size=256M]
	Region 3: Memory at b4000000 (64-bit, non-prefetchable) [size=32M]
	Region 5: I/O ports at 3000 [size=128]
	Expansion ROM at <ignored> [disabled]
	Capabilities: [60] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [78] Express (v1) Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <1us, L1 <4us
			ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr+ UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Latency L0 <1us, L1 <1us
			ClockPM- Surprise- LLActRep- BwNot-
		LnkCtl:	ASPM L0s L1 Enabled; RCB 128 bytes Disabled- Retrain- CommClk-
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x16, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
	Capabilities: [100] Virtual Channel <?>
	Capabilities: [128] Power Budgeting <?>
	Capabilities: [600] Vendor Specific Information <?>


[-- Attachment #7: lspci_secondary.log --]
[-- Type: application/octet-stream, Size: 1871 bytes --]

03:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9500 GT] (rev a1) (prog-if 00 [VGA controller])
	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-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at b2000000 (32-bit, non-prefetchable) [size=16M]
	Region 1: Memory at c0000000 (64-bit, prefetchable) [size=512M]
	Region 3: Memory at b0000000 (64-bit, non-prefetchable) [size=32M]
	Region 5: I/O ports at 2000 [size=128]
	Capabilities: [60] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
		Address: 00000000fee003f8  Data: 0000
	Capabilities: [78] Express (v1) Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s <256ns, L1 <4us
			ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x16, ASPM L0s L1, Latency L0 <256ns, L1 <1us
			ClockPM- Surprise- LLActRep- BwNot-
		LnkCtl:	ASPM L1 Enabled; RCB 128 bytes Disabled- Retrain- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x16, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
	Capabilities: [b4] Vendor Specific Information <?>
	Capabilities: [100] Virtual Channel <?>
	Capabilities: [128] Power Budgeting <?>
	Capabilities: [600] Vendor Specific Information <?>
	Kernel driver in use: pciback


[-- Attachment #8: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-08-31 17:18                               ` Keir Fraser
  2009-08-31 17:22                                 ` Mr. Teo En Ming (Zhang Enming)
@ 2009-08-31 21:14                                 ` Christian Tramnitz
  2009-09-01  8:08                                   ` Han, Weidong
  1 sibling, 1 reply; 66+ messages in thread
From: Christian Tramnitz @ 2009-08-31 21:14 UTC (permalink / raw)
  To: xen-devel

Actually yes, that helped a lot. And finally some progress on VGA 
passthrough:

I have a X58 board with two ATI PCIe cards (RV770 and RV370). Currently 
the RV770 is the primary card that is used during bootup and also with 
Xorg in dom0 (radeonhd-only no fglrx).
With the latest patches in this thread and a recent Xenclient kernel 
(haven't tested 2.6.18 in a while) I was able to passthrough the RV370 
to a HVM domu, seeing the BIOS boot and the OS loading in text mode and 
then going into graphics mode.
Windows (both pre-installed images I had and new installation attempts 
from CD) isn't working yet, telling me I don't have a fully ACPI 
compliant BIOS and quiting with a BSOD and STOP 0x5A, but I guess thats 
a minor thing because I've got a stock Knoppix to boot and load in gfx 
mode on the passthrough graphics card.

I really haven't expected that much progress since I haven't heard about 
any ATI tests at all for a while. Now I'm looking to get the STOP 0x5A 
resolved and then passthrough additional devices (USB, Sound, Network, 
Storage controller) and I'll also try to swap the RV370 and RV770 to get 
some 3D performance into the HVM domU.

Observations so far:
- when creating the domU while I'm in text mode the dom0 stalls. It 
doesn't lock up completely but the terminal and keyboard are frozen. 
When I create the domU while dom0 is running X everything is fine.
- none of the HVM domU's have picked up the USB bus I tried to 
passthrough (with keyboard and mouse attached). Not sure if I just 
passed through the wrong bus or something else is broken
- after a domU is stopped it will still show the last image on the 
passthrough gfx card (Knoppix desktop or Windows BSOD in my case)
- after a couple of restarts (xm destroy/ the hard way due to lack of 
mouse/keyboard in domU) the secondary ATI gliteched and only showed a 
gren screen, had to reboot to get it working again.
- I've tried Windows domUs with and without Viridian enabled, didn't 
make a difference in regards to the STOP


I'll continue to work on that and keep you posted. Any hints regarding 
the STOP 0x5A and Keyboard/Mouse passthrough would be much appreciated. 
(I actually have two keyboards connected, one on legacy PS/2 meant for 
dom0 and a USB keyboard and USB mouse that I'd like to passthrough)



Best regards,
    Christian


Keir Fraser wrote:
> This is probably due to c/s 20137 and now fixed by c/s 20141.
> 
>  Thanks,
>  Keir
> 

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: graphics passthrough with VT-d
  2009-08-31 19:35                           ` Tim Moore
@ 2009-09-01  1:07                             ` Han, Weidong
  2009-09-01  7:12                             ` Han, Weidong
  1 sibling, 0 replies; 66+ messages in thread
From: Han, Weidong @ 2009-09-01  1:07 UTC (permalink / raw)
  To: 'Tim Moore'
  Cc: 'xen-devel@lists.xensource.com',
	'enming.teo@asiasoftsea.net'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset="gb2312", Size: 39926 bytes --]

I forgot to mention that you should change memory addresses in xen-vBAR-pBAR.patch according to your MMIO BARs of your assigned gfx card.

For example, the output of 'lspci -s 01:00.0 -v':

        01:00.0 VGA compatible controller: nVidia Corporation Unknown device 05ff (rev a1) (prog-if 00 [VGA controller])
        Subsystem: nVidia Corporation Unknown device 0661
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at c2000000 (32-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Memory at c0000000 (64-bit, non-prefetchable) [size=32M]
        I/O ports at 9c00 [size=128]
        Expansion ROM at bff00000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable+
        Capabilities: [78] Express Endpoint IRQ 0

you can see I reserve above memories in dsdt.asl in xen-vBAR-pBAR.patch. you should replace them with memories of your gfx.

Regards,
Weidong


________________________________
From: Tim Moore [mailto:timothy.moore@expidas.net]
Sent: 2009Äê9ÔÂ1ÈÕ 3:35
To: Han, Weidong
Cc: 'xen-devel@lists.xensource.com'; 'enming.teo@asiasoftsea.net'
Subject: RE: [Xen-devel] graphics passthrough with VT-d

Hi Weidong,

Here are my findings so far, it still doesn¡¯t work but I have not experienced a crash or Dom0 lockup, and I have switched to 2.6.18-Dom0 which may also help ...

64bit Hypervisor (xen-unstable.hg 31/08/09)
Dom0 ¨C 2.6.18-xen-dom0 (from xenbits)
Patches applied:
./qemu-gfx-passthrough.patch
./qemu-change-for-vBAR-pBAR.patch
./qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
./xen-vBAR-pBAR.patch
./xen-gfx-passthrough.patch
./xen-load-vbios-file.patch

02:00.0 - Primary GFX (Dom0) Console: NVidia Geforce GTX260
03:00.0 - Secondary GFX (DomU): NVidia Geforce 9500GT

Qemu:
Warning: attempted read from physical address 0xe0000000 in xen platform mmio space
And
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]

Hope this helps,
Tim

From: Han, Weidong [mailto:weidong.han@intel.com]
Sent: 31 August 2009 09:47
To: 'enming.teo@asiasoftsea.net'; Tim Moore
Cc: 'xen-devel@lists.xensource.com'
Subject: RE: [Xen-devel] graphics passthrough with VT-d

Teo,

I attached some experimental patches for you to try to sthorugh Geforce 8400 GS.

Based on my patches posted last Friday, pls follow below instructions:
1. apply xen-load-vbios-file.patch to xen-unstable.hg
    this patch supports to load vga bios from a file.
2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
    this patch is used to 1:1 map between vBAR and pBAR
3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
    this patch is used to 1:1 map between vBAR and pBAR on qemu side
4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
    it's needed if you want to assign the secondary gfx to guest.
5. cd xen-unstable.hg
6. make clean
7. copy the vga bios file to xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
8. make; make install
9. reboot the system. or xend restart. then passthrough gfx to guest ...


Regards,
Weidong


________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 2009Äê8ÔÂ29ÈÕ 22:13
To: timothy.moore@expidas.net
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] graphics passthrough with VT-d
Hi Timothy,

Yes, I renamed the firmware file of nVidia Geforce 8400 GS to vgabios-pt.bin and placed it in the source directory tools/firmware/vgabios.

Weidong had said Intel has the 1:1 mapping patches. Let's hope he will release the patch soon to do pBAR:vBAR.



--

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@hotmail.com<mailto:teoenming@hotmail.com>

Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 09:29 PM, Tim Moore wrote:
Teo,
Did you rename your Nvidia BIOS and copy it into the hvmloader source tree as required ?
It should get compiled into roms.h in the hvmloader folder - I made sure it was there as the xen buildroot seems to delete it randomly ...
I think we are now up against the Base Address Register issue where the Nvidia driver is expecting to see the card at the Physical BAR Addresses and in the DomU these are re-mapped to different address space ... this is a problem with the Nvidia binary driver and therefore a workaround in xen is maybe needed.
That said, I'm not sure if the Nvidia BIOS likes to be re-executed and may also be an issue ...
Tim
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 29 August 2009 14:21
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: Tim Moore; xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] graphics passthrough with VT-d
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@hotmail.com<mailto:teoenming@hotmail.com>

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..@..["<mailto:GA..@..%5B> */
    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@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Email #2: space.time.universe@gmail.com<mailto:space.time.universe@gmail.com>
MSN: teoenming@hotmail.com<mailto:teoenming@hotmail.com>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com<mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel









________________________________


















_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel















________________________________












_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel




[-- Attachment #1.2: Type: text/html, Size: 72196 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: graphics passthrough with VT-d
  2009-08-31 19:35                           ` Tim Moore
  2009-09-01  1:07                             ` Han, Weidong
@ 2009-09-01  7:12                             ` Han, Weidong
  1 sibling, 0 replies; 66+ messages in thread
From: Han, Weidong @ 2009-09-01  7:12 UTC (permalink / raw)
  To: 'Tim Moore'
  Cc: 'xen-devel@lists.xensource.com',
	'enming.teo@asiasoftsea.net'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset="gb2312", Size: 39454 bytes --]

Hi Tim,

I suspect your vga bios file is incorrect, its size is very small. I found following VGA bios in xm_dmesg.log:
    ...
    (XEN) HVM1: BIOS map:
    (XEN) HVM1:  c0000-c07ff: VGA BIOS
        ...

You can check if the VGA bios is really loaded. You can use 'xxd vgabios-pt.bin' to see the VGA bios content, of course you can see the size. After you apply the patches I posted and mak the code, you can see vgabios_pt[] in xen-unstable.hg/tools/firmware/hvmloader/roms.h. content of vgabios_pt[] should be the same with output of 'xxd vgabios-pt.bin'.

Regards,
Weidong


________________________________
From: Tim Moore [mailto:timothy.moore@expidas.net]
Sent: 2009Äê9ÔÂ1ÈÕ 3:35
To: Han, Weidong
Cc: 'xen-devel@lists.xensource.com'; 'enming.teo@asiasoftsea.net'
Subject: RE: [Xen-devel] graphics passthrough with VT-d

Hi Weidong,

Here are my findings so far, it still doesn¡¯t work but I have not experienced a crash or Dom0 lockup, and I have switched to 2.6.18-Dom0 which may also help ...

64bit Hypervisor (xen-unstable.hg 31/08/09)
Dom0 ¨C 2.6.18-xen-dom0 (from xenbits)
Patches applied:
./qemu-gfx-passthrough.patch
./qemu-change-for-vBAR-pBAR.patch
./qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
./xen-vBAR-pBAR.patch
./xen-gfx-passthrough.patch
./xen-load-vbios-file.patch

02:00.0 - Primary GFX (Dom0) Console: NVidia Geforce GTX260
03:00.0 - Secondary GFX (DomU): NVidia Geforce 9500GT

Qemu:
Warning: attempted read from physical address 0xe0000000 in xen platform mmio space
And
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:04.0][Offset:30h][Length:4]

Hope this helps,
Tim

From: Han, Weidong [mailto:weidong.han@intel.com]
Sent: 31 August 2009 09:47
To: 'enming.teo@asiasoftsea.net'; Tim Moore
Cc: 'xen-devel@lists.xensource.com'
Subject: RE: [Xen-devel] graphics passthrough with VT-d

Teo,

I attached some experimental patches for you to try to sthorugh Geforce 8400 GS.

Based on my patches posted last Friday, pls follow below instructions:
1. apply xen-load-vbios-file.patch to xen-unstable.hg
    this patch supports to load vga bios from a file.
2. apply xen-vBAR-pBAR.patch to xen-unstable.hg
    this patch is used to 1:1 map between vBAR and pBAR
3. apply qemu-change-for-vBAR-pBAR.patch to ioemu-remote (qemu tree).
    this patch is used to 1:1 map between vBAR and pBAR on qemu side
4. apply qemu-claim-cycle-for-secondary-gfx-passthrough.patch
    it's needed if you want to assign the secondary gfx to guest.
5. cd xen-unstable.hg
6. make clean
7. copy the vga bios file to xen-unstabl.hg/tools/firmware/vgabios/vgabios-pt.bin
8. make; make install
9. reboot the system. or xend restart. then passthrough gfx to guest ...


Regards,
Weidong


________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 2009Äê8ÔÂ29ÈÕ 22:13
To: timothy.moore@expidas.net
Cc: xen-devel@lists.xensource.com
Subject: Re: [Xen-devel] graphics passthrough with VT-d
Hi Timothy,

Yes, I renamed the firmware file of nVidia Geforce 8400 GS to vgabios-pt.bin and placed it in the source directory tools/firmware/vgabios.

Weidong had said Intel has the 1:1 mapping patches. Let's hope he will release the patch soon to do pBAR:vBAR.



--

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@hotmail.com<mailto:teoenming@hotmail.com>

Alma Maters: Singapore Polytechnic, National University of Singapore


On 08/29/2009 09:29 PM, Tim Moore wrote:
Teo,
Did you rename your Nvidia BIOS and copy it into the hvmloader source tree as required ?
It should get compiled into roms.h in the hvmloader folder - I made sure it was there as the xen buildroot seems to delete it randomly ...
I think we are now up against the Base Address Register issue where the Nvidia driver is expecting to see the card at the Physical BAR Addresses and in the DomU these are re-mapped to different address space ... this is a problem with the Nvidia binary driver and therefore a workaround in xen is maybe needed.
That said, I'm not sure if the Nvidia BIOS likes to be re-executed and may also be an issue ...
Tim
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 29 August 2009 14:21
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: Tim Moore; xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>
Subject: Re: [Xen-devel] graphics passthrough with VT-d
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@hotmail.com<mailto:teoenming@hotmail.com>

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..@..["<mailto:GA..@..%5B> */
    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@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Email #2: space.time.universe@gmail.com<mailto:space.time.universe@gmail.com>
MSN: teoenming@hotmail.com<mailto:teoenming@hotmail.com>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Mr. Teo En Ming (Zhang Enming)
Sent: 28 August 2009 21:14
To: enming.teo@asiasoftsea.net<mailto:enming.teo@asiasoftsea.net>
Cc: xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>; 'Lin, Ben Y'; 'Kay, Allen M'; 'Jean Guyader'; Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>; weidong.han@intel.com<mailto:weidong.han@intel.com>; bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>
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@hotmail.com<mailto:teoenming@hotmail.com>

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@hotmail.com<mailto:teoenming@hotmail.com>

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<http://lists.xensource.com/archives/html/xen-devel/2009-08/bincPiiAf0QWg.bin> and qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binglLqkeq4Rj.bin> 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@hotmail.com<mailto:teoenming@hotmail.com>

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@intel.com><mailto:ben.y.lin@intel.com>

Signed-off-by: Weidong Han <weidong.han@intel.com><mailto:weidong.han@intel.com>

No virus found in this incoming message.

Checked by AVG - www.avg.com<http://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<http://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@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel









________________________________


















_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel















________________________________












_______________________________________________

Xen-devel mailing list

Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>

http://lists.xensource.com/xen-devel




[-- Attachment #1.2: Type: text/html, Size: 71423 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Re: graphics passthrough with VT-d
  2009-08-31 21:14                                 ` Christian Tramnitz
@ 2009-09-01  8:08                                   ` Han, Weidong
  2009-09-01  8:29                                     ` Christian Tramnitz
  0 siblings, 1 reply; 66+ messages in thread
From: Han, Weidong @ 2009-09-01  8:08 UTC (permalink / raw)
  To: 'Christian Tramnitz', 'xen-devel@lists.xensource.com'

Christian Tramnitz wrote:
> Actually yes, that helped a lot. And finally some progress on VGA
> passthrough:
> 
> I have a X58 board with two ATI PCIe cards (RV770 and RV370).
> Currently the RV770 is the primary card that is used during bootup
> and also with Xorg in dom0 (radeonhd-only no fglrx).
> With the latest patches in this thread and a recent Xenclient kernel
> (haven't tested 2.6.18 in a while) I was able to passthrough the RV370
> to a HVM domu, seeing the BIOS boot and the OS loading in text mode
> and then going into graphics mode.
> Windows (both pre-installed images I had and new installation attempts
> from CD) isn't working yet, telling me I don't have a fully ACPI
> compliant BIOS and quiting with a BSOD and STOP 0x5A, but I guess
> thats a minor thing because I've got a stock Knoppix to boot and load
> in gfx mode on the passthrough graphics card.
> 
> I really haven't expected that much progress since I haven't heard
> about any ATI tests at all for a while. Now I'm looking to get the
> STOP 0x5A resolved and then passthrough additional devices (USB,
> Sound, Network, Storage controller) and I'll also try to swap the
> RV370 and RV770 to get some 3D performance into the HVM domU.
> 
> Observations so far:
> - when creating the domU while I'm in text mode the dom0 stalls. It
> doesn't lock up completely but the terminal and keyboard are frozen.
> When I create the domU while dom0 is running X everything is fine.

When you passthrough secondary gfx to guest, it needs to claim the VGA cycle for assigned gfx to display guest booting progress. Then primary gfx doesn't own the VGA cycle to display text mode. In your case, pls use X in dom0 or use VNC to access dom0.

> - none of the HVM domU's have picked up the USB bus I tried to
> passthrough (with keyboard and mouse attached). Not sure if I just
> passed through the wrong bus or something else is broken

Firstly, make sure you assign the correct USB controllers attached keyboard and mouse to guest. BTW, I found USB controller assignment doesn't work well with pv-ops dom0

> - after a domU is stopped it will still show the last image on the
> passthrough gfx card (Knoppix desktop or Windows BSOD in my case)

It seems that the gfx card is not reset (FLR).

> - after a couple of restarts (xm destroy/ the hard way due to lack of
> mouse/keyboard in domU) the secondary ATI gliteched and only showed a
> gren screen, had to reboot to get it working again.

I think it's still related to gfx reset (FLR).

Regards,
Weidong

> - I've tried Windows domUs with and without Viridian enabled, didn't
> make a difference in regards to the STOP
> 
> 
> I'll continue to work on that and keep you posted. Any hints regarding
> the STOP 0x5A and Keyboard/Mouse passthrough would be much
> appreciated. (I actually have two keyboards connected, one on legacy
> PS/2 meant for dom0 and a USB keyboard and USB mouse that I'd like to
> passthrough) 
> 
> 
> 
> Best regards,
>     Christian
> 
> 
> Keir Fraser wrote:
>> This is probably due to c/s 20137 and now fixed by c/s 20141.
>> 
>>  Thanks,
>>  Keir
>> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-09-01  8:08                                   ` Han, Weidong
@ 2009-09-01  8:29                                     ` Christian Tramnitz
  2009-09-01  8:59                                       ` Han, Weidong
  0 siblings, 1 reply; 66+ messages in thread
From: Christian Tramnitz @ 2009-09-01  8:29 UTC (permalink / raw)
  To: xen-devel

Han, Weidong wrote:
>> - when creating the domU while I'm in text mode the dom0 stalls. It
>> doesn't lock up completely but the terminal and keyboard are frozen.
>> When I create the domU while dom0 is running X everything is fine.
> 
> When you passthrough secondary gfx to guest, it needs to claim the VGA cycle for assigned gfx to display guest booting progress. Then primary gfx doesn't own the VGA cycle to display text mode. In your case, pls use X in dom0 or use VNC to access dom0.
Actually I can see the text-mode boot process in domU on the passthrough 
secondary gfx card, it's just that the console stalls when running "xm 
create". This doesnt happen using an xterm, but I'm still able to see 
the text mode boot process (incl BOCHS Bios) on the secondary gfx card.

> 
>> - none of the HVM domU's have picked up the USB bus I tried to
>> passthrough (with keyboard and mouse attached). Not sure if I just
>> passed through the wrong bus or something else is broken
> 
> Firstly, make sure you assign the correct USB controllers attached keyboard and mouse to guest. BTW, I found USB controller assignment doesn't work well with pv-ops dom0

I'm using a xenclient kernel, but will simply passthrough *all* USB 
busses today.

> 
>> - after a domU is stopped it will still show the last image on the
>> passthrough gfx card (Knoppix desktop or Windows BSOD in my case)
> 
> It seems that the gfx card is not reset (FLR).

I thought the xenclient kernel has XCI already implemented but then 
again this might be limited to certain devices (Intel IGD).
It's no big deal anyway, just wanted to report it.

I'll continue to work on this patch-set instead of the just posted v2 to 
be able to passthrough the secondary gfx card and use pBAR-vBAR 1:1 mapping.


Thanks and best regards,
   Christian

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Re: graphics passthrough with VT-d
  2009-09-01  8:29                                     ` Christian Tramnitz
@ 2009-09-01  8:59                                       ` Han, Weidong
  2009-09-02  8:38                                         ` Christian Tramnitz
  0 siblings, 1 reply; 66+ messages in thread
From: Han, Weidong @ 2009-09-01  8:59 UTC (permalink / raw)
  To: 'Christian Tramnitz', 'xen-devel@lists.xensource.com'

Christian Tramnitz wrote:
> Han, Weidong wrote:
>>> - when creating the domU while I'm in text mode the dom0 stalls. It
>>> doesn't lock up completely but the terminal and keyboard are frozen.
>>> When I create the domU while dom0 is running X everything is fine.
>> 
>> When you passthrough secondary gfx to guest, it needs to claim the
>> VGA cycle for assigned gfx to display guest booting progress. Then
>> primary gfx doesn't own the VGA cycle to display text mode. In your
>> case, pls use X in dom0 or use VNC to access dom0.   
> Actually I can see the text-mode boot process in domU on the
> passthrough secondary gfx card, it's just that the console stalls
> when running "xm create". This doesnt happen using an xterm, but I'm
> still able to see 
> the text mode boot process (incl BOCHS Bios) on the secondary gfx
> card. 

Yes, I mean you can see text mode boot process on the secondary gfx card, because it will claim VGA cycle. But at the same time, the primary gfx cannot display in text mode.

> 
>> 
>>> - none of the HVM domU's have picked up the USB bus I tried to
>>> passthrough (with keyboard and mouse attached). Not sure if I just
>>> passed through the wrong bus or something else is broken
>> 
>> Firstly, make sure you assign the correct USB controllers attached
>> keyboard and mouse to guest. BTW, I found USB controller assignment
>> doesn't work well with pv-ops dom0  
> 
> I'm using a xenclient kernel, but will simply passthrough *all* USB
> busses today.

Yes, this is an easy way.

Regards,
Weidong

> 
>> 
>>> - after a domU is stopped it will still show the last image on the
>>> passthrough gfx card (Knoppix desktop or Windows BSOD in my case)
>> 
>> It seems that the gfx card is not reset (FLR).
> 
> I thought the xenclient kernel has XCI already implemented but then
> again this might be limited to certain devices (Intel IGD).
> It's no big deal anyway, just wanted to report it.
> 
> I'll continue to work on this patch-set instead of the just posted v2
> to 
> be able to passthrough the secondary gfx card and use pBAR-vBAR 1:1
> mapping. 
> 
> 
> Thanks and best regards,
>    Christian
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-09-01  8:59                                       ` Han, Weidong
@ 2009-09-02  8:38                                         ` Christian Tramnitz
  2009-09-02  8:48                                           ` Teo En Ming (Zhang Enming)
  2009-09-02  8:57                                           ` Han, Weidong
  0 siblings, 2 replies; 66+ messages in thread
From: Christian Tramnitz @ 2009-09-02  8:38 UTC (permalink / raw)
  To: xen-devel

FYI, apparently I passed through the wrong usb bus, now with all USB 
controllers passed through I have keyboard and mouse in HVM domU.
Knoppix still boots on secondary gfx cards (and even uses Compiz Fusion 
on 3D accelerated desktop), but I still can't get Windows to boot.

The STOP code is actually A5 (and not 5A as reported earlier) and 
indicates an ACPI error of the available PCI resources, MS KB says:

"STOP 0x000000A5"
(0x00000002, Parameter2, Parameter3, Parameter4):
This error is defined as ACPI root PCI resource failure. To discover 
what current resources are being used by PCI devices, it must be able to 
query the CRS descriptor in the ACPI namespace. This error occurs 
because the BIOS lacks a pointer to the list, the list is empty, or 
contains errors/conflicts.

I haven't seen this before, so its most probably related to the 
passthrough and not so trivial as I initially assumed.

If I had keyboard access early in the bootup process I could press F7 to 
get the Standard-PC HAL (non-ACPI), but it seems the Bochs BIOS lacks 
USB HID support, so I only have the keyboard available when the OS is 
loading the drivers which is to late for Windows HAL selection...



Any ideas?


Thanks,
    Christian

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Re: graphics passthrough with VT-d
  2009-09-02  8:38                                         ` Christian Tramnitz
@ 2009-09-02  8:48                                           ` Teo En Ming (Zhang Enming)
  2009-09-02  8:57                                           ` Han, Weidong
  1 sibling, 0 replies; 66+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-02  8:48 UTC (permalink / raw)
  To: chris.ace, xen-devel

I also cannot get Window HVM Dom U to boot.

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@hotmail.com
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com
[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Christian
Tramnitz
Sent: Wednesday, September 02, 2009 4:39 PM
To: xen-devel@lists.xensource.com
Subject: [Xen-devel] Re: graphics passthrough with VT-d

FYI, apparently I passed through the wrong usb bus, now with all USB 
controllers passed through I have keyboard and mouse in HVM domU.
Knoppix still boots on secondary gfx cards (and even uses Compiz Fusion 
on 3D accelerated desktop), but I still can't get Windows to boot.

The STOP code is actually A5 (and not 5A as reported earlier) and 
indicates an ACPI error of the available PCI resources, MS KB says:

"STOP 0x000000A5"
(0x00000002, Parameter2, Parameter3, Parameter4):
This error is defined as ACPI root PCI resource failure. To discover 
what current resources are being used by PCI devices, it must be able to 
query the CRS descriptor in the ACPI namespace. This error occurs 
because the BIOS lacks a pointer to the list, the list is empty, or 
contains errors/conflicts.

I haven't seen this before, so its most probably related to the 
passthrough and not so trivial as I initially assumed.

If I had keyboard access early in the bootup process I could press F7 to 
get the Standard-PC HAL (non-ACPI), but it seems the Bochs BIOS lacks 
USB HID support, so I only have the keyboard available when the OS is 
loading the drivers which is to late for Windows HAL selection...



Any ideas?


Thanks,
    Christian


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

No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.409 / Virus Database: 270.13.75/2340 - Release Date: 09/01/09
20:03:00

No virus found in this outgoing message.
Checked by AVG - www.avg.com 
Version: 8.5.409 / Virus Database: 270.13.75/2340 - Release Date: 09/01/09
20:03:00

^ permalink raw reply	[flat|nested] 66+ messages in thread

* RE: Re: graphics passthrough with VT-d
  2009-09-02  8:38                                         ` Christian Tramnitz
  2009-09-02  8:48                                           ` Teo En Ming (Zhang Enming)
@ 2009-09-02  8:57                                           ` Han, Weidong
  2009-09-03 19:38                                             ` Christian Tramnitz
  1 sibling, 1 reply; 66+ messages in thread
From: Han, Weidong @ 2009-09-02  8:57 UTC (permalink / raw)
  To: 'Christian Tramnitz', 'xen-devel@lists.xensource.com'

I didn't meet this issue. I can passthrough gfx to WinXP guest.

Did you try the same Windows guest without gfx passthrough patches? 

Regards,
Weidong


Christian Tramnitz wrote:
> FYI, apparently I passed through the wrong usb bus, now with all USB
> controllers passed through I have keyboard and mouse in HVM domU.
> Knoppix still boots on secondary gfx cards (and even uses Compiz
> Fusion on 3D accelerated desktop), but I still can't get Windows to
> boot. 
> 
> The STOP code is actually A5 (and not 5A as reported earlier) and
> indicates an ACPI error of the available PCI resources, MS KB says:
> 
> "STOP 0x000000A5"
> (0x00000002, Parameter2, Parameter3, Parameter4):
> This error is defined as ACPI root PCI resource failure. To discover
> what current resources are being used by PCI devices, it must be able
> to query the CRS descriptor in the ACPI namespace. This error occurs
> because the BIOS lacks a pointer to the list, the list is empty, or
> contains errors/conflicts.
> 
> I haven't seen this before, so its most probably related to the
> passthrough and not so trivial as I initially assumed.
> 
> If I had keyboard access early in the bootup process I could press F7
> to get the Standard-PC HAL (non-ACPI), but it seems the Bochs BIOS
> lacks USB HID support, so I only have the keyboard available when the
> OS is loading the drivers which is to late for Windows HAL
> selection... 
> 
> 
> 
> Any ideas?
> 
> 
> Thanks,
>     Christian
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-09-02  8:57                                           ` Han, Weidong
@ 2009-09-03 19:38                                             ` Christian Tramnitz
  2009-09-04 10:25                                               ` Christian Tramnitz
  0 siblings, 1 reply; 66+ messages in thread
From: Christian Tramnitz @ 2009-09-03 19:38 UTC (permalink / raw)
  To: xen-devel

Yes without gfx_passthrough it was working (even the same domU with just 
USB devices passed through).
I think it might be related to the modifications to the memory addresses 
you mentioned in another post.
I'll verify that, recompile and retest.


Best regards,
    Christian

Han, Weidong wrote:
> I didn't meet this issue. I can passthrough gfx to WinXP guest.
> 
> Did you try the same Windows guest without gfx passthrough patches? 
> 
> Regards,
> Weidong

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: graphics passthrough with VT-d
  2009-09-03 19:38                                             ` Christian Tramnitz
@ 2009-09-04 10:25                                               ` Christian Tramnitz
  0 siblings, 0 replies; 66+ messages in thread
From: Christian Tramnitz @ 2009-09-04 10:25 UTC (permalink / raw)
  To: xen-devel

It seems this was unrelated to the gfx_passthrough, I started with 
"fresh" domU configs and also reinstalled them and now its working WITH 
gfx_passthrough and USB (the whole controller as pci device) passthrough.

I do have (all as pass-through):
- accelerated video (even survives hardware detection during Win7 
installation)
- audio (onboard HDA, using digital output)
- USB (UHCI only, EHCI crashed Windows during HW detection)
running Windows 7 x64 (b7600).


I'll now try to swap the primary and secondary gfx (both ATI) to get 
some real 3D horse-power.



Best regards,
    Christian


Christian Tramnitz wrote:
> Yes without gfx_passthrough it was working (even the same domU with just 
> USB devices passed through).
> I think it might be related to the modifications to the memory addresses 
> you mentioned in another post.
> I'll verify that, recompile and retest.

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
@ 2009-08-31 11:47 Boris Derzhavets
  0 siblings, 0 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-31 11:47 UTC (permalink / raw)
  To: xen-devel, Christian Tramnitz


[-- Attachment #1.1: Type: text/plain, Size: 3655 bytes --]

Pvops kernel 2.6.31-rc6 frequently hangs at the point of issuing DHCPRELEASE on main ethernet interface at  Dom0 . 
After some time (1-2 min) console droppes into stack trace:-

SoltLock  CPU#0 idle for 61 sec!
.. . . . . . . . . . . 
{DRDY}
SoltLock  CPU#0 idle for 61 sec!

. . . . . . . . . . . 

{DRDY}
.. . . . . 

It doesn't happen to any of xenified kernels 2.6.29.6 or 2.6.30.2 running
via different Grub2 entries under the same Xen 3.4.1 Hypervisor on top
Ubuntu 9.10 Server (alpha 4).

Only cold restart of ADSL modem ( with embedded DHCP server) working
as router to the NET ( ZYXEL P660RT2) allows to issue DHCPDISCOVER
on eth1 (Dom0) , what successfully follows by DHCPOFFER, DHCPREQUEST,DHCPACK , xenbus activation and login prompt finally.

Boris



--- On Mon, 8/31/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com, "Christian Tramnitz" <chris.ace@gmx.net>
Date: Monday, August 31, 2009, 3:17 AM

The most recent build 2.6.31-rc6 compiled with static cmd line per Chris
works as well as xenified kernels via GRUB2 menuentry on Ubuntu 9.10 Server (alpha 4)

Boris

--- On Sun, 8/30/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com, "Christian Tramnitz" <chris.ace@gmx.net>
Date: Sunday, August 30, 2009, 2:19 PM

It does help for 2.6.30.2  xenified aka Suse kernel( via Andy Lyon's Patch Set V.3)  and doesn't help for 2.6.31-rc5 pvops enabled kernel.
I can't build  fresh 2-6-31-rc6 at the moment. Make fails.

Boris.

--- On Sun, 8/30/09, Christian Tramnitz <chris.ace@gmx.net> wrote:

From: Christian Tramnitz <chris.ace@gmx.net>
Subject: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9..10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: xen-devel@lists.xensource.com
Date: Sunday, August 30, 2009, 9:26 AM

Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro console=tty0" to the kernel in multiboot/module
 combination. I have seen the same problem on
 gentoo/grub2 and also read about this before. (This is not really Xen specific, but multiboot related).
My workaround was to compile the kernel options as static cmdline into the kernel itself...

Best regards,
   Christian

Boris Derzhavets wrote:
> Karmic Server HVM DomU setup at Xen 3.4.1 Dom0 F11 via virt-install.
> Attempt to build Xen from source and xenified kernel succeeded.
> Before creating Grub 2 entry for Xen Host directive "root=UUID=.."  switched off by editing /etc/default/grub and update-grub run.
> 
> Manually created entry /boot/grub/grib.cfg as advised for Debian (Grub 2)
>   Xen 3.4.1 Ubuntu 9.10 {
> multiboot (hd0,1)/xen-3.4.gz
> module    (hd0,1)/vmlinuz-2.6.30.2 root=/dev/sda2 ro console=tty0
> module    (hd0,1)/initrd-2.6.30.2.img
> }
> 
> Failure when waiting for /dev/sda2 and dropping
 to grub prompt
> 
> HVM itself loads fine.
> 
> Boris.


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



      
-----Inline Attachment Follows-----

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



      


      

[-- Attachment #1.2: Type: text/html, Size: 5447 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

* Re: Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
@ 2009-08-30 16:33 Boris Derzhavets
  0 siblings, 0 replies; 66+ messages in thread
From: Boris Derzhavets @ 2009-08-30 16:33 UTC (permalink / raw)
  To: Christian Tramnitz, xen-devel, Keir Fraser


[-- Attachment #1.1: Type: text/plain, Size: 3137 bytes --]

Setting CONFIG_CMDLINE_BOOL=y in .config allows to assign desired value via
make menuconfig:

Symbol: CMDLINE [=root=/dev/sda14 ro console=tty0]                                                       
Prompt: Built-in kernel command string                                                                      
 Defined at arch/x86/Kconfig:1644                                                                          
     Depends on: CMDLINE_BOOL                                                                                  
     Location:                                                                                                 
       -> Processor type and features                                                                         
         -> Built-in kernel command line (CMDLINE_BOOL [=y])     

Then Grub2 entry :
  menuentry "Xen 3.4 / Ubuntu 9.10 kernel 2.6.30.2-xen" {
  insmod ext2
  set root=(hd0,13)
  multiboot  (hd0,13)/xen-3.4.gz
  module     (hd0,13)/vmlinuz-2.6.30.2
  module     (hd0,13)/initrd-2.6.30.2.img
}

loads  Xen 3.4.1 Dom0 with 2.6.30.2 xenified aka Suse on top of Ubuntu 9.10 (Karmic)  Server

Once again , thanks a lot for your support
Boris.

--- On Sun, 8/30/09, Boris Derzhavets <bderzhavets@yahoo.com> wrote:

From: Boris Derzhavets <bderzhavets@yahoo.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: "Christian Tramnitz" <chris.ace@gmx.net>, "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>, "Keir Fraser" <keir.fraser@eu.citrix.com>
Date: Sunday, August 30, 2009, 12:22 PM

I've tested both options.

Chris's one works with Grub2, Keir's doesn't. 
Distro Ubuntu 9.10 Server (alpha 4.)

Thanks.
Boris.

--- On Sun, 8/30/09, Keir Fraser <keir.fraser@eu.citrix.com> wrote:

From: Keir Fraser <keir.fraser@eu.citrix.com>
Subject: Re: [Xen-devel] Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel)
To: "Christian Tramnitz" <chris.ace@gmx.net>, "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Date: Sunday, August 30, 2009, 11:50 AM

On 30/08/2009 14:26, "Christian Tramnitz" <chris.ace@gmx.net> wrote:

> Afaik grub2 does not pass the boot parameters "root=/dev/sda2 ro
> console=tty0" to the kernel in multiboot/module combination. I have seen
> the same problem on gentoo/grub2 and also read about this before. (This
> is not really Xen specific, but multiboot related).

Okay, that would clearly be a GRUB regression I think. But there is a simple
enough less ugly workaround than you suggest...

> My workaround was to compile the kernel options as static cmdline into
> the kernel itself...

Better solution would be to append dom0's options to Xen's own command line,
separated by --. E.g.,
multiboot (hd0,1)/xen-3.4.gz console=tty -- root=/dev/sda2 ro console=tty0

 -- Keir



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



      


      

[-- Attachment #1.2: Type: text/html, Size: 6694 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 66+ messages in thread

end of thread, other threads:[~2009-09-04 10:25 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-28 15:34 [PATCH 2/2] graphics passthrough with VT-d Teo En Ming (Zhang Enming)
2009-08-28 15:55 ` Mr. Teo En Ming (Zhang Enming)
2009-08-28 16:08   ` Mr. Teo En Ming (Zhang Enming)
2009-08-28 16:10   ` [PATCH(es)] " Tim Moore
2009-08-28 16:19     ` Alan Cox
2009-08-28 16:22       ` Tim Moore
2009-08-28 16:28     ` Mr. Teo En Ming (Zhang Enming)
2009-08-28 16:31       ` Mr. Teo En Ming (Zhang Enming)
2009-08-28 16:36       ` Alan Cox
2009-08-28 16:39         ` Mr. Teo En Ming (Zhang Enming)
2009-08-28 16:59   ` [PATCH 2/2] " Mr. Teo En Ming (Zhang Enming)
2009-08-28 20:13     ` Mr. Teo En Ming (Zhang Enming)
2009-08-28 22:42       ` Tim Moore
2009-08-29  2:17         ` Mr. Teo En Ming (Zhang Enming)
2009-08-29  3:48           ` Mr. Teo En Ming (Zhang Enming)
2009-08-29  6:58             ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 11:03               ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 12:25                 ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 13:20                   ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 13:29                     ` Tim Moore
2009-08-29 14:12                       ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 14:48                         ` Mr. Teo En Ming (Zhang Enming)
2009-08-31  8:47                         ` Han, Weidong
2009-08-31 14:54                           ` Mr. Teo En Ming (Zhang Enming)
2009-08-31 16:48                           ` Christian Tramnitz
2009-08-31 17:03                             ` djmagee
2009-08-31 17:18                               ` Keir Fraser
2009-08-31 17:22                                 ` Mr. Teo En Ming (Zhang Enming)
2009-08-31 21:14                                 ` Christian Tramnitz
2009-09-01  8:08                                   ` Han, Weidong
2009-09-01  8:29                                     ` Christian Tramnitz
2009-09-01  8:59                                       ` Han, Weidong
2009-09-02  8:38                                         ` Christian Tramnitz
2009-09-02  8:48                                           ` Teo En Ming (Zhang Enming)
2009-09-02  8:57                                           ` Han, Weidong
2009-09-03 19:38                                             ` Christian Tramnitz
2009-09-04 10:25                                               ` Christian Tramnitz
2009-08-31 19:35                           ` Tim Moore
2009-09-01  1:07                             ` Han, Weidong
2009-09-01  7:12                             ` Han, Weidong
2009-08-29 13:46                     ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 14:39                       ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 15:06                         ` Mr. Teo En Ming (Zhang Enming)
2009-08-29 10:41             ` Failure when "make tools" via xen-3.4.1 tarball on Ubuntu 9.10 Server ALPHA 4 Boris Derzhavets
2009-08-29 11:05               ` Boris Derzhavets
2009-08-29 15:17               ` Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
2009-08-30  9:32                 ` Boris Derzhavets
2009-08-30 12:44                   ` Keir Fraser
2009-08-30 13:19                     ` Boris Derzhavets
2009-08-30 17:55                     ` Ian Pratt
2009-08-30 18:17                       ` Tim Moore
2009-08-30 18:32                         ` Keir Fraser
2009-08-30 13:26                 ` Christian Tramnitz
2009-08-30 15:17                   ` Boris Derzhavets
2009-08-30 15:53                     ` Boris Derzhavets
2009-08-30 15:50                   ` Keir Fraser
2009-08-30 16:22                     ` Boris Derzhavets
2009-08-30 16:41                       ` Keir Fraser
2009-08-30 16:55                         ` Keir Fraser
2009-08-30 17:10                           ` Boris Derzhavets
2009-08-30 17:49                             ` Keir Fraser
2009-08-30 18:14                   ` Failure to start Xen >3.4.1 and xen-3.5-unstable Dom0 using GRUB2 Tim Moore
2009-08-30 18:19                   ` Re: Failure to setup Xen 3.4.1 Dom0 on top of Ubuntu 9.10 Server HVM DomU ( 2.6.30.2 xenified kernel) Boris Derzhavets
2009-08-31  7:17                     ` Boris Derzhavets
2009-08-30 16:33 Boris Derzhavets
2009-08-31 11:47 Boris Derzhavets

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.