* [PATCH 2/2 v2] graphics passthrough with VT-d
@ 2009-09-01 6:01 Han, Weidong
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
` (2 more replies)
0 siblings, 3 replies; 22+ messages in thread
From: Han, Weidong @ 2009-09-01 6:01 UTC (permalink / raw)
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y, 'bengheng@eecs.umich.edu', Kay, Allen M,
'Keir.Fraser@eu.citrix.com', 'Jean Guyader'
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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>
[-- Attachment #2: qemu-gfx-passthrough-v2.patch --]
[-- Type: application/octet-stream, Size: 12723 bytes --]
From b88aa69589b6f6bbbebba6f5c95a8c1a43be6cff Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Tue, 1 Sep 2009 13:20:42 +0800
Subject: [PATCH] qemu gfx passthrough support
basic gfx passthrough support:
- disable emulated VGA adpater if there is a passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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 | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/pass-through.h | 6 ++
hw/pc.c | 51 ++++++++++--------
vl.c | 32 ++++++++++--
4 files changed, 220 insertions(+), 26 deletions(-)
diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..a97368a 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)
@@ -4013,6 +4076,89 @@ static int pt_pmcsr_reg_restore(struct pt_dev *ptdev,
return 0;
}
+static int get_vgabios(unsigned char *buf)
+{
+ int fd;
+ uint32_t bios_size = 0;
+ uint32_t start = 0xC0000;
+ uint16_t magic = 0;
+
+ if ( (fd = open("/dev/mem", O_RDONLY)) < 0 )
+ {
+ PT_LOG("Error: Can't open /dev/mem: %s\n", strerror(errno));
+ return 0;
+ }
+
+ /*
+ * Check if it a real bios extension.
+ * The magic number is 0xAA55.
+ */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+ if ( read(fd, &magic, 2) != 2 )
+ goto out;
+ if ( magic != 0xAA55 )
+ goto out;
+
+ /* Find the size of the rom extension */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+ if ( lseek(fd, 2, SEEK_CUR) != (start + 2) )
+ goto out;
+ if ( read(fd, &bios_size, 1) != 1 )
+ goto out;
+
+ /* This size is in 512 bytes */
+ bios_size *= 512;
+
+ /*
+ * Set the file to the begining of the rombios,
+ * to start the copy.
+ */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+
+ if ( bios_size != read(fd, buf, bios_size))
+ bios_size = 0;
+
+out:
+ close(fd);
+ return bios_size;
+}
+
+static int setup_vga_pt(void)
+{
+ unsigned char *bios = NULL;
+ int bios_size = 0;
+ char *c = NULL;
+ char checksum = 0;
+ int rc = 0;
+
+ /* Allocated 64K for the vga bios */
+ if ( !(bios = malloc(64 * 1024)) )
+ return -1;
+
+ bios_size = get_vgabios(bios);
+ if ( bios_size == 0 || bios_size > 64 * 1024)
+ {
+ PT_LOG("vga bios size (0x%x) is invalid!\n", bios_size);
+ rc = -1;
+ goto out;
+ }
+
+ /* Adjust the bios checksum */
+ for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+ checksum += *c;
+ if ( checksum )
+ bios[bios_size - 1] -= checksum;
+
+ cpu_physical_memory_rw(0xc0000, bios, bios_size, 1);
+
+out:
+ free(bios);
+ return rc;
+}
+
static struct pt_dev * register_real_device(PCIBus *e_bus,
const char *e_dev_name, int e_devfn, uint8_t r_bus, uint8_t r_dev,
uint8_t r_func, uint32_t machine_irq, struct pci_access *pci_access,
@@ -4123,6 +4269,17 @@ static struct pt_dev * register_real_device(PCIBus *e_bus,
/* Handle real device's MMIO/PIO BARs */
pt_register_regions(assigned_device);
+ /* Setup VGA bios for passthroughed gfx */
+ if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+ {
+ rc = setup_vga_pt();
+ if ( rc < 0 )
+ {
+ PT_LOG("Setup VGA BIOS of passthroughed gfx failed!\n");
+ return NULL;
+ }
+ }
+
/* reinitialize each config register to be emulated */
rc = pt_config_init(assigned_device);
if ( rc < 0 ) {
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..0c179c7 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 passthrough\n");
+ break;
+ case GFX_DISCRETE_PASSTHRU:
+ fprintf(logfile, "Discrete graphics card passthrough\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: 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:01 [PATCH 2/2 v2] graphics passthrough with VT-d Han, Weidong
@ 2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
2009-09-01 6:51 ` Teo En Ming (Zhang Enming)
` (2 more replies)
2009-09-01 11:53 ` Jean Guyader
2009-09-04 17:02 ` Ian Jackson
2 siblings, 3 replies; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-01 6:31 UTC (permalink / raw)
To: weidong.han, xen-devel
Cc: 'Lin, Ben Y', 'Kay, Allen M', Keir.Fraser,
'Jean Guyader', bengheng
Hi,
How about the patch for loading vga bios from .bin file and the 1:1 bar
mapping in version 2 release?
Thanks for the version 2.
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 Han, Weidong
Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
@ 2009-09-01 6:51 ` Teo En Ming (Zhang Enming)
2009-09-01 6:55 ` Han, Weidong
2009-09-01 6:59 ` Han, Weidong
2009-09-01 19:00 ` Teo En Ming (Zhang Enming)
2 siblings, 1 reply; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-01 6:51 UTC (permalink / raw)
To: enming.teo, weidong.han, xen-devel
Cc: 'Lin, Ben Y', bengheng, 'Kay, Allen M',
Keir.Fraser, 'Jean Guyader'
Hi Weidong,
So I apply version 2 patch 1, and version 2 patch 2 which are posted today,
then apply
xen-load-vbios-file.patch
xen-vBAR-pBAR.patch
qemu-change-for-vBAR-pBAR.patch
qemu-claim-cycle-for-secondary-gfx-passthrough.patch
which were posted by you on 31st August 2009?
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 Teo En Ming
(Zhang Enming)
Sent: Tuesday, September 01, 2009 2:31 PM
To: weidong.han@intel.com; xen-devel@lists.xensource.com
Cc: 'Lin, Ben Y'; 'Kay,Allen M'; Keir.Fraser@eu.citrix.com; 'Jean Guyader';
bengheng@eecs.umich.edu
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Hi,
How about the patch for loading vga bios from .bin file and the 1:1 bar
mapping in version 2 release?
Thanks for the version 2.
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 Han, Weidong
Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
_______________________________________________
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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:51 ` Teo En Ming (Zhang Enming)
@ 2009-09-01 6:55 ` Han, Weidong
0 siblings, 0 replies; 22+ messages in thread
From: Han, Weidong @ 2009-09-01 6:55 UTC (permalink / raw)
To: 'enming.teo@asiasoftsea.net',
'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y, 'bengheng@eecs.umich.edu', Kay, Allen M,
'Keir.Fraser@eu.citrix.com', 'Jean Guyader'
Teo En Ming (Zhang Enming) wrote:
> Hi Weidong,
>
> So I apply version 2 patch 1, and version 2 patch 2 which are posted
> today, then apply
>
No. Don't apply the below patches based on version 2 patches. Pls use them with the version 1 patches.
Regards,
Weidong
> xen-load-vbios-file.patch
> xen-vBAR-pBAR.patch
> qemu-change-for-vBAR-pBAR.patch
> qemu-claim-cycle-for-secondary-gfx-passthrough.patch
>
> which were posted by you on 31st August 2009?
>
> 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 Teo En
> Ming (Zhang Enming)
> Sent: Tuesday, September 01, 2009 2:31 PM
> To: weidong.han@intel.com; xen-devel@lists.xensource.com
> Cc: 'Lin, Ben Y'; 'Kay,Allen M'; Keir.Fraser@eu.citrix.com; 'Jean
> Guyader'; bengheng@eecs.umich.edu
> Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>
> Hi,
>
> How about the patch for loading vga bios from .bin file and the 1:1
> bar mapping in version 2 release?
>
> Thanks for the version 2.
>
> 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 Han,
> Weidong Sent: Tuesday, September 01, 2009 2:01 PM
> To: 'xen-devel@lists.xensource.com'
> Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
> 'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
> Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>
> This patch supports basic gfx passthrough on QEMU:
> - disable emulated VGA adpater if there is passthroughed gfx
> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
> - 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.73/2338 - Release Date:
> 08/31/09 17:52:00
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
> 08/31/09 17:52:00
>
>
>
> _______________________________________________
> 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.73/2338 - Release Date:
> 08/31/09 17:52:00
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
> 08/31/09 17:52:00
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
2009-09-01 6:51 ` Teo En Ming (Zhang Enming)
@ 2009-09-01 6:59 ` Han, Weidong
2009-09-01 19:00 ` Teo En Ming (Zhang Enming)
2 siblings, 0 replies; 22+ messages in thread
From: Han, Weidong @ 2009-09-01 6:59 UTC (permalink / raw)
To: 'enming.teo@asiasoftsea.net',
'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y, Kay, Allen M, 'Keir.Fraser@eu.citrix.com',
'Jean Guyader', 'bengheng@eecs.umich.edu'
Teo En Ming (Zhang Enming) wrote:
> Hi,
>
> How about the patch for loading vga bios from .bin file and the 1:1
> bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased the hacks patches on version 2 patches. Currently pls use the hack patches with version 1 patches.
Regards,
Weidong
>
> Thanks for the version 2.
>
> 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 Han,
> Weidong Sent: Tuesday, September 01, 2009 2:01 PM
> To: 'xen-devel@lists.xensource.com'
> Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
> 'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
> Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>
> This patch supports basic gfx passthrough on QEMU:
> - disable emulated VGA adpater if there is passthroughed gfx
> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
> - 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.73/2338 - Release Date:
> 08/31/09 17:52:00
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
> 08/31/09 17:52:00
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:01 [PATCH 2/2 v2] graphics passthrough with VT-d Han, Weidong
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
@ 2009-09-01 11:53 ` Jean Guyader
2009-09-04 17:02 ` Ian Jackson
2 siblings, 0 replies; 22+ messages in thread
From: Jean Guyader @ 2009-09-01 11:53 UTC (permalink / raw)
To: Han, Weidong
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
Fraser
On Tue, Sep 01, 2009 at 02:01:11AM -0400, Han, Weidong wrote:
> This patch supports basic gfx passthrough on QEMU:
> - disable emulated VGA adpater if there is passthroughed gfx
> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
> - 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>
Acked-by: Jean Guyader <jean.guyader@citrix.com>
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
2009-09-01 6:51 ` Teo En Ming (Zhang Enming)
2009-09-01 6:59 ` Han, Weidong
@ 2009-09-01 19:00 ` Teo En Ming (Zhang Enming)
2009-09-01 19:24 ` Mr. Teo En Ming (Zhang Enming)
2 siblings, 1 reply; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-01 19:00 UTC (permalink / raw)
To: enming.teo, xen-devel
Cc: 'Lin, Ben Y', bengheng, 'Kay, Allen M',
Keir.Fraser, 'Jean Guyader'
Teo En Ming (Zhang Enming) wrote:
> Hi,
>
> How about the patch for loading vga bios from .bin file and the 1:1
> bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
>
> Thanks for the version 2.
>
> 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 Han,
> Weidong Sent: Tuesday, September 01, 2009 2:01 PM
> To: 'xen-devel@lists.xensource.com'
> Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
> 'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
> Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>
> This patch supports basic gfx passthrough on QEMU:
> - disable emulated VGA adpater if there is passthroughed gfx
> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
> - 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.73/2338 - Release Date:
> 08/31/09 17:52:00
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
> 08/31/09 17:52:00
_______________________________________________
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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 19:00 ` Teo En Ming (Zhang Enming)
@ 2009-09-01 19:24 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 19:32 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 22:49 ` Han, Weidong
0 siblings, 2 replies; 22+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-09-01 19:24 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: 17505 bytes --]
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied *xen-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin>
to changeset 20145.
**There were some errors with*
**
/Reversed/ (or previously applied) /patch detected/! Assume -R
<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fubuntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw>
So I think the maintainers of xen-unstable had applied some of the
patches from ***xen-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin>
*you posted to the tree.
Then I applied the rest of the patches:
*qemu-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
**xen-load-vbios-file.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
**xen-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
**qemu-change-for-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
**qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>*
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based
on starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the
screen output will be garbaged and I won't be able to type anything at
all in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00
00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash.
xm list shows domU running. But vncviewer pops up a QEMU monitor. Looks
like win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8]
... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8]
... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00
00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8]
... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8]
... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU
config and set gfx-passthru=0, basically starting with emulated vga bios
instead of passing through pci-e graphics.
--
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
> Teo En Ming (Zhang Enming) wrote:
>
>> Hi,
>>
>> How about the patch for loading vga bios from .bin file and the 1:1
>> bar mapping in version 2 release?
>>
> Let's make the basic patches better and acceptable first. I haven't rebased
> the hacks patches on version 2 patches. Currently pls use the hack patches
> with version 1 patches.
>
> Regards,
> Weidong
>
>
>> Thanks for the version 2.
>>
>> 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 Han,
>> Weidong Sent: Tuesday, September 01, 2009 2:01 PM
>> To: 'xen-devel@lists.xensource.com'
>> Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
>> 'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
>> Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>>
>> This patch supports basic gfx passthrough on QEMU:
>> - disable emulated VGA adpater if there is passthroughed gfx
>> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
>> - 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.73/2338 - Release Date:
>> 08/31/09 17:52:00
>>
>> No virus found in this outgoing message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
>> 08/31/09 17:52:00
>>
>
> _______________________________________________
> 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.73/2338 - Release Date: 08/31/09
> 17:52:00
>
> No virus found in this outgoing message.
> Checked by AVG - www.avg.com
> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
> 17:52:00
>
>
[-- Attachment #1.2: Type: text/html, Size: 21961 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] 22+ messages in thread
* Re: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 19:24 ` Mr. Teo En Ming (Zhang Enming)
@ 2009-09-01 19:32 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 19:37 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 22:49 ` Han, Weidong
1 sibling, 1 reply; 22+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-09-01 19:32 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: 21628 bytes --]
Basically I booted up with Intel IGD as the primary video adapter. Dom 0
has IGD while I want to pass through nVidia Geforce 8400 GS PCI-e x16 to
my Win XP Home HVM dom U. VGA passthrough still doesn't work on my Intel
DQ45CB.
Here is the hexdump of my nVidia Geforce 8400 GS VGA BIOS:
0000000: 55aa 7aeb 4b37 3430 30e9 4c19 77cc 5649 U.z.K7400.L.w.VI
0000010: 4445 4f20 0d00 0000 f001 3a1d 0000 4942 DEO ......:...IB
0000020: 4d20 5647 4120 436f 6d70 6174 6962 6c65 M VGA Compatible
0000030: 0100 0000 c000 16bc 3130 2f31 332f 3038 ........10/13/08
0000040: 0000 0000 0000 0000 0010 0000 0000 0000 ................
0000050: e9f6 3400 0000 0000 c3e3 ff7f 1810 0000 ..4.............
0000060: ffff ff7f 0000 0080 2200 a5f1 e9e9 a4e9 ........".......
0000070: f0a4 504d 4944 6c00 6f00 0000 00a0 00b0 ..PMIDl.o.......
0000080: 00b8 00c0 0033 6224 4f05 0200 7c00 0000 .....3b$O...|...
0000090: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000a0: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000b0: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000c0: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000d0: ffff ffff ffff ffff ffff ffff ffff ffff ................
00000e0: ffff ffff ffff ffff 4857 4541 4765 466f ........HWEAGeFo
00000f0: 7263 6520 3834 3030 2047 5320 5647 4120 rce 8400 GS VGA
0000100: 4249 4f53 0d0a 0000 0000 0000 0000 0000 BIOS............
0000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
0000130: 0000 0000 0000 0000 0000 0000 0056 6572 .............Ver
0000140: 7369 6f6e 2036 322e 3938 2e33 432e 3030 sion 62.98.3C.00
0000150: 2e30 3020 0d0a 0043 6f70 7972 6967 6874 .00 ...Copyright
0000160: 2028 4329 2031 3939 362d 3230 3038 204e (C) 1996-2008 N
0000170: 5649 4449 4120 436f 7270 2e0d 0a00 0000 VIDIA Corp......
0000180: ffff 0000 0000 ffff 4249 4f53 2d50 2f4e ........BIOS-P/N
0000190: 404e 3432 3332 0000 0000 0000 0000 0000 @N4232..........
00001a0: 0000 0000 0000 0000 0000 0043 6869 7020 ...........Chip
00001b0: 5265 7620 2020 0000 0000 0000 0000 00ba Rev ..........
00001c0: 9198 9691 9a9a 8d96 9198 dfad 9a93 9a9e ................
00001d0: 8c9a dfd2 dfb1 908b dfb9 908d dfaf 8d90 ................
00001e0: 9b8a 9c8b 9690 91df aa8c 9af2 f5ff 0000 ................
00001f0: 5043 4952 de10 e406 0000 1800 0000 0003 PCIR............
0000200: 7a00 0100 0080 0000 5059 4824 ffb8 4249 z.......PYH$..BI
0000210: 5400 0001 0c06 1245 3201 0400 9402 4202 T......E2.....B.
0000220: 1c00 9802 4301 0e00 b402 4401 0400 c202 ....C.....D.....
--
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/02/2009 03:24 AM, Mr. Teo En Ming (Zhang Enming) wrote:
> Dear Weidong,
>
> I checked out xen 3.5-unstable changeset 20145.
>
> I applied *xen-gfx-passthrough.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin>
> to changeset 20145.
>
> **There were some errors with*
> **
> /Reversed/ (or previously applied) /patch detected/! Assume -R
> <http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fubuntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw>
>
> So I think the maintainers of xen-unstable had applied some of the
> patches from ***xen-gfx-passthrough.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin>
> *you posted to the tree.
>
> Then I applied the rest of the patches:
>
> *qemu-gfx-passthrough.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
> **xen-load-vbios-file.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
> **xen-vBAR-pBAR.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
> **qemu-change-for-vBAR-pBAR.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
> **qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>*
>
> to changeset 20145 without problems.
>
> Here are the test results. Note that all of the test results are based
> on starting Windows XP Home HVM domU while in X server on dom0.
>
> If I try to start domU in text mode on dom0 (without X server), then
> the screen output will be garbaged and I won't be able to type
> anything at all in dom0 text mode.
>
> Test results with pvops dom 0 kernel 2.6.30-rc3
> =============================
>
> A. 1 VCPU
> ======
>
> Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
> leaving only dom0.
>
> (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: Make vBAR = pBAR of assigned gfx
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
> (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 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: fc003000-fc01261f
> (XEN) HVM1: vm86 TSS at fc012800
> (XEN) HVM1: BIOS map:
> (XEN) HVM1: c0000-cf7ff: VGA BIOS
> (XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
> (XEN) realmode.c:115:d1 Failed to emulate insn.
> (XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00
> 00 00 00 00 00
> (XEN) domain_crash called from realmode.c:166
> (XEN) Domain 1 (vcpu#0) crashed on cpu#1:
> (XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
> (XEN) CPU: 1
> (XEN) RIP: c000:[<000000000000b4b4>]
> (XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
> (XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx:
> 0000000000010593
> (XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi:
> 000000000000966a
> (XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8:
> 0000000000000000
> (XEN) r9: 0000000000000000 r10: 0000000000000000 r11:
> 0000000000000000
> (XEN) r12: 0000000000000000 r13: 0000000000000000 r14:
> 0000000000000000
> (XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4:
> 0000000000000000
> (XEN) cr3: 0000000000800000 cr2: 0000000000000000
> (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
> (XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
> (XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
>
> B. 2 VCPU
> ======
>
> I switched to vcpu=2 for win xp home hvm domU. Now domU does not
> crash. xm list shows domU running. But vncviewer pops up a QEMU
> monitor. Looks like win xp home hvm domU did not start. All I get is a
> QEMU monitor.
>
> (XEN) HVM2: HVM Loader
> (XEN) HVM2: Detected Xen v3.5-unstable
> (XEN) HVM2: CPU speed is 2800 MHz
> (XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
> (XEN) HVM2: PCI-ISA link 0 routed to IRQ5
> (XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
> (XEN) HVM2: PCI-ISA link 1 routed to IRQ10
> (XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
> (XEN) HVM2: PCI-ISA link 2 routed to IRQ11
> (XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
> (XEN) HVM2: PCI-ISA link 3 routed to IRQ5
> (XEN) HVM2: pci dev 01:2 INTD->IRQ5
> (XEN) HVM2: pci dev 01:3 INTA->IRQ10
> (XEN) HVM2: pci dev 02:0 INTA->IRQ11
> (XEN) HVM2: pci dev 03:0 INTA->IRQ5
> (XEN) HVM2: Make vBAR = pBAR of assigned gfx
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
> (XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
> (XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
> (XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
> (XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
> (XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
> (XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
> (XEN) HVM2: Multiprocessor initialisation:
> (XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs
> [3/8] ... done.
> (XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs
> [3/8] ... done.
> (XEN) HVM2: Testing HVM environment:
> (XEN) HVM2: - REP INSB across page boundaries ... passed
> (XEN) HVM2: - GS base MSRs and SWAPGS ... passed
> (XEN) HVM2: Passed 2 of 2 tests
> (XEN) HVM2: Writing SMBIOS tables ...
> (XEN) HVM2: Loading ROMBIOS ...
> (XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
> (XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
> (XEN) HVM2: Creating MP tables ...
> (XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
> (XEN) HVM2: Loading PCI Option ROM ...
> (XEN) HVM2: - Manufacturer: http://etherboot.org
> (XEN) HVM2: - Product name: gPXE
> (XEN) HVM2: Loading ACPI ...
> (XEN) HVM2: - Lo data: 000ea020-000ea04f
> (XEN) HVM2: - Hi data: fc003000-fc01261f
> (XEN) HVM2: vm86 TSS at fc012800
> (XEN) HVM2: BIOS map:
> (XEN) HVM2: c0000-cf7ff: VGA BIOS
> (XEN) HVM2: cf800-dbfff: Etherboot ROM
> (XEN) HVM2: eb000-eb175: SMBIOS tables
> (XEN) HVM2: f0000-fffff: Main BIOS
> (XEN) HVM2: Invoking ROMBIOS ...
> (XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>
> The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
>
> Test results with pvops dom 0 kernel 2.6.31-rc6
> =============================
>
> A. 1 VCPU
> ======
>
> (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: Make vBAR = pBAR of assigned gfx
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
> (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 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: fc003000-fc01261f
> (XEN) HVM1: vm86 TSS at fc012800
> (XEN) HVM1: BIOS map:
> (XEN) HVM1: c0000-cf7ff: VGA BIOS
> (XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
> (XEN) realmode.c:115:d1 Failed to emulate insn.
> (XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00
> 00 00 00 00 00
> (XEN) domain_crash called from realmode.c:166
> (XEN) Domain 1 (vcpu#0) crashed on cpu#1:
> (XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
> (XEN) CPU: 1
> (XEN) RIP: c000:[<000000000000b4b4>]
> (XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
> (XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx:
> 0000000000021f0f
> (XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi:
> 000000000000966a
> (XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8:
> 0000000000000000
> (XEN) r9: 0000000000000000 r10: 0000000000000000 r11:
> 0000000000000000
> (XEN) r12: 0000000000000000 r13: 0000000000000000 r14:
> 0000000000000000
> (XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4:
> 0000000000000000
> (XEN) cr3: 0000000000800000 cr2: 0000000000000000
> (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
> (XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
> (XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
>
> B. 2 VCPU
> ======
>
> (XEN) HVM2: HVM Loader
> (XEN) HVM2: Detected Xen v3.5-unstable
> (XEN) HVM2: CPU speed is 2800 MHz
> (XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
> (XEN) HVM2: PCI-ISA link 0 routed to IRQ5
> (XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
> (XEN) HVM2: PCI-ISA link 1 routed to IRQ10
> (XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
> (XEN) HVM2: PCI-ISA link 2 routed to IRQ11
> (XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
> (XEN) HVM2: PCI-ISA link 3 routed to IRQ5
> (XEN) HVM2: pci dev 01:2 INTD->IRQ5
> (XEN) HVM2: pci dev 01:3 INTA->IRQ10
> (XEN) HVM2: pci dev 02:0 INTA->IRQ11
> (XEN) HVM2: pci dev 03:0 INTA->IRQ5
> (XEN) HVM2: Make vBAR = pBAR of assigned gfx
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
> (XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
> (XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
> (XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
> (XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
> (XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
> (XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
> (XEN) HVM2: Multiprocessor initialisation:
> (XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs
> [3/8] ... done.
> (XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs
> [3/8] ... done.
> (XEN) HVM2: Testing HVM environment:
> (XEN) HVM2: - REP INSB across page boundaries ... passed
> (XEN) HVM2: - GS base MSRs and SWAPGS ... passed
> (XEN) HVM2: Passed 2 of 2 tests
> (XEN) HVM2: Writing SMBIOS tables ...
> (XEN) HVM2: Loading ROMBIOS ...
> (XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
> (XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
> (XEN) HVM2: Creating MP tables ...
> (XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
> (XEN) HVM2: Loading PCI Option ROM ...
> (XEN) HVM2: - Manufacturer: http://etherboot.org
> (XEN) HVM2: - Product name: gPXE
> (XEN) HVM2: Loading ACPI ...
> (XEN) HVM2: - Lo data: 000ea020-000ea04f
> (XEN) HVM2: - Hi data: fc003000-fc01261f
> (XEN) HVM2: vm86 TSS at fc012800
> (XEN) HVM2: BIOS map:
> (XEN) HVM2: c0000-cf7ff: VGA BIOS
> (XEN) HVM2: cf800-dbfff: Etherboot ROM
> (XEN) HVM2: eb000-eb175: SMBIOS tables
> (XEN) HVM2: f0000-fffff: Main BIOS
> (XEN) HVM2: Invoking ROMBIOS ...
> (XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
>
> Hope the test results helped.
>
> I can start win xp home hvm dom U successfully if i remove pci in domU
> config and set gfx-passthru=0, basically starting with emulated vga
> bios instead of passing through pci-e graphics.
> --
> 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
>> Teo En Ming (Zhang Enming) wrote:
>>
>>> Hi,
>>>
>>> How about the patch for loading vga bios from .bin file and the 1:1
>>> bar mapping in version 2 release?
>>>
>> Let's make the basic patches better and acceptable first. I haven't rebased
>> the hacks patches on version 2 patches. Currently pls use the hack patches
>> with version 1 patches.
>>
>> Regards,
>> Weidong
>>
>>
>>> Thanks for the version 2.
>>>
>>> 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 Han,
>>> Weidong Sent: Tuesday, September 01, 2009 2:01 PM
>>> To: 'xen-devel@lists.xensource.com'
>>> Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
>>> 'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
>>> Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>>>
>>> This patch supports basic gfx passthrough on QEMU:
>>> - disable emulated VGA adpater if there is passthroughed gfx
>>> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
>>> - 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.73/2338 - Release Date:
>>> 08/31/09 17:52:00
>>>
>>> No virus found in this outgoing message.
>>> Checked by AVG -www.avg.com
>>> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
>>> 08/31/09 17:52:00
>>>
>> _______________________________________________
>> 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.73/2338 - Release Date: 08/31/09
>> 17:52:00
>>
>> No virus found in this outgoing message.
>> Checked by AVG -www.avg.com
>> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
>> 17:52:00
>>
>>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
[-- Attachment #1.2: Type: text/html, Size: 26904 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] 22+ messages in thread
* Re: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 19:32 ` Mr. Teo En Ming (Zhang Enming)
@ 2009-09-01 19:37 ` Mr. Teo En Ming (Zhang Enming)
0 siblings, 0 replies; 22+ messages in thread
From: Mr. Teo En Ming (Zhang Enming) @ 2009-09-01 19:37 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: 23720 bytes --]
Here is my roms.h content:
unsigned vgabios_pt[] = {
0xeb7aaa55, 0x3034374b, 0x194ce930, 0x4956cc77,
0x204f4544, 0x0000000d, 0x1d3a01f0, 0x42490000,
0x4756204d, 0x6f432041, 0x7461706d, 0x656c6269,
0x00000001, 0xbc1600c0, 0x312f3031, 0x38302f33,
0x00000000, 0x00000000, 0x00001000, 0x00000000,
0x0034f6e9, 0x00000000, 0x7fffe3c3, 0x00001018,
0x7fffffff, 0x80000000, 0xf1a50022, 0xe9a4e9e9,
0x4d50a4f0, 0x006c4449, 0x0000006f, 0xb000a000,
0xc000b800, 0x24623300, 0x0002054f, 0x0000007c,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff,
0xffffffff, 0xffffffff, 0x41455748, 0x6f466547,
0x20656372, 0x30303438, 0x20534720, 0x20414756,
0x534f4942, 0x00000a0d, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
Hence my nVidia Geforce 8400 GS VGA BIOS has been successfully dumped
into roms.h.
--
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/02/2009 03:32 AM, Mr. Teo En Ming (Zhang Enming) wrote:
> Basically I booted up with Intel IGD as the primary video adapter. Dom
> 0 has IGD while I want to pass through nVidia Geforce 8400 GS PCI-e
> x16 to my Win XP Home HVM dom U. VGA passthrough still doesn't work on
> my Intel DQ45CB.
>
> Here is the hexdump of my nVidia Geforce 8400 GS VGA BIOS:
> 0000000: 55aa 7aeb 4b37 3430 30e9 4c19 77cc 5649 U.z.K7400.L.w.VI
> 0000010: 4445 4f20 0d00 0000 f001 3a1d 0000 4942 DEO ......:...IB
> 0000020: 4d20 5647 4120 436f 6d70 6174 6962 6c65 M VGA Compatible
> 0000030: 0100 0000 c000 16bc 3130 2f31 332f 3038 ........10/13/08
> 0000040: 0000 0000 0000 0000 0010 0000 0000 0000 ................
> 0000050: e9f6 3400 0000 0000 c3e3 ff7f 1810 0000 ..4.............
> 0000060: ffff ff7f 0000 0080 2200 a5f1 e9e9 a4e9 ........".......
> 0000070: f0a4 504d 4944 6c00 6f00 0000 00a0 00b0 ..PMIDl.o.......
> 0000080: 00b8 00c0 0033 6224 4f05 0200 7c00 0000 .....3b$O...|...
> 0000090: ffff ffff ffff ffff ffff ffff ffff ffff ................
> 00000a0: ffff ffff ffff ffff ffff ffff ffff ffff ................
> 00000b0: ffff ffff ffff ffff ffff ffff ffff ffff ................
> 00000c0: ffff ffff ffff ffff ffff ffff ffff ffff ................
> 00000d0: ffff ffff ffff ffff ffff ffff ffff ffff ................
> 00000e0: ffff ffff ffff ffff 4857 4541 4765 466f ........HWEAGeFo
> 00000f0: 7263 6520 3834 3030 2047 5320 5647 4120 rce 8400 GS VGA
> 0000100: 4249 4f53 0d0a 0000 0000 0000 0000 0000 BIOS............
> 0000110: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0000120: 0000 0000 0000 0000 0000 0000 0000 0000 ................
> 0000130: 0000 0000 0000 0000 0000 0000 0056 6572 .............Ver
> 0000140: 7369 6f6e 2036 322e 3938 2e33 432e 3030 sion 62.98.3C.00
> 0000150: 2e30 3020 0d0a 0043 6f70 7972 6967 6874 .00 ...Copyright
> 0000160: 2028 4329 2031 3939 362d 3230 3038 204e (C) 1996-2008 N
> 0000170: 5649 4449 4120 436f 7270 2e0d 0a00 0000 VIDIA Corp......
> 0000180: ffff 0000 0000 ffff 4249 4f53 2d50 2f4e ........BIOS-P/N
> 0000190: 404e 3432 3332 0000 0000 0000 0000 0000 @N4232..........
> 00001a0: 0000 0000 0000 0000 0000 0043 6869 7020 ...........Chip
> 00001b0: 5265 7620 2020 0000 0000 0000 0000 00ba Rev ..........
> 00001c0: 9198 9691 9a9a 8d96 9198 dfad 9a93 9a9e ................
> 00001d0: 8c9a dfd2 dfb1 908b dfb9 908d dfaf 8d90 ................
> 00001e0: 9b8a 9c8b 9690 91df aa8c 9af2 f5ff 0000 ................
> 00001f0: 5043 4952 de10 e406 0000 1800 0000 0003 PCIR............
> 0000200: 7a00 0100 0080 0000 5059 4824 ffb8 4249 z.......PYH$..BI
> 0000210: 5400 0001 0c06 1245 3201 0400 9402 4202 T......E2.....B.
> 0000220: 1c00 9802 4301 0e00 b402 4401 0400 c202 ....C.....D.....
>
> --
> 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/02/2009 03:24 AM, Mr. Teo En Ming (Zhang Enming) wrote:
>> Dear Weidong,
>>
>> I checked out xen 3.5-unstable changeset 20145.
>>
>> I applied *xen-gfx-passthrough.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin>
>> to changeset 20145.
>>
>> **There were some errors with*
>> **
>> /Reversed/ (or previously applied) /patch detected/! Assume -R
>> <http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fubuntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw>
>>
>> So I think the maintainers of xen-unstable had applied some of the
>> patches from ***xen-gfx-passthrough.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin>
>> *you posted to the tree.
>>
>> Then I applied the rest of the patches:
>>
>> *qemu-gfx-passthrough.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
>> **xen-load-vbios-file.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
>> **xen-vBAR-pBAR.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
>> **qemu-change-for-vBAR-pBAR.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
>> **qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
>> <http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>*
>>
>> to changeset 20145 without problems.
>>
>> Here are the test results. Note that all of the test results are
>> based on starting Windows XP Home HVM domU while in X server on dom0.
>>
>> If I try to start domU in text mode on dom0 (without X server), then
>> the screen output will be garbaged and I won't be able to type
>> anything at all in dom0 text mode.
>>
>> Test results with pvops dom 0 kernel 2.6.30-rc3
>> =============================
>>
>> A. 1 VCPU
>> ======
>>
>> Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
>> leaving only dom0.
>>
>> (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: Make vBAR = pBAR of assigned gfx
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
>> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
>> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
>> (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 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: fc003000-fc01261f
>> (XEN) HVM1: vm86 TSS at fc012800
>> (XEN) HVM1: BIOS map:
>> (XEN) HVM1: c0000-cf7ff: VGA BIOS
>> (XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
>> (XEN) realmode.c:115:d1 Failed to emulate insn.
>> (XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4:
>> 00 00 00 00 00 00
>> (XEN) domain_crash called from realmode.c:166
>> (XEN) Domain 1 (vcpu#0) crashed on cpu#1:
>> (XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
>> (XEN) CPU: 1
>> (XEN) RIP: c000:[<000000000000b4b4>]
>> (XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
>> (XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx:
>> 0000000000010593
>> (XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi:
>> 000000000000966a
>> (XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8:
>> 0000000000000000
>> (XEN) r9: 0000000000000000 r10: 0000000000000000 r11:
>> 0000000000000000
>> (XEN) r12: 0000000000000000 r13: 0000000000000000 r14:
>> 0000000000000000
>> (XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4:
>> 0000000000000000
>> (XEN) cr3: 0000000000800000 cr2: 0000000000000000
>> (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
>> (XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
>> (XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
>>
>> B. 2 VCPU
>> ======
>>
>> I switched to vcpu=2 for win xp home hvm domU. Now domU does not
>> crash. xm list shows domU running. But vncviewer pops up a QEMU
>> monitor. Looks like win xp home hvm domU did not start. All I get is
>> a QEMU monitor.
>>
>> (XEN) HVM2: HVM Loader
>> (XEN) HVM2: Detected Xen v3.5-unstable
>> (XEN) HVM2: CPU speed is 2800 MHz
>> (XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
>> (XEN) HVM2: PCI-ISA link 0 routed to IRQ5
>> (XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
>> (XEN) HVM2: PCI-ISA link 1 routed to IRQ10
>> (XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
>> (XEN) HVM2: PCI-ISA link 2 routed to IRQ11
>> (XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
>> (XEN) HVM2: PCI-ISA link 3 routed to IRQ5
>> (XEN) HVM2: pci dev 01:2 INTD->IRQ5
>> (XEN) HVM2: pci dev 01:3 INTA->IRQ10
>> (XEN) HVM2: pci dev 02:0 INTA->IRQ11
>> (XEN) HVM2: pci dev 03:0 INTA->IRQ5
>> (XEN) HVM2: Make vBAR = pBAR of assigned gfx
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
>> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
>> (XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
>> (XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
>> (XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
>> (XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
>> (XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
>> (XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
>> (XEN) HVM2: Multiprocessor initialisation:
>> (XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs
>> [3/8] ... done.
>> (XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs
>> [3/8] ... done.
>> (XEN) HVM2: Testing HVM environment:
>> (XEN) HVM2: - REP INSB across page boundaries ... passed
>> (XEN) HVM2: - GS base MSRs and SWAPGS ... passed
>> (XEN) HVM2: Passed 2 of 2 tests
>> (XEN) HVM2: Writing SMBIOS tables ...
>> (XEN) HVM2: Loading ROMBIOS ...
>> (XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
>> (XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
>> (XEN) HVM2: Creating MP tables ...
>> (XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
>> (XEN) HVM2: Loading PCI Option ROM ...
>> (XEN) HVM2: - Manufacturer: http://etherboot.org
>> (XEN) HVM2: - Product name: gPXE
>> (XEN) HVM2: Loading ACPI ...
>> (XEN) HVM2: - Lo data: 000ea020-000ea04f
>> (XEN) HVM2: - Hi data: fc003000-fc01261f
>> (XEN) HVM2: vm86 TSS at fc012800
>> (XEN) HVM2: BIOS map:
>> (XEN) HVM2: c0000-cf7ff: VGA BIOS
>> (XEN) HVM2: cf800-dbfff: Etherboot ROM
>> (XEN) HVM2: eb000-eb175: SMBIOS tables
>> (XEN) HVM2: f0000-fffff: Main BIOS
>> (XEN) HVM2: Invoking ROMBIOS ...
>> (XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>>
>> The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
>>
>> Test results with pvops dom 0 kernel 2.6.31-rc6
>> =============================
>>
>> A. 1 VCPU
>> ======
>>
>> (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: Make vBAR = pBAR of assigned gfx
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
>> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
>> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
>> (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 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: fc003000-fc01261f
>> (XEN) HVM1: vm86 TSS at fc012800
>> (XEN) HVM1: BIOS map:
>> (XEN) HVM1: c0000-cf7ff: VGA BIOS
>> (XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
>> (XEN) realmode.c:115:d1 Failed to emulate insn.
>> (XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4:
>> 00 00 00 00 00 00
>> (XEN) domain_crash called from realmode.c:166
>> (XEN) Domain 1 (vcpu#0) crashed on cpu#1:
>> (XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
>> (XEN) CPU: 1
>> (XEN) RIP: c000:[<000000000000b4b4>]
>> (XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
>> (XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx:
>> 0000000000021f0f
>> (XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi:
>> 000000000000966a
>> (XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8:
>> 0000000000000000
>> (XEN) r9: 0000000000000000 r10: 0000000000000000 r11:
>> 0000000000000000
>> (XEN) r12: 0000000000000000 r13: 0000000000000000 r14:
>> 0000000000000000
>> (XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4:
>> 0000000000000000
>> (XEN) cr3: 0000000000800000 cr2: 0000000000000000
>> (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
>> (XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
>> (XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
>>
>> B. 2 VCPU
>> ======
>>
>> (XEN) HVM2: HVM Loader
>> (XEN) HVM2: Detected Xen v3.5-unstable
>> (XEN) HVM2: CPU speed is 2800 MHz
>> (XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
>> (XEN) HVM2: PCI-ISA link 0 routed to IRQ5
>> (XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
>> (XEN) HVM2: PCI-ISA link 1 routed to IRQ10
>> (XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
>> (XEN) HVM2: PCI-ISA link 2 routed to IRQ11
>> (XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
>> (XEN) HVM2: PCI-ISA link 3 routed to IRQ5
>> (XEN) HVM2: pci dev 01:2 INTD->IRQ5
>> (XEN) HVM2: pci dev 01:3 INTA->IRQ10
>> (XEN) HVM2: pci dev 02:0 INTA->IRQ11
>> (XEN) HVM2: pci dev 03:0 INTA->IRQ5
>> (XEN) HVM2: Make vBAR = pBAR of assigned gfx
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
>> (XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
>> (XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
>> (XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
>> (XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
>> (XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
>> (XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
>> (XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
>> (XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
>> (XEN) HVM2: Multiprocessor initialisation:
>> (XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs
>> [3/8] ... done.
>> (XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs
>> [3/8] ... done.
>> (XEN) HVM2: Testing HVM environment:
>> (XEN) HVM2: - REP INSB across page boundaries ... passed
>> (XEN) HVM2: - GS base MSRs and SWAPGS ... passed
>> (XEN) HVM2: Passed 2 of 2 tests
>> (XEN) HVM2: Writing SMBIOS tables ...
>> (XEN) HVM2: Loading ROMBIOS ...
>> (XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
>> (XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
>> (XEN) HVM2: Creating MP tables ...
>> (XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
>> (XEN) HVM2: Loading PCI Option ROM ...
>> (XEN) HVM2: - Manufacturer: http://etherboot.org
>> (XEN) HVM2: - Product name: gPXE
>> (XEN) HVM2: Loading ACPI ...
>> (XEN) HVM2: - Lo data: 000ea020-000ea04f
>> (XEN) HVM2: - Hi data: fc003000-fc01261f
>> (XEN) HVM2: vm86 TSS at fc012800
>> (XEN) HVM2: BIOS map:
>> (XEN) HVM2: c0000-cf7ff: VGA BIOS
>> (XEN) HVM2: cf800-dbfff: Etherboot ROM
>> (XEN) HVM2: eb000-eb175: SMBIOS tables
>> (XEN) HVM2: f0000-fffff: Main BIOS
>> (XEN) HVM2: Invoking ROMBIOS ...
>> (XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
>> (XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
>>
>> Hope the test results helped.
>>
>> I can start win xp home hvm dom U successfully if i remove pci in
>> domU config and set gfx-passthru=0, basically starting with emulated
>> vga bios instead of passing through pci-e graphics.
>> --
>> 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
>>> Teo En Ming (Zhang Enming) wrote:
>>>
>>>> Hi,
>>>>
>>>> How about the patch for loading vga bios from .bin file and the 1:1
>>>> bar mapping in version 2 release?
>>>>
>>> Let's make the basic patches better and acceptable first. I haven't rebased
>>> the hacks patches on version 2 patches. Currently pls use the hack patches
>>> with version 1 patches.
>>>
>>> Regards,
>>> Weidong
>>>
>>>
>>>> Thanks for the version 2.
>>>>
>>>> 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 Han,
>>>> Weidong Sent: Tuesday, September 01, 2009 2:01 PM
>>>> To: 'xen-devel@lists.xensource.com'
>>>> Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
>>>> 'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
>>>> Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
>>>>
>>>> This patch supports basic gfx passthrough on QEMU:
>>>> - disable emulated VGA adpater if there is passthroughed gfx
>>>> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
>>>> - 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.73/2338 - Release Date:
>>>> 08/31/09 17:52:00
>>>>
>>>> No virus found in this outgoing message.
>>>> Checked by AVG -www.avg.com
>>>> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
>>>> 08/31/09 17:52:00
>>>>
>>> _______________________________________________
>>> 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.73/2338 - Release Date: 08/31/09
>>> 17:52:00
>>>
>>> No virus found in this outgoing message.
>>> Checked by AVG -www.avg.com
>>> Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
>>> 17:52:00
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>
>
[-- Attachment #1.2: Type: text/html, Size: 29120 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 19:24 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 19:32 ` Mr. Teo En Ming (Zhang Enming)
@ 2009-09-01 22:49 ` Han, Weidong
2009-09-02 3:29 ` Teo En Ming (Zhang Enming)
1 sibling, 1 reply; 22+ messages in thread
From: Han, Weidong @ 2009-09-01 22:49 UTC (permalink / raw)
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
'Jean Guyader', 'Keir.Fraser@eu.citrix.com',
'bengheng@eecs.umich.edu'
[-- Attachment #1.1: Type: text/plain, Size: 18679 bytes --]
xen-gfx-passthrough.patch was checked into xne-unstable as changeset 20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches. Christian Tramnitz said he succeeded to passthrough secondary gfx with my patches.
Regards,
Weidong
________________________________
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied xen-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin> to changeset 20145.
There were some errors with
Reversed (or previously applied) patch detected! Assume -R<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fubuntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw>
So I think the maintainers of xen-unstable had applied some of the patches from xen-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin> you posted to the tree.
Then I applied the rest of the patches:
qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
xen-load-vbios-file.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
xen-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
qemu-change-for-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the screen output will be garbaged and I won't be able to type anything at all in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited, leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm list shows domU running. But vncviewer pops up a QEMU monitor. Looks like win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU config and set gfx-passthru=0, basically starting with emulated vga bios instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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<mailto:teoenming@hotmail.com>
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com>
[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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.73/2338 - Release Date:
08/31/09 17:52: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.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>
http://lists.xensource.com/xen-devel
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.73/2338 - Release Date: 08/31/09
17:52: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.73/2338 - Release Date: 08/31/09
17:52:00
[-- Attachment #1.2: Type: text/html, Size: 23644 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 22:49 ` Han, Weidong
@ 2009-09-02 3:29 ` Teo En Ming (Zhang Enming)
2009-09-02 3:37 ` Han, Weidong
0 siblings, 1 reply; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-02 3:29 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: 19153 bytes --]
Hi Weidong,
Even though I tried to apply xen-gfx-passthrough.patch to xen 3.5-unstable
changeset 20145, it asked “Apply anyway?” and I chose no. For assume -R, I
also chose no. Some files have been patched, while most files are not
patched with xen-gfx-passthrough.patch.
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 6:49 AM
To: 'enming.teo@asiasoftsea.net'
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 v2] graphics passthrough with VT-d
xen-gfx-passthrough.patch was checked into xne-unstable as changeset
20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches.
Christian Tramnitz said he succeeded to passthrough secondary gfx with my
patches.
Regards,
Weidong
_____
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.
citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch to changeset 20145.
There were some errors with
<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fu
buntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=
j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw> Reversed
(or previously applied) patch detected! Assume -R
So I think the maintainers of xen-unstable had applied some of the patches
from
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch you posted to the tree.
Then I applied the rest of the patches:
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on
starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the
screen output will be garbaged and I won't be able to type anything at all
in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm
list shows domU running. But vncviewer pops up a QEMU monitor. Looks like
win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU
config and set gfx-passthru=0, basically starting with emulated vga bios
instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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 Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- register/unregister legacy VGA I/O ports and MMIOs for
passthroughed gfx
Signed-off-by: Ben Lin <mailto:ben.y.lin@intel.com> <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <mailto:weidong.han@intel.com>
<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.73/2338 - Release Date:
08/31/09 17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
[-- Attachment #1.2: Type: text/html, Size: 41932 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-02 3:29 ` Teo En Ming (Zhang Enming)
@ 2009-09-02 3:37 ` Han, Weidong
2009-09-02 3:52 ` Teo En Ming (Zhang Enming)
0 siblings, 1 reply; 22+ messages in thread
From: Han, Weidong @ 2009-09-02 3:37 UTC (permalink / raw)
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
Guyader', 'Jean, 'Keir.Fraser@eu.citrix.com',
'bengheng@eecs.umich.edu'
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset="gb2312", Size: 20657 bytes --]
make sure your xen version is older than 20144, such as 20143. Otherwise it conflicts when you apply my posted patches.
Pls post your steps to build your environment with my patches. I suspect you may make some mistakes on xen build.
Regards,
Weidong
________________________________
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009Äê9ÔÂ2ÈÕ 11:29
To: Han, Weidong
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 v2] graphics passthrough with VT-d
Hi Weidong,
Even though I tried to apply xen-gfx-passthrough.patch to xen 3.5-unstable changeset 20145, it asked ¡°Apply anyway?¡± and I chose no. For assume ¨CR, I also chose no. Some files have been patched, while most files are not patched with xen-gfx-passthrough.patch.
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
________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 6:49 AM
To: 'enming.teo@asiasoftsea.net'
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 v2] graphics passthrough with VT-d
xen-gfx-passthrough.patch was checked into xne-unstable as changeset 20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches. Christian Tramnitz said he succeeded to passthrough secondary gfx with my patches.
Regards,
Weidong
________________________________
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009Äê9ÔÂ2ÈÕ 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied xen-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin> to changeset 20145.
There were some errors with
Reversed (or previously applied) patch detected! Assume -R<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fubuntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw>
So I think the maintainers of xen-unstable had applied some of the patches from xen-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin> you posted to the tree.
Then I applied the rest of the patches:
qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
xen-load-vbios-file.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
xen-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
qemu-change-for-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the screen output will be garbaged and I won't be able to type anything at all in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited, leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm list shows domU running. But vncviewer pops up a QEMU monitor. Looks like win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU config and set gfx-passthru=0, basically starting with emulated vga bios instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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<mailto:teoenming@hotmail.com>
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com>
[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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.73/2338 - Release Date:
08/31/09 17:52: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.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>
http://lists.xensource.com/xen-devel
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.73/2338 - Release Date: 08/31/09
17:52: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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09 17:52:00
[-- Attachment #1.2: Type: text/html, Size: 43064 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-02 3:37 ` Han, Weidong
@ 2009-09-02 3:52 ` Teo En Ming (Zhang Enming)
2009-09-02 5:01 ` Teo En Ming (Zhang Enming)
0 siblings, 1 reply; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-02 3:52 UTC (permalink / raw)
To: weidong.han
Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
'Guyader'', 'Jean, Keir.Fraser, bengheng
[-- Attachment #1.1: Type: text/plain, Size: 21868 bytes --]
Hi,
If I checked out 20145 or later, then I need to SKIP
xen-gfx-passthrough.patch but apply all the rest of the patches?
If I cannot do this, how I can check out earlier changesets? Is it hg
checkout something something?
My patching procedures are:
# cd xen-unstable.hg
# patch -p1 < xen-gfx-passthrough.patch
# cd tools/ioemu-remote
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
# cd ../..
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
# cd tools/ioemu-remote
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
# cd ../..
# make clean
copy vgabios-pt.bin to tools/firmware/vgabios
# make xen
# make install-xen
# make tools
# make install-tools
# reboot
Thank you.
Regards,
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
BEng(Hons)(Mechanical Engineering)
Technical Support Engineer
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@hotmail.com
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 11:38 AM
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com'; Lin,Ben Y; Kay, Allen M; Guyader';
'Jean; 'Keir.Fraser@eu.citrix.com'; 'bengheng@eecs.umich.edu'
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
make sure your xen version is older than 20144, such as 20143. Otherwise it
conflicts when you apply my posted patches.
Pls post your steps to build your environment with my patches. I suspect you
may make some mistakes on xen build.
Regards,
Weidong
_____
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 11:29
To: Han, Weidong
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 v2] graphics passthrough with VT-d
Hi Weidong,
Even though I tried to apply xen-gfx-passthrough.patch to xen 3.5-unstable
changeset 20145, it asked “Apply anyway?” and I chose no. For assume -R, I
also chose no. Some files have been patched, while most files are not
patched with xen-gfx-passthrough.patch.
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 6:49 AM
To: 'enming.teo@asiasoftsea.net'
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 v2] graphics passthrough with VT-d
xen-gfx-passthrough.patch was checked into xne-unstable as changeset
20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches.
Christian Tramnitz said he succeeded to passthrough secondary gfx with my
patches.
Regards,
Weidong
_____
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.
citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch to changeset 20145.
There were some errors with
<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fu
buntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=
j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw> Reversed
(or previously applied) patch detected! Assume -R
So I think the maintainers of xen-unstable had applied some of the patches
from
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch you posted to the tree.
Then I applied the rest of the patches:
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on
starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the
screen output will be garbaged and I won't be able to type anything at all
in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm
list shows domU running. But vncviewer pops up a QEMU monitor. Looks like
win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU
config and set gfx-passthru=0, basically starting with emulated vga bios
instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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 Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- register/unregister legacy VGA I/O ports and MMIOs for
passthroughed gfx
Signed-off-by: Ben Lin <mailto:ben.y.lin@intel.com> <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <mailto:weidong.han@intel.com>
<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.73/2338 - Release Date:
08/31/09 17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
[-- Attachment #1.2: Type: text/html, Size: 57571 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-02 3:52 ` Teo En Ming (Zhang Enming)
@ 2009-09-02 5:01 ` Teo En Ming (Zhang Enming)
2009-09-02 5:37 ` Han, Weidong
0 siblings, 1 reply; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-02 5:01 UTC (permalink / raw)
To: enming.teo, weidong.han
Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
'Guyader'', 'Jean, Keir.Fraser, bengheng
[-- Attachment #1.1: Type: text/plain, Size: 22952 bytes --]
Hi,
I have read the man page for hg.
To check out changeset 20143, just run
# hg checkout 20143
Reference: http://bitbucket.org/sjl/hg-crew-sjl/src/f40273b0ad7b/README
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Teo En Ming (Zhang Enming)
Sent: Wednesday, September 02, 2009 11:53 AM
To: weidong.han@intel.com
Cc: xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay,Allen M'; 'Guyader'';
'Jean; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Hi,
If I checked out 20145 or later, then I need to SKIP
xen-gfx-passthrough.patch but apply all the rest of the patches?
If I cannot do this, how I can check out earlier changesets? Is it hg
checkout something something?
My patching procedures are:
# cd xen-unstable.hg
# patch -p1 < xen-gfx-passthrough.patch
# cd tools/ioemu-remote
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
# cd ../..
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
# cd tools/ioemu-remote
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
# cd ../..
# make clean
copy vgabios-pt.bin to tools/firmware/vgabios
# make xen
# make install-xen
# make tools
# make install-tools
# reboot
Thank you.
Regards,
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
BEng(Hons)(Mechanical Engineering)
Technical Support Engineer
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@hotmail.com
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 11:38 AM
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com'; Lin,Ben Y; Kay, Allen M; Guyader';
'Jean; 'Keir.Fraser@eu.citrix.com'; 'bengheng@eecs.umich.edu'
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
make sure your xen version is older than 20144, such as 20143. Otherwise it
conflicts when you apply my posted patches.
Pls post your steps to build your environment with my patches. I suspect you
may make some mistakes on xen build.
Regards,
Weidong
_____
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 11:29
To: Han, Weidong
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 v2] graphics passthrough with VT-d
Hi Weidong,
Even though I tried to apply xen-gfx-passthrough.patch to xen 3.5-unstable
changeset 20145, it asked “Apply anyway?” and I chose no. For assume -R, I
also chose no. Some files have been patched, while most files are not
patched with xen-gfx-passthrough.patch.
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 6:49 AM
To: 'enming.teo@asiasoftsea.net'
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 v2] graphics passthrough with VT-d
xen-gfx-passthrough.patch was checked into xne-unstable as changeset
20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches.
Christian Tramnitz said he succeeded to passthrough secondary gfx with my
patches.
Regards,
Weidong
_____
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.
citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch to changeset 20145.
There were some errors with
<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fu
buntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=
j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw> Reversed
(or previously applied) patch detected! Assume -R
So I think the maintainers of xen-unstable had applied some of the patches
from
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch you posted to the tree.
Then I applied the rest of the patches:
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on
starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the
screen output will be garbaged and I won't be able to type anything at all
in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm
list shows domU running. But vncviewer pops up a QEMU monitor. Looks like
win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU
config and set gfx-passthru=0, basically starting with emulated vga bios
instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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 Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- register/unregister legacy VGA I/O ports and MMIOs for
passthroughed gfx
Signed-off-by: Ben Lin <mailto:ben.y.lin@intel.com> <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <mailto:weidong.han@intel.com>
<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.73/2338 - Release Date:
08/31/09 17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 09/01/09
20:03:00
[-- Attachment #1.2: Type: text/html, Size: 63169 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-02 5:01 ` Teo En Ming (Zhang Enming)
@ 2009-09-02 5:37 ` Han, Weidong
2009-09-02 13:35 ` Teo En Ming (Zhang Enming)
0 siblings, 1 reply; 22+ messages in thread
From: Han, Weidong @ 2009-09-02 5:37 UTC (permalink / raw)
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
'Guyader'', ''Jean' <'Jean>,
'Keir.Fraser@eu.citrix.com',
'bengheng@eecs.umich.edu'
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1: Type: text/plain; charset="gb2312", Size: 24513 bytes --]
Yes. so you can use old xen version.
BTW, our patches only changes tools and qemu code, doesn't change xen hypervisor code, so you just need to 'make tools' and 'make install-tools'.
Regards,
Weidong
________________________________
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009Äê9ÔÂ2ÈÕ 13:02
To: enming.teo@asiasoftsea.net; Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; 'Guyader''; 'Jean; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Hi,
I have read the man page for hg.
To check out changeset 20143, just run
# hg checkout 20143
Reference: http://bitbucket.org/sjl/hg-crew-sjl/src/f40273b0ad7b/README
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
________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Teo En Ming (Zhang Enming)
Sent: Wednesday, September 02, 2009 11:53 AM
To: weidong.han@intel.com
Cc: xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay,Allen M'; 'Guyader''; 'Jean; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Hi,
If I checked out 20145 or later, then I need to SKIP xen-gfx-passthrough.patch but apply all the rest of the patches?
If I cannot do this, how I can check out earlier changesets? Is it hg checkout something something?
My patching procedures are:
# cd xen-unstable.hg
# patch ¨Cp1 < xen-gfx-passthrough.patch
# cd tools/ioemu-remote
# patch -p1 < qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
# cd ../..
# patch -p1 < xen-load-vbios-file.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
# patch -p1 < xen-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
# cd tools/ioemu-remote
# patch -p1 < qemu-change-for-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
# patch -p1 < qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>
# cd ../..
# make clean
copy vgabios-pt.bin to tools/firmware/vgabios
# make xen
# make install-xen
# make tools
# make install-tools
# reboot
Thank you.
Regards,
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering) BEng(Hons)(Mechanical Engineering)
Technical Support Engineer
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@hotmail.com
________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 11:38 AM
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com'; Lin,Ben Y; Kay, Allen M; Guyader'; 'Jean; 'Keir.Fraser@eu.citrix.com'; 'bengheng@eecs.umich.edu'
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
make sure your xen version is older than 20144, such as 20143. Otherwise it conflicts when you apply my posted patches.
Pls post your steps to build your environment with my patches. I suspect you may make some mistakes on xen build.
Regards,
Weidong
________________________________
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009Äê9ÔÂ2ÈÕ 11:29
To: Han, Weidong
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 v2] graphics passthrough with VT-d
Hi Weidong,
Even though I tried to apply xen-gfx-passthrough.patch to xen 3.5-unstable changeset 20145, it asked ¡°Apply anyway?¡± and I chose no. For assume ¨CR, I also chose no. Some files have been patched, while most files are not patched with xen-gfx-passthrough.patch.
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
________________________________
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 6:49 AM
To: 'enming.teo@asiasoftsea.net'
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 v2] graphics passthrough with VT-d
xen-gfx-passthrough.patch was checked into xne-unstable as changeset 20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches. Christian Tramnitz said he succeeded to passthrough secondary gfx with my patches.
Regards,
Weidong
________________________________
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009Äê9ÔÂ2ÈÕ 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied xen-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin> to changeset 20145.
There were some errors with
Reversed (or previously applied) patch detected! Assume -R<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fubuntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw>
So I think the maintainers of xen-unstable had applied some of the patches from xen-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bin> you posted to the tree.
Then I applied the rest of the patches:
qemu-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bin>
xen-load-vbios-file.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bin>
xen-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bin>
qemu-change-for-vBAR-pBAR.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bin>
qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bin>
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the screen output will be garbaged and I won't be able to type anything at all in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited, leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm list shows domU running. But vncviewer pops up a QEMU monitor. Looks like win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00 00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ... done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU config and set gfx-passthru=0, basically starting with emulated vga bios instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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<mailto:teoenming@hotmail.com>
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com<mailto:xen-devel-bounces@lists.xensource.com>
[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu<mailto:bengheng@eecs.umich.edu>'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com<mailto:Keir.Fraser@eu.citrix.com>'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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.73/2338 - Release Date:
08/31/09 17:52: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.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com<mailto:Xen-devel@lists.xensource.com>
http://lists.xensource.com/xen-devel
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.73/2338 - Release Date: 08/31/09
17:52: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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09 17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09 17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 09/01/09 20:03:00
[-- Attachment #1.2: Type: text/html, Size: 64281 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] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-02 5:37 ` Han, Weidong
@ 2009-09-02 13:35 ` Teo En Ming (Zhang Enming)
0 siblings, 0 replies; 22+ messages in thread
From: Teo En Ming (Zhang Enming) @ 2009-09-02 13:35 UTC (permalink / raw)
To: weidong.han
Cc: xen-devel, 'Lin, Ben Y', 'Kay, Allen M',
'Guyader'', 'Jean, Keir.Fraser, bengheng
[-- Attachment #1.1: Type: text/plain, Size: 24864 bytes --]
Hi
I have checked out xen 3.5-unstable changeset 20143 and applied all the vga
passthrough patches.
But nVidia Geforce 8400 gs pci-e x16 passthrough to win xp home hvm domU on
my Intel dq45cb still doesn’t work.
I am shown the qemu monitor. I can only switch between the qemu monitor and
the parallel0 console. I can’t see win xp home hvm domU booting.
Anybody has success with vga passthrough to win xp hvm?
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 1:38 PM
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com'; Lin,Ben Y; Kay, Allen M; 'Guyader'';
''Jean'; 'Keir.Fraser@eu.citrix.com'; 'bengheng@eecs.umich.edu'
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Yes. so you can use old xen version.
BTW, our patches only changes tools and qemu code, doesn't change xen
hypervisor code, so you just need to 'make tools' and 'make install-tools'.
Regards,
Weidong
_____
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 13:02
To: enming.teo@asiasoftsea.net; Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; 'Guyader'';
'Jean; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Hi,
I have read the man page for hg.
To check out changeset 20143, just run
# hg checkout 20143
Reference: http://bitbucket.org/sjl/hg-crew-sjl/src/f40273b0ad7b/README
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Teo En Ming (Zhang Enming)
Sent: Wednesday, September 02, 2009 11:53 AM
To: weidong.han@intel.com
Cc: xen-devel@lists.xensource.com; 'Lin, Ben Y'; 'Kay,Allen M'; 'Guyader'';
'Jean; Keir.Fraser@eu.citrix.com; bengheng@eecs.umich.edu
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Hi,
If I checked out 20145 or later, then I need to SKIP
xen-gfx-passthrough.patch but apply all the rest of the patches?
If I cannot do this, how I can check out earlier changesets? Is it hg
checkout something something?
My patching procedures are:
# cd xen-unstable.hg
# patch -p1 < xen-gfx-passthrough.patch
# cd tools/ioemu-remote
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
# cd ../..
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
# cd tools/ioemu-remote
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
# patch -p1 <
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
# cd ../..
# make clean
copy vgabios-pt.bin to tools/firmware/vgabios
# make xen
# make install-xen
# make tools
# make install-tools
# reboot
Thank you.
Regards,
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics Engineering)
BEng(Hons)(Mechanical Engineering)
Technical Support Engineer
Information Technology Department
Asiasoft Online Pte Ltd
Tampines Central 1 #04-01 Tampines Plaza
Singapore 529541
Republic of Singapore
Mobile: +65-9648-9798
MSN: teoenming@hotmail.com
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 11:38 AM
To: 'enming.teo@asiasoftsea.net'
Cc: 'xen-devel@lists.xensource.com'; Lin,Ben Y; Kay, Allen M; Guyader';
'Jean; 'Keir.Fraser@eu.citrix.com'; 'bengheng@eecs.umich.edu'
Subject: RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
make sure your xen version is older than 20144, such as 20143. Otherwise it
conflicts when you apply my posted patches.
Pls post your steps to build your environment with my patches. I suspect you
may make some mistakes on xen build.
Regards,
Weidong
_____
From: Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 11:29
To: Han, Weidong
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 v2] graphics passthrough with VT-d
Hi Weidong,
Even though I tried to apply xen-gfx-passthrough.patch to xen 3.5-unstable
changeset 20145, it asked “Apply anyway?” and I chose no. For assume -R, I
also chose no. Some files have been patched, while most files are not
patched with xen-gfx-passthrough.patch.
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
_____
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.
xensource.com] On Behalf Of Han, Weidong
Sent: Wednesday, September 02, 2009 6:49 AM
To: 'enming.teo@asiasoftsea.net'
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 v2] graphics passthrough with VT-d
xen-gfx-passthrough.patch was checked into xne-unstable as changeset
20144,so you cannot apply it on 20145.
For your secondary gfx passthrough case, pls use the version 1 patches.
Christian Tramnitz said he succeeded to passthrough secondary gfx with my
patches.
Regards,
Weidong
_____
From: Mr. Teo En Ming (Zhang Enming) [mailto:enming.teo@asiasoftsea.net]
Sent: 2009年9月2日 3:24
To: Han, Weidong
Cc: xen-devel@lists.xensource.com; Lin, Ben Y; Kay, Allen M; Keir.Fraser@eu.
citrix.com; 'Jean Guyader'; bengheng@eecs.umich.edu
Subject: Re: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
Dear Weidong,
I checked out xen 3.5-unstable changeset 20145.
I applied
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch to changeset 20145.
There were some errors with
<http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fu
buntuforums.org%2Fshowthread.php%3Ft%3D555032&ei=kHCdSvGwH5ze6APtzem4AQ&rct=
j&q=reversed+patch+detected&usg=AFQjCNHs2YXFZTPfMG-VGfXZgmuhqM5xGw> Reversed
(or previously applied) patch detected! Assume -R
So I think the maintainers of xen-unstable had applied some of the patches
from
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binAd5XKpOakg.bi
n> xen-gfx-passthrough.patch you posted to the tree.
Then I applied the rest of the patches:
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bintJIxIJU9it.bi
n> qemu-gfx-passthrough.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/binBhcfOvfwKC.bi
n> xen-load-vbios-file.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bins09ti77jB2.bi
n> xen-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bin5Tp1Qi5LaR.bi
n> qemu-change-for-vBAR-pBAR.patch
<http://lists.xensource.com/archives/html/xen-devel/2009-08/bingGoDCQZtlM.bi
n> qemu-claim-vga-cycle-for-secondary-gfx-passthrough.patch
to changeset 20145 without problems.
Here are the test results. Note that all of the test results are based on
starting Windows XP Home HVM domU while in X server on dom0.
If I try to start domU in text mode on dom0 (without X server), then the
screen output will be garbaged and I won't be able to type anything at all
in dom0 text mode.
Test results with pvops dom 0 kernel 2.6.30-rc3
=============================
A. 1 VCPU
======
Tried starting win xp home domu with vcpu=1. DomU crashed and exited,
leaving only dom0.
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000082 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000010593
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000a1a4 rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
I switched to vcpu=2 for win xp home hvm domU. Now domU does not crash. xm
list shows domU running. But vncviewer pops up a QEMU monitor. Looks like
win xp home hvm domU did not start. All I get is a QEMU monitor.
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
The same thing happens when testing under pvops dom 0 kernel 2.6.31-rc6.
Test results with pvops dom 0 kernel 2.6.31-rc6
=============================
A. 1 VCPU
======
(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: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 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:2 bar 20 size 00000020: 0000c201
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(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 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: fc003000-fc01261f
(XEN) HVM1: vm86 TSS at fc012800
(XEN) HVM1: BIOS map:
(XEN) HVM1: c0000-cf7ff: VGA BIOS
(XEN) HVM1: cf800-dbfff: 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: *** int 15h function AX=5f14, BX=078f not yet supported!
(XEN) realmode.c:115:d1 Failed to emulate insn.
(XEN) realmode.c:165:d1 Real-mode emulation failed @ b4b4:0000b4b4: 00 00 00
00 00 00
(XEN) domain_crash called from realmode.c:166
(XEN) Domain 1 (vcpu#0) crashed on cpu#1:
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Not tainted ]----
(XEN) CPU: 1
(XEN) RIP: c000:[<000000000000b4b4>]
(XEN) RFLAGS: 0000000000000086 CONTEXT: hvm guest
(XEN) rax: 000000000000b422 rbx: 000000000000b4b4 rcx: 0000000000021f0f
(XEN) rdx: 00000000000003d4 rsi: 0000000000009e48 rdi: 000000000000966a
(XEN) rbp: 000000000000d49c rsp: 0000000000009662 r8: 0000000000000000
(XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000
(XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000
(XEN) r15: 0000000000000000 cr0: 0000000000000010 cr4: 0000000000000000
(XEN) cr3: 0000000000800000 cr2: 0000000000000000
(XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: c000
(XEN) [VT-D]iommu.c:1292:d0 domain_context_unmap:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1178:d0 domain_context_mapping:PCIe: bdf = 1:0.0
B. 2 VCPU
======
(XEN) HVM2: HVM Loader
(XEN) HVM2: Detected Xen v3.5-unstable
(XEN) HVM2: CPU speed is 2800 MHz
(XEN) irq.c:243: Dom2 PCI link 0 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom2 PCI link 1 changed 0 -> 10
(XEN) HVM2: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom2 PCI link 2 changed 0 -> 11
(XEN) HVM2: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom2 PCI link 3 changed 0 -> 5
(XEN) HVM2: PCI-ISA link 3 routed to IRQ5
(XEN) HVM2: pci dev 01:2 INTD->IRQ5
(XEN) HVM2: pci dev 01:3 INTA->IRQ10
(XEN) HVM2: pci dev 02:0 INTA->IRQ11
(XEN) HVM2: pci dev 03:0 INTA->IRQ5
(XEN) HVM2: Make vBAR = pBAR of assigned gfx
(XEN) domctl.c:836:d0 memory_map:add: gfn=d2000 mfn=d2000 nr_mfns=1000
(XEN) domctl.c:836:d0 memory_map:add: gfn=c0000 mfn=c0000 nr_mfns=10000
(XEN) domctl.c:836:d0 memory_map:add: gfn=d0000 mfn=d0000 nr_mfns=2000
(XEN) domctl.c:887:d0 ioport_map:add f_gport=d000 f_mport=d000 np=80
(XEN) HVM2: pci dev 02:0 bar 14 size 01000000: e0000008
(XEN) HVM2: pci dev 02:0 bar 10 size 00000100: 0000c001
(XEN) HVM2: pci dev 03:0 bar 10 size 00000100: 0000c101
(XEN) HVM2: pci dev 03:0 bar 14 size 00000100: e1000000
(XEN) HVM2: pci dev 01:2 bar 20 size 00000020: 0000c201
(XEN) HVM2: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM2: Multiprocessor initialisation:
(XEN) HVM2: - CPU0 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: - CPU1 ... 36-bit phys ... fixed MTRRs ... var MTRRs [3/8] ...
done.
(XEN) HVM2: Testing HVM environment:
(XEN) HVM2: - REP INSB across page boundaries ... passed
(XEN) HVM2: - GS base MSRs and SWAPGS ... passed
(XEN) HVM2: Passed 2 of 2 tests
(XEN) HVM2: Writing SMBIOS tables ...
(XEN) HVM2: Loading ROMBIOS ...
(XEN) HVM2: 11900 bytes of ROMBIOS high-memory extensions:
(XEN) HVM2: Relocating to 0xfc000000-0xfc002e7c ... done
(XEN) HVM2: Creating MP tables ...
(XEN) HVM2: Loading VGABIOS of passthroughed gfx ...
(XEN) HVM2: Loading PCI Option ROM ...
(XEN) HVM2: - Manufacturer: http://etherboot.org
(XEN) HVM2: - Product name: gPXE
(XEN) HVM2: Loading ACPI ...
(XEN) HVM2: - Lo data: 000ea020-000ea04f
(XEN) HVM2: - Hi data: fc003000-fc01261f
(XEN) HVM2: vm86 TSS at fc012800
(XEN) HVM2: BIOS map:
(XEN) HVM2: c0000-cf7ff: VGA BIOS
(XEN) HVM2: cf800-dbfff: Etherboot ROM
(XEN) HVM2: eb000-eb175: SMBIOS tables
(XEN) HVM2: f0000-fffff: Main BIOS
(XEN) HVM2: Invoking ROMBIOS ...
(XEN) HVM2: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
(XEN) mce.c:694:d0 MCE: rdmsr MCG_CAP 0x806
Hope the test results helped.
I can start win xp home hvm dom U successfully if i remove pci in domU
config and set gfx-passthru=0, basically starting with emulated vga bios
instead of passing through pci-e graphics.
--
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
Teo En Ming (Zhang Enming) wrote:
Hi,
How about the patch for loading vga bios from .bin file and the 1:1
bar mapping in version 2 release?
Let's make the basic patches better and acceptable first. I haven't rebased
the hacks patches on version 2 patches. Currently pls use the hack patches
with version 1 patches.
Regards,
Weidong
Thanks for the version 2.
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 Han,
Weidong Sent: Tuesday, September 01, 2009 2:01 PM
To: 'xen-devel@lists.xensource.com'
Cc: Lin, Ben Y; 'bengheng@eecs.umich.edu'; Kay,Allen M;
'Keir.Fraser@eu.citrix.com'; 'Jean Guyader'
Subject: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d
This patch supports basic gfx passthrough on QEMU:
- disable emulated VGA adpater if there is passthroughed gfx
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- register/unregister legacy VGA I/O ports and MMIOs for
passthroughed gfx
Signed-off-by: Ben Lin <mailto:ben.y.lin@intel.com> <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <mailto:weidong.han@intel.com>
<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.73/2338 - Release Date:
08/31/09 17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date:
08/31/09 17:52:00
_______________________________________________
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.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this outgoing message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 08/31/09
17:52:00
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.409 / Virus Database: 270.13.73/2338 - Release Date: 09/01/09
20:03:00
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
[-- Attachment #1.2: Type: text/html, Size: 71316 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] 22+ messages in thread
* Re: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-01 6:01 [PATCH 2/2 v2] graphics passthrough with VT-d Han, Weidong
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
2009-09-01 11:53 ` Jean Guyader
@ 2009-09-04 17:02 ` Ian Jackson
2009-09-06 5:25 ` Han, Weidong
2 siblings, 1 reply; 22+ messages in thread
From: Ian Jackson @ 2009-09-04 17:02 UTC (permalink / raw)
To: Han, Weidong
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
'Jean Guyader', 'Keir.Fraser@eu.citrix.com',
'bengheng@eecs.umich.edu'
Han, Weidong writes ("[Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d"):
> This patch supports basic gfx passthrough on QEMU:
> - disable emulated VGA adpater if there is passthroughed gfx
> - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
> - register/unregister legacy VGA I/O ports and MMIOs for passthroughed gfx
Thanks for this. However:
* It breaks the build if passthrough is disabled (eg due to lack
of pciutils-dev).
* Reindenting all of the code in pc.c which initalises out the
various graphics cards is very merge-unfriendly. Is that change
needed at all, or could you just disable the various graphics cards
on the qemu command line ?
* Likewise, in vl.c.
Regards,
Ian.
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-04 17:02 ` Ian Jackson
@ 2009-09-06 5:25 ` Han, Weidong
2009-09-16 5:23 ` Han, Weidong
0 siblings, 1 reply; 22+ messages in thread
From: Han, Weidong @ 2009-09-06 5:25 UTC (permalink / raw)
To: 'Ian Jackson'
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
'Jean Guyader', 'Keir.Fraser@eu.citrix.com',
'bengheng@eecs.umich.edu'
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
Ian Jackson wrote:
> Han, Weidong writes ("[Xen-devel] [PATCH 2/2 v2] graphics passthrough
> with VT-d"):
>> This patch supports basic gfx passthrough on QEMU:
>> - disable emulated VGA adpater if there is passthroughed gfx
>> - retrieve VGA bios from host 0xC0000, then load it to guest
>> 0xC0000
>> - register/unregister legacy VGA I/O ports and MMIOs for
>> passthroughed gfx
>
> Thanks for this. However:
>
> * It breaks the build if passthrough is disabled (eg due to lack
> of pciutils-dev).
It won't break the build when lack of pciutils-dev for me.
>
> * Reindenting all of the code in pc.c which initalises out the
> various graphics cards is very merge-unfriendly. Is that change
> needed at all, or could you just disable the various graphics cards
> on the qemu command line ?
>
> * Likewise, in vl.c.
Ok. I updated the code to add a new vga type for gfx passthrough. Then it needn't to add the check before various vga initialization in pc.c and vl.c. Attached the updated patch. Pls review it. Thanks.
Regards,
Weidong
>
> Regards,
> Ian.
[-- Attachment #2: qemu-gfx-passthrough-v3.patch --]
[-- Type: application/octet-stream, Size: 8948 bytes --]
From 08be38b656d955714012924acb606aef92aaf95a Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Sun, 6 Sep 2009 06:25:34 +0800
Subject: [PATCH] qemu gfx passthrough support
basic gfx passthrough support:
- add a vga type for gfx passthrough
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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>
Acked-by: Jean Guyader <jean.guyader@critix.com>
---
hw/pass-through.c | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++
vl.c | 17 ++++++-
2 files changed, 173 insertions(+), 1 deletions(-)
diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..a97368a 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)
@@ -4013,6 +4076,89 @@ static int pt_pmcsr_reg_restore(struct pt_dev *ptdev,
return 0;
}
+static int get_vgabios(unsigned char *buf)
+{
+ int fd;
+ uint32_t bios_size = 0;
+ uint32_t start = 0xC0000;
+ uint16_t magic = 0;
+
+ if ( (fd = open("/dev/mem", O_RDONLY)) < 0 )
+ {
+ PT_LOG("Error: Can't open /dev/mem: %s\n", strerror(errno));
+ return 0;
+ }
+
+ /*
+ * Check if it a real bios extension.
+ * The magic number is 0xAA55.
+ */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+ if ( read(fd, &magic, 2) != 2 )
+ goto out;
+ if ( magic != 0xAA55 )
+ goto out;
+
+ /* Find the size of the rom extension */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+ if ( lseek(fd, 2, SEEK_CUR) != (start + 2) )
+ goto out;
+ if ( read(fd, &bios_size, 1) != 1 )
+ goto out;
+
+ /* This size is in 512 bytes */
+ bios_size *= 512;
+
+ /*
+ * Set the file to the begining of the rombios,
+ * to start the copy.
+ */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+
+ if ( bios_size != read(fd, buf, bios_size))
+ bios_size = 0;
+
+out:
+ close(fd);
+ return bios_size;
+}
+
+static int setup_vga_pt(void)
+{
+ unsigned char *bios = NULL;
+ int bios_size = 0;
+ char *c = NULL;
+ char checksum = 0;
+ int rc = 0;
+
+ /* Allocated 64K for the vga bios */
+ if ( !(bios = malloc(64 * 1024)) )
+ return -1;
+
+ bios_size = get_vgabios(bios);
+ if ( bios_size == 0 || bios_size > 64 * 1024)
+ {
+ PT_LOG("vga bios size (0x%x) is invalid!\n", bios_size);
+ rc = -1;
+ goto out;
+ }
+
+ /* Adjust the bios checksum */
+ for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+ checksum += *c;
+ if ( checksum )
+ bios[bios_size - 1] -= checksum;
+
+ cpu_physical_memory_rw(0xc0000, bios, bios_size, 1);
+
+out:
+ free(bios);
+ return rc;
+}
+
static struct pt_dev * register_real_device(PCIBus *e_bus,
const char *e_dev_name, int e_devfn, uint8_t r_bus, uint8_t r_dev,
uint8_t r_func, uint32_t machine_irq, struct pci_access *pci_access,
@@ -4123,6 +4269,17 @@ static struct pt_dev * register_real_device(PCIBus *e_bus,
/* Handle real device's MMIO/PIO BARs */
pt_register_regions(assigned_device);
+ /* Setup VGA bios for passthroughed gfx */
+ if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+ {
+ rc = setup_vga_pt();
+ if ( rc < 0 )
+ {
+ PT_LOG("Setup VGA BIOS of passthroughed gfx failed!\n");
+ return NULL;
+ }
+ }
+
/* reinitialize each config register to be emulated */
rc = pt_config_init(assigned_device);
if ( rc < 0 ) {
diff --git a/vl.c b/vl.c
index 62bed05..1257b21 100644
--- a/vl.c
+++ b/vl.c
@@ -213,6 +213,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;
@@ -4042,7 +4043,7 @@ static void help(int exitcode)
#endif
#endif
"-portrait rotate graphical output 90 deg left (only PXA LCD)\n"
- "-vga [std|cirrus|vmware|none]\n"
+ "-vga [std|cirrus|vmware|passthrough|none]\n"
" select video card type\n"
"-full-screen start in full screen\n"
#if defined(TARGET_PPC) || defined(TARGET_SPARC)
@@ -4269,6 +4270,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 +4449,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", 0, QEMU_OPTION_gfx_passthru},
{ "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
{ "vncunused", 0, QEMU_OPTION_vncunused },
{ "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
@@ -4615,18 +4618,27 @@ static void select_vgahw (const char *p)
std_vga_enabled = 1;
cirrus_vga_enabled = 0;
vmsvga_enabled = 0;
+ gfx_passthru = 0;
} else if (strstart(p, "cirrus", &opts)) {
cirrus_vga_enabled = 1;
std_vga_enabled = 0;
vmsvga_enabled = 0;
+ gfx_passthru = 0;
} else if (strstart(p, "vmware", &opts)) {
cirrus_vga_enabled = 0;
std_vga_enabled = 0;
vmsvga_enabled = 1;
+ gfx_passthru = 0;
+ } else if (strstart(p, "passthrough", &opts)) {
+ cirrus_vga_enabled = 0;
+ std_vga_enabled = 0;
+ vmsvga_enabled = 0;
+ gfx_passthru = 1;
} else if (strstart(p, "none", &opts)) {
cirrus_vga_enabled = 0;
std_vga_enabled = 0;
vmsvga_enabled = 0;
+ gfx_passthru = 0;
} else {
invalid_vga:
fprintf(stderr, "Unknown vga type: %s\n", p);
@@ -5484,6 +5496,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_runas:
run_as = optarg;
break;
+ case QEMU_OPTION_gfx_passthru:
+ select_vgahw("passthrough");
+ break;
}
}
}
--
1.6.3
[-- 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 related [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-06 5:25 ` Han, Weidong
@ 2009-09-16 5:23 ` Han, Weidong
2009-09-18 15:39 ` Ian Jackson
0 siblings, 1 reply; 22+ messages in thread
From: Han, Weidong @ 2009-09-16 5:23 UTC (permalink / raw)
To: 'Ian Jackson'
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
Guyader', 'Jean, 'Keir.Fraser@eu.citrix.com',
'bengheng@eecs.umich.edu'
[-- Attachment #1: Type: text/plain, Size: 1629 bytes --]
Ian,
Did you have a look at this patch? What's your opinion on it? Thanks.
Regards,
Weidong
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Han, Weidong
Sent: 2009年9月6日 13:25
To: 'Ian Jackson'
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 v2] graphics passthrough with VT-d
Ian Jackson wrote:
> Han, Weidong writes ("[Xen-devel] [PATCH 2/2 v2] graphics passthrough
> with VT-d"):
>> This patch supports basic gfx passthrough on QEMU:
>> - disable emulated VGA adpater if there is passthroughed gfx
>> - retrieve VGA bios from host 0xC0000, then load it to guest
>> 0xC0000
>> - register/unregister legacy VGA I/O ports and MMIOs for
>> passthroughed gfx
>
> Thanks for this. However:
>
> * It breaks the build if passthrough is disabled (eg due to lack
> of pciutils-dev).
It won't break the build when lack of pciutils-dev for me.
>
> * Reindenting all of the code in pc.c which initalises out the
> various graphics cards is very merge-unfriendly. Is that change
> needed at all, or could you just disable the various graphics cards
> on the qemu command line ?
>
> * Likewise, in vl.c.
Ok. I updated the code to add a new vga type for gfx passthrough. Then it needn't to add the check before various vga initialization in pc.c and vl.c. Attached the updated patch. Pls review it. Thanks.
Regards,
Weidong
>
> Regards,
> Ian.
[-- Attachment #2: qemu-gfx-passthrough-v3.patch --]
[-- Type: application/octet-stream, Size: 8948 bytes --]
From 08be38b656d955714012924acb606aef92aaf95a Mon Sep 17 00:00:00 2001
From: Weidong Han <weidong.han@intel.com>
Date: Sun, 6 Sep 2009 06:25:34 +0800
Subject: [PATCH] qemu gfx passthrough support
basic gfx passthrough support:
- add a vga type for gfx passthrough
- retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
- 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>
Acked-by: Jean Guyader <jean.guyader@critix.com>
---
hw/pass-through.c | 157 +++++++++++++++++++++++++++++++++++++++++++++++++++++
vl.c | 17 ++++++-
2 files changed, 173 insertions(+), 1 deletions(-)
diff --git a/hw/pass-through.c b/hw/pass-through.c
index 8d80755..a97368a 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)
@@ -4013,6 +4076,89 @@ static int pt_pmcsr_reg_restore(struct pt_dev *ptdev,
return 0;
}
+static int get_vgabios(unsigned char *buf)
+{
+ int fd;
+ uint32_t bios_size = 0;
+ uint32_t start = 0xC0000;
+ uint16_t magic = 0;
+
+ if ( (fd = open("/dev/mem", O_RDONLY)) < 0 )
+ {
+ PT_LOG("Error: Can't open /dev/mem: %s\n", strerror(errno));
+ return 0;
+ }
+
+ /*
+ * Check if it a real bios extension.
+ * The magic number is 0xAA55.
+ */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+ if ( read(fd, &magic, 2) != 2 )
+ goto out;
+ if ( magic != 0xAA55 )
+ goto out;
+
+ /* Find the size of the rom extension */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+ if ( lseek(fd, 2, SEEK_CUR) != (start + 2) )
+ goto out;
+ if ( read(fd, &bios_size, 1) != 1 )
+ goto out;
+
+ /* This size is in 512 bytes */
+ bios_size *= 512;
+
+ /*
+ * Set the file to the begining of the rombios,
+ * to start the copy.
+ */
+ if ( start != lseek(fd, start, SEEK_SET) )
+ goto out;
+
+ if ( bios_size != read(fd, buf, bios_size))
+ bios_size = 0;
+
+out:
+ close(fd);
+ return bios_size;
+}
+
+static int setup_vga_pt(void)
+{
+ unsigned char *bios = NULL;
+ int bios_size = 0;
+ char *c = NULL;
+ char checksum = 0;
+ int rc = 0;
+
+ /* Allocated 64K for the vga bios */
+ if ( !(bios = malloc(64 * 1024)) )
+ return -1;
+
+ bios_size = get_vgabios(bios);
+ if ( bios_size == 0 || bios_size > 64 * 1024)
+ {
+ PT_LOG("vga bios size (0x%x) is invalid!\n", bios_size);
+ rc = -1;
+ goto out;
+ }
+
+ /* Adjust the bios checksum */
+ for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+ checksum += *c;
+ if ( checksum )
+ bios[bios_size - 1] -= checksum;
+
+ cpu_physical_memory_rw(0xc0000, bios, bios_size, 1);
+
+out:
+ free(bios);
+ return rc;
+}
+
static struct pt_dev * register_real_device(PCIBus *e_bus,
const char *e_dev_name, int e_devfn, uint8_t r_bus, uint8_t r_dev,
uint8_t r_func, uint32_t machine_irq, struct pci_access *pci_access,
@@ -4123,6 +4269,17 @@ static struct pt_dev * register_real_device(PCIBus *e_bus,
/* Handle real device's MMIO/PIO BARs */
pt_register_regions(assigned_device);
+ /* Setup VGA bios for passthroughed gfx */
+ if ( gfx_passthru && (assigned_device->pci_dev->device_class == 0x0300) )
+ {
+ rc = setup_vga_pt();
+ if ( rc < 0 )
+ {
+ PT_LOG("Setup VGA BIOS of passthroughed gfx failed!\n");
+ return NULL;
+ }
+ }
+
/* reinitialize each config register to be emulated */
rc = pt_config_init(assigned_device);
if ( rc < 0 ) {
diff --git a/vl.c b/vl.c
index 62bed05..1257b21 100644
--- a/vl.c
+++ b/vl.c
@@ -213,6 +213,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;
@@ -4042,7 +4043,7 @@ static void help(int exitcode)
#endif
#endif
"-portrait rotate graphical output 90 deg left (only PXA LCD)\n"
- "-vga [std|cirrus|vmware|none]\n"
+ "-vga [std|cirrus|vmware|passthrough|none]\n"
" select video card type\n"
"-full-screen start in full screen\n"
#if defined(TARGET_PPC) || defined(TARGET_SPARC)
@@ -4269,6 +4270,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 +4449,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", 0, QEMU_OPTION_gfx_passthru},
{ "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
{ "vncunused", 0, QEMU_OPTION_vncunused },
{ "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
@@ -4615,18 +4618,27 @@ static void select_vgahw (const char *p)
std_vga_enabled = 1;
cirrus_vga_enabled = 0;
vmsvga_enabled = 0;
+ gfx_passthru = 0;
} else if (strstart(p, "cirrus", &opts)) {
cirrus_vga_enabled = 1;
std_vga_enabled = 0;
vmsvga_enabled = 0;
+ gfx_passthru = 0;
} else if (strstart(p, "vmware", &opts)) {
cirrus_vga_enabled = 0;
std_vga_enabled = 0;
vmsvga_enabled = 1;
+ gfx_passthru = 0;
+ } else if (strstart(p, "passthrough", &opts)) {
+ cirrus_vga_enabled = 0;
+ std_vga_enabled = 0;
+ vmsvga_enabled = 0;
+ gfx_passthru = 1;
} else if (strstart(p, "none", &opts)) {
cirrus_vga_enabled = 0;
std_vga_enabled = 0;
vmsvga_enabled = 0;
+ gfx_passthru = 0;
} else {
invalid_vga:
fprintf(stderr, "Unknown vga type: %s\n", p);
@@ -5484,6 +5496,9 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_runas:
run_as = optarg;
break;
+ case QEMU_OPTION_gfx_passthru:
+ select_vgahw("passthrough");
+ break;
}
}
}
--
1.6.3
[-- 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 related [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-16 5:23 ` Han, Weidong
@ 2009-09-18 15:39 ` Ian Jackson
2009-09-20 12:48 ` Han, Weidong
0 siblings, 1 reply; 22+ messages in thread
From: Ian Jackson @ 2009-09-18 15:39 UTC (permalink / raw)
To: Han, Weidong
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
Guyader, Keir Fraser
Han, Weidong writes ("RE: [Xen-devel] [PATCH 2/2 v2] graphics passthrough with VT-d"):
> Did you have a look at this patch? What's your opinion on it? Thanks.
Thanks, that's an improvement.
The setting of gfx_passthru = 0; in each branch in select_vgahw is a
bit intrusive, so I dropped that bit; I think ti's still correct,
although the processing of conflicting command line options may be
changed slightly. I hope that's OK; if not please let me know.
Thanks,
Ian.
^ permalink raw reply [flat|nested] 22+ messages in thread
* RE: [PATCH 2/2 v2] graphics passthrough with VT-d
2009-09-18 15:39 ` Ian Jackson
@ 2009-09-20 12:48 ` Han, Weidong
0 siblings, 0 replies; 22+ messages in thread
From: Han, Weidong @ 2009-09-20 12:48 UTC (permalink / raw)
To: 'Ian Jackson'
Cc: 'xen-devel@lists.xensource.com', Lin, Ben Y, Kay, Allen M,
Guyader', 'Jean, 'Keir Fraser',
'bengheng@eecs.umich.edu'
Ian Jackson wrote:
> Han, Weidong writes ("RE: [Xen-devel] [PATCH 2/2 v2] graphics
> passthrough with VT-d"):
>> Did you have a look at this patch? What's your opinion on it? Thanks.
>
> Thanks, that's an improvement.
>
> The setting of gfx_passthru = 0; in each branch in select_vgahw is a
> bit intrusive, so I dropped that bit; I think ti's still correct,
> although the processing of conflicting command line options may be
> changed slightly. I hope that's OK; if not please let me know.
>
It's ok for me. Setting of gfx_passthru = 0; in each branch in select_vgahw is just for consistent with other emulated vgas. It's no problem to remove them because the gfx_passthru is initilized to 0. Thanks.
Regards,
Weidong
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2009-09-20 12:48 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-01 6:01 [PATCH 2/2 v2] graphics passthrough with VT-d Han, Weidong
2009-09-01 6:31 ` Teo En Ming (Zhang Enming)
2009-09-01 6:51 ` Teo En Ming (Zhang Enming)
2009-09-01 6:55 ` Han, Weidong
2009-09-01 6:59 ` Han, Weidong
2009-09-01 19:00 ` Teo En Ming (Zhang Enming)
2009-09-01 19:24 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 19:32 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 19:37 ` Mr. Teo En Ming (Zhang Enming)
2009-09-01 22:49 ` Han, Weidong
2009-09-02 3:29 ` Teo En Ming (Zhang Enming)
2009-09-02 3:37 ` Han, Weidong
2009-09-02 3:52 ` Teo En Ming (Zhang Enming)
2009-09-02 5:01 ` Teo En Ming (Zhang Enming)
2009-09-02 5:37 ` Han, Weidong
2009-09-02 13:35 ` Teo En Ming (Zhang Enming)
2009-09-01 11:53 ` Jean Guyader
2009-09-04 17:02 ` Ian Jackson
2009-09-06 5:25 ` Han, Weidong
2009-09-16 5:23 ` Han, Weidong
2009-09-18 15:39 ` Ian Jackson
2009-09-20 12:48 ` Han, Weidong
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.