All of lore.kernel.org
 help / color / mirror / Atom feed
* Experimental results for VGA passthrough
@ 2009-06-04 17:09 Beng Heng, Ng
  2009-06-04 17:43 ` Jean Guyader
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-04 17:09 UTC (permalink / raw)
  To: xen-devel

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

Hi,

I tried patching Xen 3.4 Testing c/s 19628 with vga passthrough code
(less HID passthrough), and did some tests. I made some modifications in
pci_setup to skip loading the emulated VGA bios and pci_load_option_roms
to load the passthrough VGA bios. The setup uses Intel DQ45CB and ATI
HD2600XT.

The BDFs for the relevant devices are:
Intel IGD  00:02.0
ATI gfx    01:00.0, 01:00.1
There's 2 BDFs for ATI because one of them is for the Audio. Both have
to be passed through simultaneously.

In the first scenario, Intel IGD is set up as the primary for Dom0. The
ATI gfx is passed through to DomU. Interestingly, it is the screen that
is connected to Intel's output that displays DomU (albeit with few
colors and low resolution). However, in the Device Manager, ATI is
reported. I believe this is because Intel's address space is being
mapped, instead of ATI's. Shutting down DomU does not return the display
to Dom0. The display remains at the last screen showing DomU shutting
down. I have a clip showing the observations. However, I wasn't able to
attach it. If you would like to take a look, please let me know.

In the second scenario, Intel IGD is passed through to DomU. The ATI gfx
is thus absent. However, when DomU is booted, there is an IOMMU page
fault. This is shown in the attachment starting from Line 659.
The system subsequently hangs. Does anyone have an explanation to what's
going on in this case?

So, VGA passthrough works, but is extremely flaky. Any
comments/suggestions to correct the problems observed will be greatly
appreciated.

Thanks.

- Beng Heng

[-- Attachment #2: vgapt.log --]
[-- Type: text/plain, Size: 40823 bytes --]


AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
Login incorrect

login:  __  __            _____ _  _    _             _                   
 \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___ 
  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
 /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
                                                   |_|             
(XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 01:37:06 EDT 2009
(XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
(XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 0 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009e800 (usable)
(XEN)  000000000009e800 - 00000000000a0000 (reserved)
(XEN)  00000000000e0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 000000007d6c1000 (usable)
(XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
(XEN)  000000007d704000 - 000000007d826000 (reserved)
(XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
(XEN)  000000007d83a000 - 000000007d93c000 (reserved)
(XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
(XEN)  000000007d93d000 - 000000007d942000 (reserved)
(XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
(XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
(XEN)  000000007d967000 - 000000007d986000 (reserved)
(XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
(XEN)  000000007d98c000 - 000000007db00000 (usable)
(XEN)  000000007dc00000 - 0000000080000000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff000000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000017c000000 (usable)
(XEN) System RAM: 3991MB (4087628kB)
(XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
(XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
(XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
(XEN) ACPI: FACS 7D952F40, 0040
(XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
(XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
(XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
(XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
(XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
(XEN) NUMA turned off
(XEN) Faking a node at 0000000000000000-000000017c000000
(XEN) Domain heap initialised
(XEN) DMI 2.4 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x408
(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
(XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
(XEN) Processor #0 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
(XEN) Processor #1 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
(XEN) Processor #2 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
(XEN) Processor #3 7:7 APIC version 20
(XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) [VT-D]dmar.c:485: Host address width 36
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
(XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) Intel VT-d DMAR tables have been parsed.
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Initializing CPU#0
(XEN) Detected 2499.782 MHz processor.
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 0
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN) HVM: VMX enabled
(XEN) Intel machine check reporting enabled on CPU#0.
(XEN) CPU0: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU0 has no CMCI support
(XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 1/1 eip 8c000
(XEN) Initializing CPU#1
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 1
(XEN) Intel machine check reporting enabled on CPU#1.
(XEN) CPU1: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU1 has no CMCI support
(XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 2/2 eip 8c000
(XEN) Initializing CPU#2
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 2
(XEN) Intel machine check reporting enabled on CPU#2.
(XEN) CPU2: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU2 has no CMCI support
(XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 3/3 eip 8c000
(XEN) Initializing CPU#3
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 3
(XEN) Intel machine check reporting enabled on CPU#3.
(XEN) CPU3: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU3 has no CMCI support
(XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Total of 4 processors activated.
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) checking TSC synchronization across 4 CPUs: passed.
(XEN) Platform timer is 3.579MHz ACPI PM Timer
(XEN) microcode.c:73:d32767 microcode: CPU1 resumed
(XEN) Brought up 4 CPUs
(XEN) microcode.c:73:d32767 microcode: CPU2 resumed
(XEN) microcode.c:73:d32767 microcode: CPU3 resumed
(XEN) Intel VT-d Snoop Control not supported.
(XEN) Intel VT-d DMA Passthrough not supported.
(XEN) Intel VT-d Queued Invalidation not supported.
(XEN) Intel VT-d Interrupt Remapping not supported.
(XEN) I/O virtualisation enabled
(XEN) I/O virtualisation for PV guests disabled
(XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
(XEN) ACPI sleep modes: S3
(XEN) mcheck_poll: Machine check polling timer started.
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
(XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) elf_xen_parse_note: GUEST_OS = "linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0xffffffff80000000
(XEN)     virt_offset      = 0x0
(XEN)     virt_kstart      = 0xffffffff80200000
(XEN)     virt_kend        = 0xffffffff8087cda8
(XEN)     virt_entry       = 0xffffffff80200000
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
(XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
(XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
(XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
(XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
(XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
(XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
(XEN)  ENTRY ADDRESS: ffffffff80200000
(XEN) Dom0 has maximum 4 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
(XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
(XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
(XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
(XEN) Scrubbing Free RAM: .............................done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
(XEN) Freed 128kB init memory.
kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0))
Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
BIOS-provided physical RAM map:
 Xen: 0000000000000000 - 0000000040800000 (usable)
DMI 2.4 present.
No mptable found.
  >>> ERROR: Invalid checksum
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
Setting APIC routing to xen
Using ACPI (MADT) for SMP configuration information
Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
Built 1 zonelists.  Total pages: 260580
Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2499.718 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Software IO TLB enabled: 
 Aperture:     64 megabytes
 Kernel range: ffff880002407000 - ffff880006407000
 Address size: 27 bits
PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
Calibrating delay using timer specific routine.. 5000.84 BogoMIPS (lpj=25004222)
Mount-cache hash table entries: 256
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
SMP alternatives: switching to UP code
ACPI: Core revision 20060707
SMP alternatives: switching to SMP code
Initializing CPU#1
Initializing CPU#2
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 1
Brought up 4 CPUs
Initializing CPU#3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 2
migration_cost=33
checking if image is initramfs... it is
Freeing initrd memory: 7436k freed
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
PCI: Not using MMCONFIG.
PCI: Using configuration type 1
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
(XEN) io_apic.c:2139: 
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
pnp: PnP ACPI: found 10 devices
xen_mem: Initialising balloon driver.
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
pnp: 00:09: ioport range 0x400-0x47f could not be reserved
pnp: 00:09: ioport range 0x1180-0x119f has been reserved
pnp: 00:09: ioport range 0x500-0x57f has been reserved
(XEN) PCI add device 00:00.0
(XEN) PCI add device 00:01.0
(XEN) PCI add device 00:02.0
pciback 0000:00:02.0: seizing device
(XEN) PCI add device 00:03.0
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:03.3
(XEN) PCI add device 00:19.0
(XEN) PCI add device 00:1a.0
(XEN) PCI add device 00:1a.1
(XEN) PCI add device 00:1a.2
(XEN) PCI add device 00:1a.7
(XEN) PCI add device 00:1b.0
(XEN) PCI add device 00:1d.0
(XEN) PCI add device 00:1d.1
(XEN) PCI add device 00:1d.2
(XEN) PCI add device 00:1d.7
(XEN) PCI add device 00:1e.0
(XEN) PCI add device 00:1f.0
(XEN) PCI add device 00:1f.2
(XEN) PCI add device 00:1f.3
(XEN) PCI add device 00:1f.5
(XEN) PCI add device 01:00.0
(XEN) PCI add device 01:00.1
(XEN) PCI add device 02:00.0
(XEN) PCI add device 02:01.0
PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
PCI: Bridge: 0000:00:01.0
  IO window: c000-cfff
  MEM window: c0000000-d00fffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1e.0
  IO window: b000-bfff
  MEM window: d0800000-d08fffff
  PREFETCH window: 88000000-880fffff
GSI 16 sharing vector 0xB0 and IRQ 16
ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
floppy0: Unable to grab DMA2 for the floppy driver
floppy0: no floppy controllers found
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
HP CISS Driver (v 3.6.10)
Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
Copyright (c) 1999-2006 Intel Corporation.
(XEN) PCI add device 02:00.0
GSI 17 sharing vector 0xB8 and IRQ 17
ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
e1000e: Copyright (c) 1999-2008 Intel Corporation.
(XEN) PCI add device 00:19.0
GSI 18 sharing vector 0xC0 and IRQ 18
ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
eth1: Intel(R) PRO/1000 Network Connection
eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
e100: Copyright(c) 1999-2005 Intel Corporation
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Xen virtual console successfully installed as ttyS0
Event-channel device installed.
blktap_device_init: blktap device major 254
blktap_ring_init: blktap ring major: 253
netfront: Initialising virtual ethernet driver.
ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
ACPI: PCI interrupt for device 0000:00:02.0 disabled
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:1f.5
Adaptec aacraid driver (1.1-5[2409]-mh2)
3ware Storage Controller device driver for Linux v1.26.02.001.
(XEN) PCI add device 00:1f.2
GSI 19 sharing vector 0xD0 and IRQ 19
ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part 
ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
scsi0 : ahci
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/133
scsi1 : ahci
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata2.00: ATAPI, max UDMA/100
ata2.00: configured for UDMA/100
scsi2 : ahci
ata3: SATA link down (SStatus 0 SControl 300)
scsi3 : ahci
ata4: SATA link down (SStatus 0 SControl 300)
scsi4 : ahci
ata5: SATA link down (SStatus 0 SControl 300)
scsi5 : ahci
ata6: SATA link down (SStatus 0 SControl 300)
  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
  Type:   CD-ROM                             ANSI SCSI revision: 05
(XEN) PCI add device 00:1f.5
ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 19
ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 19
ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 19
scsi6 : ata_piix
ATA: abnormal status 0x7F on port 0xD177
scsi7 : ata_piix
ATA: abnormal status 0x7F on port 0xD157
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
sd 0:0:0:0: Attached scsi disk sda
Fusion MPT base driver 3.04.01
Copyright (c) 1999-2005 LSI Logic Corporation
Fusion MPT SPI Host driver 3.04.01
usbmon: debugfs is not available
USB Universal Host Controller Interface driver v3.0
(XEN) PCI add device 00:1a.0
ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
uhci_hcd 0000:00:1a.0: UHCI Host Controller
uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.1
ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
uhci_hcd 0000:00:1a.1: UHCI Host Controller
uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.2
GSI 20 sharing vector 0x21 and IRQ 20
ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 20
uhci_hcd 0000:00:1a.2: UHCI Host Controller
uhci_hcd 0000:00:1a.2: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:1a.2: irq 20, io base 0x0000d0a0
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.0
GSI 21 sharing vector 0x29 and IRQ 21
ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
uhci_hcd 0000:00:1d.0: UHCI Host Controller
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
usb usb4: configuration #1 chosen from 1 choice
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.1
ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 5
uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000d060
usb usb5: configuration #1 chosen from 1 choice
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.2
ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 20
uhci_hcd 0000:00:1d.2: UHCI Host Controller
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 6
uhci_hcd 0000:00:1d.2: irq 20, io base 0x0000d040
usb usb6: configuration #1 chosen from 1 choice
hub 6-0:1.0: USB hub found
hub 6-0:1.0: 2 ports detected
usb 3-1: new full speed USB device using uhci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
hub 3-1:1.0: USB hub found
hub 3-1:1.0: 4 ports detected
usb 3-1.1: new low speed USB device using uhci_hcd and address 3
usb 3-1.1: configuration #1 chosen from 1 choice
input: HID 04f3:0801 as /class/input/input0
input: USB HID v1.10 Keyboard [HID 04f3:0801] on usb-0000:00:1a.2-1.1
input: HID 04f3:0801 as /class/input/input1
input: USB HID v1.10 Mouse [HID 04f3:0801] on usb-0000:00:1a.2-1.1
usbcore: registered new driver usbhid
/usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Bridge firewalling registered
PCI IO multiplexer device installed.
ACPI: (supports S0 S1 S3 S4 S5)
BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
Freeing unused kernel memory: 216k freed
Mounting proc filesystem
Mounting sysfs filesystem
Creating /dev
Creating initial device nodes
Loading /lib/kbd/keymaps/i386/qwerty/us.map
Setting up hotplug.
Creating block device nodes.
Creating character device nodes.
Creating root device.
Mounting root filesystem.
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Setting up other filesystems.
Switching to new root and running init.
		Welcome to Fedora 
		Press 'I' to enter interactive startup.
Starting udev: G[  OK  ]
Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
Jun 04 10:15:48 | DM multipath kernel driver not loaded
Setting up Logical Volume Management: File descriptor 7 left open
[  OK  ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2 
/: clean, 2579435/6111232 files, 12471113/24418800 blocks
[  OK  ]
Remounting root filesystem in read-write mode:  [  OK  ]
Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
FATAL: Module fuse not found.
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
[FAILED]
Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
[  OK  ]
Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
[  OK  ]
Entering non-interactive startup
Applying Intel CPU microcode update: FATAL: Module microcode not found.
[  OK  ]ERROR: Module microcode does not exist in /proc/modules

ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
[FAILED]
iptables: Applying firewall rules: FATAL: Module ip_tables not found.
iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]
Starting auditd: [FAILED]
Starting system logger: [  OK  ]
Starting irqbalance: [  OK  ]
Starting rpcbind: [  OK  ]
Starting NFS statd: [FAILED]
Starting RPC idmapd: FATAL: Module sunrpc not found.
FATAL: Error running install command for sunrpc
Error: RPC MTAB does not exist.
Starting system message bus: [  OK  ]
Starting HAL daemon: [  OK  ]
Setting network parameters... [  OK  ]
Starting NetworkManager daemon: [  OK  ]
Starting portreserve: [  OK  ]
Starting Bluetooth services:[  OK  ]
Starting sendmail: [  OK  ]
Starting sm-client: [  OK  ]
Starting console mouse services: [  OK  ]
Starting httpd: [  OK  ]
Starting crond: [  OK  ][  OK  ]
Starting kerneloops:[  OK  ]
Starting atd: [  OK  ][  OK  ]
Starting Avahi daemon... [  OK  ]
Starting cups: [  OK  ]
Starting anacron: [  OK  ]
Starting sshd: [  OK  ]

Fedora release 10 (Cambridge)
Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)

xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 1f0
(XEN)     l2[1f0] = 0
(XEN)     l2[1f0] not present
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) Assertion '(sp == 0) || (peoi[sp-1].vector < vector)' failed at irq.c:322
(XEN) ----[ Xen-3.4.1-rc1-pre  x86_64  debug=y  Not tainted ]----
(XEN) CPU:    0
(XEN) RIP:    e008:[<ffff828c80147b5f>] do_IRQ+0x11d/0x42e
(XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
(XEN) rax: 00000000000000b8   rbx: ffff828c802b4100   rcx: 0000000000000001
(XEN) rdx: ffff828c80239340   rsi: 0000000000000001   rdi: 00000000000000b8
(XEN) rbp: ffff828c80287da8   rsp: ffff828c80287d48   r8:  0000000000000002
(XEN) r9:  0000000000000004   r10: ffff828c802c5360   r11: 000000206772e721
(XEN) r12: ffff828c80287db8   r13: ffff828c80118de9   r14: ffff8301776222f0
(XEN) r15: ffff83017bfe22f0   cr0: 0000000080050033   cr4: 00000000000026f0
(XEN) cr3: 000000016e01e000   cr2: 000000000089aba0
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff828c80287d48:
(XEN)    0000000000000001 0000000000000010 00007d737fd78277 ffff828c802b4124
(XEN)    000000b8000000b8 ffff828c802b4100 00000000000000b8 ffff828c80239180
(XEN)    0000000000000000 ffff828c80118de9 ffff83017bfe22f8 ffff83017bfe22f0
(XEN)    00007d737fd78227 ffff828c80141406 ffff83017bfe22f0 ffff83017bfe22f8
(XEN)    ffff828c80118de9 0000000000000000 ffff828c80287e88 ffff828c80239180
(XEN)    000000206772e721 ffff828c802c5360 0000000000000004 0000000000000002
(XEN)    0000000000000000 0000000000000002 ffff828c802c5440 ffff828c80239120
(XEN)    ffff828c80239180 000000b800000000 ffff828c8011b46a 000000000000e008
(XEN)    0000000000000246 ffff828c80287e60 0000000000000000 ffff828c8011d13d
(XEN)    0000000000000002 ffff828c80239120 0000002065a91d8f ffff828c80239180
(XEN)    ffff828c80287ed8 ffff828c8011d26d ffff828c80287ea8 ffff828c80239180
(XEN)    ffff83017bfe22f0 0000000000000000 0000000001154820 ffff828c80287f28
(XEN)    ffff828c8029e900 ffff828c8029f900 ffff828c80287f18 ffff828c8011b29f
(XEN)    ffff83007d4fe000 ffff83007d4fe000 0000000001154820 0000000001154820
(XEN)    00002b5875a9e538 0000000000000000 00007d737fd780b7 ffff828c801d0296
(XEN)    0000000000000000 00002b5875a9e538 0000000001154820 0000000001154820
(XEN)    0000000000000000 00002b5875a9e538 0000000000000000 0000003a92d6da70
(XEN)    0000003aacd1aebc 0000000000000000 0000000001154820 0000003aacf6e940
(XEN)    0000000000000000 00002b5875a9e520 00002b5875a9e538 0000009800000000
(XEN)    0000003aaccd9727 000000000000e033 0000000000000246 00002b5875a9e4c8
(XEN) Xen call trace:
(XEN)    [<ffff828c80147b5f>] do_IRQ+0x11d/0x42e
(XEN)    [<ffff828c80141406>] common_interrupt+0x26/0x30
(XEN)    [<ffff828c8011b46a>] _spin_unlock_irq+0x22/0x23
(XEN)    [<ffff828c8011d26d>] timer_softirq_action+0x10c/0x350
(XEN)    [<ffff828c8011b29f>] do_softirq+0x6f/0x80
(XEN)    
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion '(sp == 0) || (peoi[sp-1].vector < vector)' failed at irq.c:322
(XEN) ****************************************
(XEN) 
(XEN) Reboot in five seconds...
(XEN) Resetting with ACPI MEMORY or I/O RESET_REG.

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

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

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

* Re: Experimental results for VGA passthrough
  2009-06-04 17:09 Experimental results for VGA passthrough Beng Heng, Ng
@ 2009-06-04 17:43 ` Jean Guyader
  2009-06-04 18:27   ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Jean Guyader @ 2009-06-04 17:43 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: xen-devel

2009/6/4 Beng Heng, Ng <bengheng@eecs.umich.edu>:
> Hi,
>
> I tried patching Xen 3.4 Testing c/s 19628 with vga passthrough code
> (less HID passthrough), and did some tests. I made some modifications in
> pci_setup to skip loading the emulated VGA bios and pci_load_option_roms
> to load the passthrough VGA bios. The setup uses Intel DQ45CB and ATI
> HD2600XT.
>
> The BDFs for the relevant devices are:
> Intel IGD  00:02.0
> ATI gfx    01:00.0, 01:00.1
> There's 2 BDFs for ATI because one of them is for the Audio. Both have
> to be passed through simultaneously.
>
> In the first scenario, Intel IGD is set up as the primary for Dom0. The
> ATI gfx is passed through to DomU. Interestingly, it is the screen that
> is connected to Intel's output that displays DomU (albeit with few
> colors and low resolution). However, in the Device Manager, ATI is
> reported. I believe this is because Intel's address space is being
> mapped, instead of ATI's. Shutting down DomU does not return the display
> to Dom0. The display remains at the last screen showing DomU shutting
> down. I have a clip showing the observations. However, I wasn't able to
> attach it. If you would like to take a look, please let me know.
>
> In the second scenario, Intel IGD is passed through to DomU. The ATI gfx
> is thus absent. However, when DomU is booted, there is an IOMMU page
> fault. This is shown in the attachment starting from Line 659.
> The system subsequently hangs. Does anyone have an explanation to what's
> going on in this case?
>
> So, VGA passthrough works, but is extremely flaky. Any
> comments/suggestions to correct the problems observed will be greatly
> appreciated.
>
> Thanks.
>
> - Beng Heng
>
>
> AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
> Login incorrect
>
> login:  __  __            _____ _  _    _             _
>  \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___
>  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
>  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
>  /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
>                                                   |_|
> (XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 01:37:06 EDT 2009
> (XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
> (XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
> (XEN) Video information:
> (XEN)  VGA is text mode 80x25, font 8x16
> (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
> (XEN) Disc information:
> (XEN)  Found 0 MBR signatures
> (XEN)  Found 1 EDD information structures
> (XEN) Xen-e820 RAM map:
> (XEN)  0000000000000000 - 000000000009e800 (usable)
> (XEN)  000000000009e800 - 00000000000a0000 (reserved)
> (XEN)  00000000000e0000 - 0000000000100000 (reserved)
> (XEN)  0000000000100000 - 000000007d6c1000 (usable)
> (XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
> (XEN)  000000007d704000 - 000000007d826000 (reserved)
> (XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
> (XEN)  000000007d83a000 - 000000007d93c000 (reserved)
> (XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
> (XEN)  000000007d93d000 - 000000007d942000 (reserved)
> (XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
> (XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
> (XEN)  000000007d967000 - 000000007d986000 (reserved)
> (XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
> (XEN)  000000007d98c000 - 000000007db00000 (usable)
> (XEN)  000000007dc00000 - 0000000080000000 (reserved)
> (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
> (XEN)  00000000ff000000 - 0000000100000000 (reserved)
> (XEN)  0000000100000000 - 000000017c000000 (usable)
> (XEN) System RAM: 3991MB (4087628kB)
> (XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
> (XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
> (XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
> (XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
> (XEN) ACPI: FACS 7D952F40, 0040
> (XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
> (XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
> (XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
> (XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
> (XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
> (XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
> (XEN) NUMA turned off
> (XEN) Faking a node at 0000000000000000-000000017c000000
> (XEN) Domain heap initialised
> (XEN) DMI 2.4 present.
> (XEN) Using APIC driver default
> (XEN) ACPI: PM-Timer IO Port: 0x408
> (XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
> (XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
> (XEN) ACPI: Local APIC address 0xfee00000
> (XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> (XEN) Processor #0 7:7 APIC version 20
> (XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
> (XEN) Processor #1 7:7 APIC version 20
> (XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
> (XEN) Processor #2 7:7 APIC version 20
> (XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
> (XEN) Processor #3 7:7 APIC version 20
> (XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
> (XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
> (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
> (XEN) ACPI: IRQ0 used by override.
> (XEN) ACPI: IRQ2 used by override.
> (XEN) ACPI: IRQ9 used by override.
> (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
> (XEN) [VT-D]dmar.c:485: Host address width 36
> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
> (XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
> (XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
> (XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
> (XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
> (XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
> (XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
> (XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
> (XEN) Intel VT-d DMAR tables have been parsed.
> (XEN) Using ACPI (MADT) for SMP configuration information
> (XEN) Using scheduler: SMP Credit Scheduler (credit)
> (XEN) Initializing CPU#0
> (XEN) Detected 2499.782 MHz processor.
> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
> (XEN) CPU: L2 cache: 3072K
> (XEN) CPU: Physical Processor ID: 0
> (XEN) CPU: Processor Core ID: 0
> (XEN) VMX: Supported advanced features:
> (XEN)  - APIC MMIO access virtualisation
> (XEN)  - APIC TPR shadow
> (XEN)  - Virtual NMI
> (XEN)  - MSR direct-access bitmap
> (XEN) HVM: VMX enabled
> (XEN) Intel machine check reporting enabled on CPU#0.
> (XEN) CPU0: Thermal monitoring enabled (TM2)
> (XEN) CMCI: CPU0 has no CMCI support
> (XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
> (XEN) Booting processor 1/1 eip 8c000
> (XEN) Initializing CPU#1
> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
> (XEN) CPU: L2 cache: 3072K
> (XEN) CPU: Physical Processor ID: 0
> (XEN) CPU: Processor Core ID: 1
> (XEN) Intel machine check reporting enabled on CPU#1.
> (XEN) CPU1: Thermal monitoring enabled (TM2)
> (XEN) CMCI: CPU1 has no CMCI support
> (XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
> (XEN) Booting processor 2/2 eip 8c000
> (XEN) Initializing CPU#2
> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
> (XEN) CPU: L2 cache: 3072K
> (XEN) CPU: Physical Processor ID: 0
> (XEN) CPU: Processor Core ID: 2
> (XEN) Intel machine check reporting enabled on CPU#2.
> (XEN) CPU2: Thermal monitoring enabled (TM2)
> (XEN) CMCI: CPU2 has no CMCI support
> (XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
> (XEN) Booting processor 3/3 eip 8c000
> (XEN) Initializing CPU#3
> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
> (XEN) CPU: L2 cache: 3072K
> (XEN) CPU: Physical Processor ID: 0
> (XEN) CPU: Processor Core ID: 3
> (XEN) Intel machine check reporting enabled on CPU#3.
> (XEN) CPU3: Thermal monitoring enabled (TM2)
> (XEN) CMCI: CPU3 has no CMCI support
> (XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
> (XEN) Total of 4 processors activated.
> (XEN) ENABLING IO-APIC IRQs
> (XEN)  -> Using new ACK method
> (XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
> (XEN) checking TSC synchronization across 4 CPUs: passed.
> (XEN) Platform timer is 3.579MHz ACPI PM Timer
> (XEN) microcode.c:73:d32767 microcode: CPU1 resumed
> (XEN) Brought up 4 CPUs
> (XEN) microcode.c:73:d32767 microcode: CPU2 resumed
> (XEN) microcode.c:73:d32767 microcode: CPU3 resumed
> (XEN) Intel VT-d Snoop Control not supported.
> (XEN) Intel VT-d DMA Passthrough not supported.
> (XEN) Intel VT-d Queued Invalidation not supported.
> (XEN) Intel VT-d Interrupt Remapping not supported.
> (XEN) I/O virtualisation enabled
> (XEN) I/O virtualisation for PV guests disabled
> (XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
> (XEN) ACPI sleep modes: S3
> (XEN) mcheck_poll: Machine check polling timer started.
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
> (XEN) *** LOADING DOMAIN 0 ***
> (XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
> (XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
> (XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
> (XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
> (XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
> (XEN) elf_xen_parse_note: GUEST_OS = "linux"
> (XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
> (XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
> (XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
> (XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
> (XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
> (XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
> (XEN) elf_xen_parse_note: unknown xen elf note (0xd)
> (XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
> (XEN) elf_xen_parse_note: LOADER = "generic"
> (XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
> (XEN) elf_xen_addr_calc_check: addresses:
> (XEN)     virt_base        = 0xffffffff80000000
> (XEN)     elf_paddr_offset = 0xffffffff80000000
> (XEN)     virt_offset      = 0x0
> (XEN)     virt_kstart      = 0xffffffff80200000
> (XEN)     virt_kend        = 0xffffffff8087cda8
> (XEN)     virt_entry       = 0xffffffff80200000
> (XEN)     p2m_base         = 0xffffffffffffffff
> (XEN)  Xen  kernel: 64-bit, lsb, compat32
> (XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
> (XEN) PHYSICAL MEMORY ARRANGEMENT:
> (XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
> (XEN) VIRTUAL MEMORY ARRANGEMENT:
> (XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
> (XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
> (XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
> (XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
> (XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
> (XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
> (XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
> (XEN)  ENTRY ADDRESS: ffffffff80200000
> (XEN) Dom0 has maximum 4 VCPUs
> (XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
> (XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
> (XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
> (XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
> (XEN) Scrubbing Free RAM: .............................done.
> (XEN) Xen trace buffers: disabled
> (XEN) Std. Loglevel: All
> (XEN) Guest Loglevel: All
> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
> (XEN) Freed 128kB init memory.
> kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
> Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0))
> Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
> BIOS-provided physical RAM map:
>  Xen: 0000000000000000 - 0000000040800000 (usable)
> DMI 2.4 present.
> No mptable found.
>  >>> ERROR: Invalid checksum
> ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
> ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
> ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
> ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
> ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
> IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
> ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
> Setting APIC routing to xen
> Using ACPI (MADT) for SMP configuration information
> Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
> Built 1 zonelists.  Total pages: 260580
> Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)
> Initializing CPU#0
> PID hash table entries: 4096 (order: 12, 32768 bytes)
> Xen reported: 2499.718 MHz processor.
> Console: colour VGA+ 80x25
> Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
> Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
> Software IO TLB enabled:
>  Aperture:     64 megabytes
>  Kernel range: ffff880002407000 - ffff880006407000
>  Address size: 27 bits
> PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
> Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
> Calibrating delay using timer specific routine.. 5000.84 BogoMIPS (lpj=25004222)
> Mount-cache hash table entries: 256
> CPU: L1 I cache: 32K, L1 D cache: 32K
> CPU: L2 cache: 3072K
> CPU: Physical Processor ID: 0
> CPU: Processor Core ID: 0
> SMP alternatives: switching to UP code
> ACPI: Core revision 20060707
> SMP alternatives: switching to SMP code
> Initializing CPU#1
> Initializing CPU#2
> CPU: L1 I cache: 32K, L1 D cache: 32K
> CPU: L2 cache: 3072K
> CPU: Physical Processor ID: 0
> CPU: Processor Core ID: 1
> Brought up 4 CPUs
> Initializing CPU#3
> CPU: L1 I cache: 32K, L1 D cache: 32K
> CPU: L2 cache: 3072K
> CPU: Physical Processor ID: 0
> CPU: Processor Core ID: 3
> CPU: L1 I cache: 32K, L1 D cache: 32K
> CPU: L2 cache: 3072K
> CPU: Physical Processor ID: 0
> CPU: Processor Core ID: 2
> migration_cost=33
> checking if image is initramfs... it is
> Freeing initrd memory: 7436k freed
> NET: Registered protocol family 16
> ACPI: bus type pci registered
> PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
> PCI: Not using MMCONFIG.
> PCI: Using configuration type 1
> ACPI: Interpreter enabled
> ACPI: Using IOAPIC for interrupt routing
> ACPI: PCI Root Bridge [PCI0] (0000:00)
> PCI: Transparent bridge - 0000:00:1e.0
> ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
> ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
> ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
> ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
> ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
> ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
> ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
> ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
> Linux Plug and Play Support v0.97 (c) Adam Belay
> pnp: PnP ACPI init
> (XEN) io_apic.c:2139:
> (XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
> (XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
> pnp: PnP ACPI: found 10 devices
> xen_mem: Initialising balloon driver.
> SCSI subsystem initialized
> usbcore: registered new driver usbfs
> usbcore: registered new driver hub
> PCI: Using ACPI for IRQ routing
> PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
> pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
> pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
> pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
> pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
> pnp: 00:09: ioport range 0x400-0x47f could not be reserved
> pnp: 00:09: ioport range 0x1180-0x119f has been reserved
> pnp: 00:09: ioport range 0x500-0x57f has been reserved
> (XEN) PCI add device 00:00.0
> (XEN) PCI add device 00:01.0
> (XEN) PCI add device 00:02.0
> pciback 0000:00:02.0: seizing device
> (XEN) PCI add device 00:03.0
> (XEN) PCI add device 00:03.2
> (XEN) PCI add device 00:03.3
> (XEN) PCI add device 00:19.0
> (XEN) PCI add device 00:1a.0
> (XEN) PCI add device 00:1a.1
> (XEN) PCI add device 00:1a.2
> (XEN) PCI add device 00:1a.7
> (XEN) PCI add device 00:1b.0
> (XEN) PCI add device 00:1d.0
> (XEN) PCI add device 00:1d.1
> (XEN) PCI add device 00:1d.2
> (XEN) PCI add device 00:1d.7
> (XEN) PCI add device 00:1e.0
> (XEN) PCI add device 00:1f.0
> (XEN) PCI add device 00:1f.2
> (XEN) PCI add device 00:1f.3
> (XEN) PCI add device 00:1f.5
> (XEN) PCI add device 01:00.0
> (XEN) PCI add device 01:00.1
> (XEN) PCI add device 02:00.0
> (XEN) PCI add device 02:01.0
> PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
> PCI: Bridge: 0000:00:01.0
>  IO window: c000-cfff
>  MEM window: c0000000-d00fffff
>  PREFETCH window: disabled.
> PCI: Bridge: 0000:00:1e.0
>  IO window: b000-bfff
>  MEM window: d0800000-d08fffff
>  PREFETCH window: 88000000-880fffff
> GSI 16 sharing vector 0xB0 and IRQ 16
> ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
> NET: Registered protocol family 2
> IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
> TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
> TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
> TCP: Hash tables configured (established 131072 bind 65536)
> TCP reno registered
> IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
> Initializing Cryptographic API
> io scheduler noop registered
> io scheduler anticipatory registered (default)
> io scheduler deadline registered
> io scheduler cfq registered
> 0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
> 0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
> floppy0: Unable to grab DMA2 for the floppy driver
> floppy0: no floppy controllers found
> RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
> loop: loaded (max 8 devices)
> HP CISS Driver (v 3.6.10)
> Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
> Copyright (c) 1999-2006 Intel Corporation.
> (XEN) PCI add device 02:00.0
> GSI 17 sharing vector 0xB8 and IRQ 17
> ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
> e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
> e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
> e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
> e1000e: Copyright (c) 1999-2008 Intel Corporation.
> (XEN) PCI add device 00:19.0
> GSI 18 sharing vector 0xC0 and IRQ 18
> ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
> eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
> eth1: Intel(R) PRO/1000 Network Connection
> eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
> pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
> e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
> e100: Copyright(c) 1999-2005 Intel Corporation
> tun: Universal TUN/TAP device driver, 1.6
> tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
> Xen virtual console successfully installed as ttyS0
> Event-channel device installed.
> blktap_device_init: blktap device major 254
> blktap_ring_init: blktap ring major: 253
> netfront: Initialising virtual ethernet driver.
> ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
> ACPI: PCI interrupt for device 0000:00:02.0 disabled
> Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
> (XEN) PCI add device 00:03.2
> (XEN) PCI add device 00:1f.5
> Adaptec aacraid driver (1.1-5[2409]-mh2)
> 3ware Storage Controller device driver for Linux v1.26.02.001.
> (XEN) PCI add device 00:1f.2
> GSI 19 sharing vector 0xD0 and IRQ 19
> ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
> ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
> ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part
> ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
> ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
> ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
> ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
> ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
> ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
> scsi0 : ahci
> ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
> ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
> ata1.00: ata1: dev 0 multi count 16
> ata1.00: configured for UDMA/133
> scsi1 : ahci
> ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> ata2.00: ATAPI, max UDMA/100
> ata2.00: configured for UDMA/100
> scsi2 : ahci
> ata3: SATA link down (SStatus 0 SControl 300)
> scsi3 : ahci
> ata4: SATA link down (SStatus 0 SControl 300)
> scsi4 : ahci
> ata5: SATA link down (SStatus 0 SControl 300)
> scsi5 : ahci
> ata6: SATA link down (SStatus 0 SControl 300)
>  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
>  Type:   Direct-Access                      ANSI SCSI revision: 05
>  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
>  Type:   CD-ROM                             ANSI SCSI revision: 05
> (XEN) PCI add device 00:1f.5
> ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
> ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 19
> ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 19
> ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 19
> scsi6 : ata_piix
> ATA: abnormal status 0x7F on port 0xD177
> scsi7 : ata_piix
> ATA: abnormal status 0x7F on port 0xD157
> SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
> sda: Write Protect is off
> SCSI device sda: drive cache: write back
> SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
> sda: Write Protect is off
> SCSI device sda: drive cache: write back
>  sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
> sd 0:0:0:0: Attached scsi disk sda
> Fusion MPT base driver 3.04.01
> Copyright (c) 1999-2005 LSI Logic Corporation
> Fusion MPT SPI Host driver 3.04.01
> usbmon: debugfs is not available
> USB Universal Host Controller Interface driver v3.0
> (XEN) PCI add device 00:1a.0
> ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
> uhci_hcd 0000:00:1a.0: UHCI Host Controller
> uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
> uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
> usb usb1: configuration #1 chosen from 1 choice
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 2 ports detected
> (XEN) PCI add device 00:1a.1
> ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
> uhci_hcd 0000:00:1a.1: UHCI Host Controller
> uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
> uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
> usb usb2: configuration #1 chosen from 1 choice
> hub 2-0:1.0: USB hub found
> hub 2-0:1.0: 2 ports detected
> (XEN) PCI add device 00:1a.2
> GSI 20 sharing vector 0x21 and IRQ 20
> ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 20
> uhci_hcd 0000:00:1a.2: UHCI Host Controller
> uhci_hcd 0000:00:1a.2: new USB bus registered, assigned bus number 3
> uhci_hcd 0000:00:1a.2: irq 20, io base 0x0000d0a0
> usb usb3: configuration #1 chosen from 1 choice
> hub 3-0:1.0: USB hub found
> hub 3-0:1.0: 2 ports detected
> (XEN) PCI add device 00:1d.0
> GSI 21 sharing vector 0x29 and IRQ 21
> ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
> uhci_hcd 0000:00:1d.0: UHCI Host Controller
> uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 4
> uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
> usb usb4: configuration #1 chosen from 1 choice
> hub 4-0:1.0: USB hub found
> hub 4-0:1.0: 2 ports detected
> (XEN) PCI add device 00:1d.1
> ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
> uhci_hcd 0000:00:1d.1: UHCI Host Controller
> uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 5
> uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000d060
> usb usb5: configuration #1 chosen from 1 choice
> hub 5-0:1.0: USB hub found
> hub 5-0:1.0: 2 ports detected
> (XEN) PCI add device 00:1d.2
> ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 20
> uhci_hcd 0000:00:1d.2: UHCI Host Controller
> uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 6
> uhci_hcd 0000:00:1d.2: irq 20, io base 0x0000d040
> usb usb6: configuration #1 chosen from 1 choice
> hub 6-0:1.0: USB hub found
> hub 6-0:1.0: 2 ports detected
> usb 3-1: new full speed USB device using uhci_hcd and address 2
> usb 3-1: configuration #1 chosen from 1 choice
> hub 3-1:1.0: USB hub found
> hub 3-1:1.0: 4 ports detected
> usb 3-1.1: new low speed USB device using uhci_hcd and address 3
> usb 3-1.1: configuration #1 chosen from 1 choice
> input: HID 04f3:0801 as /class/input/input0
> input: USB HID v1.10 Keyboard [HID 04f3:0801] on usb-0000:00:1a.2-1.1
> input: HID 04f3:0801 as /class/input/input1
> input: USB HID v1.10 Mouse [HID 04f3:0801] on usb-0000:00:1a.2-1.1
> usbcore: registered new driver usbhid
> /usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
> PNP: No PS/2 controller found. Probing ports directly.
> serio: i8042 AUX port at 0x60,0x64 irq 12
> serio: i8042 KBD port at 0x60,0x64 irq 1
> mice: PS/2 mouse device common for all mice
> md: raid0 personality registered for level 0
> md: raid1 personality registered for level 1
> md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
> md: bitmap version 4.39
> device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
> TCP bic registered
> NET: Registered protocol family 1
> NET: Registered protocol family 17
> Bridge firewalling registered
> PCI IO multiplexer device installed.
> ACPI: (supports S0 S1 S3 S4 S5)
> BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
> Freeing unused kernel memory: 216k freed
> Mounting proc filesystem
> Mounting sysfs filesystem
> Creating /dev
> Creating initial device nodes
> Loading /lib/kbd/keymaps/i386/qwerty/us.map
> Setting up hotplug.
> Creating block device nodes.
> Creating character device nodes.
> Creating root device.
> Mounting root filesystem.
> EXT3-fs: INFO: recovery required on readonly filesystem.
> EXT3-fs: write access will be enabled during recovery.
> kjournald starting.  Commit interval 5 seconds
> EXT3-fs: recovery complete.
> EXT3-fs: mounted filesystem with ordered data mode.
> Setting up other filesystems.
> Switching to new root and running init.
>                Welcome to Fedora
>                Press 'I' to enter interactive startup.
> Starting udev: G[  OK  ]
> Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
> Jun 04 10:15:48 | DM multipath kernel driver not loaded
> Setting up Logical Volume Management: File descriptor 7 left open
> [  OK  ]
> Checking filesystems
> Checking all file systems.
> [/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2
> /: clean, 2579435/6111232 files, 12471113/24418800 blocks
> [  OK  ]
> Remounting root filesystem in read-write mode:  [  OK  ]
> Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
> FATAL: Module fuse not found.
> ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
> [FAILED]
> Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
> [  OK  ]
> Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
> [  OK  ]
> Entering non-interactive startup
> Applying Intel CPU microcode update: FATAL: Module microcode not found.
> [  OK  ]ERROR: Module microcode does not exist in /proc/modules
>
> ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
> ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'
>
> Error occurred at line: 3
> Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
> [FAILED]
> iptables: Applying firewall rules: FATAL: Module ip_tables not found.
> iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'
>
> Error occurred at line: 3
> Try `iptables-restore -h' or 'iptables-restore --help' for more information.
> [FAILED]
> Starting auditd: [FAILED]
> Starting system logger: [  OK  ]
> Starting irqbalance: [  OK  ]
> Starting rpcbind: [  OK  ]
> Starting NFS statd: [FAILED]
> Starting RPC idmapd: FATAL: Module sunrpc not found.
> FATAL: Error running install command for sunrpc
> Error: RPC MTAB does not exist.
> Starting system message bus: [  OK  ]
> Starting HAL daemon: [  OK  ]
> Setting network parameters... [  OK  ]
> Starting NetworkManager daemon: [  OK  ]
> Starting portreserve: [  OK  ]
> Starting Bluetooth services:[  OK  ]
> Starting sendmail: [  OK  ]
> Starting sm-client: [  OK  ]
> Starting console mouse services: [  OK  ]
> Starting httpd: [  OK  ]
> Starting crond: [  OK  ][  OK  ]
> Starting kerneloops:[  OK  ]
> Starting atd: [  OK  ][  OK  ]
> Starting Avahi daemon... [  OK  ]
> Starting cups: [  OK  ]
> Starting anacron: [  OK  ]
> Starting sshd: [  OK  ]
>
> Fedora release 10 (Cambridge)
> Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)
>
> xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 1f0
> (XEN)     l2[1f0] = 0
> (XEN)     l2[1f0] not present
> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
> (XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
> (XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
> (XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
> (XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
> (XEN)     root_entry = ffff83017bfb8000
> (XEN)     root_entry[0] = 17763a001
> (XEN)     context = ffff83017763a000
> (XEN)     context[10] = 201_17635a001
> (XEN)     l3 = ffff83017635a000
> (XEN)     l3_index = 1
> (XEN)     l3[1] = 12ae77003
> (XEN)     l2 = ffff83012ae77000
> (XEN)     l2_index = 160
> (XEN)     l2[160] = 0
> (XEN)     l2[160] not present
> (XEN) Assertion '(sp == 0) || (peoi[sp-1].vector < vector)' failed at irq.c:322
> (XEN) ----[ Xen-3.4.1-rc1-pre  x86_64  debug=y  Not tainted ]----
> (XEN) CPU:    0
> (XEN) RIP:    e008:[<ffff828c80147b5f>] do_IRQ+0x11d/0x42e
> (XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
> (XEN) rax: 00000000000000b8   rbx: ffff828c802b4100   rcx: 0000000000000001
> (XEN) rdx: ffff828c80239340   rsi: 0000000000000001   rdi: 00000000000000b8
> (XEN) rbp: ffff828c80287da8   rsp: ffff828c80287d48   r8:  0000000000000002
> (XEN) r9:  0000000000000004   r10: ffff828c802c5360   r11: 000000206772e721
> (XEN) r12: ffff828c80287db8   r13: ffff828c80118de9   r14: ffff8301776222f0
> (XEN) r15: ffff83017bfe22f0   cr0: 0000000080050033   cr4: 00000000000026f0
> (XEN) cr3: 000000016e01e000   cr2: 000000000089aba0
> (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
> (XEN) Xen stack trace from rsp=ffff828c80287d48:
> (XEN)    0000000000000001 0000000000000010 00007d737fd78277 ffff828c802b4124
> (XEN)    000000b8000000b8 ffff828c802b4100 00000000000000b8 ffff828c80239180
> (XEN)    0000000000000000 ffff828c80118de9 ffff83017bfe22f8 ffff83017bfe22f0
> (XEN)    00007d737fd78227 ffff828c80141406 ffff83017bfe22f0 ffff83017bfe22f8
> (XEN)    ffff828c80118de9 0000000000000000 ffff828c80287e88 ffff828c80239180
> (XEN)    000000206772e721 ffff828c802c5360 0000000000000004 0000000000000002
> (XEN)    0000000000000000 0000000000000002 ffff828c802c5440 ffff828c80239120
> (XEN)    ffff828c80239180 000000b800000000 ffff828c8011b46a 000000000000e008
> (XEN)    0000000000000246 ffff828c80287e60 0000000000000000 ffff828c8011d13d
> (XEN)    0000000000000002 ffff828c80239120 0000002065a91d8f ffff828c80239180
> (XEN)    ffff828c80287ed8 ffff828c8011d26d ffff828c80287ea8 ffff828c80239180
> (XEN)    ffff83017bfe22f0 0000000000000000 0000000001154820 ffff828c80287f28
> (XEN)    ffff828c8029e900 ffff828c8029f900 ffff828c80287f18 ffff828c8011b29f
> (XEN)    ffff83007d4fe000 ffff83007d4fe000 0000000001154820 0000000001154820
> (XEN)    00002b5875a9e538 0000000000000000 00007d737fd780b7 ffff828c801d0296
> (XEN)    0000000000000000 00002b5875a9e538 0000000001154820 0000000001154820
> (XEN)    0000000000000000 00002b5875a9e538 0000000000000000 0000003a92d6da70
> (XEN)    0000003aacd1aebc 0000000000000000 0000000001154820 0000003aacf6e940
> (XEN)    0000000000000000 00002b5875a9e520 00002b5875a9e538 0000009800000000
> (XEN)    0000003aaccd9727 000000000000e033 0000000000000246 00002b5875a9e4c8
> (XEN) Xen call trace:
> (XEN)    [<ffff828c80147b5f>] do_IRQ+0x11d/0x42e
> (XEN)    [<ffff828c80141406>] common_interrupt+0x26/0x30
> (XEN)    [<ffff828c8011b46a>] _spin_unlock_irq+0x22/0x23
> (XEN)    [<ffff828c8011d26d>] timer_softirq_action+0x10c/0x350
> (XEN)    [<ffff828c8011b29f>] do_softirq+0x6f/0x80
> (XEN)
> (XEN)
> (XEN) ****************************************
> (XEN) Panic on CPU 0:
> (XEN) Assertion '(sp == 0) || (peoi[sp-1].vector < vector)' failed at irq.c:322
> (XEN) ****************************************
> (XEN)
> (XEN) Reboot in five seconds...
> (XEN) Resetting with ACPI MEMORY or I/O RESET_REG.
>

Could you remove this assert and see where it goes?

Thanks,
Jean

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

* Re: Experimental results for VGA passthrough
  2009-06-04 17:43 ` Jean Guyader
@ 2009-06-04 18:27   ` Beng Heng, Ng
       [not found]     ` <f68b66460906041220w243c4982pe0b485347f13fa50@mail.gmail.com>
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-04 18:27 UTC (permalink / raw)
  To: Jean Guyader; +Cc: xen-devel

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

Hi Jean,

Thanks for the reply. I disabled the assertion and upon calling xm
create on DomU, the screen blanks out shortly (about 3 seconds) than
reappears with a tinge of yellow (about 3 seconds too), and finally
becomes blank totally. You can almost imagine it to be different stages
of DomU (WXP in my case) booting. I was able to RDP into DomU. Shutting
down DomU does not return the screen to Dom0. The log is attached.

- Beng Heng

[-- Attachment #2: vgapt2.log --]
[-- Type: text/plain, Size: 41877 bytes --]

 __  __            _____ _  _    _             _                   
 \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___ 
  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
 /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
                                                   |_|             
(XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 13:49:51 EDT 2009
(XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
(XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 0 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009e800 (usable)
(XEN)  000000000009e800 - 00000000000a0000 (reserved)
(XEN)  00000000000e0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 000000007d6c1000 (usable)
(XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
(XEN)  000000007d704000 - 000000007d826000 (reserved)
(XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
(XEN)  000000007d83a000 - 000000007d93c000 (reserved)
(XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
(XEN)  000000007d93d000 - 000000007d942000 (reserved)
(XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
(XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
(XEN)  000000007d967000 - 000000007d986000 (reserved)
(XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
(XEN)  000000007d98c000 - 000000007db00000 (usable)
(XEN)  000000007dc00000 - 0000000080000000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff000000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000017c000000 (usable)
(XEN) System RAM: 3991MB (4087628kB)
(XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
(XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
(XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
(XEN) ACPI: FACS 7D952F40, 0040
(XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
(XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
(XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
(XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
(XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
(XEN) NUMA turned off
(XEN) Faking a node at 0000000000000000-000000017c000000
(XEN) Domain heap initialised
(XEN) DMI 2.4 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x408
(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
(XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
(XEN) Processor #0 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
(XEN) Processor #1 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
(XEN) Processor #2 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
(XEN) Processor #3 7:7 APIC version 20
(XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) [VT-D]dmar.c:485: Host address width 36
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
(XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) Intel VT-d DMAR tables have been parsed.
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Initializing CPU#0
(XEN) Detected 2499.760 MHz processor.
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 0
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN) HVM: VMX enabled
(XEN) Intel machine check reporting enabled on CPU#0.
(XEN) CPU0: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU0 has no CMCI support
(XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 1/1 eip 8c000
(XEN) Initializing CPU#1
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 1
(XEN) Intel machine check reporting enabled on CPU#1.
(XEN) CPU1: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU1 has no CMCI support
(XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 2/2 eip 8c000
(XEN) Initializing CPU#2
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 2
(XEN) Intel machine check reporting enabled on CPU#2.
(XEN) CPU2: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU2 has no CMCI support
(XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 3/3 eip 8c000
(XEN) Initializing CPU#3
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 3
(XEN) Intel machine check reporting enabled on CPU#3.
(XEN) CPU3: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU3 has no CMCI support
(XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Total of 4 processors activated.
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) checking TSC synchronization across 4 CPUs: passed.
(XEN) Platform timer is 3.579MHz ACPI PM Timer
(XEN) microcode.c:73:d32767 microcode: CPU1 resumed
(XEN) Brought up 4 CPUs
(XEN) microcode.c:73:d32767 microcode: CPU2 resumed
(XEN) microcode.c:73:d32767 microcode: CPU3 resumed
(XEN) Intel VT-d Snoop Control not supported.
(XEN) Intel VT-d DMA Passthrough not supported.
(XEN) Intel VT-d Queued Invalidation not supported.
(XEN) Intel VT-d Interrupt Remapping not supported.
(XEN) I/O virtualisation enabled
(XEN) I/O virtualisation for PV guests disabled
(XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
(XEN) ACPI sleep modes: S3
(XEN) mcheck_poll: Machine check polling timer started.
(XEN) 'S' pressed -> blowing all shadow tables
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
(XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) elf_xen_parse_note: GUEST_OS = "linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0xffffffff80000000
(XEN)     virt_offset      = 0x0
(XEN)     virt_kstart      = 0xffffffff80200000
(XEN)     virt_kend        = 0xffffffff8087cda8
(XEN)     virt_entry       = 0xffffffff80200000
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
(XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
(XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
(XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
(XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
(XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
(XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
(XEN)  ENTRY ADDRESS: ffffffff80200000
(XEN) Dom0 has maximum 4 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
(XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
(XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
(XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
(XEN) Scrubbing Free RAM: .............................done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
(XEN) Freed 128kB init memory.
kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0))
Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
BIOS-provided physical RAM map:
 Xen: 0000000000000000 - 0000000040800000 (usable)
DMI 2.4 present.
No mptable found.
  >>> ERROR: Invalid checksum
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
Setting APIC routing to xen
Using ACPI (MADT) for SMP configuration information
Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
Built 1 zonelists.  Total pages: 260580
Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2499.716 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Software IO TLB enabled: 
 Aperture:     64 megabytes
 Kernel range: ffff880002407000 - ffff880006407000
 Address size: 27 bits
PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
Calibrating delay using timer specific routine.. 5000.66 BogoMIPS (lpj=25003323)
Mount-cache hash table entries: 256
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
SMP alternatives: switching to UP code
ACPI: Core revision 20060707
SMP alternatives: switching to SMP code
Initializing CPU#1
Initializing CPU#2
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 1
Brought up 4 CPUs
Initializing CPU#3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 2
migration_cost=31
checking if image is initramfs... it is
Freeing initrd memory: 7436k freed
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
PCI: Not using MMCONFIG.
PCI: Using configuration type 1
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
(XEN) io_apic.c:2139: 
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
pnp: PnP ACPI: found 10 devices
xen_mem: Initialising balloon driver.
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
pnp: 00:09: ioport range 0x400-0x47f could not be reserved
pnp: 00:09: ioport range 0x1180-0x119f has been reserved
pnp: 00:09: ioport range 0x500-0x57f has been reserved
(XEN) PCI add device 00:00.0
(XEN) PCI add device 00:01.0
(XEN) PCI add device 00:02.0
pciback 0000:00:02.0: seizing device
(XEN) PCI add device 00:03.0
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:03.3
(XEN) PCI add device 00:19.0
(XEN) PCI add device 00:1a.0
(XEN) PCI add device 00:1a.1
(XEN) PCI add device 00:1a.2
(XEN) PCI add device 00:1a.7
(XEN) PCI add device 00:1b.0
(XEN) PCI add device 00:1d.0
(XEN) PCI add device 00:1d.1
(XEN) PCI add device 00:1d.2
(XEN) PCI add device 00:1d.7
(XEN) PCI add device 00:1e.0
(XEN) PCI add device 00:1f.0
(XEN) PCI add device 00:1f.2
(XEN) PCI add device 00:1f.3
(XEN) PCI add device 00:1f.5
(XEN) PCI add device 01:00.0
(XEN) PCI add device 01:00.1
(XEN) PCI add device 02:00.0
(XEN) PCI add device 02:01.0
PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
PCI: Bridge: 0000:00:01.0
  IO window: c000-cfff
  MEM window: c0000000-d00fffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1e.0
  IO window: b000-bfff
  MEM window: d0800000-d08fffff
  PREFETCH window: 88000000-880fffff
GSI 16 sharing vector 0xB0 and IRQ 16
ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
floppy0: Unable to grab DMA2 for the floppy driver
floppy0: no floppy controllers found
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
HP CISS Driver (v 3.6.10)
Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
Copyright (c) 1999-2006 Intel Corporation.
(XEN) PCI add device 02:00.0
GSI 17 sharing vector 0xB8 and IRQ 17
ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
e1000e: Copyright (c) 1999-2008 Intel Corporation.
(XEN) PCI add device 00:19.0
GSI 18 sharing vector 0xC0 and IRQ 18
ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
eth1: Intel(R) PRO/1000 Network Connection
eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
e100: Copyright(c) 1999-2005 Intel Corporation
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Xen virtual console successfully installed as ttyS0
Event-channel device installed.
blktap_device_init: blktap device major 254
blktap_ring_init: blktap ring major: 253
netfront: Initialising virtual ethernet driver.
ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
ACPI: PCI interrupt for device 0000:00:02.0 disabled
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:1f.5
Adaptec aacraid driver (1.1-5[2409]-mh2)
3ware Storage Controller device driver for Linux v1.26.02.001.
(XEN) PCI add device 00:1f.2
GSI 19 sharing vector 0xD0 and IRQ 19
ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part 
ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
scsi0 : ahci
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/133
scsi1 : ahci
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata2.00: ATAPI, max UDMA/100
ata2.00: configured for UDMA/100
scsi2 : ahci
ata3: SATA link down (SStatus 0 SControl 300)
scsi3 : ahci
ata4: SATA link down (SStatus 0 SControl 300)
scsi4 : ahci
ata5: SATA link down (SStatus 0 SControl 300)
scsi5 : ahci
ata6: SATA link down (SStatus 0 SControl 300)
  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
  Type:   CD-ROM                             ANSI SCSI revision: 05
(XEN) PCI add device 00:1f.5
ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 19
ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 19
ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 19
scsi6 : ata_piix
ATA: abnormal status 0x7F on port 0xD177
scsi7 : ata_piix
ATA: abnormal status 0x7F on port 0xD157
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
sd 0:0:0:0: Attached scsi disk sda
Fusion MPT base driver 3.04.01
Copyright (c) 1999-2005 LSI Logic Corporation
Fusion MPT SPI Host driver 3.04.01
usbmon: debugfs is not available
USB Universal Host Controller Interface driver v3.0
(XEN) PCI add device 00:1a.0
ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
uhci_hcd 0000:00:1a.0: UHCI Host Controller
uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.1
ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
uhci_hcd 0000:00:1a.1: UHCI Host Controller
uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.2
GSI 20 sharing vector 0x21 and IRQ 20
ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 20
uhci_hcd 0000:00:1a.2: UHCI Host Controller
uhci_hcd 0000:00:1a.2: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:1a.2: irq 20, io base 0x0000d0a0
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.0
GSI 21 sharing vector 0x29 and IRQ 21
ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
uhci_hcd 0000:00:1d.0: UHCI Host Controller
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
usb usb4: configuration #1 chosen from 1 choice
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.1
ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 5
uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000d060
usb usb5: configuration #1 chosen from 1 choice
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.2
ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 20
uhci_hcd 0000:00:1d.2: UHCI Host Controller
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 6
uhci_hcd 0000:00:1d.2: irq 20, io base 0x0000d040
usb usb6: configuration #1 chosen from 1 choice
hub 6-0:1.0: USB hub found
hub 6-0:1.0: 2 ports detected
usb 3-1: new full speed USB device using uhci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
hub 3-1:1.0: USB hub found
hub 3-1:1.0: 4 ports detected
usb 3-1.1: new low speed USB device using uhci_hcd and address 3
usb 3-1.1: configuration #1 chosen from 1 choice
input: HID 04f3:0801 as /class/input/input0
input: USB HID v1.10 Keyboard [HID 04f3:0801] on usb-0000:00:1a.2-1.1
input: HID 04f3:0801 as /class/input/input1
input: USB HID v1.10 Mouse [HID 04f3:0801] on usb-0000:00:1a.2-1.1
usbcore: registered new driver usbhid
/usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Bridge firewalling registered
PCI IO multiplexer device installed.
ACPI: (supports S0 S1 S3 S4 S5)
BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
Freeing unused kernel memory: 216k freed
Mounting proc filesystem
Mounting sysfs filesystem
Creating /dev
Creating initial device nodes
Loading /lib/kbd/keymaps/i386/qwerty/us.map
Setting up hotplug.
Creating block device nodes.
Creating character device nodes.
Creating root device.
Mounting root filesystem.
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Setting up other filesystems.
Switching to new root and running init.
		Welcome to Fedora 
		Press 'I' to enter interactive startup.
Starting udev: G[  OK  ]
Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
Jun 04 14:11:00 | DM multipath kernel driver not loaded
Setting up Logical Volume Management: File descriptor 7 left open
[  OK  ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2 
/: clean, 2579449/6111232 files, 12471163/24418800 blocks
[  OK  ]
Remounting root filesystem in read-write mode:  [  OK  ]
Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
FATAL: Module fuse not found.
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
[FAILED]
Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
[  OK  ]
Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
[  OK  ]
Entering non-interactive startup
Applying Intel CPU microcode update: FATAL: Module microcode not found.
[  OK  ]ERROR: Module microcode does not exist in /proc/modules

ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
[FAILED]
iptables: Applying firewall rules: FATAL: Module ip_tables not found.
iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]
Starting auditd: [FAILED]
Starting system logger: [  OK  ]
Starting irqbalance: [  OK  ]
Starting rpcbind: [  OK  ]
Starting NFS statd: [FAILED]
Starting RPC idmapd: FATAL: Module sunrpc not found.
FATAL: Error running install command for sunrpc
Error: RPC MTAB does not exist.
Starting system message bus: [  OK  ]
Starting HAL daemon: [  OK  ]
Setting network parameters... [  OK  ]
Starting NetworkManager daemon: [  OK  ]
Starting portreserve: [  OK  ]
Starting Bluetooth services:[  OK  ]
Starting sendmail: [  OK  ]
Starting sm-client: [  OK  ]
Starting console mouse services: [  OK  ]
Starting httpd: [  OK  ]
Starting crond: [  OK  ][  OK  ]
Starting kerneloops:[  OK  ]
Starting atd: [  OK  ][  OK  ]
Starting Avahi daemon... [  OK  ]
Starting cups: [  OK  ]
Starting anacron: [  OK  ]
Starting sshd: [  OK  ]

Fedora release 10 (Cambridge)
Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)

xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 1f0
(XEN)     l2[1f0] = 0
(XEN)     l2[1f0] not present
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) HVM1: HVM Loader
(XEN) HVM1: Detected Xen v3.4.1-rc1-pre
(XEN) HVM1: CPU speed is 2500 MHz
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) irq.c:243: Dom1 PCI link 0 changed 0 -> 5
(XEN) HVM1: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom1 PCI link 1 changed 0 -> 10
(XEN) HVM1: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom1 PCI link 2 changed 0 -> 11
(XEN) HVM1: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom1 PCI link 3 changed 0 -> 5
(XEN) HVM1: PCI-ISA link 3 routed to IRQ5
(XEN) HVM1: pci dev 01:3 INTA->IRQ10
(XEN) HVM1: pci dev 02:0 INTA->IRQ11
(XEN) HVM1: pci dev 03:0 INTA->IRQ5
(XEN) HVM1: pci dev 04:0 INTA->IRQ5
(XEN) HVM1: pci dev 02:0 bar 18 size 10000000: e000000c
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) HVM1: pci dev 03:0 bar 14 size 01000000: f0000008
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) HVM1: pci dev 02:0 bar 10 size 00400000: f1000004
(XEN) HVM1: pci dev 03:0 bar 10 size 00000100: 0000c001
(XEN) HVM1: pci dev 04:0 bar 10 size 00000100: 0000c101
(XEN) HVM1: pci dev 04:0 bar 14 size 00000100: f1400000
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c201
(XEN) HVM1: pci dev 02:0 bar 20 size 00000008: 0000c211
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
(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: Passed 1/1 tests
(XEN) HVM1: Writing SMBIOS tables ...
(XEN) HVM1: Loading ROMBIOS ...
(XEN) HVM1: 9788 bytes of ROMBIOS high-memory extensions:
(XEN) HVM1:   Relocating to 0xfc000000-0xfc00263c ... done
(XEN) HVM1: Creating MP tables ...
(XEN) HVM1: No emulated VGA adaptor ...
(XEN) HVM1: Loading PCI Option ROM ...
(XEN) HVM1:  - Manufacturer: http://etherboot.org
(XEN) HVM1:  - Product name: gPXE
(XEN) HVM1: Loading ACPI ...
(XEN) HVM1:  - Lo data: 000ea020-000ea04f
(XEN) HVM1:  - Hi data: fc002800-fc005c9f
(XEN) HVM1: vm86 TSS at fc006000
(XEN) HVM1: BIOS map:
(XEN) HVM1:  c8000-d47ff: Etherboot ROM
(XEN) HVM1:  eb000-eb150: SMBIOS tables
(XEN) HVM1:  f0000-fffff: Main BIOS
(XEN) HVM1: Invoking ROMBIOS ...
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Bochs BIOS - build: 06/23/99
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Options: apmbios pcibios eltorito PMM 
(XEN) HVM1: 
(XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (8192 MBytes)
(XEN) HVM1: IDE time out
(XEN) HVM1: 
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763c0001
(XEN)     l3 = ffff8301763c0000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) HVM1: 
(XEN) HVM1: 
(XEN) HVM1: Press F12 for boot menu.
(XEN) HVM1: 
(XEN) HVM1: Booting from Hard Disk...
(XEN) HVM1: Booting from 0000:7c00
(XEN) HVM1: int13_harddisk: function 15, unmapped device for ELDL=81
(XEN) HVM1: *** int 15h function AX=e980, BX=006e not yet supported!
(XEN) irq.c:243: Dom1 PCI link 0 changed 5 -> 0
(XEN) irq.c:243: Dom1 PCI link 1 changed 10 -> 0
(XEN) irq.c:243: Dom1 PCI link 2 changed 11 -> 0
(XEN) irq.c:243: Dom1 PCI link 3 changed 5 -> 0
(XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c210 f_mport=d220 np=8
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
(XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c210 f_mport=d220 np=8
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
(XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
Disabling IRQ #16

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

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

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

* Re: Experimental results for VGA passthrough
       [not found]         ` <f68b66460906041241y4a5bbdaax99761a87d05ad5cb@mail.gmail.com>
@ 2009-06-05  1:30           ` Beng Heng, Ng
  2009-06-05  6:55             ` Jean Guyader
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-05  1:30 UTC (permalink / raw)
  To: Jean Guyader; +Cc: xen-devel

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

Ok, I've gotten that patch in. If I pass through Intel IGD now, I'm able
to boot DomU with it. However, it is not particularly stable, meaning
sometimes it just takes too long to start DomU (I waited about 2
minutes). I think it may have something to do with the pagefault. I've
attached the log for a normal case.

One problem remains though. After shutting down from within DomU, the
screen still stays at the Windows Shutdown screen.

Also, the resolution and color is probably in EGA. Is this because some
of the registers are still emulated?

Thanks.

- Beng Heng

So that solves
Jean Guyader wrote:
> If you want the intel to work as a primary display adapter you need to
> do all those thing:
>   - Disable the vga in qemu
>   - Copy the VGA bios in the guest
>   - Map the legacy io port and MMIOs
>   - Fake some value in the host bridge.
> 
> You can have a look at this patch.
> http://xenbits.xen.org/gitweb?p=xenclient/ioemu-pq.git;a=blob;f=master/vga-passthrough;h=d2adba9f84a17df59b1bedc843d29433b4f1eff0;hb=HEAD
> 
> I will try to push it xen upstream when i'll have some times.
> 
> Jean
> 

[-- Attachment #2: vgapt3.log --]
[-- Type: text/plain, Size: 73615 bytes --]


Password:  __  __            _____ _  _    _             _                   
 \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___ 
  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
 /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
                                                   |_|             
(XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 19:35:25 EDT 2009
(XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
(XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 0 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009e800 (usable)
(XEN)  000000000009e800 - 00000000000a0000 (reserved)
(XEN)  00000000000e0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 000000007d6c1000 (usable)
(XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
(XEN)  000000007d704000 - 000000007d826000 (reserved)
(XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
(XEN)  000000007d83a000 - 000000007d93c000 (reserved)
(XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
(XEN)  000000007d93d000 - 000000007d942000 (reserved)
(XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
(XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
(XEN)  000000007d967000 - 000000007d986000 (reserved)
(XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
(XEN)  000000007d98c000 - 000000007db00000 (usable)
(XEN)  000000007dc00000 - 0000000080000000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff000000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000017c000000 (usable)
(XEN) System RAM: 3991MB (4087628kB)
(XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
(XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
(XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
(XEN) ACPI: FACS 7D952F40, 0040
(XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
(XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
(XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
(XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
(XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
(XEN) NUMA turned off
(XEN) Faking a node at 0000000000000000-000000017c000000
(XEN) Domain heap initialised
(XEN) DMI 2.4 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x408
(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
(XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
(XEN) Processor #0 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
(XEN) Processor #1 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
(XEN) Processor #2 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
(XEN) Processor #3 7:7 APIC version 20
(XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) [VT-D]dmar.c:485: Host address width 36
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
(XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) Intel VT-d DMAR tables have been parsed.
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Initializing CPU#0
(XEN) Detected 2499.750 MHz processor.
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 0
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN) HVM: VMX enabled
(XEN) Intel machine check reporting enabled on CPU#0.
(XEN) CPU0: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU0 has no CMCI support
(XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 1/1 eip 8c000
(XEN) Initializing CPU#1
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 1
(XEN) Intel machine check reporting enabled on CPU#1.
(XEN) CPU1: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU1 has no CMCI support
(XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 2/2 eip 8c000
(XEN) Initializing CPU#2
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 2
(XEN) Intel machine check reporting enabled on CPU#2.
(XEN) CPU2: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU2 has no CMCI support
(XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 3/3 eip 8c000
(XEN) Initializing CPU#3
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 3
(XEN) Intel machine check reporting enabled on CPU#3.
(XEN) CPU3: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU3 has no CMCI support
(XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Total of 4 processors activated.
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) checking TSC synchronization across 4 CPUs: passed.
(XEN) Platform timer is 3.579MHz ACPI PM Timer
(XEN) microcode.c:73:d32767 microcode: CPU1 resumed
(XEN) microcode.c:73:d32767 microcode: CPU2 resumed
(XEN) Brought up 4 CPUs
(XEN) microcode.c:73:d32767 microcode: CPU3 resumed
(XEN) Intel VT-d Snoop Control not supported.
(XEN) Intel VT-d DMA Passthrough not supported.
(XEN) Intel VT-d Queued Invalidation not supported.
(XEN) Intel VT-d Interrupt Remapping not supported.
(XEN) I/O virtualisation enabled
(XEN) I/O virtualisation for PV guests disabled
(XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
(XEN) ACPI sleep modes: S3
(XEN) mcheck_poll: Machine check polling timer started.
(XEN) 'S' pressed -> blowing all shadow tables
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
(XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) elf_xen_parse_note: GUEST_OS = "linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0xffffffff80000000
(XEN)     virt_offset      = 0x0
(XEN)     virt_kstart      = 0xffffffff80200000
(XEN)     virt_kend        = 0xffffffff8087cda8
(XEN)     virt_entry       = 0xffffffff80200000
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
(XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
(XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
(XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
(XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
(XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
(XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
(XEN)  ENTRY ADDRESS: ffffffff80200000
(XEN) Dom0 has maximum 4 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
(XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
(XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
(XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
(XEN) Scrubbing Free RAM: .............................done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
(XEN) Freed 128kB init memory.
kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)(00:1a.2))
Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
BIOS-provided physical RAM map:
 Xen: 0000000000000000 - 0000000040800000 (usable)
DMI 2.4 present.
No mptable found.
  >>> ERROR: Invalid checksum
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
Setting APIC routing to xen
Using ACPI (MADT) for SMP configuration information
Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
Built 1 zonelists.  Total pages: 260580
Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)(00:1a.2)
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2499.718 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Software IO TLB enabled: 
 Aperture:     64 megabytes
 Kernel range: ffff880002407000 - ffff880006407000
 Address size: 27 bits
PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
Calibrating delay using timer specific routine.. 5000.90 BogoMIPS (lpj=25004548)
Mount-cache hash table entries: 256
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
SMP alternatives: switching to UP code
ACPI: Core revision 20060707
SMP alternatives: switching to SMP code
Initializing CPU#1
Initializing CPU#2
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 1
Brought up 4 CPUs
Initializing CPU#3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 2
migration_cost=10
checking if image is initramfs... it is
Freeing initrd memory: 7436k freed
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
PCI: Not using MMCONFIG.
PCI: Using configuration type 1
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
(XEN) io_apic.c:2139: 
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
pnp: PnP ACPI: found 10 devices
xen_mem: Initialising balloon driver.
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
pnp: 00:09: ioport range 0x400-0x47f could not be reserved
pnp: 00:09: ioport range 0x1180-0x119f has been reserved
pnp: 00:09: ioport range 0x500-0x57f has been reserved
(XEN) PCI add device 00:00.0
(XEN) PCI add device 00:01.0
(XEN) PCI add device 00:02.0
pciback 0000:00:02.0: seizing device
(XEN) PCI add device 00:03.0
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:03.3
(XEN) PCI add device 00:19.0
(XEN) PCI add device 00:1a.0
(XEN) PCI add device 00:1a.1
(XEN) PCI add device 00:1a.2
pciback 0000:00:1a.2: seizing device
(XEN) PCI add device 00:1a.7
(XEN) PCI add device 00:1b.0
(XEN) PCI add device 00:1d.0
(XEN) PCI add device 00:1d.1
(XEN) PCI add device 00:1d.2
(XEN) PCI add device 00:1d.7
(XEN) PCI add device 00:1e.0
(XEN) PCI add device 00:1f.0
(XEN) PCI add device 00:1f.2
(XEN) PCI add device 00:1f.3
(XEN) PCI add device 00:1f.5
(XEN) PCI add device 01:00.0
(XEN) PCI add device 01:00.1
(XEN) PCI add device 02:00.0
(XEN) PCI add device 02:01.0
PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
PCI: Bridge: 0000:00:01.0
  IO window: c000-cfff
  MEM window: c0000000-d00fffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1e.0
  IO window: b000-bfff
  MEM window: d0800000-d08fffff
  PREFETCH window: 88000000-880fffff
GSI 16 sharing vector 0xB0 and IRQ 16
ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
floppy0: Unable to grab DMA2 for the floppy driver
floppy0: no floppy controllers found
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
HP CISS Driver (v 3.6.10)
Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
Copyright (c) 1999-2006 Intel Corporation.
(XEN) PCI add device 02:00.0
GSI 17 sharing vector 0xB8 and IRQ 17
ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
e1000e: Copyright (c) 1999-2008 Intel Corporation.
(XEN) PCI add device 00:19.0
GSI 18 sharing vector 0xC0 and IRQ 18
ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
eth1: Intel(R) PRO/1000 Network Connection
eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
e100: Copyright(c) 1999-2005 Intel Corporation
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Xen virtual console successfully installed as ttyS0
Event-channel device installed.
blktap_device_init: blktap device major 254
blktap_ring_init: blktap ring major: 253
netfront: Initialising virtual ethernet driver.
GSI 19 sharing vector 0xD0 and IRQ 19
ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 19
ACPI: PCI interrupt for device 0000:00:1a.2 disabled
ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
ACPI: PCI interrupt for device 0000:00:02.0 disabled
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:1f.5
Adaptec aacraid driver (1.1-5[2409]-mh2)
3ware Storage Controller device driver for Linux v1.26.02.001.
(XEN) PCI add device 00:1f.2
GSI 20 sharing vector 0xD8 and IRQ 20
ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 20
ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part 
ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
scsi0 : ahci
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/133
scsi1 : ahci
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata2.00: ATAPI, max UDMA/100
ata2.00: configured for UDMA/100
scsi2 : ahci
ata3: SATA link down (SStatus 0 SControl 300)
scsi3 : ahci
ata4: SATA link down (SStatus 0 SControl 300)
scsi4 : ahci
ata5: SATA link down (SStatus 0 SControl 300)
scsi5 : ahci
ata6: SATA link down (SStatus 0 SControl 300)
  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
  Type:   CD-ROM                             ANSI SCSI revision: 05
(XEN) PCI add device 00:1f.5
ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 20
ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 20
ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 20
scsi6 : ata_piix
ATA: abnormal status 0x7F on port 0xD177
scsi7 : ata_piix
ATA: abnormal status 0x7F on port 0xD157
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
sd 0:0:0:0: Attached scsi disk sda
Fusion MPT base driver 3.04.01
Copyright (c) 1999-2005 LSI Logic Corporation
Fusion MPT SPI Host driver 3.04.01
usbmon: debugfs is not available
USB Universal Host Controller Interface driver v3.0
(XEN) PCI add device 00:1a.0
ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
uhci_hcd 0000:00:1a.0: UHCI Host Controller
uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.1
ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
uhci_hcd 0000:00:1a.1: UHCI Host Controller
uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.0
GSI 21 sharing vector 0x29 and IRQ 21
ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
uhci_hcd 0000:00:1d.0: UHCI Host Controller
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.1
ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 20
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:1d.1: irq 20, io base 0x0000d060
usb usb4: configuration #1 chosen from 1 choice
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.2
ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 19
uhci_hcd 0000:00:1d.2: UHCI Host Controller
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 5
uhci_hcd 0000:00:1d.2: irq 19, io base 0x0000d040
usb usb5: configuration #1 chosen from 1 choice
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
usbcore: registered new driver usbhid
/usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Bridge firewalling registered
PCI IO multiplexer device installed.
ACPI: (supports S0 S1 S3 S4 S5)
BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
Freeing unused kernel memory: 216k freed
Mounting proc filesystem
Mounting sysfs filesystem
Creating /dev
Creating initial device nodes
Loading /lib/kbd/keymaps/i386/qwerty/us.map
Setting up hotplug.
Creating block device nodes.
Creating character device nodes.
Creating root device.
Mounting root filesystem.
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: sda2: orphan cleanup on readonly fs
EXT3-fs: sda2: 1 orphan inode deleted
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Setting up other filesystems.
Switching to new root and running init.
		Welcome to Fedora 
		Press 'I' to enter interactive startup.
Starting udev: G[  OK  ]
Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
Jun 04 21:16:28 | DM multipath kernel driver not loaded
Setting up Logical Volume Management: File descriptor 7 left open
[  OK  ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2 
/: clean, 2579462/6111232 files, 12471480/24418800 blocks
[  OK  ]
Remounting root filesystem in read-write mode:  [  OK  ]
Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
FATAL: Module fuse not found.
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
[FAILED]
Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
[  OK  ]
Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
[  OK  ]
Entering non-interactive startup
Applying Intel CPU microcode update: FATAL: Module microcode not found.
[  OK  ]ERROR: Module microcode does not exist in /proc/modules

ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
[FAILED]
iptables: Applying firewall rules: FATAL: Module ip_tables not found.
iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]
Starting auditd: [FAILED]
Starting system logger: [  OK  ]
Starting irqbalance: [  OK  ]
Starting rpcbind: [  OK  ]
Starting NFS statd: [FAILED]
Starting RPC idmapd: FATAL: Module sunrpc not found.
FATAL: Error running install command for sunrpc
Error: RPC MTAB does not exist.
Starting system message bus: [  OK  ]
Starting HAL daemon: [  OK  ]
Setting network parameters... [  OK  ]
Starting NetworkManager daemon: [  OK  ]
Starting portreserve: [  OK  ]
Starting Bluetooth services:[  OK  ]
Starting sendmail: [  OK  ]
Starting sm-client: [  OK  ]
Starting console mouse services: [  OK  ]
Starting httpd: [  OK  ]
Starting crond: [  OK  ][  OK  ]
Starting kerneloops:[  OK  ]
Starting atd: [  OK  ][  OK  ]
Starting Avahi daemon... [  OK  ]
Starting cups: [  OK  ]
Starting anacron: [  OK  ]
Starting sshd: [  OK  ]

Fedora release 10 (Cambridge)
Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)

xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 1f0
(XEN)     l2[1f0] = 0
(XEN)     l2[1f0] not present
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
(XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 13 device = 3 intx = 0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) HVM1: HVM Loader
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) HVM1: Detected Xen v3.4.1-rc1-pre
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) HVM1: CPU speed is 2500 MHz
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = (XEN) HVM1:  - REP INSB across page boundaries ... passed
(XEN) HVM1: Passed 1/1 tests
(XEN) HVM1: Writing SMBIOS tables ...
(XEN) HVM1: Loading ROMBIOS ...
(XEN) HVM1: 9788 bytes of ROMBIOS high-memory extensions:
(XEN) HVM1:   Relocating to 0xfc000000-0xfc00263c ... done
(XEN) HVM1: Creating MP tables ...
(XEN) HVM1: No emulated VGA adaptor ...
(XEN) HVM1: Loading PCI Option ROM ...
(XEN) HVM1:  - Manufacturer: http://etherboot.org
(XEN) HVM1:  - Product name: gPXE
(XEN) HVM1: Loading ACPI ...
(XEN) HVM1:  - Lo data: 000ea020-000ea04f
(XEN) HVM1:  - Hi data: fc002800-fc005c9f
(XEN) HVM1: vm86 TSS at fc006000
(XEN) HVM1: BIOS map:
(XEN) HVM1:  c0000-cc7ff: VGA BIOS
(XEN) HVM1:  cc800-d8fff: Etherboot ROM
(XEN) HVM1:  eb000-eb150: 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=5f21, BX=c000 not yet supported!
(XEN) HVM1: *** int 15h function AX=5f22, BX=0004 not yet supported!
(XEN) HVM1: Bochs BIOS - build: 06/23/99
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Options: apmbios pcibios eltorito PMM 
(XEN) HVM1: 
(XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (8192 MBytes)
(XEN) HVM1: IDE time out
(XEN) HVM1: 
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)     l3 = ffff8301763eb000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_1763eb001
(XEN)  (XEN) irq.c:243: Dom1 PCI link 0 changed 5 -> 0
(XEN) irq.c:243: Dom1 PCI link 1 changed 10 -> 0
(XEN) irq.c:243: Dom1 PCI link 2 changed 11 -> 0
(XEN) irq.c:243: Dom1 PCI link 3 changed 5 -> 0
(XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c230 f_mport=d220 np=8
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c230 f_mport=d220 np=8
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c200 f_mport=d0a0 np=20
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c200 f_mport=d0a0 np=20
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c200 f_mport=d0a0 np=20
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c200 f_mport=d0a0 np=20
(XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c230 f_mport=d220 np=8
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c230 f_mport=d220 np=8
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c200 f_mport=d0a0 np=20
(XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 101_17bf8e001
(XEN)     l3 = ffff83017bf8e000
(XEN)     l3_index = 1
(XEN)     l3[1] = 177c0c003
(XEN)     l2 = ffff830177c0c000
(XEN)     l2_index = 1f0
(XEN)     l2[1f0] = 177632003
(XEN)     l1 = ffff830177632000
(XEN)     l1_index = 0
(XEN)     l1[0] = 7e000003

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

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

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

* Re: Experimental results for VGA passthrough
  2009-06-05  1:30           ` Beng Heng, Ng
@ 2009-06-05  6:55             ` Jean Guyader
  2009-06-05 23:00               ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Jean Guyader @ 2009-06-05  6:55 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: xen-devel

Could you tell me if it works with a Vista guest or a linux hvm guest?

The page fault and the screen still stays on Windows issue are due to
the lack of FLR in your kernel. Doing a FLR on the graphic card before
booting and when the domain shutdown will fix those.

Thanks,
Jean

2009/6/5 Beng Heng, Ng <bengheng@eecs.umich.edu>:
> Ok, I've gotten that patch in. If I pass through Intel IGD now, I'm able
> to boot DomU with it. However, it is not particularly stable, meaning
> sometimes it just takes too long to start DomU (I waited about 2
> minutes). I think it may have something to do with the pagefault. I've
> attached the log for a normal case.
>
> One problem remains though. After shutting down from within DomU, the
> screen still stays at the Windows Shutdown screen.
>
> Also, the resolution and color is probably in EGA. Is this because some
> of the registers are still emulated?
>
> Thanks.
>
> - Beng Heng
>
> So that solves
> Jean Guyader wrote:
>> If you want the intel to work as a primary display adapter you need to
>> do all those thing:
>>   - Disable the vga in qemu
>>   - Copy the VGA bios in the guest
>>   - Map the legacy io port and MMIOs
>>   - Fake some value in the host bridge.
>>
>> You can have a look at this patch.
>> http://xenbits.xen.org/gitweb?p=xenclient/ioemu-pq.git;a=blob;f=master/vga-passthrough;h=d2adba9f84a17df59b1bedc843d29433b4f1eff0;hb=HEAD
>>
>> I will try to push it xen upstream when i'll have some times.
>>
>> Jean
>>
>
>

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

* Re: Experimental results for VGA passthrough
  2009-06-05  6:55             ` Jean Guyader
@ 2009-06-05 23:00               ` Beng Heng, Ng
  2009-06-05 23:01                 ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-05 23:00 UTC (permalink / raw)
  To: Jean Guyader; +Cc: xen-devel

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

Hi Jean,

For the linux guest, I tested using Ubuntu 64-bit. It doesn't seem to
work well, and hangs shortly after boot-up. I've attached a short clip
and hopefully that can explain my observations better. I've also
attached logs from the serial terminal and Qemu. I'd like to bring your
attention to the last lines of the Qemu log, which warns that the guest
is trying to write to unused BAR.

On the other hand, things are much smoother with Vista 64-bit. I have
tried no less than three times, and all went smoothly. Even the
resolution, color and Aero feature are equivalent to native. The only
minor issue is that after shutdown, the screen becomes blank. But I
suppose this is better than XP which was "stuck" in the shutdown screen.
I have the logs and clip for Vista as well. As the clip is bigger, I'll
only send it to you if you want.

Please let me know if there's any comments or suggestions which you'd
like me to try out. Thanks and have a great weekend.

Warmest Regards,
Beng Heng

Jean Guyader wrote:
> Could you tell me if it works with a Vista guest or a linux hvm guest?
> 
> The page fault and the screen still stays on Windows issue are due to
> the lack of FLR in your kernel. Doing a FLR on the graphic card before
> booting and when the domain shutdown will fix those.
> 
> Thanks,
> Jean
> 

[-- Attachment #2: qemu-dm-ubuntu64.log --]
[-- Type: text/plain, Size: 6195 bytes --]

domid: 1
qemu: the number of cpus is 1
config qemu network with xen bridge for  tap1.0 eth0
Watching /local/domain/0/device-model/1/logdirty/next-active
Watching /local/domain/0/device-model/1/command
char device redirected to /dev/pts/1
qemu_map_cache_init nr_buckets = 10000 size 4194304
shared page at pfn feffd
buffered io page at pfn feffb
Guest uuid = 2e4fc104-49fc-1e02-3ad7-3ec98d760e97
Time offset set 0
register_real_device: Assigning real physical device 00:02.0 ...
register_real_device: Disable MSI translation via per device option
pt_register_regions: IO region registered (size=0x00400000 base_addr=0xd0400004)
pt_register_regions: IO region registered (size=0x10000000 base_addr=0xb000000c)
pt_register_regions: IO region registered (size=0x00000008 base_addr=0x0000d221)
pt_register_regions: Real device vendor_id=0x8086 class=0x300
pt_register_regions: add an intel graphic card
register_real_device: Real physical device 00:02.0 registered successfully!
IRQ type = INTx
register_real_device: Assigning real physical device 00:1a.2 ...
pt_register_regions: IO region registered (size=0x00000020 base_addr=0x0000d0a1)
pt_register_regions: Real device vendor_id=0x8086 class=0xc03
register_real_device: Real physical device 00:1a.2 registered successfully!
IRQ type = INTx
Register xen platform.
Done register platform.
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
xs_read(/local/domain/0/device-model/1/xen_extended_power_mgmt): read error
I/O request not ready: 0, ptr: 0, port: 0, data: 0, count: 0, size: 0
(qemu) pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=2 first_map=1
pt_iomem_map: e_phys=f1000000 maddr=d0400000 type=0 len=4194304 index=0 first_map=1
pt_ioport_map: e_phys=c200 pio_base=d0a0 len=32 index=4 first_map=1
pt_ioport_map: e_phys=c230 pio_base=d220 len=8 index=4 first_map=1
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is rw state.
platform_fixed_ioport: changed ro/rw state of ROM memory area. now is ro state.
gpe_en_write: addr=0x1f6c, val=0x0.
gpe_sts_write: addr=0x1f68, val=0xff.
gpe_en_write: addr=0x1f6d, val=0x0.
gpe_sts_write: addr=0x1f69, val=0xff.
gpe_en_write: addr=0x1f6e, val=0x0.
gpe_sts_write: addr=0x1f6a, val=0xff.
gpe_en_write: addr=0x1f6f, val=0x0.
gpe_sts_write: addr=0x1f6b, val=0xff.
gpe_en_write: addr=0x1f6c, val=0x8.
ACPI PCI hotplug: read addr=0x10c2, val=0x0.
ACPI PCI hotplug: read addr=0x10c3, val=0x0.
ACPI PCI hotplug: read addr=0x10c4, val=0xf.
ACPI PCI hotplug: read addr=0x10c5, val=0xf.
ACPI PCI hotplug: read addr=0x10c6, val=0x0.
ACPI PCI hotplug: read addr=0x10c7, val=0x0.
ACPI PCI hotplug: read addr=0x10c8, val=0x0.
ACPI PCI hotplug: read addr=0x10c9, val=0x0.
ACPI PCI hotplug: read addr=0x10ca, val=0x0.
ACPI PCI hotplug: read addr=0x10cb, val=0x0.
ACPI PCI hotplug: read addr=0x10cc, val=0x0.
ACPI PCI hotplug: read addr=0x10cd, val=0x0.
ACPI PCI hotplug: read addr=0x10ce, val=0x0.
ACPI PCI hotplug: read addr=0x10cf, val=0x0.
ACPI PCI hotplug: read addr=0x10d0, val=0x0.
ACPI PCI hotplug: read addr=0x10d1, val=0x0.
ACPI PCI hotplug: read addr=0x10d2, val=0x0.
ACPI PCI hotplug: read addr=0x10d3, val=0x0.
ACPI PCI hotplug: read addr=0x10d4, val=0x0.
ACPI PCI hotplug: read addr=0x10d5, val=0x0.
ACPI PCI hotplug: read addr=0x10d6, val=0x0.
ACPI PCI hotplug: read addr=0x10d7, val=0x0.
ACPI PCI hotplug: read addr=0x10d8, val=0x0.
ACPI PCI hotplug: read addr=0x10d9, val=0x0.
ACPI PCI hotplug: read addr=0x10da, val=0x0.
ACPI PCI hotplug: read addr=0x10db, val=0x0.
ACPI PCI hotplug: read addr=0x10dc, val=0x0.
ACPI PCI hotplug: read addr=0x10dd, val=0x0.
ACPI PCI hotplug: read addr=0x10de, val=0x0.
ACPI PCI hotplug: read addr=0x10df, val=0x0.
ACPI PCI hotplug: read addr=0x10e0, val=0x0.
ACPI PCI hotplug: read addr=0x10e1, val=0x0.
ACPI PCI hotplug: read addr=0x10c2, val=0x0.
ACPI PCI hotplug: read addr=0x10c3, val=0x0.
ACPI PCI hotplug: read addr=0x10c4, val=0xf.
ACPI PCI hotplug: read addr=0x10c4, val=0xf.
ACPI PCI hotplug: read addr=0x10c5, val=0xf.
ACPI PCI hotplug: read addr=0x10c5, val=0xf.
ACPI PCI hotplug: read addr=0x10c6, val=0x0.
ACPI PCI hotplug: read addr=0x10c7, val=0x0.
ACPI PCI hotplug: read addr=0x10c8, val=0x0.
ACPI PCI hotplug: read addr=0x10c9, val=0x0.
ACPI PCI hotplug: read addr=0x10ca, val=0x0.
ACPI PCI hotplug: read addr=0x10cb, val=0x0.
ACPI PCI hotplug: read addr=0x10cc, val=0x0.
ACPI PCI hotplug: read addr=0x10cd, val=0x0.
ACPI PCI hotplug: read addr=0x10ce, val=0x0.
ACPI PCI hotplug: read addr=0x10cf, val=0x0.
ACPI PCI hotplug: read addr=0x10d0, val=0x0.
ACPI PCI hotplug: read addr=0x10d1, val=0x0.
ACPI PCI hotplug: read addr=0x10d2, val=0x0.
ACPI PCI hotplug: read addr=0x10d3, val=0x0.
ACPI PCI hotplug: read addr=0x10d4, val=0x0.
ACPI PCI hotplug: read addr=0x10d5, val=0x0.
ACPI PCI hotplug: read addr=0x10d6, val=0x0.
ACPI PCI hotplug: read addr=0x10d7, val=0x0.
ACPI PCI hotplug: read addr=0x10d8, val=0x0.
ACPI PCI hotplug: read addr=0x10d9, val=0x0.
ACPI PCI hotplug: read addr=0x10da, val=0x0.
ACPI PCI hotplug: read addr=0x10db, val=0x0.
ACPI PCI hotplug: read addr=0x10dc, val=0x0.
ACPI PCI hotplug: read addr=0x10dd, val=0x0.
ACPI PCI hotplug: read addr=0x10de, val=0x0.
ACPI PCI hotplug: read addr=0x10df, val=0x0.
ACPI PCI hotplug: read addr=0x10e0, val=0x0.
ACPI PCI hotplug: read addr=0x10e1, val=0x0.
pt_iomem_map: e_phys=ffc00000 maddr=d0400000 type=0 len=4194304 index=0 first_map=0
pt_iomem_map: e_phys=f1000000 maddr=d0400000 type=0 len=4194304 index=0 first_map=0
pt_iomem_map: e_phys=f0000000 maddr=b0000000 type=8 len=268435456 index=2 first_map=0
pt_iomem_map: e_phys=e0000000 maddr=b0000000 type=8 len=268435456 index=2 first_map=0
pt_ioport_map: e_phys=ffff pio_base=d220 len=8 index=4 first_map=0
pt_ioport_map: e_phys=c230 pio_base=d220 len=8 index=4 first_map=0
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:02.0][Offset:30h][Length:4]
pt_ioport_map: e_phys=ffff pio_base=d0a0 len=32 index=4 first_map=0
pt_ioport_map: e_phys=c200 pio_base=d0a0 len=32 index=4 first_map=0
pt_pci_write_config: Warning: Guest attempt to set address to unused Base Address Register. [00:03.0][Offset:30h][Length:4]

[-- Attachment #3: ubuntu64.pt.log --]
[-- Type: text/plain, Size: 8240 bytes --]


AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
Login incorrect

login: Login timed out after 60 seconds

Fedora release 10 (Cambridge)
Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)

xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_16e97d001
(XEN)     l3 = ffff83016e97d000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12b872003
(XEN)     l2 = ffff83012b872000
(XEN)     l2_index = 1f0
(XEN)     l2[1f0] = 0
(XEN)     l2[1f0] not present
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
(XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 13 device = 3 intx = 0
(XEN) HVM1: HVM Loader
(XEN) HVM1: Detected Xen v3.4.1-rc1-pre
(XEN) HVM1: CPU speed is 2500 MHz
(XEN) irq.c:243: Dom1 PCI link 0 changed 0 -> 5
(XEN) HVM1: PCI-ISA link 0 routed to IRQ5
(XEN) irq.c:243: Dom1 PCI link 1 changed 0 -> 10
(XEN) HVM1: PCI-ISA link 1 routed to IRQ10
(XEN) irq.c:243: Dom1 PCI link 2 changed 0 -> 11
(XEN) HVM1: PCI-ISA link 2 routed to IRQ11
(XEN) irq.c:243: Dom1 PCI link 3 changed 0 -> 5
(XEN) HVM1: PCI-ISA link 3 routed to IRQ5
(XEN) HVM1: pci dev 01:3 INTA->IRQ10
(XEN) HVM1: pci dev 02:0 INTA->IRQ11
(XEN) HVM1: pci dev 03:0 INTA->IRQ5
(XEN) HVM1: pci dev 04:0 INTA->IRQ5
(XEN) HVM1: pci dev 05:0 INTA->IRQ10
(XEN) HVM1: pci dev 02:0 bar 18 size 10000000: e000000c
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) HVM1: pci dev 04:0 bar 14 size 01000000: f0000008
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) HVM1: pci dev 02:0 bar 10 size 00400000: f1000004
(XEN) HVM1: pci dev 04:0 bar 10 size 00000100: 0000c001
(XEN) HVM1: pci dev 05:0 bar 10 size 00000100: 0000c101
(XEN) HVM1: pci dev 05:0 bar 14 size 00000100: f1400000
(XEN) HVM1: pci dev 03:0 bar 20 size 00000020: 0000c201
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c200 f_mport=d0a0 np=20
(XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c221
(XEN) HVM1: pci dev 02:0 bar 20 size 00000008: 0000c231
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c230 f_mport=d220 np=8
(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: Passed 1/1 tests
(XEN) HVM1: Writing SMBIOS tables ...
(XEN) HVM1: Loading ROMBIOS ...
(XEN) HVM1: 9788 bytes of ROMBIOS high-memory extensions:
(XEN) HVM1:   Relocating to 0xfc000000-0xfc00263c ... done
(XEN) HVM1: Creating MP tables ...
(XEN) HVM1: No emulated VGA adaptor ...
(XEN) HVM1: Loading PCI Option ROM ...
(XEN) HVM1:  - Manufacturer: http://etherboot.org
(XEN) HVM1:  - Product name: gPXE
(XEN) HVM1: Loading ACPI ...
(XEN) HVM1:  - Lo data: 000ea020-000ea04f
(XEN) HVM1:  - Hi data: fc002800-fc005c9f
(XEN) HVM1: vm86 TSS at fc006000
(XEN) HVM1: BIOS map:
(XEN) HVM1:  c0000-cc7ff: VGA BIOS
(XEN) HVM1:  cc800-d8fff: Etherboot ROM
(XEN) HVM1:  eb000-eb150: 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=5f21, BX=c000 not yet supported!
(XEN) HVM1: *** int 15h function AX=5f22, BX=0004 not yet supported!
(XEN) HVM1: Bochs BIOS - build: 06/23/99
(XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
(XEN) HVM1: Options: apmbios pcibios eltorito PMM 
(XEN) HVM1: 
(XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
(XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (40960 MBytes)
(XEN) HVM1: IDE time out
(XEN) HVM1: 
(XEN) HVM1: 
(XEN) HVM1: 
(XEN) HVM1: Press F12 for boot menu.
(XEN) HVM1: 
(XEN) HVM1: Booting from Hard Disk...
(XEN) HVM1: Booting from 0000:7c00
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=81
(XEN) HVM1: int13_harddisk: function 08, unmapped device for ELDL=81
(XEN) HVM1: *** int 15h function AX=00c0, BX=0000 not yet supported!
(XEN) HVM1: *** int 15h function AX=ec00, BX=0002 not yet supported!
(XEN) HVM1: KBD: unsupported int 16h function 03
(XEN) multi.c:3264:d1 guest attempted write to read-only memory page. va page=0xc0000, mfn=0x1371b7
(XEN) HVM1: *** int 15h function AX=e980, BX=0000 not yet supported!
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=81
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=81
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=82
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=82
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=83
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=83
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=84
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=84
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=85
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=85
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=86
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=86
(XEN) HVM1: int13_harddisk: function 41, unmapped device for ELDL=87
(XEN) HVM1: int13_harddisk: function 02, unmapped device for ELDL=87
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 88
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 88
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 89
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 89
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 8a
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 8a
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 8b
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 8b
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 8c
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 8c
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 8d
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 8d
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 8e
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 8e
(XEN) HVM1: int13_harddisk: function 41, ELDL out of range 8f
(XEN) HVM1: int13_harddisk: function 02, ELDL out of range 8f
(XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:835:d0 memory_map:add: gfn=ffc00 mfn=d0400 nr_mfns=400
(XEN) domctl.c:845:d0 memory_map:remove: gfn=ffc00 mfn=d0400 nr_mfns=400
(XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
(XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:835:d0 memory_map:add: gfn=f0000 mfn=b0000 nr_mfns=10000
(XEN) sh error: sh_remove_all_mappings(): can't find all mappings of mfn 12b876: c=8000000000000003 t=e800000000000001
(XEN) sh error: sh_remove_all_mappings(): can't find all mappings of mfn 12b874: c=8000000000000003 t=e800000000000001
(XEN) domctl.c:845:d0 memory_map:remove: gfn=f0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c230 f_mport=d220 np=8
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c230 f_mport=d220 np=8
(XEN) domctl.c:910:d0 ioport_map:remove f_gport=c200 f_mport=d0a0 np=20
(XEN) domctl.c:886:d0 ioport_map:add f_gport=c200 f_mport=d0a0 np=20

[-- Attachment #4: 05062009.mp4 --]
[-- Type: video/mp4, Size: 2901154 bytes --]

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

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

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

* Re: Experimental results for VGA passthrough
  2009-06-05 23:00               ` Beng Heng, Ng
@ 2009-06-05 23:01                 ` Beng Heng, Ng
  2009-06-06  9:59                   ` Jean Guyader
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-05 23:01 UTC (permalink / raw)
  To: Jean Guyader; +Cc: xen-devel

Apologies, I missed your earlier point about the FLR. I'll try that out.
Thanks.

- Beng Heng

Beng Heng, Ng wrote:
> Hi Jean,
> 
> For the linux guest, I tested using Ubuntu 64-bit. It doesn't seem to
> work well, and hangs shortly after boot-up. I've attached a short clip
> and hopefully that can explain my observations better. I've also
> attached logs from the serial terminal and Qemu. I'd like to bring your
> attention to the last lines of the Qemu log, which warns that the guest
> is trying to write to unused BAR.
> 
> On the other hand, things are much smoother with Vista 64-bit. I have
> tried no less than three times, and all went smoothly. Even the
> resolution, color and Aero feature are equivalent to native. The only
> minor issue is that after shutdown, the screen becomes blank. But I
> suppose this is better than XP which was "stuck" in the shutdown screen.
> I have the logs and clip for Vista as well. As the clip is bigger, I'll
> only send it to you if you want.
> 
> Please let me know if there's any comments or suggestions which you'd
> like me to try out. Thanks and have a great weekend.
> 
> Warmest Regards,
> Beng Heng
> 
> Jean Guyader wrote:
>> Could you tell me if it works with a Vista guest or a linux hvm guest?
>>
>> The page fault and the screen still stays on Windows issue are due to
>> the lack of FLR in your kernel. Doing a FLR on the graphic card before
>> booting and when the domain shutdown will fix those.
>>
>> Thanks,
>> Jean
>>

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

* Re: Experimental results for VGA passthrough
  2009-06-05 23:01                 ` Beng Heng, Ng
@ 2009-06-06  9:59                   ` Jean Guyader
  2009-06-06 22:40                     ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Jean Guyader @ 2009-06-06  9:59 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: xen-devel

We have a patch to the FLR support to pciback.
http://xenbits.xen.org/gitweb?p=xenclient/linux-2.6.27-pq.git;a=blob_plain;f=master/pciback-flr;hb=HEAD

Jean

2009/6/6 Beng Heng, Ng <bengheng@eecs.umich.edu>:
> Apologies, I missed your earlier point about the FLR. I'll try that out.
> Thanks.
>
> - Beng Heng
>
> Beng Heng, Ng wrote:
>> Hi Jean,
>>
>> For the linux guest, I tested using Ubuntu 64-bit. It doesn't seem to
>> work well, and hangs shortly after boot-up. I've attached a short clip
>> and hopefully that can explain my observations better. I've also
>> attached logs from the serial terminal and Qemu. I'd like to bring your
>> attention to the last lines of the Qemu log, which warns that the guest
>> is trying to write to unused BAR.
>>
>> On the other hand, things are much smoother with Vista 64-bit. I have
>> tried no less than three times, and all went smoothly. Even the
>> resolution, color and Aero feature are equivalent to native. The only
>> minor issue is that after shutdown, the screen becomes blank. But I
>> suppose this is better than XP which was "stuck" in the shutdown screen.
>> I have the logs and clip for Vista as well. As the clip is bigger, I'll
>> only send it to you if you want.
>>
>> Please let me know if there's any comments or suggestions which you'd
>> like me to try out. Thanks and have a great weekend.
>>
>> Warmest Regards,
>> Beng Heng
>>
>> Jean Guyader wrote:
>>> Could you tell me if it works with a Vista guest or a linux hvm guest?
>>>
>>> The page fault and the screen still stays on Windows issue are due to
>>> the lack of FLR in your kernel. Doing a FLR on the graphic card before
>>> booting and when the domain shutdown will fix those.
>>>
>>> Thanks,
>>> Jean
>>>
>
>

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

* Re: Experimental results for VGA passthrough
  2009-06-06  9:59                   ` Jean Guyader
@ 2009-06-06 22:40                     ` Beng Heng, Ng
  0 siblings, 0 replies; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-06 22:40 UTC (permalink / raw)
  To: Jean Guyader; +Cc: xen-devel

Hi,

With the patch applied, I did a FLR on the card as follows:
echo -n "0000:00:02.0" > /sys/bus/pci/drivers/pciback/do_flr

The screen turned blank upon issuing the command. I was able to boot up
DomU. Shutting down DomU returns the screen to blank. Is this the
expected observation?

Thanks.

- Beng Heng

Jean Guyader wrote:
> We have a patch to the FLR support to pciback.
> http://xenbits.xen.org/gitweb?p=xenclient/linux-2.6.27-pq.git;a=blob_plain;f=master/pciback-flr;hb=HEAD
> 
> Jean
> 
> 2009/6/6 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>> Apologies, I missed your earlier point about the FLR. I'll try that out.
>> Thanks.
>>
>> - Beng Heng
>>
>> Beng Heng, Ng wrote:
>>> Hi Jean,
>>>
>>> For the linux guest, I tested using Ubuntu 64-bit. It doesn't seem to
>>> work well, and hangs shortly after boot-up. I've attached a short clip
>>> and hopefully that can explain my observations better. I've also
>>> attached logs from the serial terminal and Qemu. I'd like to bring your
>>> attention to the last lines of the Qemu log, which warns that the guest
>>> is trying to write to unused BAR.
>>>
>>> On the other hand, things are much smoother with Vista 64-bit. I have
>>> tried no less than three times, and all went smoothly. Even the
>>> resolution, color and Aero feature are equivalent to native. The only
>>> minor issue is that after shutdown, the screen becomes blank. But I
>>> suppose this is better than XP which was "stuck" in the shutdown screen.
>>> I have the logs and clip for Vista as well. As the clip is bigger, I'll
>>> only send it to you if you want.
>>>
>>> Please let me know if there's any comments or suggestions which you'd
>>> like me to try out. Thanks and have a great weekend.
>>>
>>> Warmest Regards,
>>> Beng Heng
>>>
>>> Jean Guyader wrote:
>>>> Could you tell me if it works with a Vista guest or a linux hvm guest?
>>>>
>>>> The page fault and the screen still stays on Windows issue are due to
>>>> the lack of FLR in your kernel. Doing a FLR on the graphic card before
>>>> booting and when the domain shutdown will fix those.
>>>>
>>>> Thanks,
>>>> Jean
>>>>
>>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
       [not found]     ` <f68b66460906041220w243c4982pe0b485347f13fa50@mail.gmail.com>
       [not found]       ` <4A2820D0.3010301@eecs.umich.edu>
@ 2009-06-07  3:07       ` Beng Heng, Ng
  2009-06-07  3:42         ` Jun Koi
  1 sibling, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-07  3:07 UTC (permalink / raw)
  To: Jean Guyader; +Cc: xen-devel

I tried setting ATI as the primary adapter and passing it through to
DomU again. Seems to work pretty well after I install the ATI driver
over remote desktop.

I'm using ATI HD2600XT. The Radeon driver says version 9.5.

Beng Heng

Jean Guyader wrote:
> ATI driver does'nt support pass through with vt-d, so I think there is
> a very small that you can make it work.
> Did you try to install the ATI driver inside the domU using RDP?
> 
> Jean
> 
> 2009/6/4 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>> Hi Jean,
>>
>> Thanks for the reply. I disabled the assertion and upon calling xm
>> create on DomU, the screen blanks out shortly (about 3 seconds) than
>> reappears with a tinge of yellow (about 3 seconds too), and finally
>> becomes blank totally. You can almost imagine it to be different stages
>> of DomU (WXP in my case) booting. I was able to RDP into DomU. Shutting
>> down DomU does not return the screen to Dom0. The log is attached.
>>
>> - Beng Heng
>>
>>  __  __            _____ _  _    _             _
>>  \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___
>>  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
>>  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
>>  /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
>>                                                   |_|
>> (XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 13:49:51 EDT 2009
>> (XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
>> (XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
>> (XEN) Video information:
>> (XEN)  VGA is text mode 80x25, font 8x16
>> (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
>> (XEN) Disc information:
>> (XEN)  Found 0 MBR signatures
>> (XEN)  Found 1 EDD information structures
>> (XEN) Xen-e820 RAM map:
>> (XEN)  0000000000000000 - 000000000009e800 (usable)
>> (XEN)  000000000009e800 - 00000000000a0000 (reserved)
>> (XEN)  00000000000e0000 - 0000000000100000 (reserved)
>> (XEN)  0000000000100000 - 000000007d6c1000 (usable)
>> (XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
>> (XEN)  000000007d704000 - 000000007d826000 (reserved)
>> (XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
>> (XEN)  000000007d83a000 - 000000007d93c000 (reserved)
>> (XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
>> (XEN)  000000007d93d000 - 000000007d942000 (reserved)
>> (XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
>> (XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
>> (XEN)  000000007d967000 - 000000007d986000 (reserved)
>> (XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
>> (XEN)  000000007d98c000 - 000000007db00000 (usable)
>> (XEN)  000000007dc00000 - 0000000080000000 (reserved)
>> (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
>> (XEN)  00000000ff000000 - 0000000100000000 (reserved)
>> (XEN)  0000000100000000 - 000000017c000000 (usable)
>> (XEN) System RAM: 3991MB (4087628kB)
>> (XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
>> (XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
>> (XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
>> (XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
>> (XEN) ACPI: FACS 7D952F40, 0040
>> (XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
>> (XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
>> (XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
>> (XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
>> (XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
>> (XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
>> (XEN) NUMA turned off
>> (XEN) Faking a node at 0000000000000000-000000017c000000
>> (XEN) Domain heap initialised
>> (XEN) DMI 2.4 present.
>> (XEN) Using APIC driver default
>> (XEN) ACPI: PM-Timer IO Port: 0x408
>> (XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
>> (XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
>> (XEN) ACPI: Local APIC address 0xfee00000
>> (XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
>> (XEN) Processor #0 7:7 APIC version 20
>> (XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
>> (XEN) Processor #1 7:7 APIC version 20
>> (XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
>> (XEN) Processor #2 7:7 APIC version 20
>> (XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
>> (XEN) Processor #3 7:7 APIC version 20
>> (XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
>> (XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
>> (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
>> (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
>> (XEN) ACPI: IRQ0 used by override.
>> (XEN) ACPI: IRQ2 used by override.
>> (XEN) ACPI: IRQ9 used by override.
>> (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
>> (XEN) [VT-D]dmar.c:485: Host address width 36
>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
>> (XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
>> (XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
>> (XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
>> (XEN) Intel VT-d DMAR tables have been parsed.
>> (XEN) Using ACPI (MADT) for SMP configuration information
>> (XEN) Using scheduler: SMP Credit Scheduler (credit)
>> (XEN) Initializing CPU#0
>> (XEN) Detected 2499.760 MHz processor.
>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>> (XEN) CPU: L2 cache: 3072K
>> (XEN) CPU: Physical Processor ID: 0
>> (XEN) CPU: Processor Core ID: 0
>> (XEN) VMX: Supported advanced features:
>> (XEN)  - APIC MMIO access virtualisation
>> (XEN)  - APIC TPR shadow
>> (XEN)  - Virtual NMI
>> (XEN)  - MSR direct-access bitmap
>> (XEN) HVM: VMX enabled
>> (XEN) Intel machine check reporting enabled on CPU#0.
>> (XEN) CPU0: Thermal monitoring enabled (TM2)
>> (XEN) CMCI: CPU0 has no CMCI support
>> (XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>> (XEN) Booting processor 1/1 eip 8c000
>> (XEN) Initializing CPU#1
>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>> (XEN) CPU: L2 cache: 3072K
>> (XEN) CPU: Physical Processor ID: 0
>> (XEN) CPU: Processor Core ID: 1
>> (XEN) Intel machine check reporting enabled on CPU#1.
>> (XEN) CPU1: Thermal monitoring enabled (TM2)
>> (XEN) CMCI: CPU1 has no CMCI support
>> (XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>> (XEN) Booting processor 2/2 eip 8c000
>> (XEN) Initializing CPU#2
>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>> (XEN) CPU: L2 cache: 3072K
>> (XEN) CPU: Physical Processor ID: 0
>> (XEN) CPU: Processor Core ID: 2
>> (XEN) Intel machine check reporting enabled on CPU#2.
>> (XEN) CPU2: Thermal monitoring enabled (TM2)
>> (XEN) CMCI: CPU2 has no CMCI support
>> (XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>> (XEN) Booting processor 3/3 eip 8c000
>> (XEN) Initializing CPU#3
>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>> (XEN) CPU: L2 cache: 3072K
>> (XEN) CPU: Physical Processor ID: 0
>> (XEN) CPU: Processor Core ID: 3
>> (XEN) Intel machine check reporting enabled on CPU#3.
>> (XEN) CPU3: Thermal monitoring enabled (TM2)
>> (XEN) CMCI: CPU3 has no CMCI support
>> (XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>> (XEN) Total of 4 processors activated.
>> (XEN) ENABLING IO-APIC IRQs
>> (XEN)  -> Using new ACK method
>> (XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
>> (XEN) checking TSC synchronization across 4 CPUs: passed.
>> (XEN) Platform timer is 3.579MHz ACPI PM Timer
>> (XEN) microcode.c:73:d32767 microcode: CPU1 resumed
>> (XEN) Brought up 4 CPUs
>> (XEN) microcode.c:73:d32767 microcode: CPU2 resumed
>> (XEN) microcode.c:73:d32767 microcode: CPU3 resumed
>> (XEN) Intel VT-d Snoop Control not supported.
>> (XEN) Intel VT-d DMA Passthrough not supported.
>> (XEN) Intel VT-d Queued Invalidation not supported.
>> (XEN) Intel VT-d Interrupt Remapping not supported.
>> (XEN) I/O virtualisation enabled
>> (XEN) I/O virtualisation for PV guests disabled
>> (XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
>> (XEN) ACPI sleep modes: S3
>> (XEN) mcheck_poll: Machine check polling timer started.
>> (XEN) 'S' pressed -> blowing all shadow tables
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
>> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
>> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
>> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
>> (XEN) *** LOADING DOMAIN 0 ***
>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
>> (XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
>> (XEN) elf_xen_parse_note: GUEST_OS = "linux"
>> (XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
>> (XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
>> (XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
>> (XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
>> (XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
>> (XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
>> (XEN) elf_xen_parse_note: unknown xen elf note (0xd)
>> (XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
>> (XEN) elf_xen_parse_note: LOADER = "generic"
>> (XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
>> (XEN) elf_xen_addr_calc_check: addresses:
>> (XEN)     virt_base        = 0xffffffff80000000
>> (XEN)     elf_paddr_offset = 0xffffffff80000000
>> (XEN)     virt_offset      = 0x0
>> (XEN)     virt_kstart      = 0xffffffff80200000
>> (XEN)     virt_kend        = 0xffffffff8087cda8
>> (XEN)     virt_entry       = 0xffffffff80200000
>> (XEN)     p2m_base         = 0xffffffffffffffff
>> (XEN)  Xen  kernel: 64-bit, lsb, compat32
>> (XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
>> (XEN) PHYSICAL MEMORY ARRANGEMENT:
>> (XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
>> (XEN) VIRTUAL MEMORY ARRANGEMENT:
>> (XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
>> (XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
>> (XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
>> (XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
>> (XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
>> (XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
>> (XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
>> (XEN)  ENTRY ADDRESS: ffffffff80200000
>> (XEN) Dom0 has maximum 4 VCPUs
>> (XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
>> (XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
>> (XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
>> (XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
>> (XEN) Scrubbing Free RAM: .............................done.
>> (XEN) Xen trace buffers: disabled
>> (XEN) Std. Loglevel: All
>> (XEN) Guest Loglevel: All
>> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
>> (XEN) Freed 128kB init memory.
>> kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
>> Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0))
>> Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
>> BIOS-provided physical RAM map:
>>  Xen: 0000000000000000 - 0000000040800000 (usable)
>> DMI 2.4 present.
>> No mptable found.
>>  >>> ERROR: Invalid checksum
>> ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
>> ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
>> ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
>> ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
>> ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
>> IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
>> ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
>> ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
>> Setting APIC routing to xen
>> Using ACPI (MADT) for SMP configuration information
>> Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
>> Built 1 zonelists.  Total pages: 260580
>> Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)
>> Initializing CPU#0
>> PID hash table entries: 4096 (order: 12, 32768 bytes)
>> Xen reported: 2499.716 MHz processor.
>> Console: colour VGA+ 80x25
>> Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
>> Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
>> Software IO TLB enabled:
>>  Aperture:     64 megabytes
>>  Kernel range: ffff880002407000 - ffff880006407000
>>  Address size: 27 bits
>> PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
>> Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
>> Calibrating delay using timer specific routine.. 5000.66 BogoMIPS (lpj=25003323)
>> Mount-cache hash table entries: 256
>> CPU: L1 I cache: 32K, L1 D cache: 32K
>> CPU: L2 cache: 3072K
>> CPU: Physical Processor ID: 0
>> CPU: Processor Core ID: 0
>> SMP alternatives: switching to UP code
>> ACPI: Core revision 20060707
>> SMP alternatives: switching to SMP code
>> Initializing CPU#1
>> Initializing CPU#2
>> CPU: L1 I cache: 32K, L1 D cache: 32K
>> CPU: L2 cache: 3072K
>> CPU: Physical Processor ID: 0
>> CPU: Processor Core ID: 1
>> Brought up 4 CPUs
>> Initializing CPU#3
>> CPU: L1 I cache: 32K, L1 D cache: 32K
>> CPU: L2 cache: 3072K
>> CPU: Physical Processor ID: 0
>> CPU: Processor Core ID: 3
>> CPU: L1 I cache: 32K, L1 D cache: 32K
>> CPU: L2 cache: 3072K
>> CPU: Physical Processor ID: 0
>> CPU: Processor Core ID: 2
>> migration_cost=31
>> checking if image is initramfs... it is
>> Freeing initrd memory: 7436k freed
>> NET: Registered protocol family 16
>> ACPI: bus type pci registered
>> PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
>> PCI: Not using MMCONFIG.
>> PCI: Using configuration type 1
>> ACPI: Interpreter enabled
>> ACPI: Using IOAPIC for interrupt routing
>> ACPI: PCI Root Bridge [PCI0] (0000:00)
>> PCI: Transparent bridge - 0000:00:1e.0
>> ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
>> ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
>> Linux Plug and Play Support v0.97 (c) Adam Belay
>> pnp: PnP ACPI init
>> (XEN) io_apic.c:2139:
>> (XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
>> (XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
>> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
>> pnp: PnP ACPI: found 10 devices
>> xen_mem: Initialising balloon driver.
>> SCSI subsystem initialized
>> usbcore: registered new driver usbfs
>> usbcore: registered new driver hub
>> PCI: Using ACPI for IRQ routing
>> PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
>> pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
>> pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
>> pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
>> pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
>> pnp: 00:09: ioport range 0x400-0x47f could not be reserved
>> pnp: 00:09: ioport range 0x1180-0x119f has been reserved
>> pnp: 00:09: ioport range 0x500-0x57f has been reserved
>> (XEN) PCI add device 00:00.0
>> (XEN) PCI add device 00:01.0
>> (XEN) PCI add device 00:02.0
>> pciback 0000:00:02.0: seizing device
>> (XEN) PCI add device 00:03.0
>> (XEN) PCI add device 00:03.2
>> (XEN) PCI add device 00:03.3
>> (XEN) PCI add device 00:19.0
>> (XEN) PCI add device 00:1a.0
>> (XEN) PCI add device 00:1a.1
>> (XEN) PCI add device 00:1a.2
>> (XEN) PCI add device 00:1a.7
>> (XEN) PCI add device 00:1b.0
>> (XEN) PCI add device 00:1d.0
>> (XEN) PCI add device 00:1d.1
>> (XEN) PCI add device 00:1d.2
>> (XEN) PCI add device 00:1d.7
>> (XEN) PCI add device 00:1e.0
>> (XEN) PCI add device 00:1f.0
>> (XEN) PCI add device 00:1f.2
>> (XEN) PCI add device 00:1f.3
>> (XEN) PCI add device 00:1f.5
>> (XEN) PCI add device 01:00.0
>> (XEN) PCI add device 01:00.1
>> (XEN) PCI add device 02:00.0
>> (XEN) PCI add device 02:01.0
>> PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
>> PCI: Bridge: 0000:00:01.0
>>  IO window: c000-cfff
>>  MEM window: c0000000-d00fffff
>>  PREFETCH window: disabled.
>> PCI: Bridge: 0000:00:1e.0
>>  IO window: b000-bfff
>>  MEM window: d0800000-d08fffff
>>  PREFETCH window: 88000000-880fffff
>> GSI 16 sharing vector 0xB0 and IRQ 16
>> ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
>> NET: Registered protocol family 2
>> IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
>> TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
>> TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
>> TCP: Hash tables configured (established 131072 bind 65536)
>> TCP reno registered
>> IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
>> Initializing Cryptographic API
>> io scheduler noop registered
>> io scheduler anticipatory registered (default)
>> io scheduler deadline registered
>> io scheduler cfq registered
>> 0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
>> 0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
>> floppy0: Unable to grab DMA2 for the floppy driver
>> floppy0: no floppy controllers found
>> RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
>> loop: loaded (max 8 devices)
>> HP CISS Driver (v 3.6.10)
>> Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
>> Copyright (c) 1999-2006 Intel Corporation.
>> (XEN) PCI add device 02:00.0
>> GSI 17 sharing vector 0xB8 and IRQ 17
>> ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
>> e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
>> e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
>> e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
>> e1000e: Copyright (c) 1999-2008 Intel Corporation.
>> (XEN) PCI add device 00:19.0
>> GSI 18 sharing vector 0xC0 and IRQ 18
>> ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
>> eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
>> eth1: Intel(R) PRO/1000 Network Connection
>> eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
>> pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
>> e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
>> e100: Copyright(c) 1999-2005 Intel Corporation
>> tun: Universal TUN/TAP device driver, 1.6
>> tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
>> Xen virtual console successfully installed as ttyS0
>> Event-channel device installed.
>> blktap_device_init: blktap device major 254
>> blktap_ring_init: blktap ring major: 253
>> netfront: Initialising virtual ethernet driver.
>> ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
>> ACPI: PCI interrupt for device 0000:00:02.0 disabled
>> Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
>> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
>> (XEN) PCI add device 00:03.2
>> (XEN) PCI add device 00:1f.5
>> Adaptec aacraid driver (1.1-5[2409]-mh2)
>> 3ware Storage Controller device driver for Linux v1.26.02.001.
>> (XEN) PCI add device 00:1f.2
>> GSI 19 sharing vector 0xD0 and IRQ 19
>> ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
>> ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
>> ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part
>> ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
>> ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
>> ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
>> ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
>> ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
>> ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
>> scsi0 : ahci
>> ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
>> ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
>> ata1.00: ata1: dev 0 multi count 16
>> ata1.00: configured for UDMA/133
>> scsi1 : ahci
>> ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
>> ata2.00: ATAPI, max UDMA/100
>> ata2.00: configured for UDMA/100
>> scsi2 : ahci
>> ata3: SATA link down (SStatus 0 SControl 300)
>> scsi3 : ahci
>> ata4: SATA link down (SStatus 0 SControl 300)
>> scsi4 : ahci
>> ata5: SATA link down (SStatus 0 SControl 300)
>> scsi5 : ahci
>> ata6: SATA link down (SStatus 0 SControl 300)
>>  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
>>  Type:   Direct-Access                      ANSI SCSI revision: 05
>>  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
>>  Type:   CD-ROM                             ANSI SCSI revision: 05
>> (XEN) PCI add device 00:1f.5
>> ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
>> ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 19
>> ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 19
>> ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 19
>> scsi6 : ata_piix
>> ATA: abnormal status 0x7F on port 0xD177
>> scsi7 : ata_piix
>> ATA: abnormal status 0x7F on port 0xD157
>> SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
>> sda: Write Protect is off
>> SCSI device sda: drive cache: write back
>> SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
>> sda: Write Protect is off
>> SCSI device sda: drive cache: write back
>>  sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
>> sd 0:0:0:0: Attached scsi disk sda
>> Fusion MPT base driver 3.04.01
>> Copyright (c) 1999-2005 LSI Logic Corporation
>> Fusion MPT SPI Host driver 3.04.01
>> usbmon: debugfs is not available
>> USB Universal Host Controller Interface driver v3.0
>> (XEN) PCI add device 00:1a.0
>> ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
>> uhci_hcd 0000:00:1a.0: UHCI Host Controller
>> uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
>> uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
>> usb usb1: configuration #1 chosen from 1 choice
>> hub 1-0:1.0: USB hub found
>> hub 1-0:1.0: 2 ports detected
>> (XEN) PCI add device 00:1a.1
>> ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
>> uhci_hcd 0000:00:1a.1: UHCI Host Controller
>> uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
>> uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
>> usb usb2: configuration #1 chosen from 1 choice
>> hub 2-0:1.0: USB hub found
>> hub 2-0:1.0: 2 ports detected
>> (XEN) PCI add device 00:1a.2
>> GSI 20 sharing vector 0x21 and IRQ 20
>> ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 20
>> uhci_hcd 0000:00:1a.2: UHCI Host Controller
>> uhci_hcd 0000:00:1a.2: new USB bus registered, assigned bus number 3
>> uhci_hcd 0000:00:1a.2: irq 20, io base 0x0000d0a0
>> usb usb3: configuration #1 chosen from 1 choice
>> hub 3-0:1.0: USB hub found
>> hub 3-0:1.0: 2 ports detected
>> (XEN) PCI add device 00:1d.0
>> GSI 21 sharing vector 0x29 and IRQ 21
>> ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
>> uhci_hcd 0000:00:1d.0: UHCI Host Controller
>> uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 4
>> uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
>> usb usb4: configuration #1 chosen from 1 choice
>> hub 4-0:1.0: USB hub found
>> hub 4-0:1.0: 2 ports detected
>> (XEN) PCI add device 00:1d.1
>> ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
>> uhci_hcd 0000:00:1d.1: UHCI Host Controller
>> uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 5
>> uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000d060
>> usb usb5: configuration #1 chosen from 1 choice
>> hub 5-0:1.0: USB hub found
>> hub 5-0:1.0: 2 ports detected
>> (XEN) PCI add device 00:1d.2
>> ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 20
>> uhci_hcd 0000:00:1d.2: UHCI Host Controller
>> uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 6
>> uhci_hcd 0000:00:1d.2: irq 20, io base 0x0000d040
>> usb usb6: configuration #1 chosen from 1 choice
>> hub 6-0:1.0: USB hub found
>> hub 6-0:1.0: 2 ports detected
>> usb 3-1: new full speed USB device using uhci_hcd and address 2
>> usb 3-1: configuration #1 chosen from 1 choice
>> hub 3-1:1.0: USB hub found
>> hub 3-1:1.0: 4 ports detected
>> usb 3-1.1: new low speed USB device using uhci_hcd and address 3
>> usb 3-1.1: configuration #1 chosen from 1 choice
>> input: HID 04f3:0801 as /class/input/input0
>> input: USB HID v1.10 Keyboard [HID 04f3:0801] on usb-0000:00:1a.2-1.1
>> input: HID 04f3:0801 as /class/input/input1
>> input: USB HID v1.10 Mouse [HID 04f3:0801] on usb-0000:00:1a.2-1.1
>> usbcore: registered new driver usbhid
>> /usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
>> PNP: No PS/2 controller found. Probing ports directly.
>> serio: i8042 AUX port at 0x60,0x64 irq 12
>> serio: i8042 KBD port at 0x60,0x64 irq 1
>> mice: PS/2 mouse device common for all mice
>> md: raid0 personality registered for level 0
>> md: raid1 personality registered for level 1
>> md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
>> md: bitmap version 4.39
>> device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
>> TCP bic registered
>> NET: Registered protocol family 1
>> NET: Registered protocol family 17
>> Bridge firewalling registered
>> PCI IO multiplexer device installed.
>> ACPI: (supports S0 S1 S3 S4 S5)
>> BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
>> Freeing unused kernel memory: 216k freed
>> Mounting proc filesystem
>> Mounting sysfs filesystem
>> Creating /dev
>> Creating initial device nodes
>> Loading /lib/kbd/keymaps/i386/qwerty/us.map
>> Setting up hotplug.
>> Creating block device nodes.
>> Creating character device nodes.
>> Creating root device.
>> Mounting root filesystem.
>> EXT3-fs: INFO: recovery required on readonly filesystem.
>> EXT3-fs: write access will be enabled during recovery.
>> kjournald starting.  Commit interval 5 seconds
>> EXT3-fs: recovery complete.
>> EXT3-fs: mounted filesystem with ordered data mode.
>> Setting up other filesystems.
>> Switching to new root and running init.
>>                Welcome to Fedora
>>                Press 'I' to enter interactive startup.
>> Starting udev: G[  OK  ]
>> Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
>> Jun 04 14:11:00 | DM multipath kernel driver not loaded
>> Setting up Logical Volume Management: File descriptor 7 left open
>> [  OK  ]
>> Checking filesystems
>> Checking all file systems.
>> [/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2
>> /: clean, 2579449/6111232 files, 12471163/24418800 blocks
>> [  OK  ]
>> Remounting root filesystem in read-write mode:  [  OK  ]
>> Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
>> FATAL: Module fuse not found.
>> ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
>> [FAILED]
>> Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
>> [  OK  ]
>> Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
>> [  OK  ]
>> Entering non-interactive startup
>> Applying Intel CPU microcode update: FATAL: Module microcode not found.
>> [  OK  ]ERROR: Module microcode does not exist in /proc/modules
>>
>> ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
>> ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'
>>
>> Error occurred at line: 3
>> Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
>> [FAILED]
>> iptables: Applying firewall rules: FATAL: Module ip_tables not found.
>> iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'
>>
>> Error occurred at line: 3
>> Try `iptables-restore -h' or 'iptables-restore --help' for more information.
>> [FAILED]
>> Starting auditd: [FAILED]
>> Starting system logger: [  OK  ]
>> Starting irqbalance: [  OK  ]
>> Starting rpcbind: [  OK  ]
>> Starting NFS statd: [FAILED]
>> Starting RPC idmapd: FATAL: Module sunrpc not found.
>> FATAL: Error running install command for sunrpc
>> Error: RPC MTAB does not exist.
>> Starting system message bus: [  OK  ]
>> Starting HAL daemon: [  OK  ]
>> Setting network parameters... [  OK  ]
>> Starting NetworkManager daemon: [  OK  ]
>> Starting portreserve: [  OK  ]
>> Starting Bluetooth services:[  OK  ]
>> Starting sendmail: [  OK  ]
>> Starting sm-client: [  OK  ]
>> Starting console mouse services: [  OK  ]
>> Starting httpd: [  OK  ]
>> Starting crond: [  OK  ][  OK  ]
>> Starting kerneloops:[  OK  ]
>> Starting atd: [  OK  ][  OK  ]
>> Starting Avahi daemon... [  OK  ]
>> Starting cups: [  OK  ]
>> Starting anacron: [  OK  ]
>> Starting sshd: [  OK  ]
>>
>> Fedora release 10 (Cambridge)
>> Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)
>>
>> xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 1f0
>> (XEN)     l2[1f0] = 0
>> (XEN)     l2[1f0] not present
>> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
>> (XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) HVM1: HVM Loader
>> (XEN) HVM1: Detected Xen v3.4.1-rc1-pre
>> (XEN) HVM1: CPU speed is 2500 MHz
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) irq.c:243: Dom1 PCI link 0 changed 0 -> 5
>> (XEN) HVM1: PCI-ISA link 0 routed to IRQ5
>> (XEN) irq.c:243: Dom1 PCI link 1 changed 0 -> 10
>> (XEN) HVM1: PCI-ISA link 1 routed to IRQ10
>> (XEN) irq.c:243: Dom1 PCI link 2 changed 0 -> 11
>> (XEN) HVM1: PCI-ISA link 2 routed to IRQ11
>> (XEN) irq.c:243: Dom1 PCI link 3 changed 0 -> 5
>> (XEN) HVM1: PCI-ISA link 3 routed to IRQ5
>> (XEN) HVM1: pci dev 01:3 INTA->IRQ10
>> (XEN) HVM1: pci dev 02:0 INTA->IRQ11
>> (XEN) HVM1: pci dev 03:0 INTA->IRQ5
>> (XEN) HVM1: pci dev 04:0 INTA->IRQ5
>> (XEN) HVM1: pci dev 02:0 bar 18 size 10000000: e000000c
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
>> (XEN) HVM1: pci dev 03:0 bar 14 size 01000000: f0000008
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
>> (XEN) HVM1: pci dev 02:0 bar 10 size 00400000: f1000004
>> (XEN) HVM1: pci dev 03:0 bar 10 size 00000100: 0000c001
>> (XEN) HVM1: pci dev 04:0 bar 10 size 00000100: 0000c101
>> (XEN) HVM1: pci dev 04:0 bar 14 size 00000100: f1400000
>> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c201
>> (XEN) HVM1: pci dev 02:0 bar 20 size 00000008: 0000c211
>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
>> (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: Passed 1/1 tests
>> (XEN) HVM1: Writing SMBIOS tables ...
>> (XEN) HVM1: Loading ROMBIOS ...
>> (XEN) HVM1: 9788 bytes of ROMBIOS high-memory extensions:
>> (XEN) HVM1:   Relocating to 0xfc000000-0xfc00263c ... done
>> (XEN) HVM1: Creating MP tables ...
>> (XEN) HVM1: No emulated VGA adaptor ...
>> (XEN) HVM1: Loading PCI Option ROM ...
>> (XEN) HVM1:  - Manufacturer: http://etherboot.org
>> (XEN) HVM1:  - Product name: gPXE
>> (XEN) HVM1: Loading ACPI ...
>> (XEN) HVM1:  - Lo data: 000ea020-000ea04f
>> (XEN) HVM1:  - Hi data: fc002800-fc005c9f
>> (XEN) HVM1: vm86 TSS at fc006000
>> (XEN) HVM1: BIOS map:
>> (XEN) HVM1:  c8000-d47ff: Etherboot ROM
>> (XEN) HVM1:  eb000-eb150: SMBIOS tables
>> (XEN) HVM1:  f0000-fffff: Main BIOS
>> (XEN) HVM1: Invoking ROMBIOS ...
>> (XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>> (XEN) HVM1: Bochs BIOS - build: 06/23/99
>> (XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>> (XEN) HVM1: Options: apmbios pcibios eltorito PMM
>> (XEN) HVM1:
>> (XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
>> (XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (8192 MBytes)
>> (XEN) HVM1: IDE time out
>> (XEN) HVM1:
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>> (XEN)     root_entry = ffff83017bfb8000
>> (XEN)     root_entry[0] = 17763a001
>> (XEN)     context = ffff83017763a000
>> (XEN)     context[10] = 201_1763c0001
>> (XEN)     l3 = ffff8301763c0000
>> (XEN)     l3_index = 1
>> (XEN)     l3[1] = 12ae77003
>> (XEN)     l2 = ffff83012ae77000
>> (XEN)     l2_index = 160
>> (XEN)     l2[160] = 0
>> (XEN)     l2[160] not present
>> (XEN) HVM1:
>> (XEN) HVM1:
>> (XEN) HVM1: Press F12 for boot menu.
>> (XEN) HVM1:
>> (XEN) HVM1: Booting from Hard Disk...
>> (XEN) HVM1: Booting from 0000:7c00
>> (XEN) HVM1: int13_harddisk: function 15, unmapped device for ELDL=81
>> (XEN) HVM1: *** int 15h function AX=e980, BX=006e not yet supported!
>> (XEN) irq.c:243: Dom1 PCI link 0 changed 5 -> 0
>> (XEN) irq.c:243: Dom1 PCI link 1 changed 10 -> 0
>> (XEN) irq.c:243: Dom1 PCI link 2 changed 11 -> 0
>> (XEN) irq.c:243: Dom1 PCI link 3 changed 5 -> 0
>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
>> (XEN) domctl.c:910:d0 ioport_map:remove f_gport=c210 f_mport=d220 np=8
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
>> (XEN) domctl.c:910:d0 ioport_map:remove f_gport=c210 f_mport=d220 np=8
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
>> (XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
>> (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
>> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
>> Disabling IRQ #16
>>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
  2009-06-07  3:07       ` Beng Heng, Ng
@ 2009-06-07  3:42         ` Jun Koi
  2009-06-08  5:36           ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Jun Koi @ 2009-06-07  3:42 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: xen-devel

Hi Beng,

Would you please send the patch you applied on top of Xen to the list?
I think many people are interested in that.

Thanks,
Jun



On Sun, Jun 7, 2009 at 12:07 PM, Beng Heng, Ng<bengheng@eecs.umich.edu> wrote:
> I tried setting ATI as the primary adapter and passing it through to
> DomU again. Seems to work pretty well after I install the ATI driver
> over remote desktop.
>
> I'm using ATI HD2600XT. The Radeon driver says version 9.5.
>
> Beng Heng
>
> Jean Guyader wrote:
>> ATI driver does'nt support pass through with vt-d, so I think there is
>> a very small that you can make it work.
>> Did you try to install the ATI driver inside the domU using RDP?
>>
>> Jean
>>
>> 2009/6/4 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>>> Hi Jean,
>>>
>>> Thanks for the reply. I disabled the assertion and upon calling xm
>>> create on DomU, the screen blanks out shortly (about 3 seconds) than
>>> reappears with a tinge of yellow (about 3 seconds too), and finally
>>> becomes blank totally. You can almost imagine it to be different stages
>>> of DomU (WXP in my case) booting. I was able to RDP into DomU. Shutting
>>> down DomU does not return the screen to Dom0. The log is attached.
>>>
>>> - Beng Heng
>>>
>>>  __  __            _____ _  _    _             _
>>>  \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___
>>>  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
>>>  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
>>>  /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
>>>                                                   |_|
>>> (XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 13:49:51 EDT 2009
>>> (XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
>>> (XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
>>> (XEN) Video information:
>>> (XEN)  VGA is text mode 80x25, font 8x16
>>> (XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
>>> (XEN) Disc information:
>>> (XEN)  Found 0 MBR signatures
>>> (XEN)  Found 1 EDD information structures
>>> (XEN) Xen-e820 RAM map:
>>> (XEN)  0000000000000000 - 000000000009e800 (usable)
>>> (XEN)  000000000009e800 - 00000000000a0000 (reserved)
>>> (XEN)  00000000000e0000 - 0000000000100000 (reserved)
>>> (XEN)  0000000000100000 - 000000007d6c1000 (usable)
>>> (XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
>>> (XEN)  000000007d704000 - 000000007d826000 (reserved)
>>> (XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
>>> (XEN)  000000007d83a000 - 000000007d93c000 (reserved)
>>> (XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
>>> (XEN)  000000007d93d000 - 000000007d942000 (reserved)
>>> (XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
>>> (XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
>>> (XEN)  000000007d967000 - 000000007d986000 (reserved)
>>> (XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
>>> (XEN)  000000007d98c000 - 000000007db00000 (usable)
>>> (XEN)  000000007dc00000 - 0000000080000000 (reserved)
>>> (XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
>>> (XEN)  00000000ff000000 - 0000000100000000 (reserved)
>>> (XEN)  0000000100000000 - 000000017c000000 (usable)
>>> (XEN) System RAM: 3991MB (4087628kB)
>>> (XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
>>> (XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
>>> (XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
>>> (XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
>>> (XEN) ACPI: FACS 7D952F40, 0040
>>> (XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
>>> (XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
>>> (XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
>>> (XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
>>> (XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
>>> (XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
>>> (XEN) NUMA turned off
>>> (XEN) Faking a node at 0000000000000000-000000017c000000
>>> (XEN) Domain heap initialised
>>> (XEN) DMI 2.4 present.
>>> (XEN) Using APIC driver default
>>> (XEN) ACPI: PM-Timer IO Port: 0x408
>>> (XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
>>> (XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
>>> (XEN) ACPI: Local APIC address 0xfee00000
>>> (XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
>>> (XEN) Processor #0 7:7 APIC version 20
>>> (XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
>>> (XEN) Processor #1 7:7 APIC version 20
>>> (XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
>>> (XEN) Processor #2 7:7 APIC version 20
>>> (XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
>>> (XEN) Processor #3 7:7 APIC version 20
>>> (XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
>>> (XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
>>> (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
>>> (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
>>> (XEN) ACPI: IRQ0 used by override.
>>> (XEN) ACPI: IRQ2 used by override.
>>> (XEN) ACPI: IRQ9 used by override.
>>> (XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
>>> (XEN) [VT-D]dmar.c:485: Host address width 36
>>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
>>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
>>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
>>> (XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
>>> (XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
>>> (XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
>>> (XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
>>> (XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
>>> (XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
>>> (XEN) Intel VT-d DMAR tables have been parsed.
>>> (XEN) Using ACPI (MADT) for SMP configuration information
>>> (XEN) Using scheduler: SMP Credit Scheduler (credit)
>>> (XEN) Initializing CPU#0
>>> (XEN) Detected 2499.760 MHz processor.
>>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>>> (XEN) CPU: L2 cache: 3072K
>>> (XEN) CPU: Physical Processor ID: 0
>>> (XEN) CPU: Processor Core ID: 0
>>> (XEN) VMX: Supported advanced features:
>>> (XEN)  - APIC MMIO access virtualisation
>>> (XEN)  - APIC TPR shadow
>>> (XEN)  - Virtual NMI
>>> (XEN)  - MSR direct-access bitmap
>>> (XEN) HVM: VMX enabled
>>> (XEN) Intel machine check reporting enabled on CPU#0.
>>> (XEN) CPU0: Thermal monitoring enabled (TM2)
>>> (XEN) CMCI: CPU0 has no CMCI support
>>> (XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>>> (XEN) Booting processor 1/1 eip 8c000
>>> (XEN) Initializing CPU#1
>>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>>> (XEN) CPU: L2 cache: 3072K
>>> (XEN) CPU: Physical Processor ID: 0
>>> (XEN) CPU: Processor Core ID: 1
>>> (XEN) Intel machine check reporting enabled on CPU#1.
>>> (XEN) CPU1: Thermal monitoring enabled (TM2)
>>> (XEN) CMCI: CPU1 has no CMCI support
>>> (XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>>> (XEN) Booting processor 2/2 eip 8c000
>>> (XEN) Initializing CPU#2
>>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>>> (XEN) CPU: L2 cache: 3072K
>>> (XEN) CPU: Physical Processor ID: 0
>>> (XEN) CPU: Processor Core ID: 2
>>> (XEN) Intel machine check reporting enabled on CPU#2.
>>> (XEN) CPU2: Thermal monitoring enabled (TM2)
>>> (XEN) CMCI: CPU2 has no CMCI support
>>> (XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>>> (XEN) Booting processor 3/3 eip 8c000
>>> (XEN) Initializing CPU#3
>>> (XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
>>> (XEN) CPU: L2 cache: 3072K
>>> (XEN) CPU: Physical Processor ID: 0
>>> (XEN) CPU: Processor Core ID: 3
>>> (XEN) Intel machine check reporting enabled on CPU#3.
>>> (XEN) CPU3: Thermal monitoring enabled (TM2)
>>> (XEN) CMCI: CPU3 has no CMCI support
>>> (XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
>>> (XEN) Total of 4 processors activated.
>>> (XEN) ENABLING IO-APIC IRQs
>>> (XEN)  -> Using new ACK method
>>> (XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
>>> (XEN) checking TSC synchronization across 4 CPUs: passed.
>>> (XEN) Platform timer is 3.579MHz ACPI PM Timer
>>> (XEN) microcode.c:73:d32767 microcode: CPU1 resumed
>>> (XEN) Brought up 4 CPUs
>>> (XEN) microcode.c:73:d32767 microcode: CPU2 resumed
>>> (XEN) microcode.c:73:d32767 microcode: CPU3 resumed
>>> (XEN) Intel VT-d Snoop Control not supported.
>>> (XEN) Intel VT-d DMA Passthrough not supported.
>>> (XEN) Intel VT-d Queued Invalidation not supported.
>>> (XEN) Intel VT-d Interrupt Remapping not supported.
>>> (XEN) I/O virtualisation enabled
>>> (XEN) I/O virtualisation for PV guests disabled
>>> (XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
>>> (XEN) ACPI sleep modes: S3
>>> (XEN) mcheck_poll: Machine check polling timer started.
>>> (XEN) 'S' pressed -> blowing all shadow tables
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
>>> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
>>> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
>>> (XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
>>> (XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
>>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
>>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
>>> (XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
>>> (XEN) *** LOADING DOMAIN 0 ***
>>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
>>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
>>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
>>> (XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
>>> (XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
>>> (XEN) elf_xen_parse_note: GUEST_OS = "linux"
>>> (XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
>>> (XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
>>> (XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
>>> (XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
>>> (XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
>>> (XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
>>> (XEN) elf_xen_parse_note: unknown xen elf note (0xd)
>>> (XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
>>> (XEN) elf_xen_parse_note: LOADER = "generic"
>>> (XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
>>> (XEN) elf_xen_addr_calc_check: addresses:
>>> (XEN)     virt_base        = 0xffffffff80000000
>>> (XEN)     elf_paddr_offset = 0xffffffff80000000
>>> (XEN)     virt_offset      = 0x0
>>> (XEN)     virt_kstart      = 0xffffffff80200000
>>> (XEN)     virt_kend        = 0xffffffff8087cda8
>>> (XEN)     virt_entry       = 0xffffffff80200000
>>> (XEN)     p2m_base         = 0xffffffffffffffff
>>> (XEN)  Xen  kernel: 64-bit, lsb, compat32
>>> (XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
>>> (XEN) PHYSICAL MEMORY ARRANGEMENT:
>>> (XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
>>> (XEN) VIRTUAL MEMORY ARRANGEMENT:
>>> (XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
>>> (XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
>>> (XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
>>> (XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
>>> (XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
>>> (XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
>>> (XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
>>> (XEN)  ENTRY ADDRESS: ffffffff80200000
>>> (XEN) Dom0 has maximum 4 VCPUs
>>> (XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
>>> (XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
>>> (XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
>>> (XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
>>> (XEN) Scrubbing Free RAM: .............................done.
>>> (XEN) Xen trace buffers: disabled
>>> (XEN) Std. Loglevel: All
>>> (XEN) Guest Loglevel: All
>>> (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
>>> (XEN) Freed 128kB init memory.
>>> kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
>>> Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0))
>>> Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
>>> BIOS-provided physical RAM map:
>>>  Xen: 0000000000000000 - 0000000040800000 (usable)
>>> DMI 2.4 present.
>>> No mptable found.
>>>  >>> ERROR: Invalid checksum
>>> ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
>>> ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
>>> ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
>>> ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
>>> ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
>>> IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
>>> ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
>>> ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
>>> Setting APIC routing to xen
>>> Using ACPI (MADT) for SMP configuration information
>>> Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
>>> Built 1 zonelists.  Total pages: 260580
>>> Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)
>>> Initializing CPU#0
>>> PID hash table entries: 4096 (order: 12, 32768 bytes)
>>> Xen reported: 2499.716 MHz processor.
>>> Console: colour VGA+ 80x25
>>> Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
>>> Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
>>> Software IO TLB enabled:
>>>  Aperture:     64 megabytes
>>>  Kernel range: ffff880002407000 - ffff880006407000
>>>  Address size: 27 bits
>>> PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
>>> Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
>>> Calibrating delay using timer specific routine.. 5000.66 BogoMIPS (lpj=25003323)
>>> Mount-cache hash table entries: 256
>>> CPU: L1 I cache: 32K, L1 D cache: 32K
>>> CPU: L2 cache: 3072K
>>> CPU: Physical Processor ID: 0
>>> CPU: Processor Core ID: 0
>>> SMP alternatives: switching to UP code
>>> ACPI: Core revision 20060707
>>> SMP alternatives: switching to SMP code
>>> Initializing CPU#1
>>> Initializing CPU#2
>>> CPU: L1 I cache: 32K, L1 D cache: 32K
>>> CPU: L2 cache: 3072K
>>> CPU: Physical Processor ID: 0
>>> CPU: Processor Core ID: 1
>>> Brought up 4 CPUs
>>> Initializing CPU#3
>>> CPU: L1 I cache: 32K, L1 D cache: 32K
>>> CPU: L2 cache: 3072K
>>> CPU: Physical Processor ID: 0
>>> CPU: Processor Core ID: 3
>>> CPU: L1 I cache: 32K, L1 D cache: 32K
>>> CPU: L2 cache: 3072K
>>> CPU: Physical Processor ID: 0
>>> CPU: Processor Core ID: 2
>>> migration_cost=31
>>> checking if image is initramfs... it is
>>> Freeing initrd memory: 7436k freed
>>> NET: Registered protocol family 16
>>> ACPI: bus type pci registered
>>> PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
>>> PCI: Not using MMCONFIG.
>>> PCI: Using configuration type 1
>>> ACPI: Interpreter enabled
>>> ACPI: Using IOAPIC for interrupt routing
>>> ACPI: PCI Root Bridge [PCI0] (0000:00)
>>> PCI: Transparent bridge - 0000:00:1e.0
>>> ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
>>> ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
>>> Linux Plug and Play Support v0.97 (c) Adam Belay
>>> pnp: PnP ACPI init
>>> (XEN) io_apic.c:2139:
>>> (XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
>>> (XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
>>> (XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
>>> pnp: PnP ACPI: found 10 devices
>>> xen_mem: Initialising balloon driver.
>>> SCSI subsystem initialized
>>> usbcore: registered new driver usbfs
>>> usbcore: registered new driver hub
>>> PCI: Using ACPI for IRQ routing
>>> PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
>>> pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
>>> pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
>>> pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
>>> pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
>>> pnp: 00:09: ioport range 0x400-0x47f could not be reserved
>>> pnp: 00:09: ioport range 0x1180-0x119f has been reserved
>>> pnp: 00:09: ioport range 0x500-0x57f has been reserved
>>> (XEN) PCI add device 00:00.0
>>> (XEN) PCI add device 00:01.0
>>> (XEN) PCI add device 00:02.0
>>> pciback 0000:00:02.0: seizing device
>>> (XEN) PCI add device 00:03.0
>>> (XEN) PCI add device 00:03.2
>>> (XEN) PCI add device 00:03.3
>>> (XEN) PCI add device 00:19.0
>>> (XEN) PCI add device 00:1a.0
>>> (XEN) PCI add device 00:1a.1
>>> (XEN) PCI add device 00:1a.2
>>> (XEN) PCI add device 00:1a.7
>>> (XEN) PCI add device 00:1b.0
>>> (XEN) PCI add device 00:1d.0
>>> (XEN) PCI add device 00:1d.1
>>> (XEN) PCI add device 00:1d.2
>>> (XEN) PCI add device 00:1d.7
>>> (XEN) PCI add device 00:1e.0
>>> (XEN) PCI add device 00:1f.0
>>> (XEN) PCI add device 00:1f.2
>>> (XEN) PCI add device 00:1f.3
>>> (XEN) PCI add device 00:1f.5
>>> (XEN) PCI add device 01:00.0
>>> (XEN) PCI add device 01:00.1
>>> (XEN) PCI add device 02:00.0
>>> (XEN) PCI add device 02:01.0
>>> PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
>>> PCI: Bridge: 0000:00:01.0
>>>  IO window: c000-cfff
>>>  MEM window: c0000000-d00fffff
>>>  PREFETCH window: disabled.
>>> PCI: Bridge: 0000:00:1e.0
>>>  IO window: b000-bfff
>>>  MEM window: d0800000-d08fffff
>>>  PREFETCH window: 88000000-880fffff
>>> GSI 16 sharing vector 0xB0 and IRQ 16
>>> ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
>>> NET: Registered protocol family 2
>>> IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
>>> TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
>>> TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
>>> TCP: Hash tables configured (established 131072 bind 65536)
>>> TCP reno registered
>>> IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
>>> Initializing Cryptographic API
>>> io scheduler noop registered
>>> io scheduler anticipatory registered (default)
>>> io scheduler deadline registered
>>> io scheduler cfq registered
>>> 0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
>>> 0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
>>> floppy0: Unable to grab DMA2 for the floppy driver
>>> floppy0: no floppy controllers found
>>> RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
>>> loop: loaded (max 8 devices)
>>> HP CISS Driver (v 3.6.10)
>>> Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
>>> Copyright (c) 1999-2006 Intel Corporation.
>>> (XEN) PCI add device 02:00.0
>>> GSI 17 sharing vector 0xB8 and IRQ 17
>>> ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
>>> e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
>>> e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
>>> e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
>>> e1000e: Copyright (c) 1999-2008 Intel Corporation.
>>> (XEN) PCI add device 00:19.0
>>> GSI 18 sharing vector 0xC0 and IRQ 18
>>> ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
>>> eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
>>> eth1: Intel(R) PRO/1000 Network Connection
>>> eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
>>> pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
>>> e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
>>> e100: Copyright(c) 1999-2005 Intel Corporation
>>> tun: Universal TUN/TAP device driver, 1.6
>>> tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
>>> Xen virtual console successfully installed as ttyS0
>>> Event-channel device installed.
>>> blktap_device_init: blktap device major 254
>>> blktap_ring_init: blktap ring major: 253
>>> netfront: Initialising virtual ethernet driver.
>>> ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
>>> ACPI: PCI interrupt for device 0000:00:02.0 disabled
>>> Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
>>> ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
>>> (XEN) PCI add device 00:03.2
>>> (XEN) PCI add device 00:1f.5
>>> Adaptec aacraid driver (1.1-5[2409]-mh2)
>>> 3ware Storage Controller device driver for Linux v1.26.02.001.
>>> (XEN) PCI add device 00:1f.2
>>> GSI 19 sharing vector 0xD0 and IRQ 19
>>> ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
>>> ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
>>> ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part
>>> ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
>>> ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
>>> ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
>>> ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
>>> ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
>>> ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
>>> scsi0 : ahci
>>> ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
>>> ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
>>> ata1.00: ata1: dev 0 multi count 16
>>> ata1.00: configured for UDMA/133
>>> scsi1 : ahci
>>> ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
>>> ata2.00: ATAPI, max UDMA/100
>>> ata2.00: configured for UDMA/100
>>> scsi2 : ahci
>>> ata3: SATA link down (SStatus 0 SControl 300)
>>> scsi3 : ahci
>>> ata4: SATA link down (SStatus 0 SControl 300)
>>> scsi4 : ahci
>>> ata5: SATA link down (SStatus 0 SControl 300)
>>> scsi5 : ahci
>>> ata6: SATA link down (SStatus 0 SControl 300)
>>>  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
>>>  Type:   Direct-Access                      ANSI SCSI revision: 05
>>>  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
>>>  Type:   CD-ROM                             ANSI SCSI revision: 05
>>> (XEN) PCI add device 00:1f.5
>>> ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
>>> ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 19
>>> ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 19
>>> ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 19
>>> scsi6 : ata_piix
>>> ATA: abnormal status 0x7F on port 0xD177
>>> scsi7 : ata_piix
>>> ATA: abnormal status 0x7F on port 0xD157
>>> SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
>>> sda: Write Protect is off
>>> SCSI device sda: drive cache: write back
>>> SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
>>> sda: Write Protect is off
>>> SCSI device sda: drive cache: write back
>>>  sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
>>> sd 0:0:0:0: Attached scsi disk sda
>>> Fusion MPT base driver 3.04.01
>>> Copyright (c) 1999-2005 LSI Logic Corporation
>>> Fusion MPT SPI Host driver 3.04.01
>>> usbmon: debugfs is not available
>>> USB Universal Host Controller Interface driver v3.0
>>> (XEN) PCI add device 00:1a.0
>>> ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
>>> uhci_hcd 0000:00:1a.0: UHCI Host Controller
>>> uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
>>> uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
>>> usb usb1: configuration #1 chosen from 1 choice
>>> hub 1-0:1.0: USB hub found
>>> hub 1-0:1.0: 2 ports detected
>>> (XEN) PCI add device 00:1a.1
>>> ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
>>> uhci_hcd 0000:00:1a.1: UHCI Host Controller
>>> uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
>>> uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
>>> usb usb2: configuration #1 chosen from 1 choice
>>> hub 2-0:1.0: USB hub found
>>> hub 2-0:1.0: 2 ports detected
>>> (XEN) PCI add device 00:1a.2
>>> GSI 20 sharing vector 0x21 and IRQ 20
>>> ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 20
>>> uhci_hcd 0000:00:1a.2: UHCI Host Controller
>>> uhci_hcd 0000:00:1a.2: new USB bus registered, assigned bus number 3
>>> uhci_hcd 0000:00:1a.2: irq 20, io base 0x0000d0a0
>>> usb usb3: configuration #1 chosen from 1 choice
>>> hub 3-0:1.0: USB hub found
>>> hub 3-0:1.0: 2 ports detected
>>> (XEN) PCI add device 00:1d.0
>>> GSI 21 sharing vector 0x29 and IRQ 21
>>> ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
>>> uhci_hcd 0000:00:1d.0: UHCI Host Controller
>>> uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 4
>>> uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
>>> usb usb4: configuration #1 chosen from 1 choice
>>> hub 4-0:1.0: USB hub found
>>> hub 4-0:1.0: 2 ports detected
>>> (XEN) PCI add device 00:1d.1
>>> ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
>>> uhci_hcd 0000:00:1d.1: UHCI Host Controller
>>> uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 5
>>> uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000d060
>>> usb usb5: configuration #1 chosen from 1 choice
>>> hub 5-0:1.0: USB hub found
>>> hub 5-0:1.0: 2 ports detected
>>> (XEN) PCI add device 00:1d.2
>>> ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 20
>>> uhci_hcd 0000:00:1d.2: UHCI Host Controller
>>> uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 6
>>> uhci_hcd 0000:00:1d.2: irq 20, io base 0x0000d040
>>> usb usb6: configuration #1 chosen from 1 choice
>>> hub 6-0:1.0: USB hub found
>>> hub 6-0:1.0: 2 ports detected
>>> usb 3-1: new full speed USB device using uhci_hcd and address 2
>>> usb 3-1: configuration #1 chosen from 1 choice
>>> hub 3-1:1.0: USB hub found
>>> hub 3-1:1.0: 4 ports detected
>>> usb 3-1.1: new low speed USB device using uhci_hcd and address 3
>>> usb 3-1.1: configuration #1 chosen from 1 choice
>>> input: HID 04f3:0801 as /class/input/input0
>>> input: USB HID v1.10 Keyboard [HID 04f3:0801] on usb-0000:00:1a.2-1.1
>>> input: HID 04f3:0801 as /class/input/input1
>>> input: USB HID v1.10 Mouse [HID 04f3:0801] on usb-0000:00:1a.2-1.1
>>> usbcore: registered new driver usbhid
>>> /usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
>>> PNP: No PS/2 controller found. Probing ports directly.
>>> serio: i8042 AUX port at 0x60,0x64 irq 12
>>> serio: i8042 KBD port at 0x60,0x64 irq 1
>>> mice: PS/2 mouse device common for all mice
>>> md: raid0 personality registered for level 0
>>> md: raid1 personality registered for level 1
>>> md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
>>> md: bitmap version 4.39
>>> device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
>>> TCP bic registered
>>> NET: Registered protocol family 1
>>> NET: Registered protocol family 17
>>> Bridge firewalling registered
>>> PCI IO multiplexer device installed.
>>> ACPI: (supports S0 S1 S3 S4 S5)
>>> BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
>>> Freeing unused kernel memory: 216k freed
>>> Mounting proc filesystem
>>> Mounting sysfs filesystem
>>> Creating /dev
>>> Creating initial device nodes
>>> Loading /lib/kbd/keymaps/i386/qwerty/us.map
>>> Setting up hotplug.
>>> Creating block device nodes.
>>> Creating character device nodes.
>>> Creating root device.
>>> Mounting root filesystem.
>>> EXT3-fs: INFO: recovery required on readonly filesystem.
>>> EXT3-fs: write access will be enabled during recovery.
>>> kjournald starting.  Commit interval 5 seconds
>>> EXT3-fs: recovery complete.
>>> EXT3-fs: mounted filesystem with ordered data mode.
>>> Setting up other filesystems.
>>> Switching to new root and running init.
>>>                Welcome to Fedora
>>>                Press 'I' to enter interactive startup.
>>> Starting udev: G[  OK  ]
>>> Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
>>> Jun 04 14:11:00 | DM multipath kernel driver not loaded
>>> Setting up Logical Volume Management: File descriptor 7 left open
>>> [  OK  ]
>>> Checking filesystems
>>> Checking all file systems.
>>> [/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2
>>> /: clean, 2579449/6111232 files, 12471163/24418800 blocks
>>> [  OK  ]
>>> Remounting root filesystem in read-write mode:  [  OK  ]
>>> Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
>>> FATAL: Module fuse not found.
>>> ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
>>> [FAILED]
>>> Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
>>> [  OK  ]
>>> Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
>>> [  OK  ]
>>> Entering non-interactive startup
>>> Applying Intel CPU microcode update: FATAL: Module microcode not found.
>>> [  OK  ]ERROR: Module microcode does not exist in /proc/modules
>>>
>>> ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
>>> ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'
>>>
>>> Error occurred at line: 3
>>> Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
>>> [FAILED]
>>> iptables: Applying firewall rules: FATAL: Module ip_tables not found.
>>> iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'
>>>
>>> Error occurred at line: 3
>>> Try `iptables-restore -h' or 'iptables-restore --help' for more information.
>>> [FAILED]
>>> Starting auditd: [FAILED]
>>> Starting system logger: [  OK  ]
>>> Starting irqbalance: [  OK  ]
>>> Starting rpcbind: [  OK  ]
>>> Starting NFS statd: [FAILED]
>>> Starting RPC idmapd: FATAL: Module sunrpc not found.
>>> FATAL: Error running install command for sunrpc
>>> Error: RPC MTAB does not exist.
>>> Starting system message bus: [  OK  ]
>>> Starting HAL daemon: [  OK  ]
>>> Setting network parameters... [  OK  ]
>>> Starting NetworkManager daemon: [  OK  ]
>>> Starting portreserve: [  OK  ]
>>> Starting Bluetooth services:[  OK  ]
>>> Starting sendmail: [  OK  ]
>>> Starting sm-client: [  OK  ]
>>> Starting console mouse services: [  OK  ]
>>> Starting httpd: [  OK  ]
>>> Starting crond: [  OK  ][  OK  ]
>>> Starting kerneloops:[  OK  ]
>>> Starting atd: [  OK  ][  OK  ]
>>> Starting Avahi daemon... [  OK  ]
>>> Starting cups: [  OK  ]
>>> Starting anacron: [  OK  ]
>>> Starting sshd: [  OK  ]
>>>
>>> Fedora release 10 (Cambridge)
>>> Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)
>>>
>>> xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 1f0
>>> (XEN)     l2[1f0] = 0
>>> (XEN)     l2[1f0] not present
>>> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
>>> (XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
>>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
>>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) HVM1: HVM Loader
>>> (XEN) HVM1: Detected Xen v3.4.1-rc1-pre
>>> (XEN) HVM1: CPU speed is 2500 MHz
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) irq.c:243: Dom1 PCI link 0 changed 0 -> 5
>>> (XEN) HVM1: PCI-ISA link 0 routed to IRQ5
>>> (XEN) irq.c:243: Dom1 PCI link 1 changed 0 -> 10
>>> (XEN) HVM1: PCI-ISA link 1 routed to IRQ10
>>> (XEN) irq.c:243: Dom1 PCI link 2 changed 0 -> 11
>>> (XEN) HVM1: PCI-ISA link 2 routed to IRQ11
>>> (XEN) irq.c:243: Dom1 PCI link 3 changed 0 -> 5
>>> (XEN) HVM1: PCI-ISA link 3 routed to IRQ5
>>> (XEN) HVM1: pci dev 01:3 INTA->IRQ10
>>> (XEN) HVM1: pci dev 02:0 INTA->IRQ11
>>> (XEN) HVM1: pci dev 03:0 INTA->IRQ5
>>> (XEN) HVM1: pci dev 04:0 INTA->IRQ5
>>> (XEN) HVM1: pci dev 02:0 bar 18 size 10000000: e000000c
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
>>> (XEN) HVM1: pci dev 03:0 bar 14 size 01000000: f0000008
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
>>> (XEN) HVM1: pci dev 02:0 bar 10 size 00400000: f1000004
>>> (XEN) HVM1: pci dev 03:0 bar 10 size 00000100: 0000c001
>>> (XEN) HVM1: pci dev 04:0 bar 10 size 00000100: 0000c101
>>> (XEN) HVM1: pci dev 04:0 bar 14 size 00000100: f1400000
>>> (XEN) HVM1: pci dev 01:1 bar 20 size 00000010: 0000c201
>>> (XEN) HVM1: pci dev 02:0 bar 20 size 00000008: 0000c211
>>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
>>> (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: Passed 1/1 tests
>>> (XEN) HVM1: Writing SMBIOS tables ...
>>> (XEN) HVM1: Loading ROMBIOS ...
>>> (XEN) HVM1: 9788 bytes of ROMBIOS high-memory extensions:
>>> (XEN) HVM1:   Relocating to 0xfc000000-0xfc00263c ... done
>>> (XEN) HVM1: Creating MP tables ...
>>> (XEN) HVM1: No emulated VGA adaptor ...
>>> (XEN) HVM1: Loading PCI Option ROM ...
>>> (XEN) HVM1:  - Manufacturer: http://etherboot.org
>>> (XEN) HVM1:  - Product name: gPXE
>>> (XEN) HVM1: Loading ACPI ...
>>> (XEN) HVM1:  - Lo data: 000ea020-000ea04f
>>> (XEN) HVM1:  - Hi data: fc002800-fc005c9f
>>> (XEN) HVM1: vm86 TSS at fc006000
>>> (XEN) HVM1: BIOS map:
>>> (XEN) HVM1:  c8000-d47ff: Etherboot ROM
>>> (XEN) HVM1:  eb000-eb150: SMBIOS tables
>>> (XEN) HVM1:  f0000-fffff: Main BIOS
>>> (XEN) HVM1: Invoking ROMBIOS ...
>>> (XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>>> (XEN) HVM1: Bochs BIOS - build: 06/23/99
>>> (XEN) HVM1: $Revision: 1.221 $ $Date: 2008/12/07 17:32:29 $
>>> (XEN) HVM1: Options: apmbios pcibios eltorito PMM
>>> (XEN) HVM1:
>>> (XEN) HVM1: ata0-0: PCHS=16383/16/63 translation=lba LCHS=1024/255/63
>>> (XEN) HVM1: ata0 master: QEMU HARDDISK ATA-7 Hard-Disk (8192 MBytes)
>>> (XEN) HVM1: IDE time out
>>> (XEN) HVM1:
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
>>> (XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
>>> (XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
>>> (XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
>>> (XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
>>> (XEN)     root_entry = ffff83017bfb8000
>>> (XEN)     root_entry[0] = 17763a001
>>> (XEN)     context = ffff83017763a000
>>> (XEN)     context[10] = 201_1763c0001
>>> (XEN)     l3 = ffff8301763c0000
>>> (XEN)     l3_index = 1
>>> (XEN)     l3[1] = 12ae77003
>>> (XEN)     l2 = ffff83012ae77000
>>> (XEN)     l2_index = 160
>>> (XEN)     l2[160] = 0
>>> (XEN)     l2[160] not present
>>> (XEN) HVM1:
>>> (XEN) HVM1:
>>> (XEN) HVM1: Press F12 for boot menu.
>>> (XEN) HVM1:
>>> (XEN) HVM1: Booting from Hard Disk...
>>> (XEN) HVM1: Booting from 0000:7c00
>>> (XEN) HVM1: int13_harddisk: function 15, unmapped device for ELDL=81
>>> (XEN) HVM1: *** int 15h function AX=e980, BX=006e not yet supported!
>>> (XEN) irq.c:243: Dom1 PCI link 0 changed 5 -> 0
>>> (XEN) irq.c:243: Dom1 PCI link 1 changed 10 -> 0
>>> (XEN) irq.c:243: Dom1 PCI link 2 changed 11 -> 0
>>> (XEN) irq.c:243: Dom1 PCI link 3 changed 5 -> 0
>>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
>>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
>>> (XEN) domctl.c:910:d0 ioport_map:remove f_gport=c210 f_mport=d220 np=8
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
>>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
>>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=f1000 mfn=d0400 nr_mfns=400
>>> (XEN) domctl.c:845:d0 memory_map:remove: gfn=e0000 mfn=b0000 nr_mfns=10000
>>> (XEN) domctl.c:910:d0 ioport_map:remove f_gport=c210 f_mport=d220 np=8
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=f1000 mfn=d0400 nr_mfns=400
>>> (XEN) domctl.c:835:d0 memory_map:add: gfn=e0000 mfn=b0000 nr_mfns=10000
>>> (XEN) domctl.c:886:d0 ioport_map:add f_gport=c210 f_mport=d220 np=8
>>> (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
>>> (XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
>>> Disabling IRQ #16
>>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>

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

* Re: Experimental results for VGA passthrough
  2009-06-07  3:42         ` Jun Koi
@ 2009-06-08  5:36           ` Beng Heng, Ng
  2009-06-08  8:29             ` Andrew Lyon
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08  5:36 UTC (permalink / raw)
  To: Jun Koi; +Cc: xen-devel

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

Certainly. I tried this on Xen 3.4.1 rc1 pre, changeset 19645. Most of
these stuff are from Jean and his team. Hopefully more people can update
their results.

- Beng Heng

Jun Koi wrote:
> Hi Beng,
> 
> Would you please send the patch you applied on top of Xen to the list?
> I think many people are interested in that.
> 
> Thanks,
> Jun
> 
> 
> 


[-- Attachment #2: patch.20090607212059 --]
[-- Type: text/plain, Size: 83836 bytes --]

diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c	2009-06-07 19:04:11.000000000 -0400
@@ -208,7 +208,7 @@ void pciback_release_pci_dev(struct pcib
 	}
 
 	spin_unlock_irqrestore(&dev_data->lock, flags);
-	pcistub_put_pci_dev(found_dev);
+	pcistub_put_pci_dev(found_dev, 0);
 }
 
 int pciback_init_devices(struct pciback_device *pdev)
@@ -396,7 +396,7 @@ void pciback_release_devices(struct pcib
 		list_for_each_entry_safe(dev_entry, d,
 					 &cntrl_entry->dev_list, list) {
 			list_del(&dev_entry->list);
-			pcistub_put_pci_dev(dev_entry->dev);
+			pcistub_put_pci_dev(dev_entry->dev, 0);
 			kfree(dev_entry);
 		}
 		list_del(&cntrl_entry->list);
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c	2009-06-07 19:04:11.000000000 -0400
@@ -88,7 +88,7 @@ void pciback_release_pci_dev(struct pcib
 	spin_unlock_irqrestore(&dev_data->lock, flags);
 
 	if (found_dev)
-		pcistub_put_pci_dev(found_dev);
+		pcistub_put_pci_dev(found_dev, 1);
 }
 
 int pciback_init_devices(struct pciback_device *pdev)
@@ -157,7 +157,7 @@ void pciback_release_devices(struct pcib
 
 	list_for_each_entry_safe(dev_entry, t, &dev_data->dev_list, list) {
 		list_del(&dev_entry->list);
-		pcistub_put_pci_dev(dev_entry->dev);
+		pcistub_put_pci_dev(dev_entry->dev, 1);
 		kfree(dev_entry);
 	}
 
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h	2009-06-07 19:04:11.000000000 -0400
@@ -25,6 +25,14 @@ struct pci_dev_entry {
 #define _PCIB_op_pending	(1)
 #define PCIB_op_pending		(1<<(_PCIB_op_pending))
 
+#define PCIBACK_TYPE_UNKNOWN       0
+#define PCIBACK_TYPE_PCIe_ENDPOINT 1
+#define PCIBACK_TYPE_PCIe_BRIDGE   2
+#define PCIBACK_TYPE_PCI_BRIDGE    3
+#define PCIBACK_TYPE_PCI           4
+
+#define DEV_CLASS_PCI_PCI_BRIDGE 0x0604
+
 struct pciback_device {
 	void *pci_dev_data;
 	spinlock_t dev_lock;
@@ -48,6 +56,13 @@ struct pciback_dev_data {
 	struct list_head config_fields;
 	int permissive;
 	int warned_on_write;
+	u32 dev_type;
+	int no_flr;
+	int exp_flr_offset;
+	int af_flr_offset;
+	int use_sbr;
+	int use_d3r;
+	u8 *cfg_space; /* saved config space for device */
 };
 
 /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
@@ -56,11 +71,25 @@ struct pci_dev *pcistub_get_pci_dev_by_s
 					    int slot, int func);
 struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
 				    struct pci_dev *dev);
-void pcistub_put_pci_dev(struct pci_dev *dev);
+void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr);
+
+/* Reference/unreference PCI Devices and stubs without changing the state */
+struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev);
+void pcistub_unref_pci_dev(struct pci_dev *dev);
+
+/* Store/reload config space for devices */
+void pciback_store_config_space(struct pci_dev *dev);
+void pciback_reload_config_space(struct pci_dev *dev);
 
 /* Ensure a device is turned off or reset */
 void pciback_reset_device(struct pci_dev *pdev);
 
+/* Do a function level reset (or approximage functionality) for device */
+void pciback_flr_device(struct pci_dev *dev);
+
+/* Helper to classify the device type */
+void pciback_classify_device(struct pci_dev *dev);
+
 /* Access a virtual configuration space for a PCI device */
 int pciback_config_init(void);
 int pciback_config_init_dev(struct pci_dev *dev);
@@ -102,6 +131,10 @@ void pciback_release_devices(struct pcib
 irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
 void pciback_do_op(void *data);
 
+/* Parse and load device specific module parameters */
+int pciback_parse_device_params(const char *device_args, int type,
+					int (*add_func) (int domain, int bus, int slot, int func, int type));
+
 int pciback_xenbus_register(void);
 void pciback_xenbus_unregister(void);
 
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c	2009-06-07 19:04:11.000000000 -0400
@@ -5,20 +5,189 @@
  */
 #include <linux/module.h>
 #include <linux/wait.h>
+#include <linux/delay.h> /* For mdelay function */
 #include <asm/bitops.h>
 #include <xen/evtchn.h>
 #include "pciback.h"
 
+#define PCIBACK_VENDOR_INTEL     0x8086
+#define PCIBACK_CLASS_ID_USB     0x0c03
+#define PCIBACK_CLASS_ID_VGA     0x0300
+#define PCIBACK_USB_FLRCTRL      0x4
+
+#define PCIBACK_IGFX_CAP09_OFFSET    0xa4
+#define PCIBACK_IGFX_CAP13_OFFSET    0xa4
+
+#define PCIBACK_IGFX_MEDIARST        0x0d
+#define PCIBACK_IGFX_MEDIARST_OFFSET 0xc0
+
 int verbose_request = 0;
 module_param(verbose_request, int, 0644);
 
+struct pcistub_sbr_entry {
+	struct list_head dev_list;
+	struct pci_dev *dev;
+};
+
+struct pcistub_sbr_list {
+	struct list_head dev_list;
+	struct pci_dev *bridge;
+	struct pci_dev *dev;
+	int find_all;
+	int err;
+};
+
+/* Used to store the config state so it can be restored after
+ * resets.
+ */
+void pciback_store_config_space(struct pci_dev *dev)
+{
+	struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
+	u32 *ptr = (u32*)dev_data->cfg_space;
+	int i, count = dev->cfg_size/sizeof(u32);
+	
+	for (i = 0; i < count; i += sizeof(u32), ptr++)
+		pci_read_config_dword(dev, i, ptr);
+}
+
+/* Used to reload the config state after resets.
+ */
+void pciback_reload_config_space(struct pci_dev *dev)
+{
+	struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
+	u32 *ptr = (u32*)dev_data->cfg_space;
+	int i, val, count = dev->cfg_size/sizeof(u32);
+
+	for (i = 0; i < count; i += sizeof(u32), ptr++) {
+		pci_read_config_dword(dev, i, &val);
+		if (val != *ptr)
+			pci_write_config_dword(dev, i, *ptr);
+	}
+}
+
+static void pciback_walk_bus_cb(struct pci_dev *dev, void *userdata)
+{
+	struct pcistub_sbr_list *list = (struct pcistub_sbr_list*)userdata;
+	struct pcistub_sbr_entry *entry;
+	struct pci_dev *dev_tmp;
+	
+	if (list->err != 0)
+		return;
+
+	/* For PCIe endpoints we are only looking for co-assigned functions */
+	if (!list->find_all &&
+		(dev->bus->number != list->dev->bus->number ||
+		 PCI_SLOT(dev->devfn) != PCI_SLOT(list->dev->devfn)))
+		return;
+
+	dev_tmp = pcistub_ref_pci_dev(dev);
+	if (dev_tmp == NULL) {
+		/* not controlled by pciback, fail */
+		list->err = ENXIO;
+		return;
+	}
+
+	entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
+	if (entry == NULL) {
+		pcistub_unref_pci_dev(dev_tmp);
+		list->err = ENOMEM;
+		return;
+	}
+
+	entry->dev = dev_tmp;
+	list_add_tail(&entry->dev_list, &list->dev_list);
+}
+
+static void pciback_cleanup_sbr_list(struct pcistub_sbr_list *list)
+{
+	struct pcistub_sbr_entry *entry;
+
+	list_for_each_entry(entry, &list->dev_list, dev_list) {
+		pcistub_unref_pci_dev(entry->dev);
+		kfree(entry);
+	}
+}
+
+/* Routine to find all devices and bridges that need to be reset
+ * during a secondary bus reset. For PCIe this is simply all the
+ * functions on the particular device. For PCI this is all devices
+ * and bridges below the topmost PCI/PCI-X bridge. Note for PCI, 
+ * there is at least one something->PCI/PCI-X bridge to find since
+ * the device is not on the host bus 0 and is on a PCI bus.
+ */
+static int pciback_get_sbr_list(struct pci_dev *dev, 
+	struct pcistub_sbr_list *list, int pcie_endpoint)
+{
+	struct pci_dev *bridge = dev->bus->self;
+	struct pci_dev *last = NULL;
+	int exp_pos;
+	u16 exp_caps = 0;
+
+	list->err = 0;
+	list->dev = dev;
+	INIT_LIST_HEAD(&list->dev_list);
+
+	if (!pcie_endpoint) {
+		while (bridge) {
+			/* Looking for the uppermost PCI/PCI-X bridge. If it is not PCIe then 
+			 * this is a PCI/PCI-X bridge. If it is PCIe then except the PCIe to 
+			 * PCI/PCI-X type 7, the rest of the bridge types are PCIe so the last 
+			 * bridge encountered was the topmost PCI/PCI-X bridge.
+			 */
+			exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
+			if (exp_pos != 0) {
+				pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
+				if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE)
+					break; /* don't want it in the list if it is a PCIe bridge */
+			}
+			last = bridge;
+			bridge = last->bus->self;
+		}
+		list->bridge = last;
+		list->find_all = 1; /* find all devices/bridges below the topmost */
+	}
+	else {
+		if (bridge) {
+			/* For PCIe, SBR logic is limited to PCIe endpoints behind a root/switch
+			 * port.
+			 */
+			exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
+			if (likely(exp_pos != 0)) {
+				pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
+				exp_caps = ((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4);
+				if (exp_caps == PCI_EXP_TYPE_ROOT_PORT ||
+					exp_caps == PCI_EXP_TYPE_UPSTREAM ||
+					exp_caps == PCI_EXP_TYPE_DOWNSTREAM)
+					last = bridge;
+			}
+		}
+		list->bridge = last;
+		list->find_all = 0; /* find just functions on this slot */
+	}
+
+	/* Sanity check, there may not be any appropriate bridge to reset */
+	if (!list->bridge) {
+		dev_dbg(&dev->dev, "No appropriate bridge to reset\n");
+		return ENXIO;
+	}
+
+	pci_walk_bus(list->bridge->subordinate, pciback_walk_bus_cb, list);
+
+	if (list->err) {
+		pciback_cleanup_sbr_list(list);
+		return list->err;
+	}
+
+	return 0;
+}
+
 /* Ensure a device is "turned off" and ready to be exported.
  * (Also see pciback_config_reset to ensure virtual configuration space is
  * ready to be re-exported)
  */
 void pciback_reset_device(struct pci_dev *dev)
 {
-	u16 cmd;
+	u16 cmd = 0;
 
 	/* Disable devices (but not bridges) */
 	if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
@@ -38,6 +207,425 @@ void pciback_reset_device(struct pci_dev
 		}
 	}
 }
+
+/* Do a PCIe type function level reset for a single function on this
+ * device.
+ */
+static void pciback_do_pcie_flr(struct pci_dev *dev, int exp_pos)
+{
+	u16 status = 0;
+	
+	dev_dbg(&dev->dev, "doing PCIe FLR\n");	
+
+	pci_block_user_cfg_access(dev);
+
+	/* Wait for Transaction Pending bit clean */
+	msleep(100);
+	pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
+	if (status & PCI_EXP_DEVSTA_TRPND) {
+		dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
+		ssleep(1);
+		pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
+		if (status & PCI_EXP_DEVSTA_TRPND)
+			dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
+	}
+
+	pci_write_config_word(dev, exp_pos + PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
+	mdelay(200);
+
+	pciback_reload_config_space(dev);
+
+	pci_unblock_user_cfg_access(dev);
+}
+
+/* Do a PCI type function level reset for a single function on this
+ * device. This uses the Advanced Features Capability extensions to
+ * the PCI spec.
+ */
+static void pciback_do_pci_flr(struct pci_dev *dev, int af_pos, int clear_cmd)
+{
+	u8 status = 0;
+
+	dev_dbg(&dev->dev, "doing PCI FLR\n");
+
+	pci_block_user_cfg_access(dev);
+
+	/* Clear the command register to prevent new transactions */
+	if (clear_cmd)
+		pci_write_config_word(dev, PCI_COMMAND, 0);
+
+	/* Wait for Transaction Pending bit clean */
+	msleep(100);
+	pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
+	if (status & PCI_AF_STA_TP) {
+		dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
+		ssleep(1);
+		pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
+		if (status & PCI_AF_STA_TP)
+			dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
+	}
+
+	pci_write_config_byte(dev, af_pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
+	mdelay(200);
+
+	pciback_reload_config_space(dev);
+
+	pci_unblock_user_cfg_access(dev);
+}
+
+/* Vendor specific resets. These can be set in the vendor specific
+ * capabilities structures. Currently only the Intel USB and iGFX
+ * reset is supported.
+ */
+static int pciback_do_vendor_specific_reset(struct pci_dev *dev)
+{
+	struct pci_dev *gmch;
+	int vendor_pos, i;
+	u32 reg32 = 0;
+	u16 device_id, cmd;	
+	u8 reg8 = 0;
+
+	dev_dbg(&dev->dev, "doing vendor specific resets\n");	
+
+	if (dev->vendor != PCIBACK_VENDOR_INTEL)
+		return -ENXIO;
+
+	if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
+		if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0))
+			return -ENXIO;
+
+		/* Locate the GMCH (north bridge) and test for specific Intel devices */
+		gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+		if (!gmch)
+			return -ENXIO;
+
+		device_id = gmch->device;
+		pci_dev_put(gmch);
+
+		if (device_id != PCI_DEVICE_ID_INTEL_GMCHGM45)
+			return -ENXIO;
+
+		/* Correct device and platform, assume vendor specific offset */
+		pci_read_config_dword(dev, PCIBACK_IGFX_CAP09_OFFSET, &reg32);
+		if ((reg32 & 0x000000FF) != PCI_CAP_ID_VNDR ||
+			((reg32 >> 16) & 0x000000FF) != 0x06 ||
+			((reg32 >> 24) & 0x000000F0) != 0x20)
+			return -ENXIO;
+
+		vendor_pos = PCIBACK_IGFX_CAP09_OFFSET;
+	} else if ((dev->class >> 8) == PCIBACK_CLASS_ID_USB) {
+		vendor_pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
+		if (vendor_pos == 0)
+			return -ENXIO;
+	}
+	else
+		return -ENXIO;	
+
+	if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
+		pci_write_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, PCIBACK_IGFX_MEDIARST);
+		for (i = 0; i <= 10; i++) {
+			msleep(100);
+			pci_read_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, &reg8);
+			if ((reg8 & 0x01) == 0)
+				break;
+			if (i == 10) {
+				dev_warn(&dev->dev, "media not reset after 1s; skipping FLR\n");
+				goto out;
+			}
+		}
+        
+		/* This specific reset will hang if the command register does not have
+		 * memory space access enabled */
+		pci_read_config_word(dev, PCI_COMMAND, &cmd);
+		pci_write_config_word(dev, PCI_COMMAND, (cmd | PCI_COMMAND_MEMORY));
+		/* The rest is the same as a PCI AF FLR - use the same routine */
+		pciback_do_pci_flr(dev, vendor_pos, 0);
+		pci_write_config_word(dev, PCI_COMMAND, cmd);
+	} else {
+		pci_block_user_cfg_access(dev);
+
+		pci_write_config_byte(dev, vendor_pos + PCIBACK_USB_FLRCTRL, 1);
+		mdelay(200);
+
+		pciback_reload_config_space(dev);
+
+		pci_unblock_user_cfg_access(dev);
+	}
+
+out:
+	return 0;
+}
+
+/* Use a D0-D3-D0 device state transition to reset the device. This
+ * is a good enough reset for some devices (like NICs).
+ */
+static int pciback_do_dstate_transition_reset(struct pci_dev *dev)
+{
+	int pm_pos;
+	u32 pm_ctl = 0;
+
+	pm_pos = pci_find_capability(dev, PCI_CAP_ID_PM);
+	if (pm_pos == 0)
+		return -ENXIO;
+
+	dev_dbg(&dev->dev, "doing Dstate transition reset\n");	
+
+	/* No_Soft_Reset - When set 1, this bit indicates that devices
+	 * transitioning from D3hot to D0 because of PowerState commands 
+	 * do not perform an internal reset.
+	 */
+	pci_read_config_dword(dev, pm_pos + PCI_PM_CTRL, &pm_ctl);
+	if (pm_ctl & PCI_PM_CTRL_NO_SOFT_RESET)
+		return -ENXIO;
+	
+	pci_block_user_cfg_access(dev);
+
+	pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
+	pm_ctl |= PCI_PM_CTRL_D3HOT;
+	pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
+	mdelay(10);
+
+	pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
+	pm_ctl |= PCI_PM_CTRL_D0;
+	pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
+	mdelay(10);
+
+	pciback_reload_config_space(dev);
+
+	pci_unblock_user_cfg_access(dev);
+	
+	return 0;
+}
+
+/* Do a secondary bus reset on a bridge. This is only done if all
+ * co-assignment rules are satisfied and if it was explicitly 
+ * requested via pciback parameters.
+ */
+static int pciback_do_secondary_bus_reset(struct pci_dev *dev, u32 dev_type)
+{
+	struct pcistub_sbr_list sbr_list;
+	struct pcistub_sbr_entry *entry;
+	u16 pci_bctl = 0;
+	int err = 0;
+
+	/* Call helper to get the device list needed for the device type. */
+	err = pciback_get_sbr_list(dev, &sbr_list,
+			(dev_type == PCIBACK_TYPE_PCIe_ENDPOINT ? 1 : 0));
+	if (err) {
+		dev_warn(&dev->dev, 
+			"secondary bus reset failed for device - all functions need to be co-assigned - err: %d\n", err);
+		return err;
+	}
+
+	pci_block_user_cfg_access(dev);
+
+	/* Reset the secondary bus and restore the PCI space for all the devfn found above.
+	 */
+	pci_read_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, &pci_bctl);
+	pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl | PCI_BRIDGE_CTL_BUS_RESET);
+	msleep(200);
+	pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl);
+	msleep(200);
+	
+	list_for_each_entry(entry, &sbr_list.dev_list, dev_list) {
+		pciback_reload_config_space(entry->dev);
+	}
+	
+	pci_unblock_user_cfg_access(dev);
+
+	pciback_cleanup_sbr_list(&sbr_list);
+
+	return 0;
+}
+
+/* This function is used to do a function level reset on a singe 
+ * device/function. FLRs must be done on devices before they are 
+ * unassigned from one domain and passed through to another. The 
+ * preferred method is to do an actual FLR on the device but the 
+ * functionality may not be present or exposed. In the later case
+ * we attempt to locate the capability even though it is not 
+ * chained into the capabilities list.
+ *
+ * In some cases, there is no way to perform the actual FLR so we 
+ * fall back to some alternate methods (which are not as effective
+ * or useful).
+ */
+void pciback_flr_device(struct pci_dev *dev)
+{
+	struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
+	int err = 0;
+
+	if (dev_data->no_flr) {
+		dev_dbg(&dev->dev, "FLR disabled for device\n");
+		return;
+	}
+	dev_dbg(&dev->dev, "FLR invoked for device\n");
+
+	do {
+		/* First, always try to do an FLR */
+		if (dev_data->dev_type == PCIBACK_TYPE_PCIe_ENDPOINT &&
+			dev_data->exp_flr_offset != 0) {
+			pciback_do_pcie_flr(dev, dev_data->exp_flr_offset);
+			break;
+		}
+		if (dev_data->dev_type == PCIBACK_TYPE_PCI &&
+			dev_data->af_flr_offset != 0) {
+			pciback_do_pci_flr(dev, dev_data->af_flr_offset, 1);
+			break;
+		}
+		
+		/* Next for integrated devices on the host bus 0, try some other methods */
+		if (dev->bus->number == 0) {
+			err = pciback_do_vendor_specific_reset(dev);
+			if (err && dev_data->use_d3r)
+				err = pciback_do_dstate_transition_reset(dev);
+			if (err)
+				dev_warn(&dev->dev, "FLR functionality not supported; "
+						"attempts to use vendor FLR or D-states unsuccessful\n");
+			break;
+		}
+
+		/* Else attempt a secondary bus reset if all conditions are met */
+		if (dev_data->use_sbr) {
+			err = pciback_do_secondary_bus_reset(dev, dev_data->dev_type);
+			if (err)
+				dev_warn(&dev->dev, "FLR functionality not supported; "
+						"attempts to use secondary bus reset unsuccessful;\n");
+			break;
+		}
+
+		err = -ENODEV;		
+	} while (0);
+
+	if (err)
+		dev_warn(&dev->dev, "FLR not performed for device\n");
+}
+
+/* Helper used to location the FLR capabilities for a PCIe device.
+ * When the capability cannot be found in the chain but is present,
+ * special logic is used to attempt to locate functionality.
+ *
+ * returns: the offset to the capability, zero if not found.
+ */
+static int pciback_find_pcie_flr_caps(struct pci_dev *dev)
+{
+	int exp_pos;
+	u32 cap = 0;
+
+	/* First look for the PCIe FLR capabilities using the capabilities list */
+	exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
+	if (exp_pos) {
+		pci_read_config_dword(dev, exp_pos + PCI_EXP_DEVCAP, &cap);
+		if (cap & PCI_EXP_DEVCAP_FLR) {
+			return exp_pos;
+		}
+	}
+
+	return 0;
+}
+
+/* Helper used to location the AF FLR capabilities for a PCI device.
+ * When the capability cannot be found in the chain but is present,
+ * special logic is used to attempt to locate functionality.
+ *
+ * returns: the offset to the capability, zero if not found.
+ */
+static int pciback_find_pci_flr_caps(struct pci_dev *dev)
+{
+	struct pci_dev *gmch;
+	int af_pos;
+	u16 device_id;
+	u8 cap = 0, reg8 = 0;
+
+	/* First look for the PCI AF capabilities for FLR using the capabilities list. This
+	 * is only used on the devices on the root/host bus (integrated devices). 
+	 */
+	if (dev->bus->number != 0)
+		return 0;
+
+	af_pos = pci_find_capability(dev, PCI_CAP_ID_AF);
+	if (af_pos) {
+		pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
+		if (cap & PCI_AF_CAP_FLR) {
+			return af_pos;
+		}
+	}
+
+	/* Next look for the unchained AF capabilities for FLR using specific 
+	 * logic. Currently only the graphics device on the Intel Q45 etc 
+	 * systems has special logic for locating the hidden FLR caps.
+     */
+	do {
+		if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0) ||
+			dev->vendor != PCIBACK_VENDOR_INTEL || (dev->class >> 8) != PCIBACK_CLASS_ID_VGA)
+			break;
+
+		/* Locate the GMCH (north bridge) and test for specific Intel devices */
+		gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+		if (!gmch)
+			break;
+
+		device_id = gmch->device;
+		pci_dev_put(gmch);
+
+		if (device_id != PCI_DEVICE_ID_INTEL_GMCHQ45 &&
+			device_id != PCI_DEVICE_ID_INTEL_GMCHG45 &&
+			device_id != PCI_DEVICE_ID_INTEL_GMCHG41)
+			break;
+		
+		/* Correct device and platform, assume AF offset */
+		af_pos = PCIBACK_IGFX_CAP13_OFFSET;
+		pci_read_config_byte(dev, af_pos + PCI_AF_LENFLD, &reg8);
+		if (reg8 == PCI_AF_LENGTH) {
+			pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
+			if (cap & PCI_AF_CAP_FLR) {
+				return af_pos;
+			}
+		}
+	} while (0);
+
+	/* Else not found */
+	return 0;
+}
+
+/* Classify the device, specifically determine if it is PCIe/PCI 
+ * and whether it is a PCIe endpoint, bridge, or other PCI device. 
+ */
+void pciback_classify_device(struct pci_dev *dev)
+{
+	struct pciback_dev_data *dev_data;
+	int exp_pos;
+	u16 exp_caps = 0;
+
+	dev_data = pci_get_drvdata(dev);
+	dev_data->dev_type = PCIBACK_TYPE_UNKNOWN;
+
+	exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
+	
+	if ((dev->class >> 8) != DEV_CLASS_PCI_PCI_BRIDGE) {
+		if (exp_pos != 0) {
+			dev_data->dev_type = PCIBACK_TYPE_PCIe_ENDPOINT;
+			dev_data->exp_flr_offset = pciback_find_pcie_flr_caps(dev);
+		} else {
+			dev_data->dev_type = PCIBACK_TYPE_PCI;
+			dev_data->af_flr_offset = pciback_find_pci_flr_caps(dev);
+		}
+		goto classify_done;
+	}
+	
+	if (exp_pos == 0) {
+		dev_data->dev_type = PCIBACK_TYPE_PCI_BRIDGE;
+		goto classify_done;
+	}
+
+	pci_read_config_word(dev, exp_pos + PCI_EXP_FLAGS, &exp_caps);
+	dev_data->dev_type = (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) == PCI_EXP_TYPE_PCI_BRIDGE) ? PCIBACK_TYPE_PCI_BRIDGE : PCIBACK_TYPE_PCIe_BRIDGE;
+
+classify_done:
+
+	return;
+}
+
 extern wait_queue_head_t aer_wait_queue;
 extern struct workqueue_struct *pciback_wq;
 /*
@@ -132,3 +720,51 @@ irqreturn_t pciback_handle_event(int irq
 
 	return IRQ_HANDLED;
 }
+
+/* Helper routine used to parse command line parameters passed to the 
+ * pciback module from the boot loader. These params all have the form
+ * of a list of one or more devices, e.g.:
+ * (XXXX:XX:XX.X)(XXXX:XX:XX.X)
+ * Which is: (domain/segment:bus:dev.func)
+ */
+int pciback_parse_device_params(const char *device_args, int type, 
+			int (*add_func) (int domain, int bus, int slot, int func, int type))
+{
+	int pos = 0;
+	int err = 0;
+	int domain, bus, slot, func;
+	int parsed;
+
+	if (device_args && *device_args) {
+		do {
+			parsed = 0;
+
+			err = sscanf(device_args + pos,
+				     " (%x:%x:%x.%x) %n",
+				     &domain, &bus, &slot, &func, &parsed);
+			if (err != 4) {
+				domain = 0;
+				err = sscanf(device_args + pos,
+					     " (%x:%x.%x) %n",
+					     &bus, &slot, &func, &parsed);
+				if (err != 3)
+					goto parse_error;
+			}
+
+			err = add_func(domain, bus, slot, func, type);
+			if (err)
+				goto out;
+
+			/* if parsed<=0, we've reached the end of the string */
+			pos += parsed;
+		} while (parsed > 0 && device_args[pos]);
+	}
+
+out:
+	return err;
+
+parse_error:
+	printk(KERN_ERR "pciback: Error parsing device parameters \"%s\" at \"%s\"\n",
+	       device_args, device_args + pos);
+	return -EINVAL;
+}
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c	2009-06-07 19:04:11.000000000 -0400
@@ -24,10 +24,28 @@ wait_queue_head_t aer_wait_queue;
 * We want to avoid in middle of AER ops, pciback devices is being removed
 */
 static DECLARE_RWSEM(pcistub_sem);
-module_param_named(hide, pci_devs_to_hide, charp, 0444);
+module_param_named(hide, pci_devs_to_hide, charp, S_IRUGO);
+
+static char *pci_devs_use_sbr = NULL;
+module_param_named(sbr, pci_devs_use_sbr, charp, S_IRUGO);
+
+static char *pci_devs_use_d3r = NULL;
+module_param_named(d3r, pci_devs_use_d3r, charp, S_IRUGO);
+
+static char *pci_devs_no_flr = NULL;
+module_param_named(noflr, pci_devs_no_flr, charp, S_IRUGO);
+
+/* Device id list holding different device type listings
+ * for hiding devices and reset logic.
+ */
+#define PCIBACK_ID_TYPE_HIDE  1
+#define PCIBACK_ID_TYPE_SBR   2
+#define PCIBACK_ID_TYPE_D3R   3
+#define PCIBACK_ID_TYPE_NOFLR 4
 
 struct pcistub_device_id {
 	struct list_head slot_list;
+	int type;
 	int domain;
 	unsigned char bus;
 	unsigned int devfn;
@@ -56,6 +74,8 @@ static LIST_HEAD(pcistub_devices);
 static int initialize_devices = 0;
 static LIST_HEAD(seized_devices);
 
+static int disable_all_flr = 0;
+
 static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
 {
 	struct pcistub_device *psdev;
@@ -78,6 +98,23 @@ static struct pcistub_device *pcistub_de
 	return psdev;
 }
 
+static struct pciback_dev_data *pcistub_dev_data_alloc(struct pci_dev *dev)
+{
+	struct pciback_dev_data *dev_data;
+
+	dev_dbg(&dev->dev, "pcistub_dev_data_alloc\n");
+
+	dev_data = kzalloc(sizeof(*dev_data) + dev->cfg_size, GFP_ATOMIC);
+	if (!dev_data)
+		return NULL;
+		
+	pci_set_drvdata(dev, dev_data);
+
+	dev_data->cfg_space = (u8*)(dev_data) + sizeof(*dev_data);
+
+	return dev_data;
+}
+
 /* Don't call this directly as it's called by pcistub_device_put */
 static void pcistub_device_release(struct kref *kref)
 {
@@ -200,7 +237,7 @@ struct pci_dev *pcistub_get_pci_dev(stru
 	return found_dev;
 }
 
-void pcistub_put_pci_dev(struct pci_dev *dev)
+void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr)
 {
 	struct pcistub_device *psdev, *found_psdev = NULL;
 	unsigned long flags;
@@ -220,6 +257,13 @@ void pcistub_put_pci_dev(struct pci_dev 
 	* pcistub and pciback when AER is in processing
 	*/
 	down_write(&pcistub_sem);
+
+	/* For pass-through devices, do an FLR (or approximate) for the device
+	 * before it is put back and ready for the next domain
+	 */
+	if (!disable_all_flr && do_flr)
+		pciback_flr_device(dev);
+
 	/* Cleanup our device
 	 * (so it's ready for the next domain)
 	 */
@@ -235,6 +279,43 @@ void pcistub_put_pci_dev(struct pci_dev 
 	up_write(&pcistub_sem);
 }
 
+struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev)
+{
+	struct pcistub_device *psdev;
+	struct pci_dev *found_dev = NULL;
+	unsigned long flags;
+
+	spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+	list_for_each_entry(psdev, &pcistub_devices, dev_list) {
+		if (psdev->dev == dev) {
+			pcistub_device_get(psdev); /* just a ref count */
+			found_dev = psdev->dev;
+			break;
+		}
+	}
+
+	spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+	return found_dev;
+}
+
+void pcistub_unref_pci_dev(struct pci_dev *dev)
+{
+	struct pcistub_device *psdev;
+	unsigned long flags;
+
+	spin_lock_irqsave(&pcistub_devices_lock, flags);
+
+	list_for_each_entry(psdev, &pcistub_devices, dev_list) {
+		if (psdev->dev == dev) {
+			pcistub_device_get(psdev); /* just an unref count */
+			break;
+		}
+	}
+
+	spin_unlock_irqrestore(&pcistub_devices_lock, flags);
+}
+
 static int __devinit pcistub_match_one(struct pci_dev *dev,
 				       struct pcistub_device_id *pdev_id)
 {
@@ -255,7 +336,7 @@ static int __devinit pcistub_match_one(s
 	return 0;
 }
 
-static int __devinit pcistub_match(struct pci_dev *dev)
+static int __devinit pcistub_match(struct pci_dev *dev, int type)
 {
 	struct pcistub_device_id *pdev_id;
 	unsigned long flags;
@@ -263,6 +344,8 @@ static int __devinit pcistub_match(struc
 
 	spin_lock_irqsave(&device_ids_lock, flags);
 	list_for_each_entry(pdev_id, &pcistub_device_ids, slot_list) {
+		if (pdev_id->type != type)
+			continue;
 		if (pcistub_match_one(dev, pdev_id)) {
 			found = 1;
 			break;
@@ -285,12 +368,11 @@ static int __devinit pcistub_init_device
 	 * would need to be called somewhere to free the memory allocated
 	 * here and then to call kfree(pci_get_drvdata(psdev->dev)).
 	 */
-	dev_data = kzalloc(sizeof(*dev_data), GFP_ATOMIC);
+	dev_data = pcistub_dev_data_alloc(dev);
 	if (!dev_data) {
 		err = -ENOMEM;
 		goto out;
 	}
-	pci_set_drvdata(dev, dev_data);
 
 	dev_dbg(&dev->dev, "initializing config\n");
 
@@ -317,6 +399,22 @@ static int __devinit pcistub_init_device
 	dev_dbg(&dev->dev, "reset device\n");
 	pciback_reset_device(dev);
 
+	/* Classify the device so we know if it is PCI/PCIe and if it is
+	 * a bridge - this information is used for FLR logic. Also store 
+	 * values if SBR/D3R reset logic was requested.
+	 */
+	pciback_classify_device(dev);
+	dev_data->no_flr = pcistub_match(dev, PCIBACK_ID_TYPE_NOFLR);
+	if (!dev_data->no_flr) {
+		dev_data->use_sbr = pcistub_match(dev, PCIBACK_ID_TYPE_SBR);
+		dev_data->use_d3r = pcistub_match(dev, PCIBACK_ID_TYPE_D3R);
+	}
+
+	/* Store the config space here where the device is off and ready to be 
+	 * exported before any FLRs or other resets are done
+	 */
+	pciback_store_config_space(dev);
+
 	return 0;
 
       config_release:
@@ -414,7 +512,7 @@ static int __devinit pcistub_probe(struc
 
 	dev_dbg(&dev->dev, "probing...\n");
 
-	if (pcistub_match(dev)) {
+	if (pcistub_match(dev, PCIBACK_ID_TYPE_HIDE)) {
 
 		if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL
 		    && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
@@ -851,7 +949,7 @@ static inline int str_to_quirk(const cha
 	return -EINVAL;
 }
 
-static int pcistub_device_id_add(int domain, int bus, int slot, int func)
+static int pcistub_device_id_add(int domain, int bus, int slot, int func, int type)
 {
 	struct pcistub_device_id *pci_dev_id;
 	unsigned long flags;
@@ -860,12 +958,13 @@ static int pcistub_device_id_add(int dom
 	if (!pci_dev_id)
 		return -ENOMEM;
 
+	pci_dev_id->type = type;
 	pci_dev_id->domain = domain;
 	pci_dev_id->bus = bus;
 	pci_dev_id->devfn = PCI_DEVFN(slot, func);
 
-	pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
-		 domain, bus, slot, func);
+	pr_debug("pciback: adding device ID type: %d for %04x:%02x:%02x.%01x\n",
+		 type, domain, bus, slot, func);
 
 	spin_lock_irqsave(&device_ids_lock, flags);
 	list_add_tail(&pci_dev_id->slot_list, &pcistub_device_ids);
@@ -874,7 +973,7 @@ static int pcistub_device_id_add(int dom
 	return 0;
 }
 
-static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
+static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
 {
 	struct pcistub_device_id *pci_dev_id, *t;
 	int devfn = PCI_DEVFN(slot, func);
@@ -884,7 +983,7 @@ static int pcistub_device_id_remove(int 
 	spin_lock_irqsave(&device_ids_lock, flags);
 	list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
 
-		if (pci_dev_id->domain == domain
+		if (pci_dev_id->type == type && pci_dev_id->domain == domain
 		    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
 			/* Don't break; here because it's possible the same
 			 * slot could be in the list more than once
@@ -939,6 +1038,32 @@ static int pcistub_reg_add(int domain, i
 	return err;
 }
 
+static int pcistub_device_do_flr(int domain, int bus, int slot, int func)
+{
+	int err = 0;
+	struct pcistub_device *psdev;
+	struct pci_dev *dev;
+
+	psdev = pcistub_device_find(domain, bus, slot, func);
+	if (!psdev || !psdev->dev) {
+		err = -ENODEV;
+		goto out;
+	}
+	dev = psdev->dev;
+
+	/* Do an FLR (or approximate) for the device on demand and 
+	 * reload config
+	 */
+	if (!disable_all_flr) {
+		pciback_flr_device(dev);
+	}
+	else
+		dev_dbg(&dev->dev, "FLR disabled for all devices\n");
+
+out:
+	return err;
+}
+
 static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
 				size_t count)
 {
@@ -949,7 +1074,7 @@ static ssize_t pcistub_slot_add(struct d
 	if (err)
 		goto out;
 
-	err = pcistub_device_id_add(domain, bus, slot, func);
+	err = pcistub_device_id_add(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
 
       out:
 	if (!err)
@@ -969,7 +1094,7 @@ static ssize_t pcistub_slot_remove(struc
 	if (err)
 		goto out;
 
-	err = pcistub_device_id_remove(domain, bus, slot, func);
+	err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
 
       out:
 	if (!err)
@@ -987,6 +1112,10 @@ static ssize_t pcistub_slot_show(struct 
 
 	spin_lock_irqsave(&device_ids_lock, flags);
 	list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
+		/* only want devices set for hide, not reset entries */
+		if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
+			continue;
+
 		if (count >= PAGE_SIZE)
 			break;
 
@@ -1068,7 +1197,7 @@ static ssize_t pcistub_quirk_show(struct
 
 DRIVER_ATTR(quirks, S_IRUSR | S_IWUSR, pcistub_quirk_show, pcistub_quirk_add);
 
-static ssize_t permissive_add(struct device_driver *drv, const char *buf,
+static ssize_t pcistub_permissive_add(struct device_driver *drv, const char *buf,
 			      size_t count)
 {
 	int domain, bus, slot, func;
@@ -1109,7 +1238,7 @@ static ssize_t permissive_add(struct dev
 	return err;
 }
 
-static ssize_t permissive_show(struct device_driver *drv, char *buf)
+static ssize_t pcistub_permissive_show(struct device_driver *drv, char *buf)
 {
 	struct pcistub_device *psdev;
 	struct pciback_dev_data *dev_data;
@@ -1132,7 +1261,68 @@ static ssize_t permissive_show(struct de
 	return count;
 }
 
-DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add);
+DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, pcistub_permissive_show, pcistub_permissive_add);
+
+static ssize_t pcistub_do_flr(struct device_driver *drv, const char *buf,
+				   size_t count)
+{
+	int domain, bus, slot, func;
+	int err;
+
+	err = str_to_slot(buf, &domain, &bus, &slot, &func);
+	if (err)
+		goto out;
+
+	err = pcistub_device_do_flr(domain, bus, slot, func);
+
+out:
+	if (!err)
+		err = count;
+	return err;
+}
+
+DRIVER_ATTR(do_flr, S_IWUSR, NULL, pcistub_do_flr);
+
+static ssize_t pcistub_resets(struct device_driver *drv, const char *buf,
+				   size_t count)
+{
+	int domain, bus, slot, func;
+	int type, err = 0;
+
+	/* string begins with reset type specifier sbr=|dr3=|noflr= */
+	if (!strncmp(buf, "sbr=", 4)) {
+		type = PCIBACK_ID_TYPE_SBR;
+		buf += 4;
+	} else if (!strncmp(buf, "d3r=", 4)) {
+		type = PCIBACK_ID_TYPE_D3R;
+		buf += 4;
+	} else if (!strncmp(buf, "noflr=", 6)) {
+		type = PCIBACK_ID_TYPE_NOFLR;
+		buf += 6;
+	} else {
+		err = -EINVAL;
+		goto out;
+	}
+
+	/* check special wildcard noflr */
+	if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "(*)", 3)) {
+		disable_all_flr = 1;
+		goto out;
+	}
+
+	err = str_to_slot(buf, &domain, &bus, &slot, &func);
+	if (err)
+		goto out;
+
+	err = pcistub_device_id_add(domain, bus, slot, func, type);
+
+out:
+	if (!err)
+		err = count;
+	return err;
+}
+
+DRIVER_ATTR(resets, S_IWUSR, NULL, pcistub_resets);
 
 #ifdef CONFIG_PCI_MSI
 
@@ -1158,6 +1348,8 @@ static void pcistub_exit(void)
 	driver_remove_file(&pciback_pci_driver.driver, &driver_attr_slots);
 	driver_remove_file(&pciback_pci_driver.driver, &driver_attr_quirks);
 	driver_remove_file(&pciback_pci_driver.driver, &driver_attr_permissive);
+	driver_remove_file(&pciback_pci_driver.driver, &driver_attr_do_flr);
+	driver_remove_file(&pciback_pci_driver.driver, &driver_attr_resets);
 
 	pci_unregister_driver(&pciback_pci_driver);
 	WARN_ON(unregister_msi_get_owner(pciback_get_owner));
@@ -1165,35 +1357,27 @@ static void pcistub_exit(void)
 
 static int __init pcistub_init(void)
 {
-	int pos = 0;
 	int err = 0;
-	int domain, bus, slot, func;
-	int parsed;
 
-	if (pci_devs_to_hide && *pci_devs_to_hide) {
-		do {
-			parsed = 0;
-
-			err = sscanf(pci_devs_to_hide + pos,
-				     " (%x:%x:%x.%x) %n",
-				     &domain, &bus, &slot, &func, &parsed);
-			if (err != 4) {
-				domain = 0;
-				err = sscanf(pci_devs_to_hide + pos,
-					     " (%x:%x.%x) %n",
-					     &bus, &slot, &func, &parsed);
-				if (err != 3)
-					goto parse_error;
-			}
+	/* Parse device lists for hide, sbr, and d3r */
+	err = pciback_parse_device_params(pci_devs_to_hide, PCIBACK_ID_TYPE_HIDE, pcistub_device_id_add);
+	if (err)
+		goto out;
 
-			err = pcistub_device_id_add(domain, bus, slot, func);
-			if (err)
-				goto out;
+	err = pciback_parse_device_params(pci_devs_use_sbr, PCIBACK_ID_TYPE_SBR, pcistub_device_id_add);
+	if (err)
+		goto out;
 
-			/* if parsed<=0, we've reached the end of the string */
-			pos += parsed;
-		} while (parsed > 0 && pci_devs_to_hide[pos]);
-	}
+	err = pciback_parse_device_params(pci_devs_use_d3r, PCIBACK_ID_TYPE_D3R, pcistub_device_id_add);
+	if (err)
+		goto out;
+
+	if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "(*)", 3))
+		disable_all_flr = 1; /* check special wildcard noflr */
+	else
+		err = pciback_parse_device_params(pci_devs_no_flr, PCIBACK_ID_TYPE_NOFLR, pcistub_device_id_add);
+	if (err)
+		goto out;
 
 	/* If we're the first PCI Device Driver to register, we're the
 	 * first one to get offered PCI devices as they become
@@ -1217,6 +1401,12 @@ static int __init pcistub_init(void)
 	if (!err)
 		err = driver_create_file(&pciback_pci_driver.driver,
 					 &driver_attr_permissive);
+	if (!err)
+		err = driver_create_file(&pciback_pci_driver.driver,
+					 &driver_attr_do_flr);
+	if (!err)
+		err = driver_create_file(&pciback_pci_driver.driver,
+					 &driver_attr_resets);
 
 	if (!err)
 		err = register_msi_get_owner(pciback_get_owner);
@@ -1225,11 +1415,6 @@ static int __init pcistub_init(void)
 
       out:
 	return err;
-
-      parse_error:
-	printk(KERN_ERR "pciback: Error parsing pci_devs_to_hide at \"%s\"\n",
-	       pci_devs_to_hide + pos);
-	return -EINVAL;
 }
 
 #ifndef MODULE
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c	2009-06-07 19:04:11.000000000 -0400
@@ -109,7 +109,7 @@ void pciback_release_pci_dev(struct pcib
 	spin_unlock_irqrestore(&slot_dev->lock, flags);
 
 	if (found_dev)
-		pcistub_put_pci_dev(found_dev);
+		pcistub_put_pci_dev(found_dev, 0);
 }
 
 int pciback_init_devices(struct pciback_device *pdev)
@@ -149,7 +149,7 @@ void pciback_release_devices(struct pcib
 		for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
 			dev = slot_dev->slots[bus][slot];
 			if (dev != NULL)
-				pcistub_put_pci_dev(dev);
+				pcistub_put_pci_dev(dev, 0);
 		}
 
 	kfree(slot_dev);
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c
--- a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c	2009-06-07 20:48:21.000000000 -0400
+++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c	2009-06-07 19:04:11.000000000 -0400
@@ -162,7 +162,7 @@ void pciback_release_pci_dev(struct pcib
 	spin_unlock_irqrestore(&vpci_dev->lock, flags);
 
 	if (found_dev)
-		pcistub_put_pci_dev(found_dev);
+		pcistub_put_pci_dev(found_dev, 0);
 }
 
 int pciback_init_devices(struct pciback_device *pdev)
@@ -202,7 +202,7 @@ void pciback_release_devices(struct pcib
 		list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
 					 list) {
 			list_del(&e->list);
-			pcistub_put_pci_dev(e->dev);
+			pcistub_put_pci_dev(e->dev, 0);
 			kfree(e);
 		}
 	}
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_ids.h b/linux-2.6.18-xen.hg/include/linux/pci_ids.h
--- a/linux-2.6.18-xen.hg/include/linux/pci_ids.h	2009-06-07 20:48:23.000000000 -0400
+++ b/linux-2.6.18-xen.hg/include/linux/pci_ids.h	2009-06-07 19:04:11.000000000 -0400
@@ -2259,6 +2259,14 @@
 #define PCI_DEVICE_ID_INTEL_IXP2800	0x9004
 #define PCI_DEVICE_ID_INTEL_S21152BB	0xb152
 
+#define PCI_DEVICE_ID_INTEL_GMCHQ45 0x2e10
+#define PCI_DEVICE_ID_INTEL_GMCHG45 0x2e20
+#define PCI_DEVICE_ID_INTEL_MCHP45  0x2e20
+#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
+#define PCI_DEVICE_ID_INTEL_GMCHGM45 0x2a40
+
+#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
+
 #define PCI_VENDOR_ID_SCALEMP		0x8686
 #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL	0x1010
 
diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_regs.h b/linux-2.6.18-xen.hg/include/linux/pci_regs.h
--- a/linux-2.6.18-xen.hg/include/linux/pci_regs.h	2009-06-07 20:48:23.000000000 -0400
+++ b/linux-2.6.18-xen.hg/include/linux/pci_regs.h	2009-06-07 19:04:11.000000000 -0400
@@ -201,6 +201,7 @@
 #define  PCI_CAP_ID_SHPC 	0x0C	/* PCI Standard Hot-Plug Controller */
 #define  PCI_CAP_ID_EXP 	0x10	/* PCI Express */
 #define  PCI_CAP_ID_MSIX	0x11	/* MSI-X */
+#define  PCI_CAP_ID_AF      0x13    /* Advanced Features Capability */
 #define PCI_CAP_LIST_NEXT	1	/* Next capability in the list */
 #define PCI_CAP_FLAGS		2	/* Capability defined flags (16 bits) */
 #define PCI_CAP_SIZEOF		4
@@ -229,6 +230,11 @@
 #define  PCI_PM_CTRL_DATA_SEL_MASK	0x1e00	/* Data select (??) */
 #define  PCI_PM_CTRL_DATA_SCALE_MASK	0x6000	/* Data scale (??) */
 #define  PCI_PM_CTRL_PME_STATUS	0x8000	/* PME pin status */
+#define  PCI_PM_CTRL_DATA_DSTATE_MASK 0x3	/* D0 - D3 */
+#define  PCI_PM_CTRL_D0 0x0
+#define  PCI_PM_CTRL_D1 0x1
+#define  PCI_PM_CTRL_D2 0x2
+#define  PCI_PM_CTRL_D3HOT 0x3
 #define PCI_PM_PPB_EXTENSIONS	6	/* PPB support extensions (??) */
 #define  PCI_PM_PPB_B2_B3	0x40	/* Stop clock when in D3hot (??) */
 #define  PCI_PM_BPCC_ENABLE	0x80	/* Bus power/clock control enable (??) */
@@ -346,6 +352,7 @@
 #define  PCI_EXP_DEVCAP_PWR_IND	0x4000	/* Power Indicator Present */
 #define  PCI_EXP_DEVCAP_PWR_VAL	0x3fc0000 /* Slot Power Limit Value */
 #define  PCI_EXP_DEVCAP_PWR_SCL	0xc000000 /* Slot Power Limit Scale */
+#define  PCI_EXP_DEVCAP_FLR     0x10000000 /* Function Level Reset */
 #define PCI_EXP_DEVCTL		8	/* Device Control */
 #define  PCI_EXP_DEVCTL_CERE	0x0001	/* Correctable Error Reporting En. */
 #define  PCI_EXP_DEVCTL_NFERE	0x0002	/* Non-Fatal Error Reporting Enable */
@@ -358,6 +365,7 @@
 #define  PCI_EXP_DEVCTL_AUX_PME	0x0400	/* Auxiliary Power PM Enable */
 #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
 #define  PCI_EXP_DEVCTL_READRQ	0x7000	/* Max_Read_Request_Size */
+#define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
 #define PCI_EXP_DEVSTA		10	/* Device Status */
 #define  PCI_EXP_DEVSTA_CED	0x01	/* Correctable Error Detected */
 #define  PCI_EXP_DEVSTA_NFED	0x02	/* Non-Fatal Error Detected */
@@ -482,6 +490,17 @@
 #define  PCI_ARI_CTRL_ACS	0x0002	/* ACS Function Groups Enable */
 #define  PCI_ARI_CTRL_FG(x)	(((x) >> 4) & 7) /* Function Group */
 
+/* Advanced Features Capability */
+#define PCI_AF_LENFLD    0x02 /* Device length offset */
+#define  PCI_AF_LENGTH   0x06
+#define PCI_AF_DEVCAP    0x03 /* Device capabilities offset */
+#define  PCI_AF_CAP_TP   0x01
+#define  PCI_AF_CAP_FLR  0x02
+#define PCI_AF_CTRL      0x04 /* Device CTRL offset */
+#define  PCI_AF_CTRL_FLR 0x01
+#define PCI_AF_STA       0x05 /* Device STATUS offset */
+#define  PCI_AF_STA_TP   0x01
+ 
 /* Single Root I/O Virtualization */
 #define PCI_SRIOV_CAP		0x04	/* SR-IOV Capabilities */
 #define  PCI_SRIOV_CAP_VFM	0x01	/* VF Migration Capable */
diff -rupN --ignore-blank-lines-X diffignore a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/firmware/hvmloader/hvmloader.c	2009-06-07 19:04:11.000000000 -0400
@@ -673,6 +673,7 @@ int main(void)
         break;
     default:
         printf("No emulated VGA adaptor ...\n");
+        vgabios_sz = round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
         break;
     }
 
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/console.h b/tools/ioemu-remote/console.h
--- a/tools/ioemu-remote/console.h	2009-06-07 21:14:47.000000000 -0400
+++ b/tools/ioemu-remote/console.h	2009-06-07 19:04:11.000000000 -0400
@@ -290,6 +290,9 @@ void vga_hw_update(void);
 void vga_hw_invalidate(void);
 void vga_hw_screen_dump(const char *filename);
 
+void unset_vga_acc(void);
+void set_vga_acc(void);
+
 int is_graphic_console(void);
 int is_fixedsize_console(void);
 CharDriverState *text_console_init(const char *p);
@@ -341,4 +344,9 @@ const char *readline_get_history(unsigne
 void readline_start(const char *prompt, int is_password,
                     ReadLineFunc *readline_func, void *opaque);
 
+/* intel.c */
+int intel_enter(void);
+int intel_leave(void);
+void intel_display_init(DisplayState *ds);
+
 #endif
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pass-through.c b/tools/ioemu-remote/hw/pass-through.c
--- a/tools/ioemu-remote/hw/pass-through.c	2009-06-07 21:14:48.000000000 -0400
+++ b/tools/ioemu-remote/hw/pass-through.c	2009-06-07 19:04:11.000000000 -0400
@@ -90,6 +90,8 @@
 #include "qemu-xen.h"
 #include <unistd.h>
 
+extern int vga_passthrough;
+
 struct php_dev {
     struct pt_dev *pt_dev;
     uint8_t valid;
@@ -1573,10 +1575,11 @@ static int pt_dev_is_virtfn(struct pci_d
 
 static int pt_register_regions(struct pt_dev *assigned_device)
 {
-    int i = 0;
+    int i = 0, ret = 0;
     uint32_t bar_data = 0;
     struct pci_dev *pci_dev = assigned_device->pci_dev;
     PCIDevice *d = &assigned_device->dev;
+    uint16_t class, vendor_id;
 
     /* Register PIO/MMIO BARs */
     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
@@ -1632,6 +1635,25 @@ static int pt_register_regions(struct pt
             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
     }
 
+    /* Map legacy ioport and iomem, for specific devices */
+    vendor_id = pci_read_word(pci_dev, 0x00);
+    class = pci_read_word(pci_dev, 0x0a);
+
+    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
+    if ( vga_passthrough && class == 0x0300 )
+    {
+        PT_LOG("add an intel graphic card\n");
+
+        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_ADD_MAPPING);
+        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_ADD_MAPPING);
+        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_ADD_MAPPING);
+        if ( ret != 0 )
+        {
+            PT_LOG("legacy mapping failed!\n");
+            return ret;
+        }
+    }
+
     return 0;
 }
 
@@ -1640,6 +1662,7 @@ static void pt_unregister_regions(struct
     int i, type, ret;
     uint32_t e_size;
     PCIDevice *d = (PCIDevice*)assigned_device;
+    uint16_t class, vendor_id;
 
     for ( i = 0; i < PCI_NUM_REGIONS; i++ )
     {
@@ -1681,6 +1704,24 @@ static void pt_unregister_regions(struct
 
     }
 
+    /* unmap legacy ioport and iomem, for specific devices */
+    vendor_id = pci_read_word(assigned_device->pci_dev, 0x00);
+    class = pci_read_word(assigned_device->pci_dev, 0x0a);
+    
+    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
+    if ( vga_passthrough && class == 0x0300 )
+    {
+        PT_LOG("remove an intel graphic card\n");
+
+        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_REMOVE_MAPPING);
+        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_REMOVE_MAPPING);
+        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_REMOVE_MAPPING);
+        if ( ret != 0 )
+        {
+            PT_LOG("legacy unmapping failed !\n");
+        }
+    }
+
 }
 
 static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
@@ -3759,7 +3800,7 @@ static struct pt_dev * register_real_dev
     struct pci_config_cf8 machine_bdf;
     char *key, *val;
     int msi_translate, power_mgmt;
-
+    
     PT_LOG("Assigning real physical device %02x:%02x.%x ...\n",
         r_bus, r_dev, r_func);
 
@@ -3931,7 +3972,7 @@ static struct pt_dev * register_real_dev
     }
 
 out:
-    PT_LOG("Real physical device %02x:%02x.%x registered successfuly!\n"
+    PT_LOG("Real physical device %02x:%02x.%x registered successfully!\n"
            "IRQ type = %s\n", r_bus, r_dev, r_func,
            assigned_device->msi_trans_en? "MSI-INTx":"INTx");
 
@@ -4113,3 +4154,47 @@ err:
     return status;
 }
 
+u8 pt_pci_host_read_byte(int bus, int dev, int fn, u32 addr)
+{
+    struct pci_dev *pci_dev;
+    u8             val;
+
+    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
+    if (!pci_dev)
+        return 0;
+
+    val = pci_read_byte(pci_dev, addr);
+    pci_free_dev(pci_dev);
+
+    return val;
+}
+
+u16 pt_pci_host_read_word(int bus, int dev, int fn, u32 addr)
+{
+    struct pci_dev *pci_dev;
+    u16             val;
+
+    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
+    if (!pci_dev)
+        return 0;
+
+    val = pci_read_word(pci_dev, addr);
+    pci_free_dev(pci_dev);
+
+    return val;
+}
+
+u32 pt_pci_host_read_long(int bus, int dev, int fn, u32 addr)
+{
+    struct pci_dev *pci_dev;
+    u32             val;
+
+    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
+    if (!pci_dev)
+        return 0;
+
+    val = pci_read_long(pci_dev, addr);
+    pci_free_dev(pci_dev);
+
+    return val;
+}
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pc.c b/tools/ioemu-remote/hw/pc.c
--- a/tools/ioemu-remote/hw/pc.c	2009-06-07 21:14:47.000000000 -0400
+++ b/tools/ioemu-remote/hw/pc.c	2009-06-07 19:04:11.000000000 -0400
@@ -65,6 +65,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
 extern uint8_t *acpi_tables;
 extern size_t acpi_tables_len;
 
+extern int vga_passthrough;
+
 static fdctrl_t *floppy_controller;
 static RTCState *rtc_state;
 static PITState *pit;
@@ -984,6 +986,7 @@ vga_bios_error:
 
     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
 
+    if (!vga_passthrough) {
     if (cirrus_vga_enabled) {
         if (pci_enabled) {
             pci_cirrus_vga_init(pci_bus,
@@ -1010,6 +1013,7 @@ vga_bios_error:
                          vga_ram_addr, vga_ram_size);
         }
     }
+    }
 
 #ifdef CONFIG_PASSTHROUGH
     /* Pass-through Initialization
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pci.c b/tools/ioemu-remote/hw/pci.c
--- a/tools/ioemu-remote/hw/pci.c	2009-06-07 21:14:47.000000000 -0400
+++ b/tools/ioemu-remote/hw/pci.c	2009-06-07 19:04:11.000000000 -0400
@@ -28,11 +28,14 @@
 #include "virtio-net.h"
 #include "sysemu.h"
 
+#include "pass-through.h"
 #include "exec-all.h"
 #include "qemu-xen.h"
 
 //#define DEBUG_PCI
 
+extern int vga_passthrough;
+
 struct PCIBus {
     int bus_num;
     int devfn_min;
@@ -611,7 +614,24 @@ uint32_t pci_data_read(void *opaque, uin
         goto the_end;
     }
     config_addr = addr & 0xff;
-    val = pci_dev->config_read(pci_dev, config_addr, len);
+    if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
+    {
+        val = pci_dev->config_read(pci_dev, config_addr, len);
+
+        if (config_addr == 0x52) // GMCH
+            val = pt_pci_host_read_word(0, 0, 0, 0x52);
+        if (config_addr == 0x02) // Device ID
+        {
+            if (len == 2)
+                val = pt_pci_host_read_word(0, 0, 0, 0x00);
+            else if (len == 4)
+                val = pt_pci_host_read_long(0, 0, 0, 0x00);
+        }
+    } else if (vga_passthrough && pci_dev->devfn == 0x10 && // intel graphic card
+               config_addr == 0xfc) // OpRegion address
+        val = 0; // force to fall back to SMI mode
+    else
+        val = pci_dev->config_read(pci_dev, config_addr, len);
 #if defined(DEBUG_PCI)
     printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",
            pci_dev->name, config_addr, val, len);
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/vga.c b/tools/ioemu-remote/hw/vga.c
--- a/tools/ioemu-remote/hw/vga.c	2009-06-07 21:14:47.000000000 -0400
+++ b/tools/ioemu-remote/hw/vga.c	2009-06-07 19:04:11.000000000 -0400
@@ -34,9 +34,9 @@
 
 #include "qemu-timer.h"
 
-//#define DEBUG_VGA
-//#define DEBUG_VGA_MEM
-//#define DEBUG_VGA_REG
+#define DEBUG_VGA
+#define DEBUG_VGA_MEM
+#define DEBUG_VGA_REG
 
 //#define DEBUG_BOCHS_VBE
 
@@ -161,6 +161,18 @@ static uint8_t expand4to8[16];
 static void vga_bios_init(VGAState *s);
 static void vga_screen_dump(void *opaque, const char *filename);
 
+static VGAState *xen_vga_state;
+
+void set_vga_acc(void)
+{
+    set_vram_mapping(xen_vga_state, xen_vga_state->lfb_addr, xen_vga_state->lfb_end);
+}
+
+void unset_vga_acc(void)
+{
+    unset_vram_mapping(xen_vga_state);
+}
+
 static void vga_dumb_update_retrace_info(VGAState *s)
 {
     (void) s;
@@ -2473,8 +2485,6 @@ static void vga_bios_init(VGAState *s)
 }
 
 
-static VGAState *xen_vga_state;
-
 /* Allocate video memory in the GPFN space */
 void xen_vga_populate_vram(uint64_t vram_addr, uint32_t vga_ram_size)
 {
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/intel.c b/tools/ioemu-remote/intel.c
--- a/tools/ioemu-remote/intel.c	1969-12-31 19:00:00.000000000 -0500
+++ b/tools/ioemu-remote/intel.c	2009-06-07 19:04:11.000000000 -0400
@@ -0,0 +1,494 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+#include <signal.h>
+#include <pci/pci.h>
+
+#include "qemu-common.h"
+#include "console.h"
+#include "sysemu.h"
+
+#define INTEL_DEBUG(format, args...)                                    \
+    fprintf (stderr, "intel.c:%d:%s " format , __LINE__, __func__, ## args)
+
+#define TileW           128
+#define TileH           8
+
+#define REG_DR_DSPASURF		0x7019C
+#define REG_DR_DSPACNTR		0x70180
+#define REG_DR_DSPASTRIDE	0x70188
+#define REG_DR_PIPEACONF	0x70008
+
+#define REG_DR_DSPBSURF		0x7119C
+#define REG_DR_DSPBCNTR		0x71180
+#define REG_DR_DSPBSTRIDE	0x71188
+#define REG_DR_PIPEBCONF	0x71008
+
+#define REG_DE_PIPEASRC		0x6001c
+
+extern int                      vga_passthrough;
+uint32_t                        guest_framebuffer;
+
+static int                      display = 0;
+
+static int                      mmio_fd = -1;
+static int                      mem_fd = -1;
+static uint8_t                  *intel_mem = NULL;
+static uint8_t                  *intel_mmio = NULL;
+static int                      intel_force_full_update = 0;
+static int                      intel_have_focus;
+static int                      IntelPitch = 16;
+static int                      IntelX = 1280;
+static int                      IntelY = 1024;
+static DisplayState             *lds = NULL;
+static uint8_t                  *old_data = NULL;
+static uint32_t                 intel_fb_base, intel_mmio_base;
+static uint32_t                 map_s, map_d, map_size;
+static int                      refresh;
+
+static void set_data_mappings(void);
+static void unset_data_mappings(int mapping);
+static void set_data_pointer(void);
+static void intel_resize(DisplayState *ds);
+
+static inline unsigned int intel_get_reg(unsigned int reg)
+{
+    return *(unsigned int*)(intel_mmio + reg);
+}
+
+static inline int is_linear(void)
+{
+    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
+    if (((*dspacntr) & (1 << 10)) == 0)
+        return 1;
+    else
+        return 0;
+}
+
+static inline unsigned int intel_get_pitch(void)
+{
+    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
+    return *dspastride;
+}
+
+static inline unsigned int intel_get_offset(DisplaySurface *ds, int x, int y)
+{
+    return (y * ds->width + x) * 4;
+}
+
+static void intel_update_linear(DisplaySurface *ds, int x, int y, int w, int h)
+{
+    int i, bpp = ds->pf.depth / 8;
+    unsigned char *s, *d;
+    s = ds->data;
+    d = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
+    s += (ds->linesize * y) + bpp * x;
+    d += (ds->linesize * y) + bpp * x;
+    for (i = 0; i < h; i++) {
+        memcpy(d, s, w * bpp);
+        s += ds->linesize;
+        d += ds->linesize;
+    }
+}
+
+static void intel_force_linear(int linesize)
+{
+    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
+    unsigned int *pipeaconf = (unsigned int *)(intel_mmio + REG_DR_PIPEACONF);
+    unsigned int *dspasurf = (unsigned int *)(intel_mmio + REG_DR_DSPASURF);
+    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
+
+    unsigned int *dspbcntr = (unsigned int *)(intel_mmio + REG_DR_DSPBCNTR);
+    unsigned int *pipebconf = (unsigned int *)(intel_mmio + REG_DR_PIPEBCONF);
+    unsigned int *dspbsurf = (unsigned int *)(intel_mmio + REG_DR_DSPBSURF);
+    unsigned int *dspbstride = (unsigned int *)(intel_mmio + REG_DR_DSPBSTRIDE);
+
+    unsigned int surfa = 0, surfb = 0, pipea = 0, pipeb = 0;
+    char pipebenabled = !!(*pipebconf & (1 << 30));
+
+
+    INTEL_DEBUG("DSPASURF CTRL: 0x%x\n", intel_get_reg(REG_DR_DSPACNTR));
+
+    /* Disable surface */
+    pipea = *pipeaconf & (0x3 << 18);
+    *pipeaconf &= ~(0x3 << 18);
+    *dspacntr |= (1 << 31);
+    /* Address of the surface to map to */
+    surfa = *dspasurf;
+    *dspasurf = 0x00000000;
+    *dspacntr &= ~(1 << 31);
+    *dspasurf = 0x00000000;
+    *pipeaconf |= pipea;
+
+    if (pipebenabled) {
+        INTEL_DEBUG("PIPEBCONF enabled.\n");
+
+        /* Disable surface */
+        pipeb = *pipebconf & (0x3 << 18);
+        *pipebconf &= ~(0x3 << 18);
+        *dspbcntr |= (1 << 31);
+        /* Address of the surface to map to */
+        surfb = *dspbsurf;
+        *dspbsurf = 0x00000000;
+        *dspbcntr &= ~(1 << 31);
+        *dspbsurf = 0x00000000;
+        *pipebconf |= pipeb;
+    }
+
+    usleep(20000);
+
+    *pipeaconf &= ~(0x3 << 18);
+    /* Enable surface linear mode */
+    *dspacntr &= ~(1 << 10);
+    if (linesize) *dspastride = linesize;
+    *dspasurf = surfa;
+    *dspacntr |= (1 << 31);
+    *pipeaconf |= pipea;
+
+    if (pipebenabled) {
+        *pipebconf &= ~(0x3 << 18);
+        /* Enable surface linear mode */
+        *dspbcntr &= ~(1 << 10);
+        if (linesize) *dspbstride = linesize;
+        *dspbsurf = surfb;
+        *dspbcntr |= (1 << 31);
+        *pipebconf |= pipeb;
+    }
+
+    usleep(20000);
+}
+
+static void intel_update(DisplayState *ds, int x, int y, int w, int h)
+{
+    if (intel_have_focus && !old_data && !map_size)
+        intel_update_linear(ds->surface, x, y, w, h);
+}
+
+static void set_fb_mapping(void)
+{
+    DisplaySurface *surf = lds->surface;
+    int rc;
+    unsigned long nr_pfn;
+
+    unset_vga_acc();
+    fprintf(stderr, "set_fb_mapping: %x %x\n", (intel_fb_base + intel_get_reg(REG_DR_DSPASURF)), guest_framebuffer);
+    nr_pfn = (surf->linesize * surf->height) >> TARGET_PAGE_BITS;
+
+    rc = xc_domain_memory_mapping(xc_handle,
+            domid,
+            (guest_framebuffer >> TARGET_PAGE_BITS),
+            ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS),
+            nr_pfn,
+            DPCI_ADD_MAPPING);
+    if (rc) {
+        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
+        return;
+    }
+    map_s = ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS);
+    map_d = (guest_framebuffer >> TARGET_PAGE_BITS);
+    map_size = nr_pfn;
+}
+
+static void unset_fb_mapping(void)
+{
+    int rc;
+
+    fprintf(stderr, "unset_fb_mapping: %x %x\n", map_d, map_s);
+
+    rc = xc_domain_memory_mapping(xc_handle,
+            domid,
+            map_d,
+            map_s,
+            map_size,
+            DPCI_REMOVE_MAPPING);
+    if (rc) {
+        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
+        return;
+    }
+
+    set_vga_acc();
+    map_s = 0;
+    map_d = 0;
+    map_size = 0;
+}
+
+static void intel_setdata(DisplayState *ds)
+{
+    if (map_size)
+        unset_fb_mapping();
+    set_fb_mapping();
+}
+
+static void intel_resize_shared(DisplayState *ds, int w, int h, int depth, int linesize, void *pixels)
+{
+    DisplaySurface *surf = ds->surface;
+
+    if (!intel_have_focus) {
+        surf->width = w;
+        surf->height = h;
+        intel_resize(ds);
+        return;
+    }
+    if (depth == 32 && w == IntelX && h == IntelY)
+        surf->flags = QEMU_ALLOCATED_FLAG;
+    else
+        surf->flags &= ~QEMU_ALLOCATED_FLAG;
+    if (surf->flags & QEMU_ALLOCATED_FLAG) {
+        surf->width = w;
+        surf->height = h;
+        surf->pf.depth = 32;
+        surf->linesize = linesize;
+        /* adjust linesize */
+        intel_force_linear(linesize);
+        set_data_mappings();
+        if (refresh) {
+            memcpy(surf->data, pixels, surf->linesize * surf->height);
+            refresh = 0;
+        }
+        surf->data = pixels;
+        intel_setdata(ds);
+    } else {
+        surf->width = w;
+        surf->height = h;
+        intel_resize(ds);
+    }
+}
+
+static void intel_resize(DisplayState *ds)
+{
+    DisplaySurface *surf = ds->surface;
+    int old_linesize = surf->linesize;
+
+    if (surf->pf.depth == 32 && surf->width == IntelX && surf->height == IntelY)
+      surf->flags = QEMU_ALLOCATED_FLAG;
+    else
+      surf->flags &= ~QEMU_ALLOCATED_FLAG;
+
+    if (is_buffer_shared(surf))
+    {
+      INTEL_DEBUG("intel_resize_shared: enable shared buffer, linesize %d\n",
+                  surf->linesize);
+      intel_force_linear(surf->linesize);
+      set_data_mappings();
+      if (refresh)
+      {
+        // Pixels doesn't exist anymore ??
+        //memcpy(surf->data, pixels, surf->linesize * surf->height);
+        refresh = 0;
+      }
+      intel_setdata(ds);
+      return;
+    }
+    
+    INTEL_DEBUG("intel_resize: no shared buffer, linesize=%d\n", surf->linesize);
+    surf->linesize = intel_get_pitch();
+    if (map_size) {
+        unset_fb_mapping();
+        unset_data_mappings(1);
+    }
+    if (intel_have_focus && !is_linear()) {
+        intel_force_linear(0);
+    }
+    surf->flags &= ~QEMU_ALLOCATED_FLAG;
+    if (intel_have_focus && !old_data &&
+        surf->width * surf->height <= IntelX * IntelY)
+        set_data_mappings();
+    else if (intel_have_focus && old_data &&
+             surf->width * surf->height > IntelX * IntelY)
+        unset_data_mappings(0);
+    if (!old_data) {
+        qemu_free(surf->data);
+        surf->data = qemu_mallocz(surf->height * surf->linesize);
+    } else {
+        INTEL_DEBUG("intel_resize: set_data_pointer\n");
+        set_data_pointer();
+    }
+    if (intel_have_focus)
+        memset((unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)), 0x0, IntelX * IntelY);
+    if (refresh) {
+        if (old_data) {
+            unsigned char *s, *d;
+            int i;
+            s = old_data;
+            d = surf->data;
+            for (i = 0; i < surf->height; i++) {
+                memcpy(d, s, surf->width * 4);
+                s += old_linesize;
+                d += surf->linesize;
+            }
+        }
+        refresh = 0;
+    }
+}
+
+static void intel_refresh(DisplayState *ds)
+{
+    vga_hw_update();
+}
+
+static void intel_init_mapping(void)
+{
+    struct pci_access   *pci_bus;
+    struct pci_dev      *pci_dev;
+
+    mmio_fd = open("/dev/mem", O_RDWR);
+    if (mmio_fd == -1)
+    {
+        perror("open");
+        exit(1);
+    }
+    mem_fd = open("/dev/mem", O_RDWR);
+    if (mem_fd == -1)
+    {
+        perror("open");
+        exit(1);
+    }
+
+    pci_bus = pci_alloc();
+    pci_init(pci_bus);
+    pci_dev = pci_get_dev(pci_bus, 0, 0, 2, 0);
+    pci_fill_info(pci_dev, PCI_FILL_BASES);
+    intel_fb_base = pci_dev->base_addr[2] & 0xfffff000;
+    intel_mmio_base = pci_dev->base_addr[0] & 0xfffff000;
+    pci_free_dev(pci_dev);
+    pci_cleanup(pci_bus);
+
+    INTEL_DEBUG("Map intel main mem 0x%x\n", intel_fb_base);
+    intel_mem = mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED,
+                     mem_fd, intel_fb_base);
+    if (intel_mem == MAP_FAILED)
+    {
+        perror("mmap");
+        exit(1);
+    }
+
+    INTEL_DEBUG("Map intel mmio 0x%x\n", intel_mmio_base);
+    intel_mmio = mmap(NULL, 4 * 1024 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED,
+                      mmio_fd, intel_mmio_base);
+    if (intel_mem == MAP_FAILED)
+    {
+        perror("mmap");
+        exit(1);
+    }
+}
+
+static void set_data_pointer(void)
+{
+    DisplaySurface *surf = lds->surface;
+
+    surf->data = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
+    surf->data = surf->data +
+                surf->linesize * ((IntelY - surf->height) / 2) +
+                4 * ((IntelX - surf->width) / 2);
+}
+
+static void set_data_mappings(void)
+{
+    INTEL_DEBUG("set_data_mappings\n");
+    if (!old_data)
+        old_data = lds->surface->data;
+    set_data_pointer();
+}
+
+static void unset_data_mappings(int mapping)
+{
+    DisplaySurface *surf = lds->surface;
+    if (!old_data)
+        return;
+    if (mapping) {
+        uint8_t * buffer_pointer = surf->data;
+        surf->data = old_data;
+        old_data = NULL;
+        surf->data = realloc(surf->data, surf->linesize * surf->height);
+        memcpy(surf->data,
+                (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)),
+                surf->linesize * surf->height);
+        memcpy(buffer_pointer,
+                surf->data,
+                surf->linesize * surf->height);
+    } else {
+        uint8_t * buffer_pointer = surf->data;
+        surf->data = old_data;
+        old_data = NULL;
+        surf->data = realloc(surf->data, surf->linesize * surf->height);
+        memcpy(surf->data,
+                buffer_pointer,
+                surf->linesize * surf->height);
+    }
+    INTEL_DEBUG("unset_data_mappings %d: success\n", mapping);
+}
+
+static int intel_getfocus(void)
+{
+    return intel_have_focus;
+}
+
+static void intel_focus(int focus)
+{
+    if (intel_have_focus == focus)
+        return;
+
+    INTEL_DEBUG("intel_focus %d\n", focus);
+    intel_have_focus = focus;
+    if (focus) {
+        if (!is_linear()) {
+	    IntelPitch = intel_get_reg(REG_DR_DSPASTRIDE);
+	    IntelX = ((intel_get_reg(REG_DE_PIPEASRC) >> 16) & 0xfff) + 1;
+	    IntelY = (intel_get_reg(REG_DE_PIPEASRC) & 0xfff) + 1;
+	    INTEL_DEBUG("Resolution is %dx%d\n", IntelX, IntelY);
+        }
+        refresh = 1;
+        lds->listeners->dpy_resize = intel_resize;
+        lds->listeners->dpy_setdata = intel_setdata;
+        vga_hw_invalidate();
+    } else {
+        if (map_size) {
+            unset_fb_mapping();
+            unset_data_mappings(1);
+        } else if (old_data) {
+            unset_data_mappings(0);
+        }
+        lds->listeners->dpy_resize = NULL;
+        lds->listeners->dpy_setdata = NULL;
+        lds->surface->flags &= ~QEMU_ALLOCATED_FLAG;
+    }
+}
+
+int intel_enter(void)
+{
+    intel_focus(1);
+    return 1;
+}
+
+int intel_leave(void)
+{
+    intel_focus(0);
+    return 1;
+}
+
+void intel_display_init(DisplayState *ds)
+{
+    DisplaySurface *surf = ds->surface;
+
+    INTEL_DEBUG("\n");
+
+    intel_init_mapping();
+
+    INTEL_DEBUG("Frambuffer is at 0x%x\n", intel_get_reg(REG_DR_DSPASURF));
+
+    surf->flags = 0;
+    surf->width = 640;
+    surf->height = 480;
+    surf->pf.depth = 32;
+    intel_resize(ds);
+    lds = ds;
+
+    ds->listeners->dpy_update = intel_update;
+    ds->listeners->dpy_resize = intel_resize;
+    ds->listeners->dpy_refresh = intel_refresh;
+}
\ No newline at end of file
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/vl.c b/tools/ioemu-remote/vl.c
--- a/tools/ioemu-remote/vl.c	2009-06-07 21:14:47.000000000 -0400
+++ b/tools/ioemu-remote/vl.c	2009-06-07 19:29:12.000000000 -0400
@@ -233,6 +233,9 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_
 #ifdef TARGET_I386
 int win2k_install_hack = 0;
 int rtc_td_hack = 0;
+int vga_passthrough = 0;
+const char *dom0_input = NULL;
+int intel = 0;
 #endif
 int usb_enabled = 0;
 int smp_cpus = 1;
@@ -4039,6 +4042,9 @@ static void help(int exitcode)
            "-disable-opengl disable OpenGL rendering, using SDL"
 #endif
 #endif
+           "-vga_passthrough enable graphics card passthrough\n"
+           "-dom0-input     enable dom0 controlling qemu\n"
+           "-intel          use intel gfx\n"
            "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n"
            "-vga [std|cirrus|vmware|none]\n"
            "                select video card type\n"
@@ -4275,6 +4281,9 @@ enum {
     QEMU_OPTION_domainname,
     QEMU_OPTION_acpi,
     QEMU_OPTION_vcpus,
+    QEMU_OPTION_vga_passthrough,
+    QEMU_OPTION_dom0_input,
+    QEMU_OPTION_intel,
 
     /* Debug/Expert options: */
     QEMU_OPTION_serial,
@@ -4448,6 +4457,9 @@ static const QEMUOption qemu_options[] =
     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
     { "vncunused", 0, QEMU_OPTION_vncunused },
     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
+    { "vga_passthrough", 0, QEMU_OPTION_vga_passthrough },
+    { "dom0-input", HAS_ARG, QEMU_OPTION_dom0_input },
+    { "intel", 0, QEMU_OPTION_intel },
 #if defined(CONFIG_XEN) && !defined(CONFIG_DM)
     { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid },
     { "xen-create", 0, QEMU_OPTION_xen_create },
@@ -5281,6 +5293,15 @@ int main(int argc, char **argv, char **e
             case QEMU_OPTION_disable_opengl:
                 opengl_enabled = 0;
                 break;
+            case QEMU_OPTION_vga_passthrough:
+                vga_passthrough = 1;
+                break;
+            case QEMU_OPTION_dom0_input:
+                dom0_input = optarg;
+                break;
+            case QEMU_OPTION_intel:
+                intel = 1;
+                break;
             case QEMU_OPTION_direct_pci:
                direct_pci = optarg;
                 break;
@@ -5876,6 +5897,14 @@ int main(int argc, char **argv, char **e
             fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
             exit(1);
         }
+
+#ifdef CONFIG_DM 
+        if(vga_passthrough)
+            fprintf(stderr, "Replace if initializing dom0_driver\n" );
+#else        
+        dumb_display_init(ds);
+#endif
+
     } else { 
 #if defined(CONFIG_CURSES)
             if (curses) {
diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/xen-hooks.mak b/tools/ioemu-remote/xen-hooks.mak
--- a/tools/ioemu-remote/xen-hooks.mak	2009-06-07 21:14:47.000000000 -0400
+++ b/tools/ioemu-remote/xen-hooks.mak	2009-06-07 19:04:12.000000000 -0400
@@ -35,6 +35,7 @@ OBJS += exec-dm.o
 OBJS += pci_emulation.o
 OBJS += helper2.o
 OBJS += battery_mgmt.o
+OBJS += intel.o
 
 ifdef CONFIG_STUBDOM
 CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \
diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/libxc/xc_hvm_build.c	2009-06-07 19:04:12.000000000 -0400
@@ -1,7 +1,3 @@
-/******************************************************************************
- * xc_hvm_build.c
- */
-
 #include <stddef.h>
 #include <inttypes.h>
 #include <stdlib.h>
@@ -66,6 +62,82 @@ static void build_hvm_info(void *hvm_inf
     hvm_info->checksum = -sum;
 }
 
+static int init_vgabios(int            xc_handle,
+                        uint32_t       dom,
+                        unsigned char *buffer,
+                        uint32_t       bios_size)
+{
+    char                *va_bios = NULL;
+    uint32_t            va_size = 0;
+
+    va_size = bios_size + bios_size % XC_PAGE_SIZE;
+    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
+                                   PROT_READ | PROT_WRITE, 0xC0);
+    if (!va_bios)
+    {
+        IPRINTF("Unable to map vga bios!\n");
+        return -1;
+    }
+
+    if ( buffer != NULL)
+        memcpy(va_bios, buffer, bios_size);
+    else
+        memset(va_bios, 0, bios_size);
+
+    munmap(va_bios, va_size);
+    return 0;
+}
+
+static int  setup_vga_pt(int            xc_handle,
+                         uint32_t       dom)
+{
+    int                 rc = 0;
+    unsigned char       *bios = NULL;
+    int                 bios_size = 0;
+    char                *c = NULL;
+    char                checksum = 0;
+
+    IPRINTF("Setting up vga passthrough.\n");
+
+    /* Allocated 64K for the vga bios */
+    if (!(bios = malloc(64 * 1024))) {
+        IPRINTF("Error allocating memory for vga bios.\n");
+        return -1;
+    }
+
+#ifdef __linux__
+    bios_size = xc_get_vgabios(bios, 64 * 1024);
+#else
+    bios_size = 0;
+#endif /* __linux__ */
+
+    if (bios_size == 0)
+    {
+        IPRINTF("vga bios size is 0!\n");
+        rc = -1;
+        goto error;
+    }
+       
+    /* Adjust the bios checksum */
+    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
+        checksum += *c;
+    if (checksum)
+        bios[bios_size - 1] -= checksum;
+    init_vgabios(xc_handle, dom, bios, bios_size);    
+
+error:
+    free(bios);
+
+    if( rc == -1 ) {
+        IPRINTF("Error setting up vga passthrough.\n");
+    }
+    else {
+        IPRINTF("Success setting up vga passthrough.\n");
+    }
+
+    return rc;
+}
+
 static int loadelfimage(
     struct elf_binary *elf, int xch, uint32_t dom, unsigned long *parray)
 {
@@ -381,7 +453,8 @@ int xc_hvm_build_target_mem(int xc_handl
                            uint32_t domid,
                            int memsize,
                            int target,
-                           const char *image_name)
+                           const char *image_name,
+                           int vga_pt_enabled)
 {
     char *image;
     int  sts;
@@ -392,6 +465,12 @@ int xc_hvm_build_target_mem(int xc_handl
         return -1;
 
     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
+    if ( vga_pt_enabled ) {
+        sts |= setup_vga_pt(xc_handle, domid);
+    } else {
+        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
+    }
+
 
     free(image);
 
diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
--- a/tools/libxc/xc_linux.c	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/libxc/xc_linux.c	2009-06-07 19:04:12.000000000 -0400
@@ -562,6 +562,57 @@ int xc_gnttab_set_max_grants(int xcg_han
     return 0;
 }
 
+int xc_get_vgabios(unsigned char        *buf,
+                   int                  len)
+{
+    int         mem;
+    uint32_t    start, size = 0;
+    uint16_t    magic = 0;
+
+    start = 0xC0000;
+    if (len < size)
+        return 0;
+    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
+        return 0;
+   
+    /*
+    ** Check if it a real bios extension.
+    ** The magic number is 0xAA55.
+    */
+    if (start != lseek(mem, start, SEEK_SET))
+        goto out;
+    if (read(mem, &magic, 2) != 2)
+        goto out;
+    if (magic != 0xAA55)
+        goto out;
+
+    /* Find the size of the rom extension */
+    if (start != lseek(mem, start, SEEK_SET))
+        goto out;
+    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
+        goto out;
+    if (read(mem, &size, 1) != 1)
+        goto out;
+    /* This size is in 512K */
+    size *= 512;
+
+    /*
+    ** Set the file to the begining of the rombios,
+    ** to start the copy.
+    */
+    if (start != lseek(mem, start, SEEK_SET))
+    {
+        size = 0;
+        goto out;
+    }
+    if (size != read(mem, buf, size))
+        size = 0;
+
+out:
+    close(mem);
+    return size;
+}
+
 /*
  * Local variables:
  * mode: C
diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/libxc/xenctrl.h	2009-06-07 19:04:12.000000000 -0400
@@ -145,6 +145,10 @@ int xc_waitdomain(
     int *status,
     int options);
 
+int xc_get_vgabios(
+    unsigned char       *bios,
+    int                 len);
+
 #endif /* __linux__ */
 
 /*
diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/libxc/xenguest.h	2009-06-07 19:04:12.000000000 -0400
@@ -134,7 +134,8 @@ int xc_hvm_build_target_mem(int xc_handl
                             uint32_t domid,
                             int memsize,
                             int target,
-                            const char *image_name);
+                            const char *image_name,
+                            int vga_pt_enabled);
 
 int xc_hvm_build_mem(int xc_handle,
                      uint32_t domid,
diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/python/xen/lowlevel/xc/xc.c	2009-06-07 19:04:12.000000000 -0400
@@ -890,21 +890,21 @@ static PyObject *pyxc_hvm_build(XcObject
     int i;
 #endif
     char *image;
-    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
+    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, vga_pt = 0;
 
     static char *kwd_list[] = { "domid",
                                 "memsize", "image", "target", "vcpus", "acpi",
-                                "apic", NULL };
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
+                                "apic", "vga_pt", NULL };
+    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
                                       &dom, &memsize, &image, &target, &vcpus,
-                                      &acpi, &apic) )
+                                      &acpi, &apic, &vga_pt) )
         return NULL;
 
     if ( target == -1 )
         target = memsize;
 
     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
-                                 target, image) != 0 )
+                                 target, image, vga_pt) != 0 )
         return pyxc_error_to_exception();
 
 #if !defined(__ia64__)
diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/python/xen/xend/image.py	2009-06-07 19:04:12.000000000 -0400
@@ -279,6 +279,9 @@ class ImageHandler:
         vnc_config = {}
         has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
         has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
+        has_vga_passthrough = int(vmConfig['platform'].get('vga_passthrough', 0)) != 0
+        has_intel = int(vmConfig['platform'].get('intel', 0)) != 0
+
         opengl = 1
         keymap = vmConfig['platform'].get("keymap")
         for dev_uuid in vmConfig['console_refs']:
@@ -302,7 +305,7 @@ class ImageHandler:
             ret.append("-k")
             ret.append(keymap)
 
-        if has_vnc:
+        if has_vnc and not has_vga_passthrough:
             if not vnc_config:
                 for key in ('vncunused', 'vnclisten', 'vncdisplay',
                             'vncpasswd'):
@@ -353,6 +356,15 @@ class ImageHandler:
 
         if int(vmConfig['platform'].get('monitor', 0)) != 0:
             ret = ret + ['-monitor', 'vc']
+
+        if has_vga_passthrough:
+            ret.append('-vga_passthrough')
+            dom0_input = str(vmConfig['platform'].get('dom0_input'))
+            ret = ret + ['-dom0-input', dom0_input]
+
+        if has_intel:
+            ret.append('-intel')
+
         return ret
 
     def getDeviceModelArgs(self, restore = False):
@@ -754,7 +766,9 @@ class HVMImageHandler(ImageHandler):
         self.apic = int(vmConfig['platform'].get('apic', 0))
         self.acpi = int(vmConfig['platform'].get('acpi', 0))
         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
-
+        self.vga_pt = int(vmConfig['platform'].get('vga_passthrough', 0))
+        self.dom0_input = str(vmConfig['platform'].get('dom0_input'))
+        self.intel = int(vmConfig['platform'].get('intel', 0))
 
     # Return a list of cmd line args to the device models based on the
     # xm config file
@@ -869,6 +883,7 @@ class HVMImageHandler(ImageHandler):
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
         log.debug("acpi           = %d", self.acpi)
         log.debug("apic           = %d", self.apic)
+        log.debug("vga_pt         = %d", self.vga_pt)
 
         rc = xc.hvm_build(domid          = self.vm.getDomid(),
                           image          = self.loader,
@@ -876,7 +891,8 @@ class HVMImageHandler(ImageHandler):
                           target         = mem_mb,
                           vcpus          = self.vm.getVCpuCount(),
                           acpi           = self.acpi,
-                          apic           = self.apic)
+                          apic           = self.apic,
+                          vga_pt         = self.vga_pt)
         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
 
         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/python/xen/xend/XendConfig.py	2009-06-07 19:04:12.000000000 -0400
@@ -171,6 +171,9 @@ XENAPI_PLATFORM_CFG_TYPES = {
     'pci_msitranslate': int,
     'pci_power_mgmt': int,
     'xen_platform_pci': int,
+    'vga_passthrough': int,
+    'dom0_input': str,
+    'intel': int,
 }
 
 # Xen API console 'other_config' keys.
diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py	2009-06-07 20:44:47.000000000 -0400
+++ b/tools/python/xen/xm/create.py	2009-06-07 19:04:12.000000000 -0400
@@ -618,6 +618,18 @@ gopts.var('xen_platform_pci', val='0|1',
            fn=set_int, default=1,
            use="Is xen_platform_pci used?")
 
+gopts.var('vga_passthrough', val='0|1',
+           fn=set_int, default=None,
+           use="Enable the passthrough for the graphic card.")
+
+gopts.var('dom0_input', val='DOM0_INPUT',
+           fn=set_value, default=None,
+           use="Input arguments for dom0 driver")
+
+gopts.var('intel', val='INTEL',
+           fn=set_int, default=None,
+           use="Use Intel GFX.")
+
 def err(msg):
     """Print an error to stderr and exit.
     """
@@ -932,7 +944,8 @@ def configure_hvm(config_image, vals):
              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
-             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
+             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
+             'vga_passthrough', 'dom0_input', 'intel' ]
 
     for a in args:
         if a in vals.__dict__ and vals.__dict__[a] is not None:

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

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

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

* Re: Experimental results for VGA passthrough
  2009-06-08  5:36           ` Beng Heng, Ng
@ 2009-06-08  8:29             ` Andrew Lyon
  2009-06-08 13:51               ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Andrew Lyon @ 2009-06-08  8:29 UTC (permalink / raw)
  To: Beng Heng, Ng, Xen-devel

On Mon, Jun 8, 2009 at 6:36 AM, Beng Heng, Ng <bengheng@eecs.umich.edu> wrote:
> Certainly. I tried this on Xen 3.4.1 rc1 pre, changeset 19645. Most of
> these stuff are from Jean and his team. Hopefully more people can update
> their results.
>
> - Beng Heng
>
> Jun Koi wrote:
>> Hi Beng,
>>
>> Would you please send the patch you applied on top of Xen to the list?
>> I think many people are interested in that.
>>
>> Thanks,
>> Jun
>>
>>
>>
>
>
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 19:04:11.000000000 -0400
> @@ -208,7 +208,7 @@ void pciback_release_pci_dev(struct pcib
>        }
>
>        spin_unlock_irqrestore(&dev_data->lock, flags);
> -       pcistub_put_pci_dev(found_dev);
> +       pcistub_put_pci_dev(found_dev, 0);
>  }
>
>  int pciback_init_devices(struct pciback_device *pdev)
> @@ -396,7 +396,7 @@ void pciback_release_devices(struct pcib
>                list_for_each_entry_safe(dev_entry, d,
>                                         &cntrl_entry->dev_list, list) {
>                        list_del(&dev_entry->list);
> -                       pcistub_put_pci_dev(dev_entry->dev);
> +                       pcistub_put_pci_dev(dev_entry->dev, 0);
>                        kfree(dev_entry);
>                }
>                list_del(&cntrl_entry->list);
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 19:04:11.000000000 -0400
> @@ -88,7 +88,7 @@ void pciback_release_pci_dev(struct pcib
>        spin_unlock_irqrestore(&dev_data->lock, flags);
>
>        if (found_dev)
> -               pcistub_put_pci_dev(found_dev);
> +               pcistub_put_pci_dev(found_dev, 1);
>  }
>
>  int pciback_init_devices(struct pciback_device *pdev)
> @@ -157,7 +157,7 @@ void pciback_release_devices(struct pcib
>
>        list_for_each_entry_safe(dev_entry, t, &dev_data->dev_list, list) {
>                list_del(&dev_entry->list);
> -               pcistub_put_pci_dev(dev_entry->dev);
> +               pcistub_put_pci_dev(dev_entry->dev, 1);
>                kfree(dev_entry);
>        }
>
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 19:04:11.000000000 -0400
> @@ -25,6 +25,14 @@ struct pci_dev_entry {
>  #define _PCIB_op_pending       (1)
>  #define PCIB_op_pending                (1<<(_PCIB_op_pending))
>
> +#define PCIBACK_TYPE_UNKNOWN       0
> +#define PCIBACK_TYPE_PCIe_ENDPOINT 1
> +#define PCIBACK_TYPE_PCIe_BRIDGE   2
> +#define PCIBACK_TYPE_PCI_BRIDGE    3
> +#define PCIBACK_TYPE_PCI           4
> +
> +#define DEV_CLASS_PCI_PCI_BRIDGE 0x0604
> +
>  struct pciback_device {
>        void *pci_dev_data;
>        spinlock_t dev_lock;
> @@ -48,6 +56,13 @@ struct pciback_dev_data {
>        struct list_head config_fields;
>        int permissive;
>        int warned_on_write;
> +       u32 dev_type;
> +       int no_flr;
> +       int exp_flr_offset;
> +       int af_flr_offset;
> +       int use_sbr;
> +       int use_d3r;
> +       u8 *cfg_space; /* saved config space for device */
>  };
>
>  /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
> @@ -56,11 +71,25 @@ struct pci_dev *pcistub_get_pci_dev_by_s
>                                            int slot, int func);
>  struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
>                                    struct pci_dev *dev);
> -void pcistub_put_pci_dev(struct pci_dev *dev);
> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr);
> +
> +/* Reference/unreference PCI Devices and stubs without changing the state */
> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev);
> +void pcistub_unref_pci_dev(struct pci_dev *dev);
> +
> +/* Store/reload config space for devices */
> +void pciback_store_config_space(struct pci_dev *dev);
> +void pciback_reload_config_space(struct pci_dev *dev);
>
>  /* Ensure a device is turned off or reset */
>  void pciback_reset_device(struct pci_dev *pdev);
>
> +/* Do a function level reset (or approximage functionality) for device */
> +void pciback_flr_device(struct pci_dev *dev);
> +
> +/* Helper to classify the device type */
> +void pciback_classify_device(struct pci_dev *dev);
> +
>  /* Access a virtual configuration space for a PCI device */
>  int pciback_config_init(void);
>  int pciback_config_init_dev(struct pci_dev *dev);
> @@ -102,6 +131,10 @@ void pciback_release_devices(struct pcib
>  irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
>  void pciback_do_op(void *data);
>
> +/* Parse and load device specific module parameters */
> +int pciback_parse_device_params(const char *device_args, int type,
> +                                       int (*add_func) (int domain, int bus, int slot, int func, int type));
> +
>  int pciback_xenbus_register(void);
>  void pciback_xenbus_unregister(void);
>
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 19:04:11.000000000 -0400
> @@ -5,20 +5,189 @@
>  */
>  #include <linux/module.h>
>  #include <linux/wait.h>
> +#include <linux/delay.h> /* For mdelay function */
>  #include <asm/bitops.h>
>  #include <xen/evtchn.h>
>  #include "pciback.h"
>
> +#define PCIBACK_VENDOR_INTEL     0x8086
> +#define PCIBACK_CLASS_ID_USB     0x0c03
> +#define PCIBACK_CLASS_ID_VGA     0x0300
> +#define PCIBACK_USB_FLRCTRL      0x4
> +
> +#define PCIBACK_IGFX_CAP09_OFFSET    0xa4
> +#define PCIBACK_IGFX_CAP13_OFFSET    0xa4
> +
> +#define PCIBACK_IGFX_MEDIARST        0x0d
> +#define PCIBACK_IGFX_MEDIARST_OFFSET 0xc0
> +
>  int verbose_request = 0;
>  module_param(verbose_request, int, 0644);
>
> +struct pcistub_sbr_entry {
> +       struct list_head dev_list;
> +       struct pci_dev *dev;
> +};
> +
> +struct pcistub_sbr_list {
> +       struct list_head dev_list;
> +       struct pci_dev *bridge;
> +       struct pci_dev *dev;
> +       int find_all;
> +       int err;
> +};
> +
> +/* Used to store the config state so it can be restored after
> + * resets.
> + */
> +void pciback_store_config_space(struct pci_dev *dev)
> +{
> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
> +       u32 *ptr = (u32*)dev_data->cfg_space;
> +       int i, count = dev->cfg_size/sizeof(u32);
> +
> +       for (i = 0; i < count; i += sizeof(u32), ptr++)
> +               pci_read_config_dword(dev, i, ptr);
> +}
> +
> +/* Used to reload the config state after resets.
> + */
> +void pciback_reload_config_space(struct pci_dev *dev)
> +{
> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
> +       u32 *ptr = (u32*)dev_data->cfg_space;
> +       int i, val, count = dev->cfg_size/sizeof(u32);
> +
> +       for (i = 0; i < count; i += sizeof(u32), ptr++) {
> +               pci_read_config_dword(dev, i, &val);
> +               if (val != *ptr)
> +                       pci_write_config_dword(dev, i, *ptr);
> +       }
> +}
> +
> +static void pciback_walk_bus_cb(struct pci_dev *dev, void *userdata)
> +{
> +       struct pcistub_sbr_list *list = (struct pcistub_sbr_list*)userdata;
> +       struct pcistub_sbr_entry *entry;
> +       struct pci_dev *dev_tmp;
> +
> +       if (list->err != 0)
> +               return;
> +
> +       /* For PCIe endpoints we are only looking for co-assigned functions */
> +       if (!list->find_all &&
> +               (dev->bus->number != list->dev->bus->number ||
> +                PCI_SLOT(dev->devfn) != PCI_SLOT(list->dev->devfn)))
> +               return;
> +
> +       dev_tmp = pcistub_ref_pci_dev(dev);
> +       if (dev_tmp == NULL) {
> +               /* not controlled by pciback, fail */
> +               list->err = ENXIO;
> +               return;
> +       }
> +
> +       entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
> +       if (entry == NULL) {
> +               pcistub_unref_pci_dev(dev_tmp);
> +               list->err = ENOMEM;
> +               return;
> +       }
> +
> +       entry->dev = dev_tmp;
> +       list_add_tail(&entry->dev_list, &list->dev_list);
> +}
> +
> +static void pciback_cleanup_sbr_list(struct pcistub_sbr_list *list)
> +{
> +       struct pcistub_sbr_entry *entry;
> +
> +       list_for_each_entry(entry, &list->dev_list, dev_list) {
> +               pcistub_unref_pci_dev(entry->dev);
> +               kfree(entry);
> +       }
> +}
> +
> +/* Routine to find all devices and bridges that need to be reset
> + * during a secondary bus reset. For PCIe this is simply all the
> + * functions on the particular device. For PCI this is all devices
> + * and bridges below the topmost PCI/PCI-X bridge. Note for PCI,
> + * there is at least one something->PCI/PCI-X bridge to find since
> + * the device is not on the host bus 0 and is on a PCI bus.
> + */
> +static int pciback_get_sbr_list(struct pci_dev *dev,
> +       struct pcistub_sbr_list *list, int pcie_endpoint)
> +{
> +       struct pci_dev *bridge = dev->bus->self;
> +       struct pci_dev *last = NULL;
> +       int exp_pos;
> +       u16 exp_caps = 0;
> +
> +       list->err = 0;
> +       list->dev = dev;
> +       INIT_LIST_HEAD(&list->dev_list);
> +
> +       if (!pcie_endpoint) {
> +               while (bridge) {
> +                       /* Looking for the uppermost PCI/PCI-X bridge. If it is not PCIe then
> +                        * this is a PCI/PCI-X bridge. If it is PCIe then except the PCIe to
> +                        * PCI/PCI-X type 7, the rest of the bridge types are PCIe so the last
> +                        * bridge encountered was the topmost PCI/PCI-X bridge.
> +                        */
> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
> +                       if (exp_pos != 0) {
> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
> +                               if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE)
> +                                       break; /* don't want it in the list if it is a PCIe bridge */
> +                       }
> +                       last = bridge;
> +                       bridge = last->bus->self;
> +               }
> +               list->bridge = last;
> +               list->find_all = 1; /* find all devices/bridges below the topmost */
> +       }
> +       else {
> +               if (bridge) {
> +                       /* For PCIe, SBR logic is limited to PCIe endpoints behind a root/switch
> +                        * port.
> +                        */
> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
> +                       if (likely(exp_pos != 0)) {
> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
> +                               exp_caps = ((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4);
> +                               if (exp_caps == PCI_EXP_TYPE_ROOT_PORT ||
> +                                       exp_caps == PCI_EXP_TYPE_UPSTREAM ||
> +                                       exp_caps == PCI_EXP_TYPE_DOWNSTREAM)
> +                                       last = bridge;
> +                       }
> +               }
> +               list->bridge = last;
> +               list->find_all = 0; /* find just functions on this slot */
> +       }
> +
> +       /* Sanity check, there may not be any appropriate bridge to reset */
> +       if (!list->bridge) {
> +               dev_dbg(&dev->dev, "No appropriate bridge to reset\n");
> +               return ENXIO;
> +       }
> +
> +       pci_walk_bus(list->bridge->subordinate, pciback_walk_bus_cb, list);
> +
> +       if (list->err) {
> +               pciback_cleanup_sbr_list(list);
> +               return list->err;
> +       }
> +
> +       return 0;
> +}
> +
>  /* Ensure a device is "turned off" and ready to be exported.
>  * (Also see pciback_config_reset to ensure virtual configuration space is
>  * ready to be re-exported)
>  */
>  void pciback_reset_device(struct pci_dev *dev)
>  {
> -       u16 cmd;
> +       u16 cmd = 0;
>
>        /* Disable devices (but not bridges) */
>        if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
> @@ -38,6 +207,425 @@ void pciback_reset_device(struct pci_dev
>                }
>        }
>  }
> +
> +/* Do a PCIe type function level reset for a single function on this
> + * device.
> + */
> +static void pciback_do_pcie_flr(struct pci_dev *dev, int exp_pos)
> +{
> +       u16 status = 0;
> +
> +       dev_dbg(&dev->dev, "doing PCIe FLR\n");
> +
> +       pci_block_user_cfg_access(dev);
> +
> +       /* Wait for Transaction Pending bit clean */
> +       msleep(100);
> +       pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
> +       if (status & PCI_EXP_DEVSTA_TRPND) {
> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
> +               ssleep(1);
> +               pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
> +               if (status & PCI_EXP_DEVSTA_TRPND)
> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
> +       }
> +
> +       pci_write_config_word(dev, exp_pos + PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
> +       mdelay(200);
> +
> +       pciback_reload_config_space(dev);
> +
> +       pci_unblock_user_cfg_access(dev);
> +}
> +
> +/* Do a PCI type function level reset for a single function on this
> + * device. This uses the Advanced Features Capability extensions to
> + * the PCI spec.
> + */
> +static void pciback_do_pci_flr(struct pci_dev *dev, int af_pos, int clear_cmd)
> +{
> +       u8 status = 0;
> +
> +       dev_dbg(&dev->dev, "doing PCI FLR\n");
> +
> +       pci_block_user_cfg_access(dev);
> +
> +       /* Clear the command register to prevent new transactions */
> +       if (clear_cmd)
> +               pci_write_config_word(dev, PCI_COMMAND, 0);
> +
> +       /* Wait for Transaction Pending bit clean */
> +       msleep(100);
> +       pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
> +       if (status & PCI_AF_STA_TP) {
> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
> +               ssleep(1);
> +               pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
> +               if (status & PCI_AF_STA_TP)
> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
> +       }
> +
> +       pci_write_config_byte(dev, af_pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
> +       mdelay(200);
> +
> +       pciback_reload_config_space(dev);
> +
> +       pci_unblock_user_cfg_access(dev);
> +}
> +
> +/* Vendor specific resets. These can be set in the vendor specific
> + * capabilities structures. Currently only the Intel USB and iGFX
> + * reset is supported.
> + */
> +static int pciback_do_vendor_specific_reset(struct pci_dev *dev)
> +{
> +       struct pci_dev *gmch;
> +       int vendor_pos, i;
> +       u32 reg32 = 0;
> +       u16 device_id, cmd;
> +       u8 reg8 = 0;
> +
> +       dev_dbg(&dev->dev, "doing vendor specific resets\n");
> +
> +       if (dev->vendor != PCIBACK_VENDOR_INTEL)
> +               return -ENXIO;
> +
> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0))
> +                       return -ENXIO;
> +
> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
> +               if (!gmch)
> +                       return -ENXIO;
> +
> +               device_id = gmch->device;
> +               pci_dev_put(gmch);
> +
> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHGM45)
> +                       return -ENXIO;
> +
> +               /* Correct device and platform, assume vendor specific offset */
> +               pci_read_config_dword(dev, PCIBACK_IGFX_CAP09_OFFSET, &reg32);
> +               if ((reg32 & 0x000000FF) != PCI_CAP_ID_VNDR ||
> +                       ((reg32 >> 16) & 0x000000FF) != 0x06 ||
> +                       ((reg32 >> 24) & 0x000000F0) != 0x20)
> +                       return -ENXIO;
> +
> +               vendor_pos = PCIBACK_IGFX_CAP09_OFFSET;
> +       } else if ((dev->class >> 8) == PCIBACK_CLASS_ID_USB) {
> +               vendor_pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
> +               if (vendor_pos == 0)
> +                       return -ENXIO;
> +       }
> +       else
> +               return -ENXIO;
> +
> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
> +               pci_write_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, PCIBACK_IGFX_MEDIARST);
> +               for (i = 0; i <= 10; i++) {
> +                       msleep(100);
> +                       pci_read_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, &reg8);
> +                       if ((reg8 & 0x01) == 0)
> +                               break;
> +                       if (i == 10) {
> +                               dev_warn(&dev->dev, "media not reset after 1s; skipping FLR\n");
> +                               goto out;
> +                       }
> +               }
> +
> +               /* This specific reset will hang if the command register does not have
> +                * memory space access enabled */
> +               pci_read_config_word(dev, PCI_COMMAND, &cmd);
> +               pci_write_config_word(dev, PCI_COMMAND, (cmd | PCI_COMMAND_MEMORY));
> +               /* The rest is the same as a PCI AF FLR - use the same routine */
> +               pciback_do_pci_flr(dev, vendor_pos, 0);
> +               pci_write_config_word(dev, PCI_COMMAND, cmd);
> +       } else {
> +               pci_block_user_cfg_access(dev);
> +
> +               pci_write_config_byte(dev, vendor_pos + PCIBACK_USB_FLRCTRL, 1);
> +               mdelay(200);
> +
> +               pciback_reload_config_space(dev);
> +
> +               pci_unblock_user_cfg_access(dev);
> +       }
> +
> +out:
> +       return 0;
> +}
> +
> +/* Use a D0-D3-D0 device state transition to reset the device. This
> + * is a good enough reset for some devices (like NICs).
> + */
> +static int pciback_do_dstate_transition_reset(struct pci_dev *dev)
> +{
> +       int pm_pos;
> +       u32 pm_ctl = 0;
> +
> +       pm_pos = pci_find_capability(dev, PCI_CAP_ID_PM);
> +       if (pm_pos == 0)
> +               return -ENXIO;
> +
> +       dev_dbg(&dev->dev, "doing Dstate transition reset\n");
> +
> +       /* No_Soft_Reset - When set 1, this bit indicates that devices
> +        * transitioning from D3hot to D0 because of PowerState commands
> +        * do not perform an internal reset.
> +        */
> +       pci_read_config_dword(dev, pm_pos + PCI_PM_CTRL, &pm_ctl);
> +       if (pm_ctl & PCI_PM_CTRL_NO_SOFT_RESET)
> +               return -ENXIO;
> +
> +       pci_block_user_cfg_access(dev);
> +
> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
> +       pm_ctl |= PCI_PM_CTRL_D3HOT;
> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
> +       mdelay(10);
> +
> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
> +       pm_ctl |= PCI_PM_CTRL_D0;
> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
> +       mdelay(10);
> +
> +       pciback_reload_config_space(dev);
> +
> +       pci_unblock_user_cfg_access(dev);
> +
> +       return 0;
> +}
> +
> +/* Do a secondary bus reset on a bridge. This is only done if all
> + * co-assignment rules are satisfied and if it was explicitly
> + * requested via pciback parameters.
> + */
> +static int pciback_do_secondary_bus_reset(struct pci_dev *dev, u32 dev_type)
> +{
> +       struct pcistub_sbr_list sbr_list;
> +       struct pcistub_sbr_entry *entry;
> +       u16 pci_bctl = 0;
> +       int err = 0;
> +
> +       /* Call helper to get the device list needed for the device type. */
> +       err = pciback_get_sbr_list(dev, &sbr_list,
> +                       (dev_type == PCIBACK_TYPE_PCIe_ENDPOINT ? 1 : 0));
> +       if (err) {
> +               dev_warn(&dev->dev,
> +                       "secondary bus reset failed for device - all functions need to be co-assigned - err: %d\n", err);
> +               return err;
> +       }
> +
> +       pci_block_user_cfg_access(dev);
> +
> +       /* Reset the secondary bus and restore the PCI space for all the devfn found above.
> +        */
> +       pci_read_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, &pci_bctl);
> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl | PCI_BRIDGE_CTL_BUS_RESET);
> +       msleep(200);
> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl);
> +       msleep(200);
> +
> +       list_for_each_entry(entry, &sbr_list.dev_list, dev_list) {
> +               pciback_reload_config_space(entry->dev);
> +       }
> +
> +       pci_unblock_user_cfg_access(dev);
> +
> +       pciback_cleanup_sbr_list(&sbr_list);
> +
> +       return 0;
> +}
> +
> +/* This function is used to do a function level reset on a singe
> + * device/function. FLRs must be done on devices before they are
> + * unassigned from one domain and passed through to another. The
> + * preferred method is to do an actual FLR on the device but the
> + * functionality may not be present or exposed. In the later case
> + * we attempt to locate the capability even though it is not
> + * chained into the capabilities list.
> + *
> + * In some cases, there is no way to perform the actual FLR so we
> + * fall back to some alternate methods (which are not as effective
> + * or useful).
> + */
> +void pciback_flr_device(struct pci_dev *dev)
> +{
> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
> +       int err = 0;
> +
> +       if (dev_data->no_flr) {
> +               dev_dbg(&dev->dev, "FLR disabled for device\n");
> +               return;
> +       }
> +       dev_dbg(&dev->dev, "FLR invoked for device\n");
> +
> +       do {
> +               /* First, always try to do an FLR */
> +               if (dev_data->dev_type == PCIBACK_TYPE_PCIe_ENDPOINT &&
> +                       dev_data->exp_flr_offset != 0) {
> +                       pciback_do_pcie_flr(dev, dev_data->exp_flr_offset);
> +                       break;
> +               }
> +               if (dev_data->dev_type == PCIBACK_TYPE_PCI &&
> +                       dev_data->af_flr_offset != 0) {
> +                       pciback_do_pci_flr(dev, dev_data->af_flr_offset, 1);
> +                       break;
> +               }
> +
> +               /* Next for integrated devices on the host bus 0, try some other methods */
> +               if (dev->bus->number == 0) {
> +                       err = pciback_do_vendor_specific_reset(dev);
> +                       if (err && dev_data->use_d3r)
> +                               err = pciback_do_dstate_transition_reset(dev);
> +                       if (err)
> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
> +                                               "attempts to use vendor FLR or D-states unsuccessful\n");
> +                       break;
> +               }
> +
> +               /* Else attempt a secondary bus reset if all conditions are met */
> +               if (dev_data->use_sbr) {
> +                       err = pciback_do_secondary_bus_reset(dev, dev_data->dev_type);
> +                       if (err)
> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
> +                                               "attempts to use secondary bus reset unsuccessful;\n");
> +                       break;
> +               }
> +
> +               err = -ENODEV;
> +       } while (0);
> +
> +       if (err)
> +               dev_warn(&dev->dev, "FLR not performed for device\n");
> +}
> +
> +/* Helper used to location the FLR capabilities for a PCIe device.
> + * When the capability cannot be found in the chain but is present,
> + * special logic is used to attempt to locate functionality.
> + *
> + * returns: the offset to the capability, zero if not found.
> + */
> +static int pciback_find_pcie_flr_caps(struct pci_dev *dev)
> +{
> +       int exp_pos;
> +       u32 cap = 0;
> +
> +       /* First look for the PCIe FLR capabilities using the capabilities list */
> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
> +       if (exp_pos) {
> +               pci_read_config_dword(dev, exp_pos + PCI_EXP_DEVCAP, &cap);
> +               if (cap & PCI_EXP_DEVCAP_FLR) {
> +                       return exp_pos;
> +               }
> +       }
> +
> +       return 0;
> +}
> +
> +/* Helper used to location the AF FLR capabilities for a PCI device.
> + * When the capability cannot be found in the chain but is present,
> + * special logic is used to attempt to locate functionality.
> + *
> + * returns: the offset to the capability, zero if not found.
> + */
> +static int pciback_find_pci_flr_caps(struct pci_dev *dev)
> +{
> +       struct pci_dev *gmch;
> +       int af_pos;
> +       u16 device_id;
> +       u8 cap = 0, reg8 = 0;
> +
> +       /* First look for the PCI AF capabilities for FLR using the capabilities list. This
> +        * is only used on the devices on the root/host bus (integrated devices).
> +        */
> +       if (dev->bus->number != 0)
> +               return 0;
> +
> +       af_pos = pci_find_capability(dev, PCI_CAP_ID_AF);
> +       if (af_pos) {
> +               pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
> +               if (cap & PCI_AF_CAP_FLR) {
> +                       return af_pos;
> +               }
> +       }
> +
> +       /* Next look for the unchained AF capabilities for FLR using specific
> +        * logic. Currently only the graphics device on the Intel Q45 etc
> +        * systems has special logic for locating the hidden FLR caps.
> +     */
> +       do {
> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0) ||
> +                       dev->vendor != PCIBACK_VENDOR_INTEL || (dev->class >> 8) != PCIBACK_CLASS_ID_VGA)
> +                       break;
> +
> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
> +               if (!gmch)
> +                       break;
> +
> +               device_id = gmch->device;
> +               pci_dev_put(gmch);
> +
> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHQ45 &&
> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG45 &&
> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG41)
> +                       break;
> +
> +               /* Correct device and platform, assume AF offset */
> +               af_pos = PCIBACK_IGFX_CAP13_OFFSET;
> +               pci_read_config_byte(dev, af_pos + PCI_AF_LENFLD, &reg8);
> +               if (reg8 == PCI_AF_LENGTH) {
> +                       pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
> +                       if (cap & PCI_AF_CAP_FLR) {
> +                               return af_pos;
> +                       }
> +               }
> +       } while (0);
> +
> +       /* Else not found */
> +       return 0;
> +}
> +
> +/* Classify the device, specifically determine if it is PCIe/PCI
> + * and whether it is a PCIe endpoint, bridge, or other PCI device.
> + */
> +void pciback_classify_device(struct pci_dev *dev)
> +{
> +       struct pciback_dev_data *dev_data;
> +       int exp_pos;
> +       u16 exp_caps = 0;
> +
> +       dev_data = pci_get_drvdata(dev);
> +       dev_data->dev_type = PCIBACK_TYPE_UNKNOWN;
> +
> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
> +
> +       if ((dev->class >> 8) != DEV_CLASS_PCI_PCI_BRIDGE) {
> +               if (exp_pos != 0) {
> +                       dev_data->dev_type = PCIBACK_TYPE_PCIe_ENDPOINT;
> +                       dev_data->exp_flr_offset = pciback_find_pcie_flr_caps(dev);
> +               } else {
> +                       dev_data->dev_type = PCIBACK_TYPE_PCI;
> +                       dev_data->af_flr_offset = pciback_find_pci_flr_caps(dev);
> +               }
> +               goto classify_done;
> +       }
> +
> +       if (exp_pos == 0) {
> +               dev_data->dev_type = PCIBACK_TYPE_PCI_BRIDGE;
> +               goto classify_done;
> +       }
> +
> +       pci_read_config_word(dev, exp_pos + PCI_EXP_FLAGS, &exp_caps);
> +       dev_data->dev_type = (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) == PCI_EXP_TYPE_PCI_BRIDGE) ? PCIBACK_TYPE_PCI_BRIDGE : PCIBACK_TYPE_PCIe_BRIDGE;
> +
> +classify_done:
> +
> +       return;
> +}
> +
>  extern wait_queue_head_t aer_wait_queue;
>  extern struct workqueue_struct *pciback_wq;
>  /*
> @@ -132,3 +720,51 @@ irqreturn_t pciback_handle_event(int irq
>
>        return IRQ_HANDLED;
>  }
> +
> +/* Helper routine used to parse command line parameters passed to the
> + * pciback module from the boot loader. These params all have the form
> + * of a list of one or more devices, e.g.:
> + * (XXXX:XX:XX.X)(XXXX:XX:XX.X)
> + * Which is: (domain/segment:bus:dev.func)
> + */
> +int pciback_parse_device_params(const char *device_args, int type,
> +                       int (*add_func) (int domain, int bus, int slot, int func, int type))
> +{
> +       int pos = 0;
> +       int err = 0;
> +       int domain, bus, slot, func;
> +       int parsed;
> +
> +       if (device_args && *device_args) {
> +               do {
> +                       parsed = 0;
> +
> +                       err = sscanf(device_args + pos,
> +                                    " (%x:%x:%x.%x) %n",
> +                                    &domain, &bus, &slot, &func, &parsed);
> +                       if (err != 4) {
> +                               domain = 0;
> +                               err = sscanf(device_args + pos,
> +                                            " (%x:%x.%x) %n",
> +                                            &bus, &slot, &func, &parsed);
> +                               if (err != 3)
> +                                       goto parse_error;
> +                       }
> +
> +                       err = add_func(domain, bus, slot, func, type);
> +                       if (err)
> +                               goto out;
> +
> +                       /* if parsed<=0, we've reached the end of the string */
> +                       pos += parsed;
> +               } while (parsed > 0 && device_args[pos]);
> +       }
> +
> +out:
> +       return err;
> +
> +parse_error:
> +       printk(KERN_ERR "pciback: Error parsing device parameters \"%s\" at \"%s\"\n",
> +              device_args, device_args + pos);
> +       return -EINVAL;
> +}
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 19:04:11.000000000 -0400
> @@ -24,10 +24,28 @@ wait_queue_head_t aer_wait_queue;
>  * We want to avoid in middle of AER ops, pciback devices is being removed
>  */
>  static DECLARE_RWSEM(pcistub_sem);
> -module_param_named(hide, pci_devs_to_hide, charp, 0444);
> +module_param_named(hide, pci_devs_to_hide, charp, S_IRUGO);
> +
> +static char *pci_devs_use_sbr = NULL;
> +module_param_named(sbr, pci_devs_use_sbr, charp, S_IRUGO);
> +
> +static char *pci_devs_use_d3r = NULL;
> +module_param_named(d3r, pci_devs_use_d3r, charp, S_IRUGO);
> +
> +static char *pci_devs_no_flr = NULL;
> +module_param_named(noflr, pci_devs_no_flr, charp, S_IRUGO);
> +
> +/* Device id list holding different device type listings
> + * for hiding devices and reset logic.
> + */
> +#define PCIBACK_ID_TYPE_HIDE  1
> +#define PCIBACK_ID_TYPE_SBR   2
> +#define PCIBACK_ID_TYPE_D3R   3
> +#define PCIBACK_ID_TYPE_NOFLR 4
>
>  struct pcistub_device_id {
>        struct list_head slot_list;
> +       int type;
>        int domain;
>        unsigned char bus;
>        unsigned int devfn;
> @@ -56,6 +74,8 @@ static LIST_HEAD(pcistub_devices);
>  static int initialize_devices = 0;
>  static LIST_HEAD(seized_devices);
>
> +static int disable_all_flr = 0;
> +
>  static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
>  {
>        struct pcistub_device *psdev;
> @@ -78,6 +98,23 @@ static struct pcistub_device *pcistub_de
>        return psdev;
>  }
>
> +static struct pciback_dev_data *pcistub_dev_data_alloc(struct pci_dev *dev)
> +{
> +       struct pciback_dev_data *dev_data;
> +
> +       dev_dbg(&dev->dev, "pcistub_dev_data_alloc\n");
> +
> +       dev_data = kzalloc(sizeof(*dev_data) + dev->cfg_size, GFP_ATOMIC);
> +       if (!dev_data)
> +               return NULL;
> +
> +       pci_set_drvdata(dev, dev_data);
> +
> +       dev_data->cfg_space = (u8*)(dev_data) + sizeof(*dev_data);
> +
> +       return dev_data;
> +}
> +
>  /* Don't call this directly as it's called by pcistub_device_put */
>  static void pcistub_device_release(struct kref *kref)
>  {
> @@ -200,7 +237,7 @@ struct pci_dev *pcistub_get_pci_dev(stru
>        return found_dev;
>  }
>
> -void pcistub_put_pci_dev(struct pci_dev *dev)
> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr)
>  {
>        struct pcistub_device *psdev, *found_psdev = NULL;
>        unsigned long flags;
> @@ -220,6 +257,13 @@ void pcistub_put_pci_dev(struct pci_dev
>        * pcistub and pciback when AER is in processing
>        */
>        down_write(&pcistub_sem);
> +
> +       /* For pass-through devices, do an FLR (or approximate) for the device
> +        * before it is put back and ready for the next domain
> +        */
> +       if (!disable_all_flr && do_flr)
> +               pciback_flr_device(dev);
> +
>        /* Cleanup our device
>         * (so it's ready for the next domain)
>         */
> @@ -235,6 +279,43 @@ void pcistub_put_pci_dev(struct pci_dev
>        up_write(&pcistub_sem);
>  }
>
> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev)
> +{
> +       struct pcistub_device *psdev;
> +       struct pci_dev *found_dev = NULL;
> +       unsigned long flags;
> +
> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
> +
> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
> +               if (psdev->dev == dev) {
> +                       pcistub_device_get(psdev); /* just a ref count */
> +                       found_dev = psdev->dev;
> +                       break;
> +               }
> +       }
> +
> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
> +       return found_dev;
> +}
> +
> +void pcistub_unref_pci_dev(struct pci_dev *dev)
> +{
> +       struct pcistub_device *psdev;
> +       unsigned long flags;
> +
> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
> +
> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
> +               if (psdev->dev == dev) {
> +                       pcistub_device_get(psdev); /* just an unref count */
> +                       break;
> +               }
> +       }
> +
> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
> +}
> +
>  static int __devinit pcistub_match_one(struct pci_dev *dev,
>                                       struct pcistub_device_id *pdev_id)
>  {
> @@ -255,7 +336,7 @@ static int __devinit pcistub_match_one(s
>        return 0;
>  }
>
> -static int __devinit pcistub_match(struct pci_dev *dev)
> +static int __devinit pcistub_match(struct pci_dev *dev, int type)
>  {
>        struct pcistub_device_id *pdev_id;
>        unsigned long flags;
> @@ -263,6 +344,8 @@ static int __devinit pcistub_match(struc
>
>        spin_lock_irqsave(&device_ids_lock, flags);
>        list_for_each_entry(pdev_id, &pcistub_device_ids, slot_list) {
> +               if (pdev_id->type != type)
> +                       continue;
>                if (pcistub_match_one(dev, pdev_id)) {
>                        found = 1;
>                        break;
> @@ -285,12 +368,11 @@ static int __devinit pcistub_init_device
>         * would need to be called somewhere to free the memory allocated
>         * here and then to call kfree(pci_get_drvdata(psdev->dev)).
>         */
> -       dev_data = kzalloc(sizeof(*dev_data), GFP_ATOMIC);
> +       dev_data = pcistub_dev_data_alloc(dev);
>        if (!dev_data) {
>                err = -ENOMEM;
>                goto out;
>        }
> -       pci_set_drvdata(dev, dev_data);
>
>        dev_dbg(&dev->dev, "initializing config\n");
>
> @@ -317,6 +399,22 @@ static int __devinit pcistub_init_device
>        dev_dbg(&dev->dev, "reset device\n");
>        pciback_reset_device(dev);
>
> +       /* Classify the device so we know if it is PCI/PCIe and if it is
> +        * a bridge - this information is used for FLR logic. Also store
> +        * values if SBR/D3R reset logic was requested.
> +        */
> +       pciback_classify_device(dev);
> +       dev_data->no_flr = pcistub_match(dev, PCIBACK_ID_TYPE_NOFLR);
> +       if (!dev_data->no_flr) {
> +               dev_data->use_sbr = pcistub_match(dev, PCIBACK_ID_TYPE_SBR);
> +               dev_data->use_d3r = pcistub_match(dev, PCIBACK_ID_TYPE_D3R);
> +       }
> +
> +       /* Store the config space here where the device is off and ready to be
> +        * exported before any FLRs or other resets are done
> +        */
> +       pciback_store_config_space(dev);
> +
>        return 0;
>
>       config_release:
> @@ -414,7 +512,7 @@ static int __devinit pcistub_probe(struc
>
>        dev_dbg(&dev->dev, "probing...\n");
>
> -       if (pcistub_match(dev)) {
> +       if (pcistub_match(dev, PCIBACK_ID_TYPE_HIDE)) {
>
>                if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL
>                    && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
> @@ -851,7 +949,7 @@ static inline int str_to_quirk(const cha
>        return -EINVAL;
>  }
>
> -static int pcistub_device_id_add(int domain, int bus, int slot, int func)
> +static int pcistub_device_id_add(int domain, int bus, int slot, int func, int type)
>  {
>        struct pcistub_device_id *pci_dev_id;
>        unsigned long flags;
> @@ -860,12 +958,13 @@ static int pcistub_device_id_add(int dom
>        if (!pci_dev_id)
>                return -ENOMEM;
>
> +       pci_dev_id->type = type;
>        pci_dev_id->domain = domain;
>        pci_dev_id->bus = bus;
>        pci_dev_id->devfn = PCI_DEVFN(slot, func);
>
> -       pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
> -                domain, bus, slot, func);
> +       pr_debug("pciback: adding device ID type: %d for %04x:%02x:%02x.%01x\n",
> +                type, domain, bus, slot, func);
>
>        spin_lock_irqsave(&device_ids_lock, flags);
>        list_add_tail(&pci_dev_id->slot_list, &pcistub_device_ids);
> @@ -874,7 +973,7 @@ static int pcistub_device_id_add(int dom
>        return 0;
>  }
>
> -static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
> +static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
>  {
>        struct pcistub_device_id *pci_dev_id, *t;
>        int devfn = PCI_DEVFN(slot, func);
> @@ -884,7 +983,7 @@ static int pcistub_device_id_remove(int
>        spin_lock_irqsave(&device_ids_lock, flags);
>        list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
>
> -               if (pci_dev_id->domain == domain
> +               if (pci_dev_id->type == type && pci_dev_id->domain == domain
>                    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
>                        /* Don't break; here because it's possible the same
>                         * slot could be in the list more than once
> @@ -939,6 +1038,32 @@ static int pcistub_reg_add(int domain, i
>        return err;
>  }
>
> +static int pcistub_device_do_flr(int domain, int bus, int slot, int func)
> +{
> +       int err = 0;
> +       struct pcistub_device *psdev;
> +       struct pci_dev *dev;
> +
> +       psdev = pcistub_device_find(domain, bus, slot, func);
> +       if (!psdev || !psdev->dev) {
> +               err = -ENODEV;
> +               goto out;
> +       }
> +       dev = psdev->dev;
> +
> +       /* Do an FLR (or approximate) for the device on demand and
> +        * reload config
> +        */
> +       if (!disable_all_flr) {
> +               pciback_flr_device(dev);
> +       }
> +       else
> +               dev_dbg(&dev->dev, "FLR disabled for all devices\n");
> +
> +out:
> +       return err;
> +}
> +
>  static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
>                                size_t count)
>  {
> @@ -949,7 +1074,7 @@ static ssize_t pcistub_slot_add(struct d
>        if (err)
>                goto out;
>
> -       err = pcistub_device_id_add(domain, bus, slot, func);
> +       err = pcistub_device_id_add(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>
>       out:
>        if (!err)
> @@ -969,7 +1094,7 @@ static ssize_t pcistub_slot_remove(struc
>        if (err)
>                goto out;
>
> -       err = pcistub_device_id_remove(domain, bus, slot, func);
> +       err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>
>       out:
>        if (!err)
> @@ -987,6 +1112,10 @@ static ssize_t pcistub_slot_show(struct
>
>        spin_lock_irqsave(&device_ids_lock, flags);
>        list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
> +               /* only want devices set for hide, not reset entries */
> +               if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
> +                       continue;
> +
>                if (count >= PAGE_SIZE)
>                        break;
>
> @@ -1068,7 +1197,7 @@ static ssize_t pcistub_quirk_show(struct
>
>  DRIVER_ATTR(quirks, S_IRUSR | S_IWUSR, pcistub_quirk_show, pcistub_quirk_add);
>
> -static ssize_t permissive_add(struct device_driver *drv, const char *buf,
> +static ssize_t pcistub_permissive_add(struct device_driver *drv, const char *buf,
>                              size_t count)
>  {
>        int domain, bus, slot, func;
> @@ -1109,7 +1238,7 @@ static ssize_t permissive_add(struct dev
>        return err;
>  }
>
> -static ssize_t permissive_show(struct device_driver *drv, char *buf)
> +static ssize_t pcistub_permissive_show(struct device_driver *drv, char *buf)
>  {
>        struct pcistub_device *psdev;
>        struct pciback_dev_data *dev_data;
> @@ -1132,7 +1261,68 @@ static ssize_t permissive_show(struct de
>        return count;
>  }
>
> -DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add);
> +DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, pcistub_permissive_show, pcistub_permissive_add);
> +
> +static ssize_t pcistub_do_flr(struct device_driver *drv, const char *buf,
> +                                  size_t count)
> +{
> +       int domain, bus, slot, func;
> +       int err;
> +
> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
> +       if (err)
> +               goto out;
> +
> +       err = pcistub_device_do_flr(domain, bus, slot, func);
> +
> +out:
> +       if (!err)
> +               err = count;
> +       return err;
> +}
> +
> +DRIVER_ATTR(do_flr, S_IWUSR, NULL, pcistub_do_flr);
> +
> +static ssize_t pcistub_resets(struct device_driver *drv, const char *buf,
> +                                  size_t count)
> +{
> +       int domain, bus, slot, func;
> +       int type, err = 0;
> +
> +       /* string begins with reset type specifier sbr=|dr3=|noflr= */
> +       if (!strncmp(buf, "sbr=", 4)) {
> +               type = PCIBACK_ID_TYPE_SBR;
> +               buf += 4;
> +       } else if (!strncmp(buf, "d3r=", 4)) {
> +               type = PCIBACK_ID_TYPE_D3R;
> +               buf += 4;
> +       } else if (!strncmp(buf, "noflr=", 6)) {
> +               type = PCIBACK_ID_TYPE_NOFLR;
> +               buf += 6;
> +       } else {
> +               err = -EINVAL;
> +               goto out;
> +       }
> +
> +       /* check special wildcard noflr */
> +       if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "(*)", 3)) {
> +               disable_all_flr = 1;
> +               goto out;
> +       }
> +
> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
> +       if (err)
> +               goto out;
> +
> +       err = pcistub_device_id_add(domain, bus, slot, func, type);
> +
> +out:
> +       if (!err)
> +               err = count;
> +       return err;
> +}
> +
> +DRIVER_ATTR(resets, S_IWUSR, NULL, pcistub_resets);
>
>  #ifdef CONFIG_PCI_MSI
>
> @@ -1158,6 +1348,8 @@ static void pcistub_exit(void)
>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_slots);
>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_quirks);
>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_permissive);
> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_do_flr);
> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_resets);
>
>        pci_unregister_driver(&pciback_pci_driver);
>        WARN_ON(unregister_msi_get_owner(pciback_get_owner));
> @@ -1165,35 +1357,27 @@ static void pcistub_exit(void)
>
>  static int __init pcistub_init(void)
>  {
> -       int pos = 0;
>        int err = 0;
> -       int domain, bus, slot, func;
> -       int parsed;
>
> -       if (pci_devs_to_hide && *pci_devs_to_hide) {
> -               do {
> -                       parsed = 0;
> -
> -                       err = sscanf(pci_devs_to_hide + pos,
> -                                    " (%x:%x:%x.%x) %n",
> -                                    &domain, &bus, &slot, &func, &parsed);
> -                       if (err != 4) {
> -                               domain = 0;
> -                               err = sscanf(pci_devs_to_hide + pos,
> -                                            " (%x:%x.%x) %n",
> -                                            &bus, &slot, &func, &parsed);
> -                               if (err != 3)
> -                                       goto parse_error;
> -                       }
> +       /* Parse device lists for hide, sbr, and d3r */
> +       err = pciback_parse_device_params(pci_devs_to_hide, PCIBACK_ID_TYPE_HIDE, pcistub_device_id_add);
> +       if (err)
> +               goto out;
>
> -                       err = pcistub_device_id_add(domain, bus, slot, func);
> -                       if (err)
> -                               goto out;
> +       err = pciback_parse_device_params(pci_devs_use_sbr, PCIBACK_ID_TYPE_SBR, pcistub_device_id_add);
> +       if (err)
> +               goto out;
>
> -                       /* if parsed<=0, we've reached the end of the string */
> -                       pos += parsed;
> -               } while (parsed > 0 && pci_devs_to_hide[pos]);
> -       }
> +       err = pciback_parse_device_params(pci_devs_use_d3r, PCIBACK_ID_TYPE_D3R, pcistub_device_id_add);
> +       if (err)
> +               goto out;
> +
> +       if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "(*)", 3))
> +               disable_all_flr = 1; /* check special wildcard noflr */
> +       else
> +               err = pciback_parse_device_params(pci_devs_no_flr, PCIBACK_ID_TYPE_NOFLR, pcistub_device_id_add);
> +       if (err)
> +               goto out;
>
>        /* If we're the first PCI Device Driver to register, we're the
>         * first one to get offered PCI devices as they become
> @@ -1217,6 +1401,12 @@ static int __init pcistub_init(void)
>        if (!err)
>                err = driver_create_file(&pciback_pci_driver.driver,
>                                         &driver_attr_permissive);
> +       if (!err)
> +               err = driver_create_file(&pciback_pci_driver.driver,
> +                                        &driver_attr_do_flr);
> +       if (!err)
> +               err = driver_create_file(&pciback_pci_driver.driver,
> +                                        &driver_attr_resets);
>
>        if (!err)
>                err = register_msi_get_owner(pciback_get_owner);
> @@ -1225,11 +1415,6 @@ static int __init pcistub_init(void)
>
>       out:
>        return err;
> -
> -      parse_error:
> -       printk(KERN_ERR "pciback: Error parsing pci_devs_to_hide at \"%s\"\n",
> -              pci_devs_to_hide + pos);
> -       return -EINVAL;
>  }
>
>  #ifndef MODULE
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 19:04:11.000000000 -0400
> @@ -109,7 +109,7 @@ void pciback_release_pci_dev(struct pcib
>        spin_unlock_irqrestore(&slot_dev->lock, flags);
>
>        if (found_dev)
> -               pcistub_put_pci_dev(found_dev);
> +               pcistub_put_pci_dev(found_dev, 0);
>  }
>
>  int pciback_init_devices(struct pciback_device *pdev)
> @@ -149,7 +149,7 @@ void pciback_release_devices(struct pcib
>                for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
>                        dev = slot_dev->slots[bus][slot];
>                        if (dev != NULL)
> -                               pcistub_put_pci_dev(dev);
> +                               pcistub_put_pci_dev(dev, 0);
>                }
>
>        kfree(slot_dev);
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c
> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 20:48:21.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 19:04:11.000000000 -0400
> @@ -162,7 +162,7 @@ void pciback_release_pci_dev(struct pcib
>        spin_unlock_irqrestore(&vpci_dev->lock, flags);
>
>        if (found_dev)
> -               pcistub_put_pci_dev(found_dev);
> +               pcistub_put_pci_dev(found_dev, 0);
>  }
>
>  int pciback_init_devices(struct pciback_device *pdev)
> @@ -202,7 +202,7 @@ void pciback_release_devices(struct pcib
>                list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
>                                         list) {
>                        list_del(&e->list);
> -                       pcistub_put_pci_dev(e->dev);
> +                       pcistub_put_pci_dev(e->dev, 0);
>                        kfree(e);
>                }
>        }
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_ids.h b/linux-2.6.18-xen.hg/include/linux/pci_ids.h
> --- a/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 20:48:23.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 19:04:11.000000000 -0400
> @@ -2259,6 +2259,14 @@
>  #define PCI_DEVICE_ID_INTEL_IXP2800    0x9004
>  #define PCI_DEVICE_ID_INTEL_S21152BB   0xb152
>
> +#define PCI_DEVICE_ID_INTEL_GMCHQ45 0x2e10
> +#define PCI_DEVICE_ID_INTEL_GMCHG45 0x2e20
> +#define PCI_DEVICE_ID_INTEL_MCHP45  0x2e20
> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
> +#define PCI_DEVICE_ID_INTEL_GMCHGM45 0x2a40
> +
> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
> +
>  #define PCI_VENDOR_ID_SCALEMP          0x8686
>  #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
>
> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_regs.h b/linux-2.6.18-xen.hg/include/linux/pci_regs.h
> --- a/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 20:48:23.000000000 -0400
> +++ b/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 19:04:11.000000000 -0400
> @@ -201,6 +201,7 @@
>  #define  PCI_CAP_ID_SHPC       0x0C    /* PCI Standard Hot-Plug Controller */
>  #define  PCI_CAP_ID_EXP        0x10    /* PCI Express */
>  #define  PCI_CAP_ID_MSIX       0x11    /* MSI-X */
> +#define  PCI_CAP_ID_AF      0x13    /* Advanced Features Capability */
>  #define PCI_CAP_LIST_NEXT      1       /* Next capability in the list */
>  #define PCI_CAP_FLAGS          2       /* Capability defined flags (16 bits) */
>  #define PCI_CAP_SIZEOF         4
> @@ -229,6 +230,11 @@
>  #define  PCI_PM_CTRL_DATA_SEL_MASK     0x1e00  /* Data select (??) */
>  #define  PCI_PM_CTRL_DATA_SCALE_MASK   0x6000  /* Data scale (??) */
>  #define  PCI_PM_CTRL_PME_STATUS        0x8000  /* PME pin status */
> +#define  PCI_PM_CTRL_DATA_DSTATE_MASK 0x3      /* D0 - D3 */
> +#define  PCI_PM_CTRL_D0 0x0
> +#define  PCI_PM_CTRL_D1 0x1
> +#define  PCI_PM_CTRL_D2 0x2
> +#define  PCI_PM_CTRL_D3HOT 0x3
>  #define PCI_PM_PPB_EXTENSIONS  6       /* PPB support extensions (??) */
>  #define  PCI_PM_PPB_B2_B3      0x40    /* Stop clock when in D3hot (??) */
>  #define  PCI_PM_BPCC_ENABLE    0x80    /* Bus power/clock control enable (??) */
> @@ -346,6 +352,7 @@
>  #define  PCI_EXP_DEVCAP_PWR_IND        0x4000  /* Power Indicator Present */
>  #define  PCI_EXP_DEVCAP_PWR_VAL        0x3fc0000 /* Slot Power Limit Value */
>  #define  PCI_EXP_DEVCAP_PWR_SCL        0xc000000 /* Slot Power Limit Scale */
> +#define  PCI_EXP_DEVCAP_FLR     0x10000000 /* Function Level Reset */
>  #define PCI_EXP_DEVCTL         8       /* Device Control */
>  #define  PCI_EXP_DEVCTL_CERE   0x0001  /* Correctable Error Reporting En. */
>  #define  PCI_EXP_DEVCTL_NFERE  0x0002  /* Non-Fatal Error Reporting Enable */
> @@ -358,6 +365,7 @@
>  #define  PCI_EXP_DEVCTL_AUX_PME        0x0400  /* Auxiliary Power PM Enable */
>  #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
>  #define  PCI_EXP_DEVCTL_READRQ 0x7000  /* Max_Read_Request_Size */
> +#define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
>  #define PCI_EXP_DEVSTA         10      /* Device Status */
>  #define  PCI_EXP_DEVSTA_CED    0x01    /* Correctable Error Detected */
>  #define  PCI_EXP_DEVSTA_NFED   0x02    /* Non-Fatal Error Detected */
> @@ -482,6 +490,17 @@
>  #define  PCI_ARI_CTRL_ACS      0x0002  /* ACS Function Groups Enable */
>  #define  PCI_ARI_CTRL_FG(x)    (((x) >> 4) & 7) /* Function Group */
>
> +/* Advanced Features Capability */
> +#define PCI_AF_LENFLD    0x02 /* Device length offset */
> +#define  PCI_AF_LENGTH   0x06
> +#define PCI_AF_DEVCAP    0x03 /* Device capabilities offset */
> +#define  PCI_AF_CAP_TP   0x01
> +#define  PCI_AF_CAP_FLR  0x02
> +#define PCI_AF_CTRL      0x04 /* Device CTRL offset */
> +#define  PCI_AF_CTRL_FLR 0x01
> +#define PCI_AF_STA       0x05 /* Device STATUS offset */
> +#define  PCI_AF_STA_TP   0x01
> +
>  /* Single Root I/O Virtualization */
>  #define PCI_SRIOV_CAP          0x04    /* SR-IOV Capabilities */
>  #define  PCI_SRIOV_CAP_VFM     0x01    /* VF Migration Capable */
> diff -rupN --ignore-blank-lines-X diffignore a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
> --- a/tools/firmware/hvmloader/hvmloader.c      2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/firmware/hvmloader/hvmloader.c      2009-06-07 19:04:11.000000000 -0400
> @@ -673,6 +673,7 @@ int main(void)
>         break;
>     default:
>         printf("No emulated VGA adaptor ...\n");
> +        vgabios_sz = round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
>         break;
>     }
>
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/console.h b/tools/ioemu-remote/console.h
> --- a/tools/ioemu-remote/console.h      2009-06-07 21:14:47.000000000 -0400
> +++ b/tools/ioemu-remote/console.h      2009-06-07 19:04:11.000000000 -0400
> @@ -290,6 +290,9 @@ void vga_hw_update(void);
>  void vga_hw_invalidate(void);
>  void vga_hw_screen_dump(const char *filename);
>
> +void unset_vga_acc(void);
> +void set_vga_acc(void);
> +
>  int is_graphic_console(void);
>  int is_fixedsize_console(void);
>  CharDriverState *text_console_init(const char *p);
> @@ -341,4 +344,9 @@ const char *readline_get_history(unsigne
>  void readline_start(const char *prompt, int is_password,
>                     ReadLineFunc *readline_func, void *opaque);
>
> +/* intel.c */
> +int intel_enter(void);
> +int intel_leave(void);
> +void intel_display_init(DisplayState *ds);
> +
>  #endif
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pass-through.c b/tools/ioemu-remote/hw/pass-through.c
> --- a/tools/ioemu-remote/hw/pass-through.c      2009-06-07 21:14:48.000000000 -0400
> +++ b/tools/ioemu-remote/hw/pass-through.c      2009-06-07 19:04:11.000000000 -0400
> @@ -90,6 +90,8 @@
>  #include "qemu-xen.h"
>  #include <unistd.h>
>
> +extern int vga_passthrough;
> +
>  struct php_dev {
>     struct pt_dev *pt_dev;
>     uint8_t valid;
> @@ -1573,10 +1575,11 @@ static int pt_dev_is_virtfn(struct pci_d
>
>  static int pt_register_regions(struct pt_dev *assigned_device)
>  {
> -    int i = 0;
> +    int i = 0, ret = 0;
>     uint32_t bar_data = 0;
>     struct pci_dev *pci_dev = assigned_device->pci_dev;
>     PCIDevice *d = &assigned_device->dev;
> +    uint16_t class, vendor_id;
>
>     /* Register PIO/MMIO BARs */
>     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
> @@ -1632,6 +1635,25 @@ static int pt_register_regions(struct pt
>             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
>     }
>
> +    /* Map legacy ioport and iomem, for specific devices */
> +    vendor_id = pci_read_word(pci_dev, 0x00);
> +    class = pci_read_word(pci_dev, 0x0a);
> +
> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
> +    if ( vga_passthrough && class == 0x0300 )
> +    {
> +        PT_LOG("add an intel graphic card\n");
> +
> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_ADD_MAPPING);
> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_ADD_MAPPING);
> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_ADD_MAPPING);
> +        if ( ret != 0 )
> +        {
> +            PT_LOG("legacy mapping failed!\n");
> +            return ret;
> +        }
> +    }
> +
>     return 0;
>  }
>
> @@ -1640,6 +1662,7 @@ static void pt_unregister_regions(struct
>     int i, type, ret;
>     uint32_t e_size;
>     PCIDevice *d = (PCIDevice*)assigned_device;
> +    uint16_t class, vendor_id;
>
>     for ( i = 0; i < PCI_NUM_REGIONS; i++ )
>     {
> @@ -1681,6 +1704,24 @@ static void pt_unregister_regions(struct
>
>     }
>
> +    /* unmap legacy ioport and iomem, for specific devices */
> +    vendor_id = pci_read_word(assigned_device->pci_dev, 0x00);
> +    class = pci_read_word(assigned_device->pci_dev, 0x0a);
> +
> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
> +    if ( vga_passthrough && class == 0x0300 )
> +    {
> +        PT_LOG("remove an intel graphic card\n");
> +
> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_REMOVE_MAPPING);
> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_REMOVE_MAPPING);
> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_REMOVE_MAPPING);
> +        if ( ret != 0 )
> +        {
> +            PT_LOG("legacy unmapping failed !\n");
> +        }
> +    }
> +
>  }
>
>  static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
> @@ -3759,7 +3800,7 @@ static struct pt_dev * register_real_dev
>     struct pci_config_cf8 machine_bdf;
>     char *key, *val;
>     int msi_translate, power_mgmt;
> -
> +
>     PT_LOG("Assigning real physical device %02x:%02x.%x ...\n",
>         r_bus, r_dev, r_func);
>
> @@ -3931,7 +3972,7 @@ static struct pt_dev * register_real_dev
>     }
>
>  out:
> -    PT_LOG("Real physical device %02x:%02x.%x registered successfuly!\n"
> +    PT_LOG("Real physical device %02x:%02x.%x registered successfully!\n"
>            "IRQ type = %s\n", r_bus, r_dev, r_func,
>            assigned_device->msi_trans_en? "MSI-INTx":"INTx");
>
> @@ -4113,3 +4154,47 @@ err:
>     return status;
>  }
>
> +u8 pt_pci_host_read_byte(int bus, int dev, int fn, u32 addr)
> +{
> +    struct pci_dev *pci_dev;
> +    u8             val;
> +
> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
> +    if (!pci_dev)
> +        return 0;
> +
> +    val = pci_read_byte(pci_dev, addr);
> +    pci_free_dev(pci_dev);
> +
> +    return val;
> +}
> +
> +u16 pt_pci_host_read_word(int bus, int dev, int fn, u32 addr)
> +{
> +    struct pci_dev *pci_dev;
> +    u16             val;
> +
> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
> +    if (!pci_dev)
> +        return 0;
> +
> +    val = pci_read_word(pci_dev, addr);
> +    pci_free_dev(pci_dev);
> +
> +    return val;
> +}
> +
> +u32 pt_pci_host_read_long(int bus, int dev, int fn, u32 addr)
> +{
> +    struct pci_dev *pci_dev;
> +    u32             val;
> +
> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
> +    if (!pci_dev)
> +        return 0;
> +
> +    val = pci_read_long(pci_dev, addr);
> +    pci_free_dev(pci_dev);
> +
> +    return val;
> +}
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pc.c b/tools/ioemu-remote/hw/pc.c
> --- a/tools/ioemu-remote/hw/pc.c        2009-06-07 21:14:47.000000000 -0400
> +++ b/tools/ioemu-remote/hw/pc.c        2009-06-07 19:04:11.000000000 -0400
> @@ -65,6 +65,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
>  extern uint8_t *acpi_tables;
>  extern size_t acpi_tables_len;
>
> +extern int vga_passthrough;
> +
>  static fdctrl_t *floppy_controller;
>  static RTCState *rtc_state;
>  static PITState *pit;
> @@ -984,6 +986,7 @@ vga_bios_error:
>
>     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
>
> +    if (!vga_passthrough) {
>     if (cirrus_vga_enabled) {
>         if (pci_enabled) {
>             pci_cirrus_vga_init(pci_bus,
> @@ -1010,6 +1013,7 @@ vga_bios_error:
>                          vga_ram_addr, vga_ram_size);
>         }
>     }
> +    }
>
>  #ifdef CONFIG_PASSTHROUGH
>     /* Pass-through Initialization
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pci.c b/tools/ioemu-remote/hw/pci.c
> --- a/tools/ioemu-remote/hw/pci.c       2009-06-07 21:14:47.000000000 -0400
> +++ b/tools/ioemu-remote/hw/pci.c       2009-06-07 19:04:11.000000000 -0400
> @@ -28,11 +28,14 @@
>  #include "virtio-net.h"
>  #include "sysemu.h"
>
> +#include "pass-through.h"
>  #include "exec-all.h"
>  #include "qemu-xen.h"
>
>  //#define DEBUG_PCI
>
> +extern int vga_passthrough;
> +
>  struct PCIBus {
>     int bus_num;
>     int devfn_min;
> @@ -611,7 +614,24 @@ uint32_t pci_data_read(void *opaque, uin
>         goto the_end;
>     }
>     config_addr = addr & 0xff;
> -    val = pci_dev->config_read(pci_dev, config_addr, len);
> +    if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
> +    {
> +        val = pci_dev->config_read(pci_dev, config_addr, len);
> +
> +        if (config_addr == 0x52) // GMCH
> +            val = pt_pci_host_read_word(0, 0, 0, 0x52);
> +        if (config_addr == 0x02) // Device ID
> +        {
> +            if (len == 2)
> +                val = pt_pci_host_read_word(0, 0, 0, 0x00);
> +            else if (len == 4)
> +                val = pt_pci_host_read_long(0, 0, 0, 0x00);
> +        }
> +    } else if (vga_passthrough && pci_dev->devfn == 0x10 && // intel graphic card
> +               config_addr == 0xfc) // OpRegion address
> +        val = 0; // force to fall back to SMI mode
> +    else
> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>  #if defined(DEBUG_PCI)
>     printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",
>            pci_dev->name, config_addr, val, len);
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/vga.c b/tools/ioemu-remote/hw/vga.c
> --- a/tools/ioemu-remote/hw/vga.c       2009-06-07 21:14:47.000000000 -0400
> +++ b/tools/ioemu-remote/hw/vga.c       2009-06-07 19:04:11.000000000 -0400
> @@ -34,9 +34,9 @@
>
>  #include "qemu-timer.h"
>
> -//#define DEBUG_VGA
> -//#define DEBUG_VGA_MEM
> -//#define DEBUG_VGA_REG
> +#define DEBUG_VGA
> +#define DEBUG_VGA_MEM
> +#define DEBUG_VGA_REG
>
>  //#define DEBUG_BOCHS_VBE
>
> @@ -161,6 +161,18 @@ static uint8_t expand4to8[16];
>  static void vga_bios_init(VGAState *s);
>  static void vga_screen_dump(void *opaque, const char *filename);
>
> +static VGAState *xen_vga_state;
> +
> +void set_vga_acc(void)
> +{
> +    set_vram_mapping(xen_vga_state, xen_vga_state->lfb_addr, xen_vga_state->lfb_end);
> +}
> +
> +void unset_vga_acc(void)
> +{
> +    unset_vram_mapping(xen_vga_state);
> +}
> +
>  static void vga_dumb_update_retrace_info(VGAState *s)
>  {
>     (void) s;
> @@ -2473,8 +2485,6 @@ static void vga_bios_init(VGAState *s)
>  }
>
>
> -static VGAState *xen_vga_state;
> -
>  /* Allocate video memory in the GPFN space */
>  void xen_vga_populate_vram(uint64_t vram_addr, uint32_t vga_ram_size)
>  {
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/intel.c b/tools/ioemu-remote/intel.c
> --- a/tools/ioemu-remote/intel.c        1969-12-31 19:00:00.000000000 -0500
> +++ b/tools/ioemu-remote/intel.c        2009-06-07 19:04:11.000000000 -0400
> @@ -0,0 +1,494 @@
> +#include <stdio.h>
> +#include <stdlib.h>
> +#include <stdint.h>
> +#include <sys/mman.h>
> +#include <sys/types.h>
> +#include <sys/stat.h>
> +#include <fcntl.h>
> +#include <assert.h>
> +#include <signal.h>
> +#include <pci/pci.h>
> +
> +#include "qemu-common.h"
> +#include "console.h"
> +#include "sysemu.h"
> +
> +#define INTEL_DEBUG(format, args...)                                    \
> +    fprintf (stderr, "intel.c:%d:%s " format , __LINE__, __func__, ## args)
> +
> +#define TileW           128
> +#define TileH           8
> +
> +#define REG_DR_DSPASURF                0x7019C
> +#define REG_DR_DSPACNTR                0x70180
> +#define REG_DR_DSPASTRIDE      0x70188
> +#define REG_DR_PIPEACONF       0x70008
> +
> +#define REG_DR_DSPBSURF                0x7119C
> +#define REG_DR_DSPBCNTR                0x71180
> +#define REG_DR_DSPBSTRIDE      0x71188
> +#define REG_DR_PIPEBCONF       0x71008
> +
> +#define REG_DE_PIPEASRC                0x6001c
> +
> +extern int                      vga_passthrough;
> +uint32_t                        guest_framebuffer;
> +
> +static int                      display = 0;
> +
> +static int                      mmio_fd = -1;
> +static int                      mem_fd = -1;
> +static uint8_t                  *intel_mem = NULL;
> +static uint8_t                  *intel_mmio = NULL;
> +static int                      intel_force_full_update = 0;
> +static int                      intel_have_focus;
> +static int                      IntelPitch = 16;
> +static int                      IntelX = 1280;
> +static int                      IntelY = 1024;
> +static DisplayState             *lds = NULL;
> +static uint8_t                  *old_data = NULL;
> +static uint32_t                 intel_fb_base, intel_mmio_base;
> +static uint32_t                 map_s, map_d, map_size;
> +static int                      refresh;
> +
> +static void set_data_mappings(void);
> +static void unset_data_mappings(int mapping);
> +static void set_data_pointer(void);
> +static void intel_resize(DisplayState *ds);
> +
> +static inline unsigned int intel_get_reg(unsigned int reg)
> +{
> +    return *(unsigned int*)(intel_mmio + reg);
> +}
> +
> +static inline int is_linear(void)
> +{
> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
> +    if (((*dspacntr) & (1 << 10)) == 0)
> +        return 1;
> +    else
> +        return 0;
> +}
> +
> +static inline unsigned int intel_get_pitch(void)
> +{
> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
> +    return *dspastride;
> +}
> +
> +static inline unsigned int intel_get_offset(DisplaySurface *ds, int x, int y)
> +{
> +    return (y * ds->width + x) * 4;
> +}
> +
> +static void intel_update_linear(DisplaySurface *ds, int x, int y, int w, int h)
> +{
> +    int i, bpp = ds->pf.depth / 8;
> +    unsigned char *s, *d;
> +    s = ds->data;
> +    d = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
> +    s += (ds->linesize * y) + bpp * x;
> +    d += (ds->linesize * y) + bpp * x;
> +    for (i = 0; i < h; i++) {
> +        memcpy(d, s, w * bpp);
> +        s += ds->linesize;
> +        d += ds->linesize;
> +    }
> +}
> +
> +static void intel_force_linear(int linesize)
> +{
> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
> +    unsigned int *pipeaconf = (unsigned int *)(intel_mmio + REG_DR_PIPEACONF);
> +    unsigned int *dspasurf = (unsigned int *)(intel_mmio + REG_DR_DSPASURF);
> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
> +
> +    unsigned int *dspbcntr = (unsigned int *)(intel_mmio + REG_DR_DSPBCNTR);
> +    unsigned int *pipebconf = (unsigned int *)(intel_mmio + REG_DR_PIPEBCONF);
> +    unsigned int *dspbsurf = (unsigned int *)(intel_mmio + REG_DR_DSPBSURF);
> +    unsigned int *dspbstride = (unsigned int *)(intel_mmio + REG_DR_DSPBSTRIDE);
> +
> +    unsigned int surfa = 0, surfb = 0, pipea = 0, pipeb = 0;
> +    char pipebenabled = !!(*pipebconf & (1 << 30));
> +
> +
> +    INTEL_DEBUG("DSPASURF CTRL: 0x%x\n", intel_get_reg(REG_DR_DSPACNTR));
> +
> +    /* Disable surface */
> +    pipea = *pipeaconf & (0x3 << 18);
> +    *pipeaconf &= ~(0x3 << 18);
> +    *dspacntr |= (1 << 31);
> +    /* Address of the surface to map to */
> +    surfa = *dspasurf;
> +    *dspasurf = 0x00000000;
> +    *dspacntr &= ~(1 << 31);
> +    *dspasurf = 0x00000000;
> +    *pipeaconf |= pipea;
> +
> +    if (pipebenabled) {
> +        INTEL_DEBUG("PIPEBCONF enabled.\n");
> +
> +        /* Disable surface */
> +        pipeb = *pipebconf & (0x3 << 18);
> +        *pipebconf &= ~(0x3 << 18);
> +        *dspbcntr |= (1 << 31);
> +        /* Address of the surface to map to */
> +        surfb = *dspbsurf;
> +        *dspbsurf = 0x00000000;
> +        *dspbcntr &= ~(1 << 31);
> +        *dspbsurf = 0x00000000;
> +        *pipebconf |= pipeb;
> +    }
> +
> +    usleep(20000);
> +
> +    *pipeaconf &= ~(0x3 << 18);
> +    /* Enable surface linear mode */
> +    *dspacntr &= ~(1 << 10);
> +    if (linesize) *dspastride = linesize;
> +    *dspasurf = surfa;
> +    *dspacntr |= (1 << 31);
> +    *pipeaconf |= pipea;
> +
> +    if (pipebenabled) {
> +        *pipebconf &= ~(0x3 << 18);
> +        /* Enable surface linear mode */
> +        *dspbcntr &= ~(1 << 10);
> +        if (linesize) *dspbstride = linesize;
> +        *dspbsurf = surfb;
> +        *dspbcntr |= (1 << 31);
> +        *pipebconf |= pipeb;
> +    }
> +
> +    usleep(20000);
> +}
> +
> +static void intel_update(DisplayState *ds, int x, int y, int w, int h)
> +{
> +    if (intel_have_focus && !old_data && !map_size)
> +        intel_update_linear(ds->surface, x, y, w, h);
> +}
> +
> +static void set_fb_mapping(void)
> +{
> +    DisplaySurface *surf = lds->surface;
> +    int rc;
> +    unsigned long nr_pfn;
> +
> +    unset_vga_acc();
> +    fprintf(stderr, "set_fb_mapping: %x %x\n", (intel_fb_base + intel_get_reg(REG_DR_DSPASURF)), guest_framebuffer);
> +    nr_pfn = (surf->linesize * surf->height) >> TARGET_PAGE_BITS;
> +
> +    rc = xc_domain_memory_mapping(xc_handle,
> +            domid,
> +            (guest_framebuffer >> TARGET_PAGE_BITS),
> +            ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS),
> +            nr_pfn,
> +            DPCI_ADD_MAPPING);
> +    if (rc) {
> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
> +        return;
> +    }
> +    map_s = ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS);
> +    map_d = (guest_framebuffer >> TARGET_PAGE_BITS);
> +    map_size = nr_pfn;
> +}
> +
> +static void unset_fb_mapping(void)
> +{
> +    int rc;
> +
> +    fprintf(stderr, "unset_fb_mapping: %x %x\n", map_d, map_s);
> +
> +    rc = xc_domain_memory_mapping(xc_handle,
> +            domid,
> +            map_d,
> +            map_s,
> +            map_size,
> +            DPCI_REMOVE_MAPPING);
> +    if (rc) {
> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
> +        return;
> +    }
> +
> +    set_vga_acc();
> +    map_s = 0;
> +    map_d = 0;
> +    map_size = 0;
> +}
> +
> +static void intel_setdata(DisplayState *ds)
> +{
> +    if (map_size)
> +        unset_fb_mapping();
> +    set_fb_mapping();
> +}
> +
> +static void intel_resize_shared(DisplayState *ds, int w, int h, int depth, int linesize, void *pixels)
> +{
> +    DisplaySurface *surf = ds->surface;
> +
> +    if (!intel_have_focus) {
> +        surf->width = w;
> +        surf->height = h;
> +        intel_resize(ds);
> +        return;
> +    }
> +    if (depth == 32 && w == IntelX && h == IntelY)
> +        surf->flags = QEMU_ALLOCATED_FLAG;
> +    else
> +        surf->flags &= ~QEMU_ALLOCATED_FLAG;
> +    if (surf->flags & QEMU_ALLOCATED_FLAG) {
> +        surf->width = w;
> +        surf->height = h;
> +        surf->pf.depth = 32;
> +        surf->linesize = linesize;
> +        /* adjust linesize */
> +        intel_force_linear(linesize);
> +        set_data_mappings();
> +        if (refresh) {
> +            memcpy(surf->data, pixels, surf->linesize * surf->height);
> +            refresh = 0;
> +        }
> +        surf->data = pixels;
> +        intel_setdata(ds);
> +    } else {
> +        surf->width = w;
> +        surf->height = h;
> +        intel_resize(ds);
> +    }
> +}
> +
> +static void intel_resize(DisplayState *ds)
> +{
> +    DisplaySurface *surf = ds->surface;
> +    int old_linesize = surf->linesize;
> +
> +    if (surf->pf.depth == 32 && surf->width == IntelX && surf->height == IntelY)
> +      surf->flags = QEMU_ALLOCATED_FLAG;
> +    else
> +      surf->flags &= ~QEMU_ALLOCATED_FLAG;
> +
> +    if (is_buffer_shared(surf))
> +    {
> +      INTEL_DEBUG("intel_resize_shared: enable shared buffer, linesize %d\n",
> +                  surf->linesize);
> +      intel_force_linear(surf->linesize);
> +      set_data_mappings();
> +      if (refresh)
> +      {
> +        // Pixels doesn't exist anymore ??
> +        //memcpy(surf->data, pixels, surf->linesize * surf->height);
> +        refresh = 0;
> +      }
> +      intel_setdata(ds);
> +      return;
> +    }
> +
> +    INTEL_DEBUG("intel_resize: no shared buffer, linesize=%d\n", surf->linesize);
> +    surf->linesize = intel_get_pitch();
> +    if (map_size) {
> +        unset_fb_mapping();
> +        unset_data_mappings(1);
> +    }
> +    if (intel_have_focus && !is_linear()) {
> +        intel_force_linear(0);
> +    }
> +    surf->flags &= ~QEMU_ALLOCATED_FLAG;
> +    if (intel_have_focus && !old_data &&
> +        surf->width * surf->height <= IntelX * IntelY)
> +        set_data_mappings();
> +    else if (intel_have_focus && old_data &&
> +             surf->width * surf->height > IntelX * IntelY)
> +        unset_data_mappings(0);
> +    if (!old_data) {
> +        qemu_free(surf->data);
> +        surf->data = qemu_mallocz(surf->height * surf->linesize);
> +    } else {
> +        INTEL_DEBUG("intel_resize: set_data_pointer\n");
> +        set_data_pointer();
> +    }
> +    if (intel_have_focus)
> +        memset((unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)), 0x0, IntelX * IntelY);
> +    if (refresh) {
> +        if (old_data) {
> +            unsigned char *s, *d;
> +            int i;
> +            s = old_data;
> +            d = surf->data;
> +            for (i = 0; i < surf->height; i++) {
> +                memcpy(d, s, surf->width * 4);
> +                s += old_linesize;
> +                d += surf->linesize;
> +            }
> +        }
> +        refresh = 0;
> +    }
> +}
> +
> +static void intel_refresh(DisplayState *ds)
> +{
> +    vga_hw_update();
> +}
> +
> +static void intel_init_mapping(void)
> +{
> +    struct pci_access   *pci_bus;
> +    struct pci_dev      *pci_dev;
> +
> +    mmio_fd = open("/dev/mem", O_RDWR);
> +    if (mmio_fd == -1)
> +    {
> +        perror("open");
> +        exit(1);
> +    }
> +    mem_fd = open("/dev/mem", O_RDWR);
> +    if (mem_fd == -1)
> +    {
> +        perror("open");
> +        exit(1);
> +    }
> +
> +    pci_bus = pci_alloc();
> +    pci_init(pci_bus);
> +    pci_dev = pci_get_dev(pci_bus, 0, 0, 2, 0);
> +    pci_fill_info(pci_dev, PCI_FILL_BASES);
> +    intel_fb_base = pci_dev->base_addr[2] & 0xfffff000;
> +    intel_mmio_base = pci_dev->base_addr[0] & 0xfffff000;
> +    pci_free_dev(pci_dev);
> +    pci_cleanup(pci_bus);
> +
> +    INTEL_DEBUG("Map intel main mem 0x%x\n", intel_fb_base);
> +    intel_mem = mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED,
> +                     mem_fd, intel_fb_base);
> +    if (intel_mem == MAP_FAILED)
> +    {
> +        perror("mmap");
> +        exit(1);
> +    }
> +
> +    INTEL_DEBUG("Map intel mmio 0x%x\n", intel_mmio_base);
> +    intel_mmio = mmap(NULL, 4 * 1024 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED,
> +                      mmio_fd, intel_mmio_base);
> +    if (intel_mem == MAP_FAILED)
> +    {
> +        perror("mmap");
> +        exit(1);
> +    }
> +}
> +
> +static void set_data_pointer(void)
> +{
> +    DisplaySurface *surf = lds->surface;
> +
> +    surf->data = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
> +    surf->data = surf->data +
> +                surf->linesize * ((IntelY - surf->height) / 2) +
> +                4 * ((IntelX - surf->width) / 2);
> +}
> +
> +static void set_data_mappings(void)
> +{
> +    INTEL_DEBUG("set_data_mappings\n");
> +    if (!old_data)
> +        old_data = lds->surface->data;
> +    set_data_pointer();
> +}
> +
> +static void unset_data_mappings(int mapping)
> +{
> +    DisplaySurface *surf = lds->surface;
> +    if (!old_data)
> +        return;
> +    if (mapping) {
> +        uint8_t * buffer_pointer = surf->data;
> +        surf->data = old_data;
> +        old_data = NULL;
> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
> +        memcpy(surf->data,
> +                (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)),
> +                surf->linesize * surf->height);
> +        memcpy(buffer_pointer,
> +                surf->data,
> +                surf->linesize * surf->height);
> +    } else {
> +        uint8_t * buffer_pointer = surf->data;
> +        surf->data = old_data;
> +        old_data = NULL;
> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
> +        memcpy(surf->data,
> +                buffer_pointer,
> +                surf->linesize * surf->height);
> +    }
> +    INTEL_DEBUG("unset_data_mappings %d: success\n", mapping);
> +}
> +
> +static int intel_getfocus(void)
> +{
> +    return intel_have_focus;
> +}
> +
> +static void intel_focus(int focus)
> +{
> +    if (intel_have_focus == focus)
> +        return;
> +
> +    INTEL_DEBUG("intel_focus %d\n", focus);
> +    intel_have_focus = focus;
> +    if (focus) {
> +        if (!is_linear()) {
> +           IntelPitch = intel_get_reg(REG_DR_DSPASTRIDE);
> +           IntelX = ((intel_get_reg(REG_DE_PIPEASRC) >> 16) & 0xfff) + 1;
> +           IntelY = (intel_get_reg(REG_DE_PIPEASRC) & 0xfff) + 1;
> +           INTEL_DEBUG("Resolution is %dx%d\n", IntelX, IntelY);
> +        }
> +        refresh = 1;
> +        lds->listeners->dpy_resize = intel_resize;
> +        lds->listeners->dpy_setdata = intel_setdata;
> +        vga_hw_invalidate();
> +    } else {
> +        if (map_size) {
> +            unset_fb_mapping();
> +            unset_data_mappings(1);
> +        } else if (old_data) {
> +            unset_data_mappings(0);
> +        }
> +        lds->listeners->dpy_resize = NULL;
> +        lds->listeners->dpy_setdata = NULL;
> +        lds->surface->flags &= ~QEMU_ALLOCATED_FLAG;
> +    }
> +}
> +
> +int intel_enter(void)
> +{
> +    intel_focus(1);
> +    return 1;
> +}
> +
> +int intel_leave(void)
> +{
> +    intel_focus(0);
> +    return 1;
> +}
> +
> +void intel_display_init(DisplayState *ds)
> +{
> +    DisplaySurface *surf = ds->surface;
> +
> +    INTEL_DEBUG("\n");
> +
> +    intel_init_mapping();
> +
> +    INTEL_DEBUG("Frambuffer is at 0x%x\n", intel_get_reg(REG_DR_DSPASURF));
> +
> +    surf->flags = 0;
> +    surf->width = 640;
> +    surf->height = 480;
> +    surf->pf.depth = 32;
> +    intel_resize(ds);
> +    lds = ds;
> +
> +    ds->listeners->dpy_update = intel_update;
> +    ds->listeners->dpy_resize = intel_resize;
> +    ds->listeners->dpy_refresh = intel_refresh;
> +}
> \ No newline at end of file
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/vl.c b/tools/ioemu-remote/vl.c
> --- a/tools/ioemu-remote/vl.c   2009-06-07 21:14:47.000000000 -0400
> +++ b/tools/ioemu-remote/vl.c   2009-06-07 19:29:12.000000000 -0400
> @@ -233,6 +233,9 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_
>  #ifdef TARGET_I386
>  int win2k_install_hack = 0;
>  int rtc_td_hack = 0;
> +int vga_passthrough = 0;
> +const char *dom0_input = NULL;
> +int intel = 0;
>  #endif
>  int usb_enabled = 0;
>  int smp_cpus = 1;
> @@ -4039,6 +4042,9 @@ static void help(int exitcode)
>            "-disable-opengl disable OpenGL rendering, using SDL"
>  #endif
>  #endif
> +           "-vga_passthrough enable graphics card passthrough\n"
> +           "-dom0-input     enable dom0 controlling qemu\n"
> +           "-intel          use intel gfx\n"
>            "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n"
>            "-vga [std|cirrus|vmware|none]\n"
>            "                select video card type\n"
> @@ -4275,6 +4281,9 @@ enum {
>     QEMU_OPTION_domainname,
>     QEMU_OPTION_acpi,
>     QEMU_OPTION_vcpus,
> +    QEMU_OPTION_vga_passthrough,
> +    QEMU_OPTION_dom0_input,
> +    QEMU_OPTION_intel,
>
>     /* Debug/Expert options: */
>     QEMU_OPTION_serial,
> @@ -4448,6 +4457,9 @@ static const QEMUOption qemu_options[] =
>     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
>     { "vncunused", 0, QEMU_OPTION_vncunused },
>     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
> +    { "vga_passthrough", 0, QEMU_OPTION_vga_passthrough },
> +    { "dom0-input", HAS_ARG, QEMU_OPTION_dom0_input },
> +    { "intel", 0, QEMU_OPTION_intel },
>  #if defined(CONFIG_XEN) && !defined(CONFIG_DM)
>     { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid },
>     { "xen-create", 0, QEMU_OPTION_xen_create },
> @@ -5281,6 +5293,15 @@ int main(int argc, char **argv, char **e
>             case QEMU_OPTION_disable_opengl:
>                 opengl_enabled = 0;
>                 break;
> +            case QEMU_OPTION_vga_passthrough:
> +                vga_passthrough = 1;
> +                break;
> +            case QEMU_OPTION_dom0_input:
> +                dom0_input = optarg;
> +                break;
> +            case QEMU_OPTION_intel:
> +                intel = 1;
> +                break;
>             case QEMU_OPTION_direct_pci:
>                direct_pci = optarg;
>                 break;
> @@ -5876,6 +5897,14 @@ int main(int argc, char **argv, char **e
>             fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
>             exit(1);
>         }
> +
> +#ifdef CONFIG_DM
> +        if(vga_passthrough)
> +            fprintf(stderr, "Replace if initializing dom0_driver\n" );
> +#else
> +        dumb_display_init(ds);
> +#endif
> +
>     } else {
>  #if defined(CONFIG_CURSES)
>             if (curses) {
> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/xen-hooks.mak b/tools/ioemu-remote/xen-hooks.mak
> --- a/tools/ioemu-remote/xen-hooks.mak  2009-06-07 21:14:47.000000000 -0400
> +++ b/tools/ioemu-remote/xen-hooks.mak  2009-06-07 19:04:12.000000000 -0400
> @@ -35,6 +35,7 @@ OBJS += exec-dm.o
>  OBJS += pci_emulation.o
>  OBJS += helper2.o
>  OBJS += battery_mgmt.o
> +OBJS += intel.o
>
>  ifdef CONFIG_STUBDOM
>  CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \
> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c
> --- a/tools/libxc/xc_hvm_build.c        2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/libxc/xc_hvm_build.c        2009-06-07 19:04:12.000000000 -0400
> @@ -1,7 +1,3 @@
> -/******************************************************************************
> - * xc_hvm_build.c
> - */
> -
>  #include <stddef.h>
>  #include <inttypes.h>
>  #include <stdlib.h>
> @@ -66,6 +62,82 @@ static void build_hvm_info(void *hvm_inf
>     hvm_info->checksum = -sum;
>  }
>
> +static int init_vgabios(int            xc_handle,
> +                        uint32_t       dom,
> +                        unsigned char *buffer,
> +                        uint32_t       bios_size)
> +{
> +    char                *va_bios = NULL;
> +    uint32_t            va_size = 0;
> +
> +    va_size = bios_size + bios_size % XC_PAGE_SIZE;
> +    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
> +                                   PROT_READ | PROT_WRITE, 0xC0);
> +    if (!va_bios)
> +    {
> +        IPRINTF("Unable to map vga bios!\n");
> +        return -1;
> +    }
> +
> +    if ( buffer != NULL)
> +        memcpy(va_bios, buffer, bios_size);
> +    else
> +        memset(va_bios, 0, bios_size);
> +
> +    munmap(va_bios, va_size);
> +    return 0;
> +}
> +
> +static int  setup_vga_pt(int            xc_handle,
> +                         uint32_t       dom)
> +{
> +    int                 rc = 0;
> +    unsigned char       *bios = NULL;
> +    int                 bios_size = 0;
> +    char                *c = NULL;
> +    char                checksum = 0;
> +
> +    IPRINTF("Setting up vga passthrough.\n");
> +
> +    /* Allocated 64K for the vga bios */
> +    if (!(bios = malloc(64 * 1024))) {
> +        IPRINTF("Error allocating memory for vga bios.\n");
> +        return -1;
> +    }
> +
> +#ifdef __linux__
> +    bios_size = xc_get_vgabios(bios, 64 * 1024);
> +#else
> +    bios_size = 0;
> +#endif /* __linux__ */
> +
> +    if (bios_size == 0)
> +    {
> +        IPRINTF("vga bios size is 0!\n");
> +        rc = -1;
> +        goto error;
> +    }
> +
> +    /* Adjust the bios checksum */
> +    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
> +        checksum += *c;
> +    if (checksum)
> +        bios[bios_size - 1] -= checksum;
> +    init_vgabios(xc_handle, dom, bios, bios_size);
> +
> +error:
> +    free(bios);
> +
> +    if( rc == -1 ) {
> +        IPRINTF("Error setting up vga passthrough.\n");
> +    }
> +    else {
> +        IPRINTF("Success setting up vga passthrough.\n");
> +    }
> +
> +    return rc;
> +}
> +
>  static int loadelfimage(
>     struct elf_binary *elf, int xch, uint32_t dom, unsigned long *parray)
>  {
> @@ -381,7 +453,8 @@ int xc_hvm_build_target_mem(int xc_handl
>                            uint32_t domid,
>                            int memsize,
>                            int target,
> -                           const char *image_name)
> +                           const char *image_name,
> +                           int vga_pt_enabled)
>  {
>     char *image;
>     int  sts;
> @@ -392,6 +465,12 @@ int xc_hvm_build_target_mem(int xc_handl
>         return -1;
>
>     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
> +    if ( vga_pt_enabled ) {
> +        sts |= setup_vga_pt(xc_handle, domid);
> +    } else {
> +        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
> +    }
> +
>
>     free(image);
>
> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
> --- a/tools/libxc/xc_linux.c    2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/libxc/xc_linux.c    2009-06-07 19:04:12.000000000 -0400
> @@ -562,6 +562,57 @@ int xc_gnttab_set_max_grants(int xcg_han
>     return 0;
>  }
>
> +int xc_get_vgabios(unsigned char        *buf,
> +                   int                  len)
> +{
> +    int         mem;
> +    uint32_t    start, size = 0;
> +    uint16_t    magic = 0;
> +
> +    start = 0xC0000;
> +    if (len < size)
> +        return 0;
> +    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
> +        return 0;
> +
> +    /*
> +    ** Check if it a real bios extension.
> +    ** The magic number is 0xAA55.
> +    */
> +    if (start != lseek(mem, start, SEEK_SET))
> +        goto out;
> +    if (read(mem, &magic, 2) != 2)
> +        goto out;
> +    if (magic != 0xAA55)
> +        goto out;
> +
> +    /* Find the size of the rom extension */
> +    if (start != lseek(mem, start, SEEK_SET))
> +        goto out;
> +    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
> +        goto out;
> +    if (read(mem, &size, 1) != 1)
> +        goto out;
> +    /* This size is in 512K */
> +    size *= 512;
> +
> +    /*
> +    ** Set the file to the begining of the rombios,
> +    ** to start the copy.
> +    */
> +    if (start != lseek(mem, start, SEEK_SET))
> +    {
> +        size = 0;
> +        goto out;
> +    }
> +    if (size != read(mem, buf, size))
> +        size = 0;
> +
> +out:
> +    close(mem);
> +    return size;
> +}
> +
>  /*
>  * Local variables:
>  * mode: C
> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
> --- a/tools/libxc/xenctrl.h     2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/libxc/xenctrl.h     2009-06-07 19:04:12.000000000 -0400
> @@ -145,6 +145,10 @@ int xc_waitdomain(
>     int *status,
>     int options);
>
> +int xc_get_vgabios(
> +    unsigned char       *bios,
> +    int                 len);
> +
>  #endif /* __linux__ */
>
>  /*
> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
> --- a/tools/libxc/xenguest.h    2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/libxc/xenguest.h    2009-06-07 19:04:12.000000000 -0400
> @@ -134,7 +134,8 @@ int xc_hvm_build_target_mem(int xc_handl
>                             uint32_t domid,
>                             int memsize,
>                             int target,
> -                            const char *image_name);
> +                            const char *image_name,
> +                            int vga_pt_enabled);
>
>  int xc_hvm_build_mem(int xc_handle,
>                      uint32_t domid,
> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
> --- a/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 19:04:12.000000000 -0400
> @@ -890,21 +890,21 @@ static PyObject *pyxc_hvm_build(XcObject
>     int i;
>  #endif
>     char *image;
> -    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
> +    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, vga_pt = 0;
>
>     static char *kwd_list[] = { "domid",
>                                 "memsize", "image", "target", "vcpus", "acpi",
> -                                "apic", NULL };
> -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
> +                                "apic", "vga_pt", NULL };
> +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
>                                       &dom, &memsize, &image, &target, &vcpus,
> -                                      &acpi, &apic) )
> +                                      &acpi, &apic, &vga_pt) )
>         return NULL;
>
>     if ( target == -1 )
>         target = memsize;
>
>     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
> -                                 target, image) != 0 )
> +                                 target, image, vga_pt) != 0 )
>         return pyxc_error_to_exception();
>
>  #if !defined(__ia64__)
> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
> --- a/tools/python/xen/xend/image.py    2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/python/xen/xend/image.py    2009-06-07 19:04:12.000000000 -0400
> @@ -279,6 +279,9 @@ class ImageHandler:
>         vnc_config = {}
>         has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
>         has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
> +        has_vga_passthrough = int(vmConfig['platform'].get('vga_passthrough', 0)) != 0
> +        has_intel = int(vmConfig['platform'].get('intel', 0)) != 0
> +
>         opengl = 1
>         keymap = vmConfig['platform'].get("keymap")
>         for dev_uuid in vmConfig['console_refs']:
> @@ -302,7 +305,7 @@ class ImageHandler:
>             ret.append("-k")
>             ret.append(keymap)
>
> -        if has_vnc:
> +        if has_vnc and not has_vga_passthrough:
>             if not vnc_config:
>                 for key in ('vncunused', 'vnclisten', 'vncdisplay',
>                             'vncpasswd'):
> @@ -353,6 +356,15 @@ class ImageHandler:
>
>         if int(vmConfig['platform'].get('monitor', 0)) != 0:
>             ret = ret + ['-monitor', 'vc']
> +
> +        if has_vga_passthrough:
> +            ret.append('-vga_passthrough')
> +            dom0_input = str(vmConfig['platform'].get('dom0_input'))
> +            ret = ret + ['-dom0-input', dom0_input]
> +
> +        if has_intel:
> +            ret.append('-intel')
> +
>         return ret
>
>     def getDeviceModelArgs(self, restore = False):
> @@ -754,7 +766,9 @@ class HVMImageHandler(ImageHandler):
>         self.apic = int(vmConfig['platform'].get('apic', 0))
>         self.acpi = int(vmConfig['platform'].get('acpi', 0))
>         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
> -
> +        self.vga_pt = int(vmConfig['platform'].get('vga_passthrough', 0))
> +        self.dom0_input = str(vmConfig['platform'].get('dom0_input'))
> +        self.intel = int(vmConfig['platform'].get('intel', 0))
>
>     # Return a list of cmd line args to the device models based on the
>     # xm config file
> @@ -869,6 +883,7 @@ class HVMImageHandler(ImageHandler):
>         log.debug("vcpus          = %d", self.vm.getVCpuCount())
>         log.debug("acpi           = %d", self.acpi)
>         log.debug("apic           = %d", self.apic)
> +        log.debug("vga_pt         = %d", self.vga_pt)
>
>         rc = xc.hvm_build(domid          = self.vm.getDomid(),
>                           image          = self.loader,
> @@ -876,7 +891,8 @@ class HVMImageHandler(ImageHandler):
>                           target         = mem_mb,
>                           vcpus          = self.vm.getVCpuCount(),
>                           acpi           = self.acpi,
> -                          apic           = self.apic)
> +                          apic           = self.apic,
> +                          vga_pt         = self.vga_pt)
>         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
>
>         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
> --- a/tools/python/xen/xend/XendConfig.py       2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/python/xen/xend/XendConfig.py       2009-06-07 19:04:12.000000000 -0400
> @@ -171,6 +171,9 @@ XENAPI_PLATFORM_CFG_TYPES = {
>     'pci_msitranslate': int,
>     'pci_power_mgmt': int,
>     'xen_platform_pci': int,
> +    'vga_passthrough': int,
> +    'dom0_input': str,
> +    'intel': int,
>  }
>
>  # Xen API console 'other_config' keys.
> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
> --- a/tools/python/xen/xm/create.py     2009-06-07 20:44:47.000000000 -0400
> +++ b/tools/python/xen/xm/create.py     2009-06-07 19:04:12.000000000 -0400
> @@ -618,6 +618,18 @@ gopts.var('xen_platform_pci', val='0|1',
>            fn=set_int, default=1,
>            use="Is xen_platform_pci used?")
>
> +gopts.var('vga_passthrough', val='0|1',
> +           fn=set_int, default=None,
> +           use="Enable the passthrough for the graphic card.")
> +
> +gopts.var('dom0_input', val='DOM0_INPUT',
> +           fn=set_value, default=None,
> +           use="Input arguments for dom0 driver")
> +
> +gopts.var('intel', val='INTEL',
> +           fn=set_int, default=None,
> +           use="Use Intel GFX.")
> +
>  def err(msg):
>     """Print an error to stderr and exit.
>     """
> @@ -932,7 +944,8 @@ def configure_hvm(config_image, vals):
>              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
>              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
>              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
> -             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
> +             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
> +             'vga_passthrough', 'dom0_input', 'intel' ]
>
>     for a in args:
>         if a in vals.__dict__ and vals.__dict__[a] is not None:
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
>

Where did this patch come from? I plan to try using a ati card with a
windows domU this week but first I need to port this patch to 2.6.29,
before I start I want to make sure I am working with the latest
version of the patch.

Andy

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

* Re: Experimental results for VGA passthrough
  2009-06-08  8:29             ` Andrew Lyon
@ 2009-06-08 13:51               ` Beng Heng, Ng
  2009-06-08 14:09                 ` Beng Heng, Ng
  2009-06-08 14:19                 ` Andrew Lyon
  0 siblings, 2 replies; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 13:51 UTC (permalink / raw)
  To: Andrew Lyon; +Cc: Xen-devel

The patch was mostly originally from XCI, and subsequently the Xen 3.4
testing branch.

Note that this does not include HID passthrough. It only demonstrates
VGA passthrough.

Also, you need to specify the following in your DomU configuration.
vga_passthrough=1
intel=1
dom0_input="0" (can ignore for now, since I did not include dom0 driver)

I've only tried it for HVM guests. But it should work for PV too. I've
got good results on Windows DomU. On Linux, there was an error that says
the guest is trying to access unintialised BAR.

- Beng Heng

Andrew Lyon wrote:
> On Mon, Jun 8, 2009 at 6:36 AM, Beng Heng, Ng <bengheng@eecs.umich.edu> wrote:
>> Certainly. I tried this on Xen 3.4.1 rc1 pre, changeset 19645. Most of
>> these stuff are from Jean and his team. Hopefully more people can update
>> their results.
>>
>> - Beng Heng
>>
>> Jun Koi wrote:
>>> Hi Beng,
>>>
>>> Would you please send the patch you applied on top of Xen to the list?
>>> I think many people are interested in that.
>>>
>>> Thanks,
>>> Jun
>>>
>>>
>>>
>>
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 19:04:11.000000000 -0400
>> @@ -208,7 +208,7 @@ void pciback_release_pci_dev(struct pcib
>>        }
>>
>>        spin_unlock_irqrestore(&dev_data->lock, flags);
>> -       pcistub_put_pci_dev(found_dev);
>> +       pcistub_put_pci_dev(found_dev, 0);
>>  }
>>
>>  int pciback_init_devices(struct pciback_device *pdev)
>> @@ -396,7 +396,7 @@ void pciback_release_devices(struct pcib
>>                list_for_each_entry_safe(dev_entry, d,
>>                                         &cntrl_entry->dev_list, list) {
>>                        list_del(&dev_entry->list);
>> -                       pcistub_put_pci_dev(dev_entry->dev);
>> +                       pcistub_put_pci_dev(dev_entry->dev, 0);
>>                        kfree(dev_entry);
>>                }
>>                list_del(&cntrl_entry->list);
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 19:04:11.000000000 -0400
>> @@ -88,7 +88,7 @@ void pciback_release_pci_dev(struct pcib
>>        spin_unlock_irqrestore(&dev_data->lock, flags);
>>
>>        if (found_dev)
>> -               pcistub_put_pci_dev(found_dev);
>> +               pcistub_put_pci_dev(found_dev, 1);
>>  }
>>
>>  int pciback_init_devices(struct pciback_device *pdev)
>> @@ -157,7 +157,7 @@ void pciback_release_devices(struct pcib
>>
>>        list_for_each_entry_safe(dev_entry, t, &dev_data->dev_list, list) {
>>                list_del(&dev_entry->list);
>> -               pcistub_put_pci_dev(dev_entry->dev);
>> +               pcistub_put_pci_dev(dev_entry->dev, 1);
>>                kfree(dev_entry);
>>        }
>>
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 19:04:11.000000000 -0400
>> @@ -25,6 +25,14 @@ struct pci_dev_entry {
>>  #define _PCIB_op_pending       (1)
>>  #define PCIB_op_pending                (1<<(_PCIB_op_pending))
>>
>> +#define PCIBACK_TYPE_UNKNOWN       0
>> +#define PCIBACK_TYPE_PCIe_ENDPOINT 1
>> +#define PCIBACK_TYPE_PCIe_BRIDGE   2
>> +#define PCIBACK_TYPE_PCI_BRIDGE    3
>> +#define PCIBACK_TYPE_PCI           4
>> +
>> +#define DEV_CLASS_PCI_PCI_BRIDGE 0x0604
>> +
>>  struct pciback_device {
>>        void *pci_dev_data;
>>        spinlock_t dev_lock;
>> @@ -48,6 +56,13 @@ struct pciback_dev_data {
>>        struct list_head config_fields;
>>        int permissive;
>>        int warned_on_write;
>> +       u32 dev_type;
>> +       int no_flr;
>> +       int exp_flr_offset;
>> +       int af_flr_offset;
>> +       int use_sbr;
>> +       int use_d3r;
>> +       u8 *cfg_space; /* saved config space for device */
>>  };
>>
>>  /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
>> @@ -56,11 +71,25 @@ struct pci_dev *pcistub_get_pci_dev_by_s
>>                                            int slot, int func);
>>  struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
>>                                    struct pci_dev *dev);
>> -void pcistub_put_pci_dev(struct pci_dev *dev);
>> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr);
>> +
>> +/* Reference/unreference PCI Devices and stubs without changing the state */
>> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev);
>> +void pcistub_unref_pci_dev(struct pci_dev *dev);
>> +
>> +/* Store/reload config space for devices */
>> +void pciback_store_config_space(struct pci_dev *dev);
>> +void pciback_reload_config_space(struct pci_dev *dev);
>>
>>  /* Ensure a device is turned off or reset */
>>  void pciback_reset_device(struct pci_dev *pdev);
>>
>> +/* Do a function level reset (or approximage functionality) for device */
>> +void pciback_flr_device(struct pci_dev *dev);
>> +
>> +/* Helper to classify the device type */
>> +void pciback_classify_device(struct pci_dev *dev);
>> +
>>  /* Access a virtual configuration space for a PCI device */
>>  int pciback_config_init(void);
>>  int pciback_config_init_dev(struct pci_dev *dev);
>> @@ -102,6 +131,10 @@ void pciback_release_devices(struct pcib
>>  irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
>>  void pciback_do_op(void *data);
>>
>> +/* Parse and load device specific module parameters */
>> +int pciback_parse_device_params(const char *device_args, int type,
>> +                                       int (*add_func) (int domain, int bus, int slot, int func, int type));
>> +
>>  int pciback_xenbus_register(void);
>>  void pciback_xenbus_unregister(void);
>>
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 19:04:11.000000000 -0400
>> @@ -5,20 +5,189 @@
>>  */
>>  #include <linux/module.h>
>>  #include <linux/wait.h>
>> +#include <linux/delay.h> /* For mdelay function */
>>  #include <asm/bitops.h>
>>  #include <xen/evtchn.h>
>>  #include "pciback.h"
>>
>> +#define PCIBACK_VENDOR_INTEL     0x8086
>> +#define PCIBACK_CLASS_ID_USB     0x0c03
>> +#define PCIBACK_CLASS_ID_VGA     0x0300
>> +#define PCIBACK_USB_FLRCTRL      0x4
>> +
>> +#define PCIBACK_IGFX_CAP09_OFFSET    0xa4
>> +#define PCIBACK_IGFX_CAP13_OFFSET    0xa4
>> +
>> +#define PCIBACK_IGFX_MEDIARST        0x0d
>> +#define PCIBACK_IGFX_MEDIARST_OFFSET 0xc0
>> +
>>  int verbose_request = 0;
>>  module_param(verbose_request, int, 0644);
>>
>> +struct pcistub_sbr_entry {
>> +       struct list_head dev_list;
>> +       struct pci_dev *dev;
>> +};
>> +
>> +struct pcistub_sbr_list {
>> +       struct list_head dev_list;
>> +       struct pci_dev *bridge;
>> +       struct pci_dev *dev;
>> +       int find_all;
>> +       int err;
>> +};
>> +
>> +/* Used to store the config state so it can be restored after
>> + * resets.
>> + */
>> +void pciback_store_config_space(struct pci_dev *dev)
>> +{
>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>> +       u32 *ptr = (u32*)dev_data->cfg_space;
>> +       int i, count = dev->cfg_size/sizeof(u32);
>> +
>> +       for (i = 0; i < count; i += sizeof(u32), ptr++)
>> +               pci_read_config_dword(dev, i, ptr);
>> +}
>> +
>> +/* Used to reload the config state after resets.
>> + */
>> +void pciback_reload_config_space(struct pci_dev *dev)
>> +{
>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>> +       u32 *ptr = (u32*)dev_data->cfg_space;
>> +       int i, val, count = dev->cfg_size/sizeof(u32);
>> +
>> +       for (i = 0; i < count; i += sizeof(u32), ptr++) {
>> +               pci_read_config_dword(dev, i, &val);
>> +               if (val != *ptr)
>> +                       pci_write_config_dword(dev, i, *ptr);
>> +       }
>> +}
>> +
>> +static void pciback_walk_bus_cb(struct pci_dev *dev, void *userdata)
>> +{
>> +       struct pcistub_sbr_list *list = (struct pcistub_sbr_list*)userdata;
>> +       struct pcistub_sbr_entry *entry;
>> +       struct pci_dev *dev_tmp;
>> +
>> +       if (list->err != 0)
>> +               return;
>> +
>> +       /* For PCIe endpoints we are only looking for co-assigned functions */
>> +       if (!list->find_all &&
>> +               (dev->bus->number != list->dev->bus->number ||
>> +                PCI_SLOT(dev->devfn) != PCI_SLOT(list->dev->devfn)))
>> +               return;
>> +
>> +       dev_tmp = pcistub_ref_pci_dev(dev);
>> +       if (dev_tmp == NULL) {
>> +               /* not controlled by pciback, fail */
>> +               list->err = ENXIO;
>> +               return;
>> +       }
>> +
>> +       entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
>> +       if (entry == NULL) {
>> +               pcistub_unref_pci_dev(dev_tmp);
>> +               list->err = ENOMEM;
>> +               return;
>> +       }
>> +
>> +       entry->dev = dev_tmp;
>> +       list_add_tail(&entry->dev_list, &list->dev_list);
>> +}
>> +
>> +static void pciback_cleanup_sbr_list(struct pcistub_sbr_list *list)
>> +{
>> +       struct pcistub_sbr_entry *entry;
>> +
>> +       list_for_each_entry(entry, &list->dev_list, dev_list) {
>> +               pcistub_unref_pci_dev(entry->dev);
>> +               kfree(entry);
>> +       }
>> +}
>> +
>> +/* Routine to find all devices and bridges that need to be reset
>> + * during a secondary bus reset. For PCIe this is simply all the
>> + * functions on the particular device. For PCI this is all devices
>> + * and bridges below the topmost PCI/PCI-X bridge. Note for PCI,
>> + * there is at least one something->PCI/PCI-X bridge to find since
>> + * the device is not on the host bus 0 and is on a PCI bus.
>> + */
>> +static int pciback_get_sbr_list(struct pci_dev *dev,
>> +       struct pcistub_sbr_list *list, int pcie_endpoint)
>> +{
>> +       struct pci_dev *bridge = dev->bus->self;
>> +       struct pci_dev *last = NULL;
>> +       int exp_pos;
>> +       u16 exp_caps = 0;
>> +
>> +       list->err = 0;
>> +       list->dev = dev;
>> +       INIT_LIST_HEAD(&list->dev_list);
>> +
>> +       if (!pcie_endpoint) {
>> +               while (bridge) {
>> +                       /* Looking for the uppermost PCI/PCI-X bridge. If it is not PCIe then
>> +                        * this is a PCI/PCI-X bridge. If it is PCIe then except the PCIe to
>> +                        * PCI/PCI-X type 7, the rest of the bridge types are PCIe so the last
>> +                        * bridge encountered was the topmost PCI/PCI-X bridge.
>> +                        */
>> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
>> +                       if (exp_pos != 0) {
>> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>> +                               if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE)
>> +                                       break; /* don't want it in the list if it is a PCIe bridge */
>> +                       }
>> +                       last = bridge;
>> +                       bridge = last->bus->self;
>> +               }
>> +               list->bridge = last;
>> +               list->find_all = 1; /* find all devices/bridges below the topmost */
>> +       }
>> +       else {
>> +               if (bridge) {
>> +                       /* For PCIe, SBR logic is limited to PCIe endpoints behind a root/switch
>> +                        * port.
>> +                        */
>> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
>> +                       if (likely(exp_pos != 0)) {
>> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>> +                               exp_caps = ((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4);
>> +                               if (exp_caps == PCI_EXP_TYPE_ROOT_PORT ||
>> +                                       exp_caps == PCI_EXP_TYPE_UPSTREAM ||
>> +                                       exp_caps == PCI_EXP_TYPE_DOWNSTREAM)
>> +                                       last = bridge;
>> +                       }
>> +               }
>> +               list->bridge = last;
>> +               list->find_all = 0; /* find just functions on this slot */
>> +       }
>> +
>> +       /* Sanity check, there may not be any appropriate bridge to reset */
>> +       if (!list->bridge) {
>> +               dev_dbg(&dev->dev, "No appropriate bridge to reset\n");
>> +               return ENXIO;
>> +       }
>> +
>> +       pci_walk_bus(list->bridge->subordinate, pciback_walk_bus_cb, list);
>> +
>> +       if (list->err) {
>> +               pciback_cleanup_sbr_list(list);
>> +               return list->err;
>> +       }
>> +
>> +       return 0;
>> +}
>> +
>>  /* Ensure a device is "turned off" and ready to be exported.
>>  * (Also see pciback_config_reset to ensure virtual configuration space is
>>  * ready to be re-exported)
>>  */
>>  void pciback_reset_device(struct pci_dev *dev)
>>  {
>> -       u16 cmd;
>> +       u16 cmd = 0;
>>
>>        /* Disable devices (but not bridges) */
>>        if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
>> @@ -38,6 +207,425 @@ void pciback_reset_device(struct pci_dev
>>                }
>>        }
>>  }
>> +
>> +/* Do a PCIe type function level reset for a single function on this
>> + * device.
>> + */
>> +static void pciback_do_pcie_flr(struct pci_dev *dev, int exp_pos)
>> +{
>> +       u16 status = 0;
>> +
>> +       dev_dbg(&dev->dev, "doing PCIe FLR\n");
>> +
>> +       pci_block_user_cfg_access(dev);
>> +
>> +       /* Wait for Transaction Pending bit clean */
>> +       msleep(100);
>> +       pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
>> +       if (status & PCI_EXP_DEVSTA_TRPND) {
>> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
>> +               ssleep(1);
>> +               pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
>> +               if (status & PCI_EXP_DEVSTA_TRPND)
>> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
>> +       }
>> +
>> +       pci_write_config_word(dev, exp_pos + PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
>> +       mdelay(200);
>> +
>> +       pciback_reload_config_space(dev);
>> +
>> +       pci_unblock_user_cfg_access(dev);
>> +}
>> +
>> +/* Do a PCI type function level reset for a single function on this
>> + * device. This uses the Advanced Features Capability extensions to
>> + * the PCI spec.
>> + */
>> +static void pciback_do_pci_flr(struct pci_dev *dev, int af_pos, int clear_cmd)
>> +{
>> +       u8 status = 0;
>> +
>> +       dev_dbg(&dev->dev, "doing PCI FLR\n");
>> +
>> +       pci_block_user_cfg_access(dev);
>> +
>> +       /* Clear the command register to prevent new transactions */
>> +       if (clear_cmd)
>> +               pci_write_config_word(dev, PCI_COMMAND, 0);
>> +
>> +       /* Wait for Transaction Pending bit clean */
>> +       msleep(100);
>> +       pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
>> +       if (status & PCI_AF_STA_TP) {
>> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
>> +               ssleep(1);
>> +               pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
>> +               if (status & PCI_AF_STA_TP)
>> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
>> +       }
>> +
>> +       pci_write_config_byte(dev, af_pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
>> +       mdelay(200);
>> +
>> +       pciback_reload_config_space(dev);
>> +
>> +       pci_unblock_user_cfg_access(dev);
>> +}
>> +
>> +/* Vendor specific resets. These can be set in the vendor specific
>> + * capabilities structures. Currently only the Intel USB and iGFX
>> + * reset is supported.
>> + */
>> +static int pciback_do_vendor_specific_reset(struct pci_dev *dev)
>> +{
>> +       struct pci_dev *gmch;
>> +       int vendor_pos, i;
>> +       u32 reg32 = 0;
>> +       u16 device_id, cmd;
>> +       u8 reg8 = 0;
>> +
>> +       dev_dbg(&dev->dev, "doing vendor specific resets\n");
>> +
>> +       if (dev->vendor != PCIBACK_VENDOR_INTEL)
>> +               return -ENXIO;
>> +
>> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
>> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0))
>> +                       return -ENXIO;
>> +
>> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
>> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
>> +               if (!gmch)
>> +                       return -ENXIO;
>> +
>> +               device_id = gmch->device;
>> +               pci_dev_put(gmch);
>> +
>> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHGM45)
>> +                       return -ENXIO;
>> +
>> +               /* Correct device and platform, assume vendor specific offset */
>> +               pci_read_config_dword(dev, PCIBACK_IGFX_CAP09_OFFSET, &reg32);
>> +               if ((reg32 & 0x000000FF) != PCI_CAP_ID_VNDR ||
>> +                       ((reg32 >> 16) & 0x000000FF) != 0x06 ||
>> +                       ((reg32 >> 24) & 0x000000F0) != 0x20)
>> +                       return -ENXIO;
>> +
>> +               vendor_pos = PCIBACK_IGFX_CAP09_OFFSET;
>> +       } else if ((dev->class >> 8) == PCIBACK_CLASS_ID_USB) {
>> +               vendor_pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
>> +               if (vendor_pos == 0)
>> +                       return -ENXIO;
>> +       }
>> +       else
>> +               return -ENXIO;
>> +
>> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
>> +               pci_write_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, PCIBACK_IGFX_MEDIARST);
>> +               for (i = 0; i <= 10; i++) {
>> +                       msleep(100);
>> +                       pci_read_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, &reg8);
>> +                       if ((reg8 & 0x01) == 0)
>> +                               break;
>> +                       if (i == 10) {
>> +                               dev_warn(&dev->dev, "media not reset after 1s; skipping FLR\n");
>> +                               goto out;
>> +                       }
>> +               }
>> +
>> +               /* This specific reset will hang if the command register does not have
>> +                * memory space access enabled */
>> +               pci_read_config_word(dev, PCI_COMMAND, &cmd);
>> +               pci_write_config_word(dev, PCI_COMMAND, (cmd | PCI_COMMAND_MEMORY));
>> +               /* The rest is the same as a PCI AF FLR - use the same routine */
>> +               pciback_do_pci_flr(dev, vendor_pos, 0);
>> +               pci_write_config_word(dev, PCI_COMMAND, cmd);
>> +       } else {
>> +               pci_block_user_cfg_access(dev);
>> +
>> +               pci_write_config_byte(dev, vendor_pos + PCIBACK_USB_FLRCTRL, 1);
>> +               mdelay(200);
>> +
>> +               pciback_reload_config_space(dev);
>> +
>> +               pci_unblock_user_cfg_access(dev);
>> +       }
>> +
>> +out:
>> +       return 0;
>> +}
>> +
>> +/* Use a D0-D3-D0 device state transition to reset the device. This
>> + * is a good enough reset for some devices (like NICs).
>> + */
>> +static int pciback_do_dstate_transition_reset(struct pci_dev *dev)
>> +{
>> +       int pm_pos;
>> +       u32 pm_ctl = 0;
>> +
>> +       pm_pos = pci_find_capability(dev, PCI_CAP_ID_PM);
>> +       if (pm_pos == 0)
>> +               return -ENXIO;
>> +
>> +       dev_dbg(&dev->dev, "doing Dstate transition reset\n");
>> +
>> +       /* No_Soft_Reset - When set 1, this bit indicates that devices
>> +        * transitioning from D3hot to D0 because of PowerState commands
>> +        * do not perform an internal reset.
>> +        */
>> +       pci_read_config_dword(dev, pm_pos + PCI_PM_CTRL, &pm_ctl);
>> +       if (pm_ctl & PCI_PM_CTRL_NO_SOFT_RESET)
>> +               return -ENXIO;
>> +
>> +       pci_block_user_cfg_access(dev);
>> +
>> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
>> +       pm_ctl |= PCI_PM_CTRL_D3HOT;
>> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
>> +       mdelay(10);
>> +
>> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
>> +       pm_ctl |= PCI_PM_CTRL_D0;
>> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
>> +       mdelay(10);
>> +
>> +       pciback_reload_config_space(dev);
>> +
>> +       pci_unblock_user_cfg_access(dev);
>> +
>> +       return 0;
>> +}
>> +
>> +/* Do a secondary bus reset on a bridge. This is only done if all
>> + * co-assignment rules are satisfied and if it was explicitly
>> + * requested via pciback parameters.
>> + */
>> +static int pciback_do_secondary_bus_reset(struct pci_dev *dev, u32 dev_type)
>> +{
>> +       struct pcistub_sbr_list sbr_list;
>> +       struct pcistub_sbr_entry *entry;
>> +       u16 pci_bctl = 0;
>> +       int err = 0;
>> +
>> +       /* Call helper to get the device list needed for the device type. */
>> +       err = pciback_get_sbr_list(dev, &sbr_list,
>> +                       (dev_type == PCIBACK_TYPE_PCIe_ENDPOINT ? 1 : 0));
>> +       if (err) {
>> +               dev_warn(&dev->dev,
>> +                       "secondary bus reset failed for device - all functions need to be co-assigned - err: %d\n", err);
>> +               return err;
>> +       }
>> +
>> +       pci_block_user_cfg_access(dev);
>> +
>> +       /* Reset the secondary bus and restore the PCI space for all the devfn found above.
>> +        */
>> +       pci_read_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, &pci_bctl);
>> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl | PCI_BRIDGE_CTL_BUS_RESET);
>> +       msleep(200);
>> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl);
>> +       msleep(200);
>> +
>> +       list_for_each_entry(entry, &sbr_list.dev_list, dev_list) {
>> +               pciback_reload_config_space(entry->dev);
>> +       }
>> +
>> +       pci_unblock_user_cfg_access(dev);
>> +
>> +       pciback_cleanup_sbr_list(&sbr_list);
>> +
>> +       return 0;
>> +}
>> +
>> +/* This function is used to do a function level reset on a singe
>> + * device/function. FLRs must be done on devices before they are
>> + * unassigned from one domain and passed through to another. The
>> + * preferred method is to do an actual FLR on the device but the
>> + * functionality may not be present or exposed. In the later case
>> + * we attempt to locate the capability even though it is not
>> + * chained into the capabilities list.
>> + *
>> + * In some cases, there is no way to perform the actual FLR so we
>> + * fall back to some alternate methods (which are not as effective
>> + * or useful).
>> + */
>> +void pciback_flr_device(struct pci_dev *dev)
>> +{
>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>> +       int err = 0;
>> +
>> +       if (dev_data->no_flr) {
>> +               dev_dbg(&dev->dev, "FLR disabled for device\n");
>> +               return;
>> +       }
>> +       dev_dbg(&dev->dev, "FLR invoked for device\n");
>> +
>> +       do {
>> +               /* First, always try to do an FLR */
>> +               if (dev_data->dev_type == PCIBACK_TYPE_PCIe_ENDPOINT &&
>> +                       dev_data->exp_flr_offset != 0) {
>> +                       pciback_do_pcie_flr(dev, dev_data->exp_flr_offset);
>> +                       break;
>> +               }
>> +               if (dev_data->dev_type == PCIBACK_TYPE_PCI &&
>> +                       dev_data->af_flr_offset != 0) {
>> +                       pciback_do_pci_flr(dev, dev_data->af_flr_offset, 1);
>> +                       break;
>> +               }
>> +
>> +               /* Next for integrated devices on the host bus 0, try some other methods */
>> +               if (dev->bus->number == 0) {
>> +                       err = pciback_do_vendor_specific_reset(dev);
>> +                       if (err && dev_data->use_d3r)
>> +                               err = pciback_do_dstate_transition_reset(dev);
>> +                       if (err)
>> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
>> +                                               "attempts to use vendor FLR or D-states unsuccessful\n");
>> +                       break;
>> +               }
>> +
>> +               /* Else attempt a secondary bus reset if all conditions are met */
>> +               if (dev_data->use_sbr) {
>> +                       err = pciback_do_secondary_bus_reset(dev, dev_data->dev_type);
>> +                       if (err)
>> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
>> +                                               "attempts to use secondary bus reset unsuccessful;\n");
>> +                       break;
>> +               }
>> +
>> +               err = -ENODEV;
>> +       } while (0);
>> +
>> +       if (err)
>> +               dev_warn(&dev->dev, "FLR not performed for device\n");
>> +}
>> +
>> +/* Helper used to location the FLR capabilities for a PCIe device.
>> + * When the capability cannot be found in the chain but is present,
>> + * special logic is used to attempt to locate functionality.
>> + *
>> + * returns: the offset to the capability, zero if not found.
>> + */
>> +static int pciback_find_pcie_flr_caps(struct pci_dev *dev)
>> +{
>> +       int exp_pos;
>> +       u32 cap = 0;
>> +
>> +       /* First look for the PCIe FLR capabilities using the capabilities list */
>> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
>> +       if (exp_pos) {
>> +               pci_read_config_dword(dev, exp_pos + PCI_EXP_DEVCAP, &cap);
>> +               if (cap & PCI_EXP_DEVCAP_FLR) {
>> +                       return exp_pos;
>> +               }
>> +       }
>> +
>> +       return 0;
>> +}
>> +
>> +/* Helper used to location the AF FLR capabilities for a PCI device.
>> + * When the capability cannot be found in the chain but is present,
>> + * special logic is used to attempt to locate functionality.
>> + *
>> + * returns: the offset to the capability, zero if not found.
>> + */
>> +static int pciback_find_pci_flr_caps(struct pci_dev *dev)
>> +{
>> +       struct pci_dev *gmch;
>> +       int af_pos;
>> +       u16 device_id;
>> +       u8 cap = 0, reg8 = 0;
>> +
>> +       /* First look for the PCI AF capabilities for FLR using the capabilities list. This
>> +        * is only used on the devices on the root/host bus (integrated devices).
>> +        */
>> +       if (dev->bus->number != 0)
>> +               return 0;
>> +
>> +       af_pos = pci_find_capability(dev, PCI_CAP_ID_AF);
>> +       if (af_pos) {
>> +               pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
>> +               if (cap & PCI_AF_CAP_FLR) {
>> +                       return af_pos;
>> +               }
>> +       }
>> +
>> +       /* Next look for the unchained AF capabilities for FLR using specific
>> +        * logic. Currently only the graphics device on the Intel Q45 etc
>> +        * systems has special logic for locating the hidden FLR caps.
>> +     */
>> +       do {
>> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0) ||
>> +                       dev->vendor != PCIBACK_VENDOR_INTEL || (dev->class >> 8) != PCIBACK_CLASS_ID_VGA)
>> +                       break;
>> +
>> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
>> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
>> +               if (!gmch)
>> +                       break;
>> +
>> +               device_id = gmch->device;
>> +               pci_dev_put(gmch);
>> +
>> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHQ45 &&
>> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG45 &&
>> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG41)
>> +                       break;
>> +
>> +               /* Correct device and platform, assume AF offset */
>> +               af_pos = PCIBACK_IGFX_CAP13_OFFSET;
>> +               pci_read_config_byte(dev, af_pos + PCI_AF_LENFLD, &reg8);
>> +               if (reg8 == PCI_AF_LENGTH) {
>> +                       pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
>> +                       if (cap & PCI_AF_CAP_FLR) {
>> +                               return af_pos;
>> +                       }
>> +               }
>> +       } while (0);
>> +
>> +       /* Else not found */
>> +       return 0;
>> +}
>> +
>> +/* Classify the device, specifically determine if it is PCIe/PCI
>> + * and whether it is a PCIe endpoint, bridge, or other PCI device.
>> + */
>> +void pciback_classify_device(struct pci_dev *dev)
>> +{
>> +       struct pciback_dev_data *dev_data;
>> +       int exp_pos;
>> +       u16 exp_caps = 0;
>> +
>> +       dev_data = pci_get_drvdata(dev);
>> +       dev_data->dev_type = PCIBACK_TYPE_UNKNOWN;
>> +
>> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
>> +
>> +       if ((dev->class >> 8) != DEV_CLASS_PCI_PCI_BRIDGE) {
>> +               if (exp_pos != 0) {
>> +                       dev_data->dev_type = PCIBACK_TYPE_PCIe_ENDPOINT;
>> +                       dev_data->exp_flr_offset = pciback_find_pcie_flr_caps(dev);
>> +               } else {
>> +                       dev_data->dev_type = PCIBACK_TYPE_PCI;
>> +                       dev_data->af_flr_offset = pciback_find_pci_flr_caps(dev);
>> +               }
>> +               goto classify_done;
>> +       }
>> +
>> +       if (exp_pos == 0) {
>> +               dev_data->dev_type = PCIBACK_TYPE_PCI_BRIDGE;
>> +               goto classify_done;
>> +       }
>> +
>> +       pci_read_config_word(dev, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>> +       dev_data->dev_type = (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) == PCI_EXP_TYPE_PCI_BRIDGE) ? PCIBACK_TYPE_PCI_BRIDGE : PCIBACK_TYPE_PCIe_BRIDGE;
>> +
>> +classify_done:
>> +
>> +       return;
>> +}
>> +
>>  extern wait_queue_head_t aer_wait_queue;
>>  extern struct workqueue_struct *pciback_wq;
>>  /*
>> @@ -132,3 +720,51 @@ irqreturn_t pciback_handle_event(int irq
>>
>>        return IRQ_HANDLED;
>>  }
>> +
>> +/* Helper routine used to parse command line parameters passed to the
>> + * pciback module from the boot loader. These params all have the form
>> + * of a list of one or more devices, e.g.:
>> + * (XXXX:XX:XX.X)(XXXX:XX:XX.X)
>> + * Which is: (domain/segment:bus:dev.func)
>> + */
>> +int pciback_parse_device_params(const char *device_args, int type,
>> +                       int (*add_func) (int domain, int bus, int slot, int func, int type))
>> +{
>> +       int pos = 0;
>> +       int err = 0;
>> +       int domain, bus, slot, func;
>> +       int parsed;
>> +
>> +       if (device_args && *device_args) {
>> +               do {
>> +                       parsed = 0;
>> +
>> +                       err = sscanf(device_args + pos,
>> +                                    " (%x:%x:%x.%x) %n",
>> +                                    &domain, &bus, &slot, &func, &parsed);
>> +                       if (err != 4) {
>> +                               domain = 0;
>> +                               err = sscanf(device_args + pos,
>> +                                            " (%x:%x.%x) %n",
>> +                                            &bus, &slot, &func, &parsed);
>> +                               if (err != 3)
>> +                                       goto parse_error;
>> +                       }
>> +
>> +                       err = add_func(domain, bus, slot, func, type);
>> +                       if (err)
>> +                               goto out;
>> +
>> +                       /* if parsed<=0, we've reached the end of the string */
>> +                       pos += parsed;
>> +               } while (parsed > 0 && device_args[pos]);
>> +       }
>> +
>> +out:
>> +       return err;
>> +
>> +parse_error:
>> +       printk(KERN_ERR "pciback: Error parsing device parameters \"%s\" at \"%s\"\n",
>> +              device_args, device_args + pos);
>> +       return -EINVAL;
>> +}
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 19:04:11.000000000 -0400
>> @@ -24,10 +24,28 @@ wait_queue_head_t aer_wait_queue;
>>  * We want to avoid in middle of AER ops, pciback devices is being removed
>>  */
>>  static DECLARE_RWSEM(pcistub_sem);
>> -module_param_named(hide, pci_devs_to_hide, charp, 0444);
>> +module_param_named(hide, pci_devs_to_hide, charp, S_IRUGO);
>> +
>> +static char *pci_devs_use_sbr = NULL;
>> +module_param_named(sbr, pci_devs_use_sbr, charp, S_IRUGO);
>> +
>> +static char *pci_devs_use_d3r = NULL;
>> +module_param_named(d3r, pci_devs_use_d3r, charp, S_IRUGO);
>> +
>> +static char *pci_devs_no_flr = NULL;
>> +module_param_named(noflr, pci_devs_no_flr, charp, S_IRUGO);
>> +
>> +/* Device id list holding different device type listings
>> + * for hiding devices and reset logic.
>> + */
>> +#define PCIBACK_ID_TYPE_HIDE  1
>> +#define PCIBACK_ID_TYPE_SBR   2
>> +#define PCIBACK_ID_TYPE_D3R   3
>> +#define PCIBACK_ID_TYPE_NOFLR 4
>>
>>  struct pcistub_device_id {
>>        struct list_head slot_list;
>> +       int type;
>>        int domain;
>>        unsigned char bus;
>>        unsigned int devfn;
>> @@ -56,6 +74,8 @@ static LIST_HEAD(pcistub_devices);
>>  static int initialize_devices = 0;
>>  static LIST_HEAD(seized_devices);
>>
>> +static int disable_all_flr = 0;
>> +
>>  static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
>>  {
>>        struct pcistub_device *psdev;
>> @@ -78,6 +98,23 @@ static struct pcistub_device *pcistub_de
>>        return psdev;
>>  }
>>
>> +static struct pciback_dev_data *pcistub_dev_data_alloc(struct pci_dev *dev)
>> +{
>> +       struct pciback_dev_data *dev_data;
>> +
>> +       dev_dbg(&dev->dev, "pcistub_dev_data_alloc\n");
>> +
>> +       dev_data = kzalloc(sizeof(*dev_data) + dev->cfg_size, GFP_ATOMIC);
>> +       if (!dev_data)
>> +               return NULL;
>> +
>> +       pci_set_drvdata(dev, dev_data);
>> +
>> +       dev_data->cfg_space = (u8*)(dev_data) + sizeof(*dev_data);
>> +
>> +       return dev_data;
>> +}
>> +
>>  /* Don't call this directly as it's called by pcistub_device_put */
>>  static void pcistub_device_release(struct kref *kref)
>>  {
>> @@ -200,7 +237,7 @@ struct pci_dev *pcistub_get_pci_dev(stru
>>        return found_dev;
>>  }
>>
>> -void pcistub_put_pci_dev(struct pci_dev *dev)
>> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr)
>>  {
>>        struct pcistub_device *psdev, *found_psdev = NULL;
>>        unsigned long flags;
>> @@ -220,6 +257,13 @@ void pcistub_put_pci_dev(struct pci_dev
>>        * pcistub and pciback when AER is in processing
>>        */
>>        down_write(&pcistub_sem);
>> +
>> +       /* For pass-through devices, do an FLR (or approximate) for the device
>> +        * before it is put back and ready for the next domain
>> +        */
>> +       if (!disable_all_flr && do_flr)
>> +               pciback_flr_device(dev);
>> +
>>        /* Cleanup our device
>>         * (so it's ready for the next domain)
>>         */
>> @@ -235,6 +279,43 @@ void pcistub_put_pci_dev(struct pci_dev
>>        up_write(&pcistub_sem);
>>  }
>>
>> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev)
>> +{
>> +       struct pcistub_device *psdev;
>> +       struct pci_dev *found_dev = NULL;
>> +       unsigned long flags;
>> +
>> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
>> +
>> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
>> +               if (psdev->dev == dev) {
>> +                       pcistub_device_get(psdev); /* just a ref count */
>> +                       found_dev = psdev->dev;
>> +                       break;
>> +               }
>> +       }
>> +
>> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
>> +       return found_dev;
>> +}
>> +
>> +void pcistub_unref_pci_dev(struct pci_dev *dev)
>> +{
>> +       struct pcistub_device *psdev;
>> +       unsigned long flags;
>> +
>> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
>> +
>> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
>> +               if (psdev->dev == dev) {
>> +                       pcistub_device_get(psdev); /* just an unref count */
>> +                       break;
>> +               }
>> +       }
>> +
>> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
>> +}
>> +
>>  static int __devinit pcistub_match_one(struct pci_dev *dev,
>>                                       struct pcistub_device_id *pdev_id)
>>  {
>> @@ -255,7 +336,7 @@ static int __devinit pcistub_match_one(s
>>        return 0;
>>  }
>>
>> -static int __devinit pcistub_match(struct pci_dev *dev)
>> +static int __devinit pcistub_match(struct pci_dev *dev, int type)
>>  {
>>        struct pcistub_device_id *pdev_id;
>>        unsigned long flags;
>> @@ -263,6 +344,8 @@ static int __devinit pcistub_match(struc
>>
>>        spin_lock_irqsave(&device_ids_lock, flags);
>>        list_for_each_entry(pdev_id, &pcistub_device_ids, slot_list) {
>> +               if (pdev_id->type != type)
>> +                       continue;
>>                if (pcistub_match_one(dev, pdev_id)) {
>>                        found = 1;
>>                        break;
>> @@ -285,12 +368,11 @@ static int __devinit pcistub_init_device
>>         * would need to be called somewhere to free the memory allocated
>>         * here and then to call kfree(pci_get_drvdata(psdev->dev)).
>>         */
>> -       dev_data = kzalloc(sizeof(*dev_data), GFP_ATOMIC);
>> +       dev_data = pcistub_dev_data_alloc(dev);
>>        if (!dev_data) {
>>                err = -ENOMEM;
>>                goto out;
>>        }
>> -       pci_set_drvdata(dev, dev_data);
>>
>>        dev_dbg(&dev->dev, "initializing config\n");
>>
>> @@ -317,6 +399,22 @@ static int __devinit pcistub_init_device
>>        dev_dbg(&dev->dev, "reset device\n");
>>        pciback_reset_device(dev);
>>
>> +       /* Classify the device so we know if it is PCI/PCIe and if it is
>> +        * a bridge - this information is used for FLR logic. Also store
>> +        * values if SBR/D3R reset logic was requested.
>> +        */
>> +       pciback_classify_device(dev);
>> +       dev_data->no_flr = pcistub_match(dev, PCIBACK_ID_TYPE_NOFLR);
>> +       if (!dev_data->no_flr) {
>> +               dev_data->use_sbr = pcistub_match(dev, PCIBACK_ID_TYPE_SBR);
>> +               dev_data->use_d3r = pcistub_match(dev, PCIBACK_ID_TYPE_D3R);
>> +       }
>> +
>> +       /* Store the config space here where the device is off and ready to be
>> +        * exported before any FLRs or other resets are done
>> +        */
>> +       pciback_store_config_space(dev);
>> +
>>        return 0;
>>
>>       config_release:
>> @@ -414,7 +512,7 @@ static int __devinit pcistub_probe(struc
>>
>>        dev_dbg(&dev->dev, "probing...\n");
>>
>> -       if (pcistub_match(dev)) {
>> +       if (pcistub_match(dev, PCIBACK_ID_TYPE_HIDE)) {
>>
>>                if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL
>>                    && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
>> @@ -851,7 +949,7 @@ static inline int str_to_quirk(const cha
>>        return -EINVAL;
>>  }
>>
>> -static int pcistub_device_id_add(int domain, int bus, int slot, int func)
>> +static int pcistub_device_id_add(int domain, int bus, int slot, int func, int type)
>>  {
>>        struct pcistub_device_id *pci_dev_id;
>>        unsigned long flags;
>> @@ -860,12 +958,13 @@ static int pcistub_device_id_add(int dom
>>        if (!pci_dev_id)
>>                return -ENOMEM;
>>
>> +       pci_dev_id->type = type;
>>        pci_dev_id->domain = domain;
>>        pci_dev_id->bus = bus;
>>        pci_dev_id->devfn = PCI_DEVFN(slot, func);
>>
>> -       pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
>> -                domain, bus, slot, func);
>> +       pr_debug("pciback: adding device ID type: %d for %04x:%02x:%02x.%01x\n",
>> +                type, domain, bus, slot, func);
>>
>>        spin_lock_irqsave(&device_ids_lock, flags);
>>        list_add_tail(&pci_dev_id->slot_list, &pcistub_device_ids);
>> @@ -874,7 +973,7 @@ static int pcistub_device_id_add(int dom
>>        return 0;
>>  }
>>
>> -static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
>> +static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
>>  {
>>        struct pcistub_device_id *pci_dev_id, *t;
>>        int devfn = PCI_DEVFN(slot, func);
>> @@ -884,7 +983,7 @@ static int pcistub_device_id_remove(int
>>        spin_lock_irqsave(&device_ids_lock, flags);
>>        list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
>>
>> -               if (pci_dev_id->domain == domain
>> +               if (pci_dev_id->type == type && pci_dev_id->domain == domain
>>                    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
>>                        /* Don't break; here because it's possible the same
>>                         * slot could be in the list more than once
>> @@ -939,6 +1038,32 @@ static int pcistub_reg_add(int domain, i
>>        return err;
>>  }
>>
>> +static int pcistub_device_do_flr(int domain, int bus, int slot, int func)
>> +{
>> +       int err = 0;
>> +       struct pcistub_device *psdev;
>> +       struct pci_dev *dev;
>> +
>> +       psdev = pcistub_device_find(domain, bus, slot, func);
>> +       if (!psdev || !psdev->dev) {
>> +               err = -ENODEV;
>> +               goto out;
>> +       }
>> +       dev = psdev->dev;
>> +
>> +       /* Do an FLR (or approximate) for the device on demand and
>> +        * reload config
>> +        */
>> +       if (!disable_all_flr) {
>> +               pciback_flr_device(dev);
>> +       }
>> +       else
>> +               dev_dbg(&dev->dev, "FLR disabled for all devices\n");
>> +
>> +out:
>> +       return err;
>> +}
>> +
>>  static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
>>                                size_t count)
>>  {
>> @@ -949,7 +1074,7 @@ static ssize_t pcistub_slot_add(struct d
>>        if (err)
>>                goto out;
>>
>> -       err = pcistub_device_id_add(domain, bus, slot, func);
>> +       err = pcistub_device_id_add(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>>
>>       out:
>>        if (!err)
>> @@ -969,7 +1094,7 @@ static ssize_t pcistub_slot_remove(struc
>>        if (err)
>>                goto out;
>>
>> -       err = pcistub_device_id_remove(domain, bus, slot, func);
>> +       err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>>
>>       out:
>>        if (!err)
>> @@ -987,6 +1112,10 @@ static ssize_t pcistub_slot_show(struct
>>
>>        spin_lock_irqsave(&device_ids_lock, flags);
>>        list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
>> +               /* only want devices set for hide, not reset entries */
>> +               if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
>> +                       continue;
>> +
>>                if (count >= PAGE_SIZE)
>>                        break;
>>
>> @@ -1068,7 +1197,7 @@ static ssize_t pcistub_quirk_show(struct
>>
>>  DRIVER_ATTR(quirks, S_IRUSR | S_IWUSR, pcistub_quirk_show, pcistub_quirk_add);
>>
>> -static ssize_t permissive_add(struct device_driver *drv, const char *buf,
>> +static ssize_t pcistub_permissive_add(struct device_driver *drv, const char *buf,
>>                              size_t count)
>>  {
>>        int domain, bus, slot, func;
>> @@ -1109,7 +1238,7 @@ static ssize_t permissive_add(struct dev
>>        return err;
>>  }
>>
>> -static ssize_t permissive_show(struct device_driver *drv, char *buf)
>> +static ssize_t pcistub_permissive_show(struct device_driver *drv, char *buf)
>>  {
>>        struct pcistub_device *psdev;
>>        struct pciback_dev_data *dev_data;
>> @@ -1132,7 +1261,68 @@ static ssize_t permissive_show(struct de
>>        return count;
>>  }
>>
>> -DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add);
>> +DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, pcistub_permissive_show, pcistub_permissive_add);
>> +
>> +static ssize_t pcistub_do_flr(struct device_driver *drv, const char *buf,
>> +                                  size_t count)
>> +{
>> +       int domain, bus, slot, func;
>> +       int err;
>> +
>> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
>> +       if (err)
>> +               goto out;
>> +
>> +       err = pcistub_device_do_flr(domain, bus, slot, func);
>> +
>> +out:
>> +       if (!err)
>> +               err = count;
>> +       return err;
>> +}
>> +
>> +DRIVER_ATTR(do_flr, S_IWUSR, NULL, pcistub_do_flr);
>> +
>> +static ssize_t pcistub_resets(struct device_driver *drv, const char *buf,
>> +                                  size_t count)
>> +{
>> +       int domain, bus, slot, func;
>> +       int type, err = 0;
>> +
>> +       /* string begins with reset type specifier sbr=|dr3=|noflr= */
>> +       if (!strncmp(buf, "sbr=", 4)) {
>> +               type = PCIBACK_ID_TYPE_SBR;
>> +               buf += 4;
>> +       } else if (!strncmp(buf, "d3r=", 4)) {
>> +               type = PCIBACK_ID_TYPE_D3R;
>> +               buf += 4;
>> +       } else if (!strncmp(buf, "noflr=", 6)) {
>> +               type = PCIBACK_ID_TYPE_NOFLR;
>> +               buf += 6;
>> +       } else {
>> +               err = -EINVAL;
>> +               goto out;
>> +       }
>> +
>> +       /* check special wildcard noflr */
>> +       if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "(*)", 3)) {
>> +               disable_all_flr = 1;
>> +               goto out;
>> +       }
>> +
>> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
>> +       if (err)
>> +               goto out;
>> +
>> +       err = pcistub_device_id_add(domain, bus, slot, func, type);
>> +
>> +out:
>> +       if (!err)
>> +               err = count;
>> +       return err;
>> +}
>> +
>> +DRIVER_ATTR(resets, S_IWUSR, NULL, pcistub_resets);
>>
>>  #ifdef CONFIG_PCI_MSI
>>
>> @@ -1158,6 +1348,8 @@ static void pcistub_exit(void)
>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_slots);
>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_quirks);
>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_permissive);
>> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_do_flr);
>> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_resets);
>>
>>        pci_unregister_driver(&pciback_pci_driver);
>>        WARN_ON(unregister_msi_get_owner(pciback_get_owner));
>> @@ -1165,35 +1357,27 @@ static void pcistub_exit(void)
>>
>>  static int __init pcistub_init(void)
>>  {
>> -       int pos = 0;
>>        int err = 0;
>> -       int domain, bus, slot, func;
>> -       int parsed;
>>
>> -       if (pci_devs_to_hide && *pci_devs_to_hide) {
>> -               do {
>> -                       parsed = 0;
>> -
>> -                       err = sscanf(pci_devs_to_hide + pos,
>> -                                    " (%x:%x:%x.%x) %n",
>> -                                    &domain, &bus, &slot, &func, &parsed);
>> -                       if (err != 4) {
>> -                               domain = 0;
>> -                               err = sscanf(pci_devs_to_hide + pos,
>> -                                            " (%x:%x.%x) %n",
>> -                                            &bus, &slot, &func, &parsed);
>> -                               if (err != 3)
>> -                                       goto parse_error;
>> -                       }
>> +       /* Parse device lists for hide, sbr, and d3r */
>> +       err = pciback_parse_device_params(pci_devs_to_hide, PCIBACK_ID_TYPE_HIDE, pcistub_device_id_add);
>> +       if (err)
>> +               goto out;
>>
>> -                       err = pcistub_device_id_add(domain, bus, slot, func);
>> -                       if (err)
>> -                               goto out;
>> +       err = pciback_parse_device_params(pci_devs_use_sbr, PCIBACK_ID_TYPE_SBR, pcistub_device_id_add);
>> +       if (err)
>> +               goto out;
>>
>> -                       /* if parsed<=0, we've reached the end of the string */
>> -                       pos += parsed;
>> -               } while (parsed > 0 && pci_devs_to_hide[pos]);
>> -       }
>> +       err = pciback_parse_device_params(pci_devs_use_d3r, PCIBACK_ID_TYPE_D3R, pcistub_device_id_add);
>> +       if (err)
>> +               goto out;
>> +
>> +       if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "(*)", 3))
>> +               disable_all_flr = 1; /* check special wildcard noflr */
>> +       else
>> +               err = pciback_parse_device_params(pci_devs_no_flr, PCIBACK_ID_TYPE_NOFLR, pcistub_device_id_add);
>> +       if (err)
>> +               goto out;
>>
>>        /* If we're the first PCI Device Driver to register, we're the
>>         * first one to get offered PCI devices as they become
>> @@ -1217,6 +1401,12 @@ static int __init pcistub_init(void)
>>        if (!err)
>>                err = driver_create_file(&pciback_pci_driver.driver,
>>                                         &driver_attr_permissive);
>> +       if (!err)
>> +               err = driver_create_file(&pciback_pci_driver.driver,
>> +                                        &driver_attr_do_flr);
>> +       if (!err)
>> +               err = driver_create_file(&pciback_pci_driver.driver,
>> +                                        &driver_attr_resets);
>>
>>        if (!err)
>>                err = register_msi_get_owner(pciback_get_owner);
>> @@ -1225,11 +1415,6 @@ static int __init pcistub_init(void)
>>
>>       out:
>>        return err;
>> -
>> -      parse_error:
>> -       printk(KERN_ERR "pciback: Error parsing pci_devs_to_hide at \"%s\"\n",
>> -              pci_devs_to_hide + pos);
>> -       return -EINVAL;
>>  }
>>
>>  #ifndef MODULE
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 19:04:11.000000000 -0400
>> @@ -109,7 +109,7 @@ void pciback_release_pci_dev(struct pcib
>>        spin_unlock_irqrestore(&slot_dev->lock, flags);
>>
>>        if (found_dev)
>> -               pcistub_put_pci_dev(found_dev);
>> +               pcistub_put_pci_dev(found_dev, 0);
>>  }
>>
>>  int pciback_init_devices(struct pciback_device *pdev)
>> @@ -149,7 +149,7 @@ void pciback_release_devices(struct pcib
>>                for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
>>                        dev = slot_dev->slots[bus][slot];
>>                        if (dev != NULL)
>> -                               pcistub_put_pci_dev(dev);
>> +                               pcistub_put_pci_dev(dev, 0);
>>                }
>>
>>        kfree(slot_dev);
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c
>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 20:48:21.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 19:04:11.000000000 -0400
>> @@ -162,7 +162,7 @@ void pciback_release_pci_dev(struct pcib
>>        spin_unlock_irqrestore(&vpci_dev->lock, flags);
>>
>>        if (found_dev)
>> -               pcistub_put_pci_dev(found_dev);
>> +               pcistub_put_pci_dev(found_dev, 0);
>>  }
>>
>>  int pciback_init_devices(struct pciback_device *pdev)
>> @@ -202,7 +202,7 @@ void pciback_release_devices(struct pcib
>>                list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
>>                                         list) {
>>                        list_del(&e->list);
>> -                       pcistub_put_pci_dev(e->dev);
>> +                       pcistub_put_pci_dev(e->dev, 0);
>>                        kfree(e);
>>                }
>>        }
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_ids.h b/linux-2.6.18-xen.hg/include/linux/pci_ids.h
>> --- a/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 20:48:23.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 19:04:11.000000000 -0400
>> @@ -2259,6 +2259,14 @@
>>  #define PCI_DEVICE_ID_INTEL_IXP2800    0x9004
>>  #define PCI_DEVICE_ID_INTEL_S21152BB   0xb152
>>
>> +#define PCI_DEVICE_ID_INTEL_GMCHQ45 0x2e10
>> +#define PCI_DEVICE_ID_INTEL_GMCHG45 0x2e20
>> +#define PCI_DEVICE_ID_INTEL_MCHP45  0x2e20
>> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
>> +#define PCI_DEVICE_ID_INTEL_GMCHGM45 0x2a40
>> +
>> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
>> +
>>  #define PCI_VENDOR_ID_SCALEMP          0x8686
>>  #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
>>
>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_regs.h b/linux-2.6.18-xen.hg/include/linux/pci_regs.h
>> --- a/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 20:48:23.000000000 -0400
>> +++ b/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 19:04:11.000000000 -0400
>> @@ -201,6 +201,7 @@
>>  #define  PCI_CAP_ID_SHPC       0x0C    /* PCI Standard Hot-Plug Controller */
>>  #define  PCI_CAP_ID_EXP        0x10    /* PCI Express */
>>  #define  PCI_CAP_ID_MSIX       0x11    /* MSI-X */
>> +#define  PCI_CAP_ID_AF      0x13    /* Advanced Features Capability */
>>  #define PCI_CAP_LIST_NEXT      1       /* Next capability in the list */
>>  #define PCI_CAP_FLAGS          2       /* Capability defined flags (16 bits) */
>>  #define PCI_CAP_SIZEOF         4
>> @@ -229,6 +230,11 @@
>>  #define  PCI_PM_CTRL_DATA_SEL_MASK     0x1e00  /* Data select (??) */
>>  #define  PCI_PM_CTRL_DATA_SCALE_MASK   0x6000  /* Data scale (??) */
>>  #define  PCI_PM_CTRL_PME_STATUS        0x8000  /* PME pin status */
>> +#define  PCI_PM_CTRL_DATA_DSTATE_MASK 0x3      /* D0 - D3 */
>> +#define  PCI_PM_CTRL_D0 0x0
>> +#define  PCI_PM_CTRL_D1 0x1
>> +#define  PCI_PM_CTRL_D2 0x2
>> +#define  PCI_PM_CTRL_D3HOT 0x3
>>  #define PCI_PM_PPB_EXTENSIONS  6       /* PPB support extensions (??) */
>>  #define  PCI_PM_PPB_B2_B3      0x40    /* Stop clock when in D3hot (??) */
>>  #define  PCI_PM_BPCC_ENABLE    0x80    /* Bus power/clock control enable (??) */
>> @@ -346,6 +352,7 @@
>>  #define  PCI_EXP_DEVCAP_PWR_IND        0x4000  /* Power Indicator Present */
>>  #define  PCI_EXP_DEVCAP_PWR_VAL        0x3fc0000 /* Slot Power Limit Value */
>>  #define  PCI_EXP_DEVCAP_PWR_SCL        0xc000000 /* Slot Power Limit Scale */
>> +#define  PCI_EXP_DEVCAP_FLR     0x10000000 /* Function Level Reset */
>>  #define PCI_EXP_DEVCTL         8       /* Device Control */
>>  #define  PCI_EXP_DEVCTL_CERE   0x0001  /* Correctable Error Reporting En. */
>>  #define  PCI_EXP_DEVCTL_NFERE  0x0002  /* Non-Fatal Error Reporting Enable */
>> @@ -358,6 +365,7 @@
>>  #define  PCI_EXP_DEVCTL_AUX_PME        0x0400  /* Auxiliary Power PM Enable */
>>  #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
>>  #define  PCI_EXP_DEVCTL_READRQ 0x7000  /* Max_Read_Request_Size */
>> +#define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
>>  #define PCI_EXP_DEVSTA         10      /* Device Status */
>>  #define  PCI_EXP_DEVSTA_CED    0x01    /* Correctable Error Detected */
>>  #define  PCI_EXP_DEVSTA_NFED   0x02    /* Non-Fatal Error Detected */
>> @@ -482,6 +490,17 @@
>>  #define  PCI_ARI_CTRL_ACS      0x0002  /* ACS Function Groups Enable */
>>  #define  PCI_ARI_CTRL_FG(x)    (((x) >> 4) & 7) /* Function Group */
>>
>> +/* Advanced Features Capability */
>> +#define PCI_AF_LENFLD    0x02 /* Device length offset */
>> +#define  PCI_AF_LENGTH   0x06
>> +#define PCI_AF_DEVCAP    0x03 /* Device capabilities offset */
>> +#define  PCI_AF_CAP_TP   0x01
>> +#define  PCI_AF_CAP_FLR  0x02
>> +#define PCI_AF_CTRL      0x04 /* Device CTRL offset */
>> +#define  PCI_AF_CTRL_FLR 0x01
>> +#define PCI_AF_STA       0x05 /* Device STATUS offset */
>> +#define  PCI_AF_STA_TP   0x01
>> +
>>  /* Single Root I/O Virtualization */
>>  #define PCI_SRIOV_CAP          0x04    /* SR-IOV Capabilities */
>>  #define  PCI_SRIOV_CAP_VFM     0x01    /* VF Migration Capable */
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
>> --- a/tools/firmware/hvmloader/hvmloader.c      2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/firmware/hvmloader/hvmloader.c      2009-06-07 19:04:11.000000000 -0400
>> @@ -673,6 +673,7 @@ int main(void)
>>         break;
>>     default:
>>         printf("No emulated VGA adaptor ...\n");
>> +        vgabios_sz = round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
>>         break;
>>     }
>>
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/console.h b/tools/ioemu-remote/console.h
>> --- a/tools/ioemu-remote/console.h      2009-06-07 21:14:47.000000000 -0400
>> +++ b/tools/ioemu-remote/console.h      2009-06-07 19:04:11.000000000 -0400
>> @@ -290,6 +290,9 @@ void vga_hw_update(void);
>>  void vga_hw_invalidate(void);
>>  void vga_hw_screen_dump(const char *filename);
>>
>> +void unset_vga_acc(void);
>> +void set_vga_acc(void);
>> +
>>  int is_graphic_console(void);
>>  int is_fixedsize_console(void);
>>  CharDriverState *text_console_init(const char *p);
>> @@ -341,4 +344,9 @@ const char *readline_get_history(unsigne
>>  void readline_start(const char *prompt, int is_password,
>>                     ReadLineFunc *readline_func, void *opaque);
>>
>> +/* intel.c */
>> +int intel_enter(void);
>> +int intel_leave(void);
>> +void intel_display_init(DisplayState *ds);
>> +
>>  #endif
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pass-through.c b/tools/ioemu-remote/hw/pass-through.c
>> --- a/tools/ioemu-remote/hw/pass-through.c      2009-06-07 21:14:48.000000000 -0400
>> +++ b/tools/ioemu-remote/hw/pass-through.c      2009-06-07 19:04:11.000000000 -0400
>> @@ -90,6 +90,8 @@
>>  #include "qemu-xen.h"
>>  #include <unistd.h>
>>
>> +extern int vga_passthrough;
>> +
>>  struct php_dev {
>>     struct pt_dev *pt_dev;
>>     uint8_t valid;
>> @@ -1573,10 +1575,11 @@ static int pt_dev_is_virtfn(struct pci_d
>>
>>  static int pt_register_regions(struct pt_dev *assigned_device)
>>  {
>> -    int i = 0;
>> +    int i = 0, ret = 0;
>>     uint32_t bar_data = 0;
>>     struct pci_dev *pci_dev = assigned_device->pci_dev;
>>     PCIDevice *d = &assigned_device->dev;
>> +    uint16_t class, vendor_id;
>>
>>     /* Register PIO/MMIO BARs */
>>     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
>> @@ -1632,6 +1635,25 @@ static int pt_register_regions(struct pt
>>             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
>>     }
>>
>> +    /* Map legacy ioport and iomem, for specific devices */
>> +    vendor_id = pci_read_word(pci_dev, 0x00);
>> +    class = pci_read_word(pci_dev, 0x0a);
>> +
>> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
>> +    if ( vga_passthrough && class == 0x0300 )
>> +    {
>> +        PT_LOG("add an intel graphic card\n");
>> +
>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_ADD_MAPPING);
>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_ADD_MAPPING);
>> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_ADD_MAPPING);
>> +        if ( ret != 0 )
>> +        {
>> +            PT_LOG("legacy mapping failed!\n");
>> +            return ret;
>> +        }
>> +    }
>> +
>>     return 0;
>>  }
>>
>> @@ -1640,6 +1662,7 @@ static void pt_unregister_regions(struct
>>     int i, type, ret;
>>     uint32_t e_size;
>>     PCIDevice *d = (PCIDevice*)assigned_device;
>> +    uint16_t class, vendor_id;
>>
>>     for ( i = 0; i < PCI_NUM_REGIONS; i++ )
>>     {
>> @@ -1681,6 +1704,24 @@ static void pt_unregister_regions(struct
>>
>>     }
>>
>> +    /* unmap legacy ioport and iomem, for specific devices */
>> +    vendor_id = pci_read_word(assigned_device->pci_dev, 0x00);
>> +    class = pci_read_word(assigned_device->pci_dev, 0x0a);
>> +
>> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
>> +    if ( vga_passthrough && class == 0x0300 )
>> +    {
>> +        PT_LOG("remove an intel graphic card\n");
>> +
>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_REMOVE_MAPPING);
>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_REMOVE_MAPPING);
>> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_REMOVE_MAPPING);
>> +        if ( ret != 0 )
>> +        {
>> +            PT_LOG("legacy unmapping failed !\n");
>> +        }
>> +    }
>> +
>>  }
>>
>>  static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
>> @@ -3759,7 +3800,7 @@ static struct pt_dev * register_real_dev
>>     struct pci_config_cf8 machine_bdf;
>>     char *key, *val;
>>     int msi_translate, power_mgmt;
>> -
>> +
>>     PT_LOG("Assigning real physical device %02x:%02x.%x ...\n",
>>         r_bus, r_dev, r_func);
>>
>> @@ -3931,7 +3972,7 @@ static struct pt_dev * register_real_dev
>>     }
>>
>>  out:
>> -    PT_LOG("Real physical device %02x:%02x.%x registered successfuly!\n"
>> +    PT_LOG("Real physical device %02x:%02x.%x registered successfully!\n"
>>            "IRQ type = %s\n", r_bus, r_dev, r_func,
>>            assigned_device->msi_trans_en? "MSI-INTx":"INTx");
>>
>> @@ -4113,3 +4154,47 @@ err:
>>     return status;
>>  }
>>
>> +u8 pt_pci_host_read_byte(int bus, int dev, int fn, u32 addr)
>> +{
>> +    struct pci_dev *pci_dev;
>> +    u8             val;
>> +
>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>> +    if (!pci_dev)
>> +        return 0;
>> +
>> +    val = pci_read_byte(pci_dev, addr);
>> +    pci_free_dev(pci_dev);
>> +
>> +    return val;
>> +}
>> +
>> +u16 pt_pci_host_read_word(int bus, int dev, int fn, u32 addr)
>> +{
>> +    struct pci_dev *pci_dev;
>> +    u16             val;
>> +
>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>> +    if (!pci_dev)
>> +        return 0;
>> +
>> +    val = pci_read_word(pci_dev, addr);
>> +    pci_free_dev(pci_dev);
>> +
>> +    return val;
>> +}
>> +
>> +u32 pt_pci_host_read_long(int bus, int dev, int fn, u32 addr)
>> +{
>> +    struct pci_dev *pci_dev;
>> +    u32             val;
>> +
>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>> +    if (!pci_dev)
>> +        return 0;
>> +
>> +    val = pci_read_long(pci_dev, addr);
>> +    pci_free_dev(pci_dev);
>> +
>> +    return val;
>> +}
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pc.c b/tools/ioemu-remote/hw/pc.c
>> --- a/tools/ioemu-remote/hw/pc.c        2009-06-07 21:14:47.000000000 -0400
>> +++ b/tools/ioemu-remote/hw/pc.c        2009-06-07 19:04:11.000000000 -0400
>> @@ -65,6 +65,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
>>  extern uint8_t *acpi_tables;
>>  extern size_t acpi_tables_len;
>>
>> +extern int vga_passthrough;
>> +
>>  static fdctrl_t *floppy_controller;
>>  static RTCState *rtc_state;
>>  static PITState *pit;
>> @@ -984,6 +986,7 @@ vga_bios_error:
>>
>>     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
>>
>> +    if (!vga_passthrough) {
>>     if (cirrus_vga_enabled) {
>>         if (pci_enabled) {
>>             pci_cirrus_vga_init(pci_bus,
>> @@ -1010,6 +1013,7 @@ vga_bios_error:
>>                          vga_ram_addr, vga_ram_size);
>>         }
>>     }
>> +    }
>>
>>  #ifdef CONFIG_PASSTHROUGH
>>     /* Pass-through Initialization
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pci.c b/tools/ioemu-remote/hw/pci.c
>> --- a/tools/ioemu-remote/hw/pci.c       2009-06-07 21:14:47.000000000 -0400
>> +++ b/tools/ioemu-remote/hw/pci.c       2009-06-07 19:04:11.000000000 -0400
>> @@ -28,11 +28,14 @@
>>  #include "virtio-net.h"
>>  #include "sysemu.h"
>>
>> +#include "pass-through.h"
>>  #include "exec-all.h"
>>  #include "qemu-xen.h"
>>
>>  //#define DEBUG_PCI
>>
>> +extern int vga_passthrough;
>> +
>>  struct PCIBus {
>>     int bus_num;
>>     int devfn_min;
>> @@ -611,7 +614,24 @@ uint32_t pci_data_read(void *opaque, uin
>>         goto the_end;
>>     }
>>     config_addr = addr & 0xff;
>> -    val = pci_dev->config_read(pci_dev, config_addr, len);
>> +    if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
>> +    {
>> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>> +
>> +        if (config_addr == 0x52) // GMCH
>> +            val = pt_pci_host_read_word(0, 0, 0, 0x52);
>> +        if (config_addr == 0x02) // Device ID
>> +        {
>> +            if (len == 2)
>> +                val = pt_pci_host_read_word(0, 0, 0, 0x00);
>> +            else if (len == 4)
>> +                val = pt_pci_host_read_long(0, 0, 0, 0x00);
>> +        }
>> +    } else if (vga_passthrough && pci_dev->devfn == 0x10 && // intel graphic card
>> +               config_addr == 0xfc) // OpRegion address
>> +        val = 0; // force to fall back to SMI mode
>> +    else
>> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>>  #if defined(DEBUG_PCI)
>>     printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",
>>            pci_dev->name, config_addr, val, len);
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/vga.c b/tools/ioemu-remote/hw/vga.c
>> --- a/tools/ioemu-remote/hw/vga.c       2009-06-07 21:14:47.000000000 -0400
>> +++ b/tools/ioemu-remote/hw/vga.c       2009-06-07 19:04:11.000000000 -0400
>> @@ -34,9 +34,9 @@
>>
>>  #include "qemu-timer.h"
>>
>> -//#define DEBUG_VGA
>> -//#define DEBUG_VGA_MEM
>> -//#define DEBUG_VGA_REG
>> +#define DEBUG_VGA
>> +#define DEBUG_VGA_MEM
>> +#define DEBUG_VGA_REG
>>
>>  //#define DEBUG_BOCHS_VBE
>>
>> @@ -161,6 +161,18 @@ static uint8_t expand4to8[16];
>>  static void vga_bios_init(VGAState *s);
>>  static void vga_screen_dump(void *opaque, const char *filename);
>>
>> +static VGAState *xen_vga_state;
>> +
>> +void set_vga_acc(void)
>> +{
>> +    set_vram_mapping(xen_vga_state, xen_vga_state->lfb_addr, xen_vga_state->lfb_end);
>> +}
>> +
>> +void unset_vga_acc(void)
>> +{
>> +    unset_vram_mapping(xen_vga_state);
>> +}
>> +
>>  static void vga_dumb_update_retrace_info(VGAState *s)
>>  {
>>     (void) s;
>> @@ -2473,8 +2485,6 @@ static void vga_bios_init(VGAState *s)
>>  }
>>
>>
>> -static VGAState *xen_vga_state;
>> -
>>  /* Allocate video memory in the GPFN space */
>>  void xen_vga_populate_vram(uint64_t vram_addr, uint32_t vga_ram_size)
>>  {
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/intel.c b/tools/ioemu-remote/intel.c
>> --- a/tools/ioemu-remote/intel.c        1969-12-31 19:00:00.000000000 -0500
>> +++ b/tools/ioemu-remote/intel.c        2009-06-07 19:04:11.000000000 -0400
>> @@ -0,0 +1,494 @@
>> +#include <stdio.h>
>> +#include <stdlib.h>
>> +#include <stdint.h>
>> +#include <sys/mman.h>
>> +#include <sys/types.h>
>> +#include <sys/stat.h>
>> +#include <fcntl.h>
>> +#include <assert.h>
>> +#include <signal.h>
>> +#include <pci/pci.h>
>> +
>> +#include "qemu-common.h"
>> +#include "console.h"
>> +#include "sysemu.h"
>> +
>> +#define INTEL_DEBUG(format, args...)                                    \
>> +    fprintf (stderr, "intel.c:%d:%s " format , __LINE__, __func__, ## args)
>> +
>> +#define TileW           128
>> +#define TileH           8
>> +
>> +#define REG_DR_DSPASURF                0x7019C
>> +#define REG_DR_DSPACNTR                0x70180
>> +#define REG_DR_DSPASTRIDE      0x70188
>> +#define REG_DR_PIPEACONF       0x70008
>> +
>> +#define REG_DR_DSPBSURF                0x7119C
>> +#define REG_DR_DSPBCNTR                0x71180
>> +#define REG_DR_DSPBSTRIDE      0x71188
>> +#define REG_DR_PIPEBCONF       0x71008
>> +
>> +#define REG_DE_PIPEASRC                0x6001c
>> +
>> +extern int                      vga_passthrough;
>> +uint32_t                        guest_framebuffer;
>> +
>> +static int                      display = 0;
>> +
>> +static int                      mmio_fd = -1;
>> +static int                      mem_fd = -1;
>> +static uint8_t                  *intel_mem = NULL;
>> +static uint8_t                  *intel_mmio = NULL;
>> +static int                      intel_force_full_update = 0;
>> +static int                      intel_have_focus;
>> +static int                      IntelPitch = 16;
>> +static int                      IntelX = 1280;
>> +static int                      IntelY = 1024;
>> +static DisplayState             *lds = NULL;
>> +static uint8_t                  *old_data = NULL;
>> +static uint32_t                 intel_fb_base, intel_mmio_base;
>> +static uint32_t                 map_s, map_d, map_size;
>> +static int                      refresh;
>> +
>> +static void set_data_mappings(void);
>> +static void unset_data_mappings(int mapping);
>> +static void set_data_pointer(void);
>> +static void intel_resize(DisplayState *ds);
>> +
>> +static inline unsigned int intel_get_reg(unsigned int reg)
>> +{
>> +    return *(unsigned int*)(intel_mmio + reg);
>> +}
>> +
>> +static inline int is_linear(void)
>> +{
>> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
>> +    if (((*dspacntr) & (1 << 10)) == 0)
>> +        return 1;
>> +    else
>> +        return 0;
>> +}
>> +
>> +static inline unsigned int intel_get_pitch(void)
>> +{
>> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
>> +    return *dspastride;
>> +}
>> +
>> +static inline unsigned int intel_get_offset(DisplaySurface *ds, int x, int y)
>> +{
>> +    return (y * ds->width + x) * 4;
>> +}
>> +
>> +static void intel_update_linear(DisplaySurface *ds, int x, int y, int w, int h)
>> +{
>> +    int i, bpp = ds->pf.depth / 8;
>> +    unsigned char *s, *d;
>> +    s = ds->data;
>> +    d = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
>> +    s += (ds->linesize * y) + bpp * x;
>> +    d += (ds->linesize * y) + bpp * x;
>> +    for (i = 0; i < h; i++) {
>> +        memcpy(d, s, w * bpp);
>> +        s += ds->linesize;
>> +        d += ds->linesize;
>> +    }
>> +}
>> +
>> +static void intel_force_linear(int linesize)
>> +{
>> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
>> +    unsigned int *pipeaconf = (unsigned int *)(intel_mmio + REG_DR_PIPEACONF);
>> +    unsigned int *dspasurf = (unsigned int *)(intel_mmio + REG_DR_DSPASURF);
>> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
>> +
>> +    unsigned int *dspbcntr = (unsigned int *)(intel_mmio + REG_DR_DSPBCNTR);
>> +    unsigned int *pipebconf = (unsigned int *)(intel_mmio + REG_DR_PIPEBCONF);
>> +    unsigned int *dspbsurf = (unsigned int *)(intel_mmio + REG_DR_DSPBSURF);
>> +    unsigned int *dspbstride = (unsigned int *)(intel_mmio + REG_DR_DSPBSTRIDE);
>> +
>> +    unsigned int surfa = 0, surfb = 0, pipea = 0, pipeb = 0;
>> +    char pipebenabled = !!(*pipebconf & (1 << 30));
>> +
>> +
>> +    INTEL_DEBUG("DSPASURF CTRL: 0x%x\n", intel_get_reg(REG_DR_DSPACNTR));
>> +
>> +    /* Disable surface */
>> +    pipea = *pipeaconf & (0x3 << 18);
>> +    *pipeaconf &= ~(0x3 << 18);
>> +    *dspacntr |= (1 << 31);
>> +    /* Address of the surface to map to */
>> +    surfa = *dspasurf;
>> +    *dspasurf = 0x00000000;
>> +    *dspacntr &= ~(1 << 31);
>> +    *dspasurf = 0x00000000;
>> +    *pipeaconf |= pipea;
>> +
>> +    if (pipebenabled) {
>> +        INTEL_DEBUG("PIPEBCONF enabled.\n");
>> +
>> +        /* Disable surface */
>> +        pipeb = *pipebconf & (0x3 << 18);
>> +        *pipebconf &= ~(0x3 << 18);
>> +        *dspbcntr |= (1 << 31);
>> +        /* Address of the surface to map to */
>> +        surfb = *dspbsurf;
>> +        *dspbsurf = 0x00000000;
>> +        *dspbcntr &= ~(1 << 31);
>> +        *dspbsurf = 0x00000000;
>> +        *pipebconf |= pipeb;
>> +    }
>> +
>> +    usleep(20000);
>> +
>> +    *pipeaconf &= ~(0x3 << 18);
>> +    /* Enable surface linear mode */
>> +    *dspacntr &= ~(1 << 10);
>> +    if (linesize) *dspastride = linesize;
>> +    *dspasurf = surfa;
>> +    *dspacntr |= (1 << 31);
>> +    *pipeaconf |= pipea;
>> +
>> +    if (pipebenabled) {
>> +        *pipebconf &= ~(0x3 << 18);
>> +        /* Enable surface linear mode */
>> +        *dspbcntr &= ~(1 << 10);
>> +        if (linesize) *dspbstride = linesize;
>> +        *dspbsurf = surfb;
>> +        *dspbcntr |= (1 << 31);
>> +        *pipebconf |= pipeb;
>> +    }
>> +
>> +    usleep(20000);
>> +}
>> +
>> +static void intel_update(DisplayState *ds, int x, int y, int w, int h)
>> +{
>> +    if (intel_have_focus && !old_data && !map_size)
>> +        intel_update_linear(ds->surface, x, y, w, h);
>> +}
>> +
>> +static void set_fb_mapping(void)
>> +{
>> +    DisplaySurface *surf = lds->surface;
>> +    int rc;
>> +    unsigned long nr_pfn;
>> +
>> +    unset_vga_acc();
>> +    fprintf(stderr, "set_fb_mapping: %x %x\n", (intel_fb_base + intel_get_reg(REG_DR_DSPASURF)), guest_framebuffer);
>> +    nr_pfn = (surf->linesize * surf->height) >> TARGET_PAGE_BITS;
>> +
>> +    rc = xc_domain_memory_mapping(xc_handle,
>> +            domid,
>> +            (guest_framebuffer >> TARGET_PAGE_BITS),
>> +            ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS),
>> +            nr_pfn,
>> +            DPCI_ADD_MAPPING);
>> +    if (rc) {
>> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
>> +        return;
>> +    }
>> +    map_s = ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS);
>> +    map_d = (guest_framebuffer >> TARGET_PAGE_BITS);
>> +    map_size = nr_pfn;
>> +}
>> +
>> +static void unset_fb_mapping(void)
>> +{
>> +    int rc;
>> +
>> +    fprintf(stderr, "unset_fb_mapping: %x %x\n", map_d, map_s);
>> +
>> +    rc = xc_domain_memory_mapping(xc_handle,
>> +            domid,
>> +            map_d,
>> +            map_s,
>> +            map_size,
>> +            DPCI_REMOVE_MAPPING);
>> +    if (rc) {
>> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
>> +        return;
>> +    }
>> +
>> +    set_vga_acc();
>> +    map_s = 0;
>> +    map_d = 0;
>> +    map_size = 0;
>> +}
>> +
>> +static void intel_setdata(DisplayState *ds)
>> +{
>> +    if (map_size)
>> +        unset_fb_mapping();
>> +    set_fb_mapping();
>> +}
>> +
>> +static void intel_resize_shared(DisplayState *ds, int w, int h, int depth, int linesize, void *pixels)
>> +{
>> +    DisplaySurface *surf = ds->surface;
>> +
>> +    if (!intel_have_focus) {
>> +        surf->width = w;
>> +        surf->height = h;
>> +        intel_resize(ds);
>> +        return;
>> +    }
>> +    if (depth == 32 && w == IntelX && h == IntelY)
>> +        surf->flags = QEMU_ALLOCATED_FLAG;
>> +    else
>> +        surf->flags &= ~QEMU_ALLOCATED_FLAG;
>> +    if (surf->flags & QEMU_ALLOCATED_FLAG) {
>> +        surf->width = w;
>> +        surf->height = h;
>> +        surf->pf.depth = 32;
>> +        surf->linesize = linesize;
>> +        /* adjust linesize */
>> +        intel_force_linear(linesize);
>> +        set_data_mappings();
>> +        if (refresh) {
>> +            memcpy(surf->data, pixels, surf->linesize * surf->height);
>> +            refresh = 0;
>> +        }
>> +        surf->data = pixels;
>> +        intel_setdata(ds);
>> +    } else {
>> +        surf->width = w;
>> +        surf->height = h;
>> +        intel_resize(ds);
>> +    }
>> +}
>> +
>> +static void intel_resize(DisplayState *ds)
>> +{
>> +    DisplaySurface *surf = ds->surface;
>> +    int old_linesize = surf->linesize;
>> +
>> +    if (surf->pf.depth == 32 && surf->width == IntelX && surf->height == IntelY)
>> +      surf->flags = QEMU_ALLOCATED_FLAG;
>> +    else
>> +      surf->flags &= ~QEMU_ALLOCATED_FLAG;
>> +
>> +    if (is_buffer_shared(surf))
>> +    {
>> +      INTEL_DEBUG("intel_resize_shared: enable shared buffer, linesize %d\n",
>> +                  surf->linesize);
>> +      intel_force_linear(surf->linesize);
>> +      set_data_mappings();
>> +      if (refresh)
>> +      {
>> +        // Pixels doesn't exist anymore ??
>> +        //memcpy(surf->data, pixels, surf->linesize * surf->height);
>> +        refresh = 0;
>> +      }
>> +      intel_setdata(ds);
>> +      return;
>> +    }
>> +
>> +    INTEL_DEBUG("intel_resize: no shared buffer, linesize=%d\n", surf->linesize);
>> +    surf->linesize = intel_get_pitch();
>> +    if (map_size) {
>> +        unset_fb_mapping();
>> +        unset_data_mappings(1);
>> +    }
>> +    if (intel_have_focus && !is_linear()) {
>> +        intel_force_linear(0);
>> +    }
>> +    surf->flags &= ~QEMU_ALLOCATED_FLAG;
>> +    if (intel_have_focus && !old_data &&
>> +        surf->width * surf->height <= IntelX * IntelY)
>> +        set_data_mappings();
>> +    else if (intel_have_focus && old_data &&
>> +             surf->width * surf->height > IntelX * IntelY)
>> +        unset_data_mappings(0);
>> +    if (!old_data) {
>> +        qemu_free(surf->data);
>> +        surf->data = qemu_mallocz(surf->height * surf->linesize);
>> +    } else {
>> +        INTEL_DEBUG("intel_resize: set_data_pointer\n");
>> +        set_data_pointer();
>> +    }
>> +    if (intel_have_focus)
>> +        memset((unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)), 0x0, IntelX * IntelY);
>> +    if (refresh) {
>> +        if (old_data) {
>> +            unsigned char *s, *d;
>> +            int i;
>> +            s = old_data;
>> +            d = surf->data;
>> +            for (i = 0; i < surf->height; i++) {
>> +                memcpy(d, s, surf->width * 4);
>> +                s += old_linesize;
>> +                d += surf->linesize;
>> +            }
>> +        }
>> +        refresh = 0;
>> +    }
>> +}
>> +
>> +static void intel_refresh(DisplayState *ds)
>> +{
>> +    vga_hw_update();
>> +}
>> +
>> +static void intel_init_mapping(void)
>> +{
>> +    struct pci_access   *pci_bus;
>> +    struct pci_dev      *pci_dev;
>> +
>> +    mmio_fd = open("/dev/mem", O_RDWR);
>> +    if (mmio_fd == -1)
>> +    {
>> +        perror("open");
>> +        exit(1);
>> +    }
>> +    mem_fd = open("/dev/mem", O_RDWR);
>> +    if (mem_fd == -1)
>> +    {
>> +        perror("open");
>> +        exit(1);
>> +    }
>> +
>> +    pci_bus = pci_alloc();
>> +    pci_init(pci_bus);
>> +    pci_dev = pci_get_dev(pci_bus, 0, 0, 2, 0);
>> +    pci_fill_info(pci_dev, PCI_FILL_BASES);
>> +    intel_fb_base = pci_dev->base_addr[2] & 0xfffff000;
>> +    intel_mmio_base = pci_dev->base_addr[0] & 0xfffff000;
>> +    pci_free_dev(pci_dev);
>> +    pci_cleanup(pci_bus);
>> +
>> +    INTEL_DEBUG("Map intel main mem 0x%x\n", intel_fb_base);
>> +    intel_mem = mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED,
>> +                     mem_fd, intel_fb_base);
>> +    if (intel_mem == MAP_FAILED)
>> +    {
>> +        perror("mmap");
>> +        exit(1);
>> +    }
>> +
>> +    INTEL_DEBUG("Map intel mmio 0x%x\n", intel_mmio_base);
>> +    intel_mmio = mmap(NULL, 4 * 1024 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED,
>> +                      mmio_fd, intel_mmio_base);
>> +    if (intel_mem == MAP_FAILED)
>> +    {
>> +        perror("mmap");
>> +        exit(1);
>> +    }
>> +}
>> +
>> +static void set_data_pointer(void)
>> +{
>> +    DisplaySurface *surf = lds->surface;
>> +
>> +    surf->data = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
>> +    surf->data = surf->data +
>> +                surf->linesize * ((IntelY - surf->height) / 2) +
>> +                4 * ((IntelX - surf->width) / 2);
>> +}
>> +
>> +static void set_data_mappings(void)
>> +{
>> +    INTEL_DEBUG("set_data_mappings\n");
>> +    if (!old_data)
>> +        old_data = lds->surface->data;
>> +    set_data_pointer();
>> +}
>> +
>> +static void unset_data_mappings(int mapping)
>> +{
>> +    DisplaySurface *surf = lds->surface;
>> +    if (!old_data)
>> +        return;
>> +    if (mapping) {
>> +        uint8_t * buffer_pointer = surf->data;
>> +        surf->data = old_data;
>> +        old_data = NULL;
>> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
>> +        memcpy(surf->data,
>> +                (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)),
>> +                surf->linesize * surf->height);
>> +        memcpy(buffer_pointer,
>> +                surf->data,
>> +                surf->linesize * surf->height);
>> +    } else {
>> +        uint8_t * buffer_pointer = surf->data;
>> +        surf->data = old_data;
>> +        old_data = NULL;
>> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
>> +        memcpy(surf->data,
>> +                buffer_pointer,
>> +                surf->linesize * surf->height);
>> +    }
>> +    INTEL_DEBUG("unset_data_mappings %d: success\n", mapping);
>> +}
>> +
>> +static int intel_getfocus(void)
>> +{
>> +    return intel_have_focus;
>> +}
>> +
>> +static void intel_focus(int focus)
>> +{
>> +    if (intel_have_focus == focus)
>> +        return;
>> +
>> +    INTEL_DEBUG("intel_focus %d\n", focus);
>> +    intel_have_focus = focus;
>> +    if (focus) {
>> +        if (!is_linear()) {
>> +           IntelPitch = intel_get_reg(REG_DR_DSPASTRIDE);
>> +           IntelX = ((intel_get_reg(REG_DE_PIPEASRC) >> 16) & 0xfff) + 1;
>> +           IntelY = (intel_get_reg(REG_DE_PIPEASRC) & 0xfff) + 1;
>> +           INTEL_DEBUG("Resolution is %dx%d\n", IntelX, IntelY);
>> +        }
>> +        refresh = 1;
>> +        lds->listeners->dpy_resize = intel_resize;
>> +        lds->listeners->dpy_setdata = intel_setdata;
>> +        vga_hw_invalidate();
>> +    } else {
>> +        if (map_size) {
>> +            unset_fb_mapping();
>> +            unset_data_mappings(1);
>> +        } else if (old_data) {
>> +            unset_data_mappings(0);
>> +        }
>> +        lds->listeners->dpy_resize = NULL;
>> +        lds->listeners->dpy_setdata = NULL;
>> +        lds->surface->flags &= ~QEMU_ALLOCATED_FLAG;
>> +    }
>> +}
>> +
>> +int intel_enter(void)
>> +{
>> +    intel_focus(1);
>> +    return 1;
>> +}
>> +
>> +int intel_leave(void)
>> +{
>> +    intel_focus(0);
>> +    return 1;
>> +}
>> +
>> +void intel_display_init(DisplayState *ds)
>> +{
>> +    DisplaySurface *surf = ds->surface;
>> +
>> +    INTEL_DEBUG("\n");
>> +
>> +    intel_init_mapping();
>> +
>> +    INTEL_DEBUG("Frambuffer is at 0x%x\n", intel_get_reg(REG_DR_DSPASURF));
>> +
>> +    surf->flags = 0;
>> +    surf->width = 640;
>> +    surf->height = 480;
>> +    surf->pf.depth = 32;
>> +    intel_resize(ds);
>> +    lds = ds;
>> +
>> +    ds->listeners->dpy_update = intel_update;
>> +    ds->listeners->dpy_resize = intel_resize;
>> +    ds->listeners->dpy_refresh = intel_refresh;
>> +}
>> \ No newline at end of file
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/vl.c b/tools/ioemu-remote/vl.c
>> --- a/tools/ioemu-remote/vl.c   2009-06-07 21:14:47.000000000 -0400
>> +++ b/tools/ioemu-remote/vl.c   2009-06-07 19:29:12.000000000 -0400
>> @@ -233,6 +233,9 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_
>>  #ifdef TARGET_I386
>>  int win2k_install_hack = 0;
>>  int rtc_td_hack = 0;
>> +int vga_passthrough = 0;
>> +const char *dom0_input = NULL;
>> +int intel = 0;
>>  #endif
>>  int usb_enabled = 0;
>>  int smp_cpus = 1;
>> @@ -4039,6 +4042,9 @@ static void help(int exitcode)
>>            "-disable-opengl disable OpenGL rendering, using SDL"
>>  #endif
>>  #endif
>> +           "-vga_passthrough enable graphics card passthrough\n"
>> +           "-dom0-input     enable dom0 controlling qemu\n"
>> +           "-intel          use intel gfx\n"
>>            "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n"
>>            "-vga [std|cirrus|vmware|none]\n"
>>            "                select video card type\n"
>> @@ -4275,6 +4281,9 @@ enum {
>>     QEMU_OPTION_domainname,
>>     QEMU_OPTION_acpi,
>>     QEMU_OPTION_vcpus,
>> +    QEMU_OPTION_vga_passthrough,
>> +    QEMU_OPTION_dom0_input,
>> +    QEMU_OPTION_intel,
>>
>>     /* Debug/Expert options: */
>>     QEMU_OPTION_serial,
>> @@ -4448,6 +4457,9 @@ static const QEMUOption qemu_options[] =
>>     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
>>     { "vncunused", 0, QEMU_OPTION_vncunused },
>>     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
>> +    { "vga_passthrough", 0, QEMU_OPTION_vga_passthrough },
>> +    { "dom0-input", HAS_ARG, QEMU_OPTION_dom0_input },
>> +    { "intel", 0, QEMU_OPTION_intel },
>>  #if defined(CONFIG_XEN) && !defined(CONFIG_DM)
>>     { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid },
>>     { "xen-create", 0, QEMU_OPTION_xen_create },
>> @@ -5281,6 +5293,15 @@ int main(int argc, char **argv, char **e
>>             case QEMU_OPTION_disable_opengl:
>>                 opengl_enabled = 0;
>>                 break;
>> +            case QEMU_OPTION_vga_passthrough:
>> +                vga_passthrough = 1;
>> +                break;
>> +            case QEMU_OPTION_dom0_input:
>> +                dom0_input = optarg;
>> +                break;
>> +            case QEMU_OPTION_intel:
>> +                intel = 1;
>> +                break;
>>             case QEMU_OPTION_direct_pci:
>>                direct_pci = optarg;
>>                 break;
>> @@ -5876,6 +5897,14 @@ int main(int argc, char **argv, char **e
>>             fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
>>             exit(1);
>>         }
>> +
>> +#ifdef CONFIG_DM
>> +        if(vga_passthrough)
>> +            fprintf(stderr, "Replace if initializing dom0_driver\n" );
>> +#else
>> +        dumb_display_init(ds);
>> +#endif
>> +
>>     } else {
>>  #if defined(CONFIG_CURSES)
>>             if (curses) {
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/xen-hooks.mak b/tools/ioemu-remote/xen-hooks.mak
>> --- a/tools/ioemu-remote/xen-hooks.mak  2009-06-07 21:14:47.000000000 -0400
>> +++ b/tools/ioemu-remote/xen-hooks.mak  2009-06-07 19:04:12.000000000 -0400
>> @@ -35,6 +35,7 @@ OBJS += exec-dm.o
>>  OBJS += pci_emulation.o
>>  OBJS += helper2.o
>>  OBJS += battery_mgmt.o
>> +OBJS += intel.o
>>
>>  ifdef CONFIG_STUBDOM
>>  CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c
>> --- a/tools/libxc/xc_hvm_build.c        2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/libxc/xc_hvm_build.c        2009-06-07 19:04:12.000000000 -0400
>> @@ -1,7 +1,3 @@
>> -/******************************************************************************
>> - * xc_hvm_build.c
>> - */
>> -
>>  #include <stddef.h>
>>  #include <inttypes.h>
>>  #include <stdlib.h>
>> @@ -66,6 +62,82 @@ static void build_hvm_info(void *hvm_inf
>>     hvm_info->checksum = -sum;
>>  }
>>
>> +static int init_vgabios(int            xc_handle,
>> +                        uint32_t       dom,
>> +                        unsigned char *buffer,
>> +                        uint32_t       bios_size)
>> +{
>> +    char                *va_bios = NULL;
>> +    uint32_t            va_size = 0;
>> +
>> +    va_size = bios_size + bios_size % XC_PAGE_SIZE;
>> +    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
>> +                                   PROT_READ | PROT_WRITE, 0xC0);
>> +    if (!va_bios)
>> +    {
>> +        IPRINTF("Unable to map vga bios!\n");
>> +        return -1;
>> +    }
>> +
>> +    if ( buffer != NULL)
>> +        memcpy(va_bios, buffer, bios_size);
>> +    else
>> +        memset(va_bios, 0, bios_size);
>> +
>> +    munmap(va_bios, va_size);
>> +    return 0;
>> +}
>> +
>> +static int  setup_vga_pt(int            xc_handle,
>> +                         uint32_t       dom)
>> +{
>> +    int                 rc = 0;
>> +    unsigned char       *bios = NULL;
>> +    int                 bios_size = 0;
>> +    char                *c = NULL;
>> +    char                checksum = 0;
>> +
>> +    IPRINTF("Setting up vga passthrough.\n");
>> +
>> +    /* Allocated 64K for the vga bios */
>> +    if (!(bios = malloc(64 * 1024))) {
>> +        IPRINTF("Error allocating memory for vga bios.\n");
>> +        return -1;
>> +    }
>> +
>> +#ifdef __linux__
>> +    bios_size = xc_get_vgabios(bios, 64 * 1024);
>> +#else
>> +    bios_size = 0;
>> +#endif /* __linux__ */
>> +
>> +    if (bios_size == 0)
>> +    {
>> +        IPRINTF("vga bios size is 0!\n");
>> +        rc = -1;
>> +        goto error;
>> +    }
>> +
>> +    /* Adjust the bios checksum */
>> +    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
>> +        checksum += *c;
>> +    if (checksum)
>> +        bios[bios_size - 1] -= checksum;
>> +    init_vgabios(xc_handle, dom, bios, bios_size);
>> +
>> +error:
>> +    free(bios);
>> +
>> +    if( rc == -1 ) {
>> +        IPRINTF("Error setting up vga passthrough.\n");
>> +    }
>> +    else {
>> +        IPRINTF("Success setting up vga passthrough.\n");
>> +    }
>> +
>> +    return rc;
>> +}
>> +
>>  static int loadelfimage(
>>     struct elf_binary *elf, int xch, uint32_t dom, unsigned long *parray)
>>  {
>> @@ -381,7 +453,8 @@ int xc_hvm_build_target_mem(int xc_handl
>>                            uint32_t domid,
>>                            int memsize,
>>                            int target,
>> -                           const char *image_name)
>> +                           const char *image_name,
>> +                           int vga_pt_enabled)
>>  {
>>     char *image;
>>     int  sts;
>> @@ -392,6 +465,12 @@ int xc_hvm_build_target_mem(int xc_handl
>>         return -1;
>>
>>     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
>> +    if ( vga_pt_enabled ) {
>> +        sts |= setup_vga_pt(xc_handle, domid);
>> +    } else {
>> +        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
>> +    }
>> +
>>
>>     free(image);
>>
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
>> --- a/tools/libxc/xc_linux.c    2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/libxc/xc_linux.c    2009-06-07 19:04:12.000000000 -0400
>> @@ -562,6 +562,57 @@ int xc_gnttab_set_max_grants(int xcg_han
>>     return 0;
>>  }
>>
>> +int xc_get_vgabios(unsigned char        *buf,
>> +                   int                  len)
>> +{
>> +    int         mem;
>> +    uint32_t    start, size = 0;
>> +    uint16_t    magic = 0;
>> +
>> +    start = 0xC0000;
>> +    if (len < size)
>> +        return 0;
>> +    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
>> +        return 0;
>> +
>> +    /*
>> +    ** Check if it a real bios extension.
>> +    ** The magic number is 0xAA55.
>> +    */
>> +    if (start != lseek(mem, start, SEEK_SET))
>> +        goto out;
>> +    if (read(mem, &magic, 2) != 2)
>> +        goto out;
>> +    if (magic != 0xAA55)
>> +        goto out;
>> +
>> +    /* Find the size of the rom extension */
>> +    if (start != lseek(mem, start, SEEK_SET))
>> +        goto out;
>> +    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
>> +        goto out;
>> +    if (read(mem, &size, 1) != 1)
>> +        goto out;
>> +    /* This size is in 512K */
>> +    size *= 512;
>> +
>> +    /*
>> +    ** Set the file to the begining of the rombios,
>> +    ** to start the copy.
>> +    */
>> +    if (start != lseek(mem, start, SEEK_SET))
>> +    {
>> +        size = 0;
>> +        goto out;
>> +    }
>> +    if (size != read(mem, buf, size))
>> +        size = 0;
>> +
>> +out:
>> +    close(mem);
>> +    return size;
>> +}
>> +
>>  /*
>>  * Local variables:
>>  * mode: C
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
>> --- a/tools/libxc/xenctrl.h     2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/libxc/xenctrl.h     2009-06-07 19:04:12.000000000 -0400
>> @@ -145,6 +145,10 @@ int xc_waitdomain(
>>     int *status,
>>     int options);
>>
>> +int xc_get_vgabios(
>> +    unsigned char       *bios,
>> +    int                 len);
>> +
>>  #endif /* __linux__ */
>>
>>  /*
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
>> --- a/tools/libxc/xenguest.h    2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/libxc/xenguest.h    2009-06-07 19:04:12.000000000 -0400
>> @@ -134,7 +134,8 @@ int xc_hvm_build_target_mem(int xc_handl
>>                             uint32_t domid,
>>                             int memsize,
>>                             int target,
>> -                            const char *image_name);
>> +                            const char *image_name,
>> +                            int vga_pt_enabled);
>>
>>  int xc_hvm_build_mem(int xc_handle,
>>                      uint32_t domid,
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
>> --- a/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 19:04:12.000000000 -0400
>> @@ -890,21 +890,21 @@ static PyObject *pyxc_hvm_build(XcObject
>>     int i;
>>  #endif
>>     char *image;
>> -    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
>> +    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, vga_pt = 0;
>>
>>     static char *kwd_list[] = { "domid",
>>                                 "memsize", "image", "target", "vcpus", "acpi",
>> -                                "apic", NULL };
>> -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
>> +                                "apic", "vga_pt", NULL };
>> +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
>>                                       &dom, &memsize, &image, &target, &vcpus,
>> -                                      &acpi, &apic) )
>> +                                      &acpi, &apic, &vga_pt) )
>>         return NULL;
>>
>>     if ( target == -1 )
>>         target = memsize;
>>
>>     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
>> -                                 target, image) != 0 )
>> +                                 target, image, vga_pt) != 0 )
>>         return pyxc_error_to_exception();
>>
>>  #if !defined(__ia64__)
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
>> --- a/tools/python/xen/xend/image.py    2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/python/xen/xend/image.py    2009-06-07 19:04:12.000000000 -0400
>> @@ -279,6 +279,9 @@ class ImageHandler:
>>         vnc_config = {}
>>         has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
>>         has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
>> +        has_vga_passthrough = int(vmConfig['platform'].get('vga_passthrough', 0)) != 0
>> +        has_intel = int(vmConfig['platform'].get('intel', 0)) != 0
>> +
>>         opengl = 1
>>         keymap = vmConfig['platform'].get("keymap")
>>         for dev_uuid in vmConfig['console_refs']:
>> @@ -302,7 +305,7 @@ class ImageHandler:
>>             ret.append("-k")
>>             ret.append(keymap)
>>
>> -        if has_vnc:
>> +        if has_vnc and not has_vga_passthrough:
>>             if not vnc_config:
>>                 for key in ('vncunused', 'vnclisten', 'vncdisplay',
>>                             'vncpasswd'):
>> @@ -353,6 +356,15 @@ class ImageHandler:
>>
>>         if int(vmConfig['platform'].get('monitor', 0)) != 0:
>>             ret = ret + ['-monitor', 'vc']
>> +
>> +        if has_vga_passthrough:
>> +            ret.append('-vga_passthrough')
>> +            dom0_input = str(vmConfig['platform'].get('dom0_input'))
>> +            ret = ret + ['-dom0-input', dom0_input]
>> +
>> +        if has_intel:
>> +            ret.append('-intel')
>> +
>>         return ret
>>
>>     def getDeviceModelArgs(self, restore = False):
>> @@ -754,7 +766,9 @@ class HVMImageHandler(ImageHandler):
>>         self.apic = int(vmConfig['platform'].get('apic', 0))
>>         self.acpi = int(vmConfig['platform'].get('acpi', 0))
>>         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
>> -
>> +        self.vga_pt = int(vmConfig['platform'].get('vga_passthrough', 0))
>> +        self.dom0_input = str(vmConfig['platform'].get('dom0_input'))
>> +        self.intel = int(vmConfig['platform'].get('intel', 0))
>>
>>     # Return a list of cmd line args to the device models based on the
>>     # xm config file
>> @@ -869,6 +883,7 @@ class HVMImageHandler(ImageHandler):
>>         log.debug("vcpus          = %d", self.vm.getVCpuCount())
>>         log.debug("acpi           = %d", self.acpi)
>>         log.debug("apic           = %d", self.apic)
>> +        log.debug("vga_pt         = %d", self.vga_pt)
>>
>>         rc = xc.hvm_build(domid          = self.vm.getDomid(),
>>                           image          = self.loader,
>> @@ -876,7 +891,8 @@ class HVMImageHandler(ImageHandler):
>>                           target         = mem_mb,
>>                           vcpus          = self.vm.getVCpuCount(),
>>                           acpi           = self.acpi,
>> -                          apic           = self.apic)
>> +                          apic           = self.apic,
>> +                          vga_pt         = self.vga_pt)
>>         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
>>
>>         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
>> --- a/tools/python/xen/xend/XendConfig.py       2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/python/xen/xend/XendConfig.py       2009-06-07 19:04:12.000000000 -0400
>> @@ -171,6 +171,9 @@ XENAPI_PLATFORM_CFG_TYPES = {
>>     'pci_msitranslate': int,
>>     'pci_power_mgmt': int,
>>     'xen_platform_pci': int,
>> +    'vga_passthrough': int,
>> +    'dom0_input': str,
>> +    'intel': int,
>>  }
>>
>>  # Xen API console 'other_config' keys.
>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
>> --- a/tools/python/xen/xm/create.py     2009-06-07 20:44:47.000000000 -0400
>> +++ b/tools/python/xen/xm/create.py     2009-06-07 19:04:12.000000000 -0400
>> @@ -618,6 +618,18 @@ gopts.var('xen_platform_pci', val='0|1',
>>            fn=set_int, default=1,
>>            use="Is xen_platform_pci used?")
>>
>> +gopts.var('vga_passthrough', val='0|1',
>> +           fn=set_int, default=None,
>> +           use="Enable the passthrough for the graphic card.")
>> +
>> +gopts.var('dom0_input', val='DOM0_INPUT',
>> +           fn=set_value, default=None,
>> +           use="Input arguments for dom0 driver")
>> +
>> +gopts.var('intel', val='INTEL',
>> +           fn=set_int, default=None,
>> +           use="Use Intel GFX.")
>> +
>>  def err(msg):
>>     """Print an error to stderr and exit.
>>     """
>> @@ -932,7 +944,8 @@ def configure_hvm(config_image, vals):
>>              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
>>              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
>>              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
>> -             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
>> +             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
>> +             'vga_passthrough', 'dom0_input', 'intel' ]
>>
>>     for a in args:
>>         if a in vals.__dict__ and vals.__dict__[a] is not None:
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>>
>>
> 
> Where did this patch come from? I plan to try using a ati card with a
> windows domU this week but first I need to port this patch to 2.6.29,
> before I start I want to make sure I am working with the latest
> version of the patch.
> 
> Andy
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
  2009-06-08 13:51               ` Beng Heng, Ng
@ 2009-06-08 14:09                 ` Beng Heng, Ng
  2009-06-08 14:19                 ` Andrew Lyon
  1 sibling, 0 replies; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 14:09 UTC (permalink / raw)
  To: Andrew Lyon; +Cc: Xen-devel

Sorry, it's morning and my brain wasn't with me. I didn't mean the patch
was in Xen 3.4 testing branch. I got it from the patch queue.

- Beng Heng

Beng Heng, Ng wrote:
> The patch was mostly originally from XCI, and subsequently the Xen 3.4
> testing branch.
> 
> Note that this does not include HID passthrough. It only demonstrates
> VGA passthrough.
> 
> Also, you need to specify the following in your DomU configuration.
> vga_passthrough=1
> intel=1
> dom0_input="0" (can ignore for now, since I did not include dom0 driver)
> 
> I've only tried it for HVM guests. But it should work for PV too. I've
> got good results on Windows DomU. On Linux, there was an error that says
> the guest is trying to access unintialised BAR.
> 
> - Beng Heng
> 

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

* Re: Experimental results for VGA passthrough
  2009-06-08 13:51               ` Beng Heng, Ng
  2009-06-08 14:09                 ` Beng Heng, Ng
@ 2009-06-08 14:19                 ` Andrew Lyon
  2009-06-08 14:25                   ` Beng Heng, Ng
  1 sibling, 1 reply; 28+ messages in thread
From: Andrew Lyon @ 2009-06-08 14:19 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: Xen-devel

On Mon, Jun 8, 2009 at 2:51 PM, Beng Heng, Ng<bengheng@eecs.umich.edu> wrote:
> The patch was mostly originally from XCI, and subsequently the Xen 3.4
> testing branch.
>
> Note that this does not include HID passthrough. It only demonstrates
> VGA passthrough.
>
> Also, you need to specify the following in your DomU configuration.
> vga_passthrough=1
> intel=1

What does intel=1 do?

> dom0_input="0" (can ignore for now, since I did not include dom0 driver)
>
> I've only tried it for HVM guests. But it should work for PV too. I've
> got good results on Windows DomU. On Linux, there was an error that says
> the guest is trying to access unintialised BAR.
>
> - Beng Heng
>
> Andrew Lyon wrote:
>> On Mon, Jun 8, 2009 at 6:36 AM, Beng Heng, Ng <bengheng@eecs.umich.edu> wrote:
>>> Certainly. I tried this on Xen 3.4.1 rc1 pre, changeset 19645. Most of
>>> these stuff are from Jean and his team. Hopefully more people can update
>>> their results.
>>>
>>> - Beng Heng
>>>
>>> Jun Koi wrote:
>>>> Hi Beng,
>>>>
>>>> Would you please send the patch you applied on top of Xen to the list?
>>>> I think many people are interested in that.
>>>>
>>>> Thanks,
>>>> Jun
>>>>
>>>>
>>>>
>>>
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 19:04:11.000000000 -0400
>>> @@ -208,7 +208,7 @@ void pciback_release_pci_dev(struct pcib
>>>        }
>>>
>>>        spin_unlock_irqrestore(&dev_data->lock, flags);
>>> -       pcistub_put_pci_dev(found_dev);
>>> +       pcistub_put_pci_dev(found_dev, 0);
>>>  }
>>>
>>>  int pciback_init_devices(struct pciback_device *pdev)
>>> @@ -396,7 +396,7 @@ void pciback_release_devices(struct pcib
>>>                list_for_each_entry_safe(dev_entry, d,
>>>                                         &cntrl_entry->dev_list, list) {
>>>                        list_del(&dev_entry->list);
>>> -                       pcistub_put_pci_dev(dev_entry->dev);
>>> +                       pcistub_put_pci_dev(dev_entry->dev, 0);
>>>                        kfree(dev_entry);
>>>                }
>>>                list_del(&cntrl_entry->list);
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 19:04:11.000000000 -0400
>>> @@ -88,7 +88,7 @@ void pciback_release_pci_dev(struct pcib
>>>        spin_unlock_irqrestore(&dev_data->lock, flags);
>>>
>>>        if (found_dev)
>>> -               pcistub_put_pci_dev(found_dev);
>>> +               pcistub_put_pci_dev(found_dev, 1);
>>>  }
>>>
>>>  int pciback_init_devices(struct pciback_device *pdev)
>>> @@ -157,7 +157,7 @@ void pciback_release_devices(struct pcib
>>>
>>>        list_for_each_entry_safe(dev_entry, t, &dev_data->dev_list, list) {
>>>                list_del(&dev_entry->list);
>>> -               pcistub_put_pci_dev(dev_entry->dev);
>>> +               pcistub_put_pci_dev(dev_entry->dev, 1);
>>>                kfree(dev_entry);
>>>        }
>>>
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 19:04:11.000000000 -0400
>>> @@ -25,6 +25,14 @@ struct pci_dev_entry {
>>>  #define _PCIB_op_pending       (1)
>>>  #define PCIB_op_pending                (1<<(_PCIB_op_pending))
>>>
>>> +#define PCIBACK_TYPE_UNKNOWN       0
>>> +#define PCIBACK_TYPE_PCIe_ENDPOINT 1
>>> +#define PCIBACK_TYPE_PCIe_BRIDGE   2
>>> +#define PCIBACK_TYPE_PCI_BRIDGE    3
>>> +#define PCIBACK_TYPE_PCI           4
>>> +
>>> +#define DEV_CLASS_PCI_PCI_BRIDGE 0x0604
>>> +
>>>  struct pciback_device {
>>>        void *pci_dev_data;
>>>        spinlock_t dev_lock;
>>> @@ -48,6 +56,13 @@ struct pciback_dev_data {
>>>        struct list_head config_fields;
>>>        int permissive;
>>>        int warned_on_write;
>>> +       u32 dev_type;
>>> +       int no_flr;
>>> +       int exp_flr_offset;
>>> +       int af_flr_offset;
>>> +       int use_sbr;
>>> +       int use_d3r;
>>> +       u8 *cfg_space; /* saved config space for device */
>>>  };
>>>
>>>  /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
>>> @@ -56,11 +71,25 @@ struct pci_dev *pcistub_get_pci_dev_by_s
>>>                                            int slot, int func);
>>>  struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
>>>                                    struct pci_dev *dev);
>>> -void pcistub_put_pci_dev(struct pci_dev *dev);
>>> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr);
>>> +
>>> +/* Reference/unreference PCI Devices and stubs without changing the state */
>>> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev);
>>> +void pcistub_unref_pci_dev(struct pci_dev *dev);
>>> +
>>> +/* Store/reload config space for devices */
>>> +void pciback_store_config_space(struct pci_dev *dev);
>>> +void pciback_reload_config_space(struct pci_dev *dev);
>>>
>>>  /* Ensure a device is turned off or reset */
>>>  void pciback_reset_device(struct pci_dev *pdev);
>>>
>>> +/* Do a function level reset (or approximage functionality) for device */
>>> +void pciback_flr_device(struct pci_dev *dev);
>>> +
>>> +/* Helper to classify the device type */
>>> +void pciback_classify_device(struct pci_dev *dev);
>>> +
>>>  /* Access a virtual configuration space for a PCI device */
>>>  int pciback_config_init(void);
>>>  int pciback_config_init_dev(struct pci_dev *dev);
>>> @@ -102,6 +131,10 @@ void pciback_release_devices(struct pcib
>>>  irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
>>>  void pciback_do_op(void *data);
>>>
>>> +/* Parse and load device specific module parameters */
>>> +int pciback_parse_device_params(const char *device_args, int type,
>>> +                                       int (*add_func) (int domain, int bus, int slot, int func, int type));
>>> +
>>>  int pciback_xenbus_register(void);
>>>  void pciback_xenbus_unregister(void);
>>>
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 19:04:11.000000000 -0400
>>> @@ -5,20 +5,189 @@
>>>  */
>>>  #include <linux/module.h>
>>>  #include <linux/wait.h>
>>> +#include <linux/delay.h> /* For mdelay function */
>>>  #include <asm/bitops.h>
>>>  #include <xen/evtchn.h>
>>>  #include "pciback.h"
>>>
>>> +#define PCIBACK_VENDOR_INTEL     0x8086
>>> +#define PCIBACK_CLASS_ID_USB     0x0c03
>>> +#define PCIBACK_CLASS_ID_VGA     0x0300
>>> +#define PCIBACK_USB_FLRCTRL      0x4
>>> +
>>> +#define PCIBACK_IGFX_CAP09_OFFSET    0xa4
>>> +#define PCIBACK_IGFX_CAP13_OFFSET    0xa4
>>> +
>>> +#define PCIBACK_IGFX_MEDIARST        0x0d
>>> +#define PCIBACK_IGFX_MEDIARST_OFFSET 0xc0
>>> +
>>>  int verbose_request = 0;
>>>  module_param(verbose_request, int, 0644);
>>>
>>> +struct pcistub_sbr_entry {
>>> +       struct list_head dev_list;
>>> +       struct pci_dev *dev;
>>> +};
>>> +
>>> +struct pcistub_sbr_list {
>>> +       struct list_head dev_list;
>>> +       struct pci_dev *bridge;
>>> +       struct pci_dev *dev;
>>> +       int find_all;
>>> +       int err;
>>> +};
>>> +
>>> +/* Used to store the config state so it can be restored after
>>> + * resets.
>>> + */
>>> +void pciback_store_config_space(struct pci_dev *dev)
>>> +{
>>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>>> +       u32 *ptr = (u32*)dev_data->cfg_space;
>>> +       int i, count = dev->cfg_size/sizeof(u32);
>>> +
>>> +       for (i = 0; i < count; i += sizeof(u32), ptr++)
>>> +               pci_read_config_dword(dev, i, ptr);
>>> +}
>>> +
>>> +/* Used to reload the config state after resets.
>>> + */
>>> +void pciback_reload_config_space(struct pci_dev *dev)
>>> +{
>>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>>> +       u32 *ptr = (u32*)dev_data->cfg_space;
>>> +       int i, val, count = dev->cfg_size/sizeof(u32);
>>> +
>>> +       for (i = 0; i < count; i += sizeof(u32), ptr++) {
>>> +               pci_read_config_dword(dev, i, &val);
>>> +               if (val != *ptr)
>>> +                       pci_write_config_dword(dev, i, *ptr);
>>> +       }
>>> +}
>>> +
>>> +static void pciback_walk_bus_cb(struct pci_dev *dev, void *userdata)
>>> +{
>>> +       struct pcistub_sbr_list *list = (struct pcistub_sbr_list*)userdata;
>>> +       struct pcistub_sbr_entry *entry;
>>> +       struct pci_dev *dev_tmp;
>>> +
>>> +       if (list->err != 0)
>>> +               return;
>>> +
>>> +       /* For PCIe endpoints we are only looking for co-assigned functions */
>>> +       if (!list->find_all &&
>>> +               (dev->bus->number != list->dev->bus->number ||
>>> +                PCI_SLOT(dev->devfn) != PCI_SLOT(list->dev->devfn)))
>>> +               return;
>>> +
>>> +       dev_tmp = pcistub_ref_pci_dev(dev);
>>> +       if (dev_tmp == NULL) {
>>> +               /* not controlled by pciback, fail */
>>> +               list->err = ENXIO;
>>> +               return;
>>> +       }
>>> +
>>> +       entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
>>> +       if (entry == NULL) {
>>> +               pcistub_unref_pci_dev(dev_tmp);
>>> +               list->err = ENOMEM;
>>> +               return;
>>> +       }
>>> +
>>> +       entry->dev = dev_tmp;
>>> +       list_add_tail(&entry->dev_list, &list->dev_list);
>>> +}
>>> +
>>> +static void pciback_cleanup_sbr_list(struct pcistub_sbr_list *list)
>>> +{
>>> +       struct pcistub_sbr_entry *entry;
>>> +
>>> +       list_for_each_entry(entry, &list->dev_list, dev_list) {
>>> +               pcistub_unref_pci_dev(entry->dev);
>>> +               kfree(entry);
>>> +       }
>>> +}
>>> +
>>> +/* Routine to find all devices and bridges that need to be reset
>>> + * during a secondary bus reset. For PCIe this is simply all the
>>> + * functions on the particular device. For PCI this is all devices
>>> + * and bridges below the topmost PCI/PCI-X bridge. Note for PCI,
>>> + * there is at least one something->PCI/PCI-X bridge to find since
>>> + * the device is not on the host bus 0 and is on a PCI bus.
>>> + */
>>> +static int pciback_get_sbr_list(struct pci_dev *dev,
>>> +       struct pcistub_sbr_list *list, int pcie_endpoint)
>>> +{
>>> +       struct pci_dev *bridge = dev->bus->self;
>>> +       struct pci_dev *last = NULL;
>>> +       int exp_pos;
>>> +       u16 exp_caps = 0;
>>> +
>>> +       list->err = 0;
>>> +       list->dev = dev;
>>> +       INIT_LIST_HEAD(&list->dev_list);
>>> +
>>> +       if (!pcie_endpoint) {
>>> +               while (bridge) {
>>> +                       /* Looking for the uppermost PCI/PCI-X bridge. If it is not PCIe then
>>> +                        * this is a PCI/PCI-X bridge. If it is PCIe then except the PCIe to
>>> +                        * PCI/PCI-X type 7, the rest of the bridge types are PCIe so the last
>>> +                        * bridge encountered was the topmost PCI/PCI-X bridge.
>>> +                        */
>>> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
>>> +                       if (exp_pos != 0) {
>>> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>>> +                               if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE)
>>> +                                       break; /* don't want it in the list if it is a PCIe bridge */
>>> +                       }
>>> +                       last = bridge;
>>> +                       bridge = last->bus->self;
>>> +               }
>>> +               list->bridge = last;
>>> +               list->find_all = 1; /* find all devices/bridges below the topmost */
>>> +       }
>>> +       else {
>>> +               if (bridge) {
>>> +                       /* For PCIe, SBR logic is limited to PCIe endpoints behind a root/switch
>>> +                        * port.
>>> +                        */
>>> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
>>> +                       if (likely(exp_pos != 0)) {
>>> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>>> +                               exp_caps = ((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4);
>>> +                               if (exp_caps == PCI_EXP_TYPE_ROOT_PORT ||
>>> +                                       exp_caps == PCI_EXP_TYPE_UPSTREAM ||
>>> +                                       exp_caps == PCI_EXP_TYPE_DOWNSTREAM)
>>> +                                       last = bridge;
>>> +                       }
>>> +               }
>>> +               list->bridge = last;
>>> +               list->find_all = 0; /* find just functions on this slot */
>>> +       }
>>> +
>>> +       /* Sanity check, there may not be any appropriate bridge to reset */
>>> +       if (!list->bridge) {
>>> +               dev_dbg(&dev->dev, "No appropriate bridge to reset\n");
>>> +               return ENXIO;
>>> +       }
>>> +
>>> +       pci_walk_bus(list->bridge->subordinate, pciback_walk_bus_cb, list);
>>> +
>>> +       if (list->err) {
>>> +               pciback_cleanup_sbr_list(list);
>>> +               return list->err;
>>> +       }
>>> +
>>> +       return 0;
>>> +}
>>> +
>>>  /* Ensure a device is "turned off" and ready to be exported.
>>>  * (Also see pciback_config_reset to ensure virtual configuration space is
>>>  * ready to be re-exported)
>>>  */
>>>  void pciback_reset_device(struct pci_dev *dev)
>>>  {
>>> -       u16 cmd;
>>> +       u16 cmd = 0;
>>>
>>>        /* Disable devices (but not bridges) */
>>>        if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
>>> @@ -38,6 +207,425 @@ void pciback_reset_device(struct pci_dev
>>>                }
>>>        }
>>>  }
>>> +
>>> +/* Do a PCIe type function level reset for a single function on this
>>> + * device.
>>> + */
>>> +static void pciback_do_pcie_flr(struct pci_dev *dev, int exp_pos)
>>> +{
>>> +       u16 status = 0;
>>> +
>>> +       dev_dbg(&dev->dev, "doing PCIe FLR\n");
>>> +
>>> +       pci_block_user_cfg_access(dev);
>>> +
>>> +       /* Wait for Transaction Pending bit clean */
>>> +       msleep(100);
>>> +       pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
>>> +       if (status & PCI_EXP_DEVSTA_TRPND) {
>>> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
>>> +               ssleep(1);
>>> +               pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
>>> +               if (status & PCI_EXP_DEVSTA_TRPND)
>>> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
>>> +       }
>>> +
>>> +       pci_write_config_word(dev, exp_pos + PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
>>> +       mdelay(200);
>>> +
>>> +       pciback_reload_config_space(dev);
>>> +
>>> +       pci_unblock_user_cfg_access(dev);
>>> +}
>>> +
>>> +/* Do a PCI type function level reset for a single function on this
>>> + * device. This uses the Advanced Features Capability extensions to
>>> + * the PCI spec.
>>> + */
>>> +static void pciback_do_pci_flr(struct pci_dev *dev, int af_pos, int clear_cmd)
>>> +{
>>> +       u8 status = 0;
>>> +
>>> +       dev_dbg(&dev->dev, "doing PCI FLR\n");
>>> +
>>> +       pci_block_user_cfg_access(dev);
>>> +
>>> +       /* Clear the command register to prevent new transactions */
>>> +       if (clear_cmd)
>>> +               pci_write_config_word(dev, PCI_COMMAND, 0);
>>> +
>>> +       /* Wait for Transaction Pending bit clean */
>>> +       msleep(100);
>>> +       pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
>>> +       if (status & PCI_AF_STA_TP) {
>>> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
>>> +               ssleep(1);
>>> +               pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
>>> +               if (status & PCI_AF_STA_TP)
>>> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
>>> +       }
>>> +
>>> +       pci_write_config_byte(dev, af_pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
>>> +       mdelay(200);
>>> +
>>> +       pciback_reload_config_space(dev);
>>> +
>>> +       pci_unblock_user_cfg_access(dev);
>>> +}
>>> +
>>> +/* Vendor specific resets. These can be set in the vendor specific
>>> + * capabilities structures. Currently only the Intel USB and iGFX
>>> + * reset is supported.
>>> + */
>>> +static int pciback_do_vendor_specific_reset(struct pci_dev *dev)
>>> +{
>>> +       struct pci_dev *gmch;
>>> +       int vendor_pos, i;
>>> +       u32 reg32 = 0;
>>> +       u16 device_id, cmd;
>>> +       u8 reg8 = 0;
>>> +
>>> +       dev_dbg(&dev->dev, "doing vendor specific resets\n");
>>> +
>>> +       if (dev->vendor != PCIBACK_VENDOR_INTEL)
>>> +               return -ENXIO;
>>> +
>>> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
>>> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0))
>>> +                       return -ENXIO;
>>> +
>>> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
>>> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
>>> +               if (!gmch)
>>> +                       return -ENXIO;
>>> +
>>> +               device_id = gmch->device;
>>> +               pci_dev_put(gmch);
>>> +
>>> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHGM45)
>>> +                       return -ENXIO;
>>> +
>>> +               /* Correct device and platform, assume vendor specific offset */
>>> +               pci_read_config_dword(dev, PCIBACK_IGFX_CAP09_OFFSET, &reg32);
>>> +               if ((reg32 & 0x000000FF) != PCI_CAP_ID_VNDR ||
>>> +                       ((reg32 >> 16) & 0x000000FF) != 0x06 ||
>>> +                       ((reg32 >> 24) & 0x000000F0) != 0x20)
>>> +                       return -ENXIO;
>>> +
>>> +               vendor_pos = PCIBACK_IGFX_CAP09_OFFSET;
>>> +       } else if ((dev->class >> 8) == PCIBACK_CLASS_ID_USB) {
>>> +               vendor_pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
>>> +               if (vendor_pos == 0)
>>> +                       return -ENXIO;
>>> +       }
>>> +       else
>>> +               return -ENXIO;
>>> +
>>> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
>>> +               pci_write_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, PCIBACK_IGFX_MEDIARST);
>>> +               for (i = 0; i <= 10; i++) {
>>> +                       msleep(100);
>>> +                       pci_read_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, &reg8);
>>> +                       if ((reg8 & 0x01) == 0)
>>> +                               break;
>>> +                       if (i == 10) {
>>> +                               dev_warn(&dev->dev, "media not reset after 1s; skipping FLR\n");
>>> +                               goto out;
>>> +                       }
>>> +               }
>>> +
>>> +               /* This specific reset will hang if the command register does not have
>>> +                * memory space access enabled */
>>> +               pci_read_config_word(dev, PCI_COMMAND, &cmd);
>>> +               pci_write_config_word(dev, PCI_COMMAND, (cmd | PCI_COMMAND_MEMORY));
>>> +               /* The rest is the same as a PCI AF FLR - use the same routine */
>>> +               pciback_do_pci_flr(dev, vendor_pos, 0);
>>> +               pci_write_config_word(dev, PCI_COMMAND, cmd);
>>> +       } else {
>>> +               pci_block_user_cfg_access(dev);
>>> +
>>> +               pci_write_config_byte(dev, vendor_pos + PCIBACK_USB_FLRCTRL, 1);
>>> +               mdelay(200);
>>> +
>>> +               pciback_reload_config_space(dev);
>>> +
>>> +               pci_unblock_user_cfg_access(dev);
>>> +       }
>>> +
>>> +out:
>>> +       return 0;
>>> +}
>>> +
>>> +/* Use a D0-D3-D0 device state transition to reset the device. This
>>> + * is a good enough reset for some devices (like NICs).
>>> + */
>>> +static int pciback_do_dstate_transition_reset(struct pci_dev *dev)
>>> +{
>>> +       int pm_pos;
>>> +       u32 pm_ctl = 0;
>>> +
>>> +       pm_pos = pci_find_capability(dev, PCI_CAP_ID_PM);
>>> +       if (pm_pos == 0)
>>> +               return -ENXIO;
>>> +
>>> +       dev_dbg(&dev->dev, "doing Dstate transition reset\n");
>>> +
>>> +       /* No_Soft_Reset - When set 1, this bit indicates that devices
>>> +        * transitioning from D3hot to D0 because of PowerState commands
>>> +        * do not perform an internal reset.
>>> +        */
>>> +       pci_read_config_dword(dev, pm_pos + PCI_PM_CTRL, &pm_ctl);
>>> +       if (pm_ctl & PCI_PM_CTRL_NO_SOFT_RESET)
>>> +               return -ENXIO;
>>> +
>>> +       pci_block_user_cfg_access(dev);
>>> +
>>> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
>>> +       pm_ctl |= PCI_PM_CTRL_D3HOT;
>>> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
>>> +       mdelay(10);
>>> +
>>> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
>>> +       pm_ctl |= PCI_PM_CTRL_D0;
>>> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
>>> +       mdelay(10);
>>> +
>>> +       pciback_reload_config_space(dev);
>>> +
>>> +       pci_unblock_user_cfg_access(dev);
>>> +
>>> +       return 0;
>>> +}
>>> +
>>> +/* Do a secondary bus reset on a bridge. This is only done if all
>>> + * co-assignment rules are satisfied and if it was explicitly
>>> + * requested via pciback parameters.
>>> + */
>>> +static int pciback_do_secondary_bus_reset(struct pci_dev *dev, u32 dev_type)
>>> +{
>>> +       struct pcistub_sbr_list sbr_list;
>>> +       struct pcistub_sbr_entry *entry;
>>> +       u16 pci_bctl = 0;
>>> +       int err = 0;
>>> +
>>> +       /* Call helper to get the device list needed for the device type. */
>>> +       err = pciback_get_sbr_list(dev, &sbr_list,
>>> +                       (dev_type == PCIBACK_TYPE_PCIe_ENDPOINT ? 1 : 0));
>>> +       if (err) {
>>> +               dev_warn(&dev->dev,
>>> +                       "secondary bus reset failed for device - all functions need to be co-assigned - err: %d\n", err);
>>> +               return err;
>>> +       }
>>> +
>>> +       pci_block_user_cfg_access(dev);
>>> +
>>> +       /* Reset the secondary bus and restore the PCI space for all the devfn found above.
>>> +        */
>>> +       pci_read_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, &pci_bctl);
>>> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl | PCI_BRIDGE_CTL_BUS_RESET);
>>> +       msleep(200);
>>> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl);
>>> +       msleep(200);
>>> +
>>> +       list_for_each_entry(entry, &sbr_list.dev_list, dev_list) {
>>> +               pciback_reload_config_space(entry->dev);
>>> +       }
>>> +
>>> +       pci_unblock_user_cfg_access(dev);
>>> +
>>> +       pciback_cleanup_sbr_list(&sbr_list);
>>> +
>>> +       return 0;
>>> +}
>>> +
>>> +/* This function is used to do a function level reset on a singe
>>> + * device/function. FLRs must be done on devices before they are
>>> + * unassigned from one domain and passed through to another. The
>>> + * preferred method is to do an actual FLR on the device but the
>>> + * functionality may not be present or exposed. In the later case
>>> + * we attempt to locate the capability even though it is not
>>> + * chained into the capabilities list.
>>> + *
>>> + * In some cases, there is no way to perform the actual FLR so we
>>> + * fall back to some alternate methods (which are not as effective
>>> + * or useful).
>>> + */
>>> +void pciback_flr_device(struct pci_dev *dev)
>>> +{
>>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>>> +       int err = 0;
>>> +
>>> +       if (dev_data->no_flr) {
>>> +               dev_dbg(&dev->dev, "FLR disabled for device\n");
>>> +               return;
>>> +       }
>>> +       dev_dbg(&dev->dev, "FLR invoked for device\n");
>>> +
>>> +       do {
>>> +               /* First, always try to do an FLR */
>>> +               if (dev_data->dev_type == PCIBACK_TYPE_PCIe_ENDPOINT &&
>>> +                       dev_data->exp_flr_offset != 0) {
>>> +                       pciback_do_pcie_flr(dev, dev_data->exp_flr_offset);
>>> +                       break;
>>> +               }
>>> +               if (dev_data->dev_type == PCIBACK_TYPE_PCI &&
>>> +                       dev_data->af_flr_offset != 0) {
>>> +                       pciback_do_pci_flr(dev, dev_data->af_flr_offset, 1);
>>> +                       break;
>>> +               }
>>> +
>>> +               /* Next for integrated devices on the host bus 0, try some other methods */
>>> +               if (dev->bus->number == 0) {
>>> +                       err = pciback_do_vendor_specific_reset(dev);
>>> +                       if (err && dev_data->use_d3r)
>>> +                               err = pciback_do_dstate_transition_reset(dev);
>>> +                       if (err)
>>> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
>>> +                                               "attempts to use vendor FLR or D-states unsuccessful\n");
>>> +                       break;
>>> +               }
>>> +
>>> +               /* Else attempt a secondary bus reset if all conditions are met */
>>> +               if (dev_data->use_sbr) {
>>> +                       err = pciback_do_secondary_bus_reset(dev, dev_data->dev_type);
>>> +                       if (err)
>>> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
>>> +                                               "attempts to use secondary bus reset unsuccessful;\n");
>>> +                       break;
>>> +               }
>>> +
>>> +               err = -ENODEV;
>>> +       } while (0);
>>> +
>>> +       if (err)
>>> +               dev_warn(&dev->dev, "FLR not performed for device\n");
>>> +}
>>> +
>>> +/* Helper used to location the FLR capabilities for a PCIe device.
>>> + * When the capability cannot be found in the chain but is present,
>>> + * special logic is used to attempt to locate functionality.
>>> + *
>>> + * returns: the offset to the capability, zero if not found.
>>> + */
>>> +static int pciback_find_pcie_flr_caps(struct pci_dev *dev)
>>> +{
>>> +       int exp_pos;
>>> +       u32 cap = 0;
>>> +
>>> +       /* First look for the PCIe FLR capabilities using the capabilities list */
>>> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
>>> +       if (exp_pos) {
>>> +               pci_read_config_dword(dev, exp_pos + PCI_EXP_DEVCAP, &cap);
>>> +               if (cap & PCI_EXP_DEVCAP_FLR) {
>>> +                       return exp_pos;
>>> +               }
>>> +       }
>>> +
>>> +       return 0;
>>> +}
>>> +
>>> +/* Helper used to location the AF FLR capabilities for a PCI device.
>>> + * When the capability cannot be found in the chain but is present,
>>> + * special logic is used to attempt to locate functionality.
>>> + *
>>> + * returns: the offset to the capability, zero if not found.
>>> + */
>>> +static int pciback_find_pci_flr_caps(struct pci_dev *dev)
>>> +{
>>> +       struct pci_dev *gmch;
>>> +       int af_pos;
>>> +       u16 device_id;
>>> +       u8 cap = 0, reg8 = 0;
>>> +
>>> +       /* First look for the PCI AF capabilities for FLR using the capabilities list. This
>>> +        * is only used on the devices on the root/host bus (integrated devices).
>>> +        */
>>> +       if (dev->bus->number != 0)
>>> +               return 0;
>>> +
>>> +       af_pos = pci_find_capability(dev, PCI_CAP_ID_AF);
>>> +       if (af_pos) {
>>> +               pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
>>> +               if (cap & PCI_AF_CAP_FLR) {
>>> +                       return af_pos;
>>> +               }
>>> +       }
>>> +
>>> +       /* Next look for the unchained AF capabilities for FLR using specific
>>> +        * logic. Currently only the graphics device on the Intel Q45 etc
>>> +        * systems has special logic for locating the hidden FLR caps.
>>> +     */
>>> +       do {
>>> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0) ||
>>> +                       dev->vendor != PCIBACK_VENDOR_INTEL || (dev->class >> 8) != PCIBACK_CLASS_ID_VGA)
>>> +                       break;
>>> +
>>> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
>>> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
>>> +               if (!gmch)
>>> +                       break;
>>> +
>>> +               device_id = gmch->device;
>>> +               pci_dev_put(gmch);
>>> +
>>> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHQ45 &&
>>> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG45 &&
>>> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG41)
>>> +                       break;
>>> +
>>> +               /* Correct device and platform, assume AF offset */
>>> +               af_pos = PCIBACK_IGFX_CAP13_OFFSET;
>>> +               pci_read_config_byte(dev, af_pos + PCI_AF_LENFLD, &reg8);
>>> +               if (reg8 == PCI_AF_LENGTH) {
>>> +                       pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
>>> +                       if (cap & PCI_AF_CAP_FLR) {
>>> +                               return af_pos;
>>> +                       }
>>> +               }
>>> +       } while (0);
>>> +
>>> +       /* Else not found */
>>> +       return 0;
>>> +}
>>> +
>>> +/* Classify the device, specifically determine if it is PCIe/PCI
>>> + * and whether it is a PCIe endpoint, bridge, or other PCI device.
>>> + */
>>> +void pciback_classify_device(struct pci_dev *dev)
>>> +{
>>> +       struct pciback_dev_data *dev_data;
>>> +       int exp_pos;
>>> +       u16 exp_caps = 0;
>>> +
>>> +       dev_data = pci_get_drvdata(dev);
>>> +       dev_data->dev_type = PCIBACK_TYPE_UNKNOWN;
>>> +
>>> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
>>> +
>>> +       if ((dev->class >> 8) != DEV_CLASS_PCI_PCI_BRIDGE) {
>>> +               if (exp_pos != 0) {
>>> +                       dev_data->dev_type = PCIBACK_TYPE_PCIe_ENDPOINT;
>>> +                       dev_data->exp_flr_offset = pciback_find_pcie_flr_caps(dev);
>>> +               } else {
>>> +                       dev_data->dev_type = PCIBACK_TYPE_PCI;
>>> +                       dev_data->af_flr_offset = pciback_find_pci_flr_caps(dev);
>>> +               }
>>> +               goto classify_done;
>>> +       }
>>> +
>>> +       if (exp_pos == 0) {
>>> +               dev_data->dev_type = PCIBACK_TYPE_PCI_BRIDGE;
>>> +               goto classify_done;
>>> +       }
>>> +
>>> +       pci_read_config_word(dev, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>>> +       dev_data->dev_type = (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) == PCI_EXP_TYPE_PCI_BRIDGE) ? PCIBACK_TYPE_PCI_BRIDGE : PCIBACK_TYPE_PCIe_BRIDGE;
>>> +
>>> +classify_done:
>>> +
>>> +       return;
>>> +}
>>> +
>>>  extern wait_queue_head_t aer_wait_queue;
>>>  extern struct workqueue_struct *pciback_wq;
>>>  /*
>>> @@ -132,3 +720,51 @@ irqreturn_t pciback_handle_event(int irq
>>>
>>>        return IRQ_HANDLED;
>>>  }
>>> +
>>> +/* Helper routine used to parse command line parameters passed to the
>>> + * pciback module from the boot loader. These params all have the form
>>> + * of a list of one or more devices, e.g.:
>>> + * (XXXX:XX:XX.X)(XXXX:XX:XX.X)
>>> + * Which is: (domain/segment:bus:dev.func)
>>> + */
>>> +int pciback_parse_device_params(const char *device_args, int type,
>>> +                       int (*add_func) (int domain, int bus, int slot, int func, int type))
>>> +{
>>> +       int pos = 0;
>>> +       int err = 0;
>>> +       int domain, bus, slot, func;
>>> +       int parsed;
>>> +
>>> +       if (device_args && *device_args) {
>>> +               do {
>>> +                       parsed = 0;
>>> +
>>> +                       err = sscanf(device_args + pos,
>>> +                                    " (%x:%x:%x.%x) %n",
>>> +                                    &domain, &bus, &slot, &func, &parsed);
>>> +                       if (err != 4) {
>>> +                               domain = 0;
>>> +                               err = sscanf(device_args + pos,
>>> +                                            " (%x:%x.%x) %n",
>>> +                                            &bus, &slot, &func, &parsed);
>>> +                               if (err != 3)
>>> +                                       goto parse_error;
>>> +                       }
>>> +
>>> +                       err = add_func(domain, bus, slot, func, type);
>>> +                       if (err)
>>> +                               goto out;
>>> +
>>> +                       /* if parsed<=0, we've reached the end of the string */
>>> +                       pos += parsed;
>>> +               } while (parsed > 0 && device_args[pos]);
>>> +       }
>>> +
>>> +out:
>>> +       return err;
>>> +
>>> +parse_error:
>>> +       printk(KERN_ERR "pciback: Error parsing device parameters \"%s\" at \"%s\"\n",
>>> +              device_args, device_args + pos);
>>> +       return -EINVAL;
>>> +}
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 19:04:11.000000000 -0400
>>> @@ -24,10 +24,28 @@ wait_queue_head_t aer_wait_queue;
>>>  * We want to avoid in middle of AER ops, pciback devices is being removed
>>>  */
>>>  static DECLARE_RWSEM(pcistub_sem);
>>> -module_param_named(hide, pci_devs_to_hide, charp, 0444);
>>> +module_param_named(hide, pci_devs_to_hide, charp, S_IRUGO);
>>> +
>>> +static char *pci_devs_use_sbr = NULL;
>>> +module_param_named(sbr, pci_devs_use_sbr, charp, S_IRUGO);
>>> +
>>> +static char *pci_devs_use_d3r = NULL;
>>> +module_param_named(d3r, pci_devs_use_d3r, charp, S_IRUGO);
>>> +
>>> +static char *pci_devs_no_flr = NULL;
>>> +module_param_named(noflr, pci_devs_no_flr, charp, S_IRUGO);
>>> +
>>> +/* Device id list holding different device type listings
>>> + * for hiding devices and reset logic.
>>> + */
>>> +#define PCIBACK_ID_TYPE_HIDE  1
>>> +#define PCIBACK_ID_TYPE_SBR   2
>>> +#define PCIBACK_ID_TYPE_D3R   3
>>> +#define PCIBACK_ID_TYPE_NOFLR 4
>>>
>>>  struct pcistub_device_id {
>>>        struct list_head slot_list;
>>> +       int type;
>>>        int domain;
>>>        unsigned char bus;
>>>        unsigned int devfn;
>>> @@ -56,6 +74,8 @@ static LIST_HEAD(pcistub_devices);
>>>  static int initialize_devices = 0;
>>>  static LIST_HEAD(seized_devices);
>>>
>>> +static int disable_all_flr = 0;
>>> +
>>>  static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
>>>  {
>>>        struct pcistub_device *psdev;
>>> @@ -78,6 +98,23 @@ static struct pcistub_device *pcistub_de
>>>        return psdev;
>>>  }
>>>
>>> +static struct pciback_dev_data *pcistub_dev_data_alloc(struct pci_dev *dev)
>>> +{
>>> +       struct pciback_dev_data *dev_data;
>>> +
>>> +       dev_dbg(&dev->dev, "pcistub_dev_data_alloc\n");
>>> +
>>> +       dev_data = kzalloc(sizeof(*dev_data) + dev->cfg_size, GFP_ATOMIC);
>>> +       if (!dev_data)
>>> +               return NULL;
>>> +
>>> +       pci_set_drvdata(dev, dev_data);
>>> +
>>> +       dev_data->cfg_space = (u8*)(dev_data) + sizeof(*dev_data);
>>> +
>>> +       return dev_data;
>>> +}
>>> +
>>>  /* Don't call this directly as it's called by pcistub_device_put */
>>>  static void pcistub_device_release(struct kref *kref)
>>>  {
>>> @@ -200,7 +237,7 @@ struct pci_dev *pcistub_get_pci_dev(stru
>>>        return found_dev;
>>>  }
>>>
>>> -void pcistub_put_pci_dev(struct pci_dev *dev)
>>> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr)
>>>  {
>>>        struct pcistub_device *psdev, *found_psdev = NULL;
>>>        unsigned long flags;
>>> @@ -220,6 +257,13 @@ void pcistub_put_pci_dev(struct pci_dev
>>>        * pcistub and pciback when AER is in processing
>>>        */
>>>        down_write(&pcistub_sem);
>>> +
>>> +       /* For pass-through devices, do an FLR (or approximate) for the device
>>> +        * before it is put back and ready for the next domain
>>> +        */
>>> +       if (!disable_all_flr && do_flr)
>>> +               pciback_flr_device(dev);
>>> +
>>>        /* Cleanup our device
>>>         * (so it's ready for the next domain)
>>>         */
>>> @@ -235,6 +279,43 @@ void pcistub_put_pci_dev(struct pci_dev
>>>        up_write(&pcistub_sem);
>>>  }
>>>
>>> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev)
>>> +{
>>> +       struct pcistub_device *psdev;
>>> +       struct pci_dev *found_dev = NULL;
>>> +       unsigned long flags;
>>> +
>>> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
>>> +
>>> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
>>> +               if (psdev->dev == dev) {
>>> +                       pcistub_device_get(psdev); /* just a ref count */
>>> +                       found_dev = psdev->dev;
>>> +                       break;
>>> +               }
>>> +       }
>>> +
>>> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
>>> +       return found_dev;
>>> +}
>>> +
>>> +void pcistub_unref_pci_dev(struct pci_dev *dev)
>>> +{
>>> +       struct pcistub_device *psdev;
>>> +       unsigned long flags;
>>> +
>>> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
>>> +
>>> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
>>> +               if (psdev->dev == dev) {
>>> +                       pcistub_device_get(psdev); /* just an unref count */
>>> +                       break;
>>> +               }
>>> +       }
>>> +
>>> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
>>> +}
>>> +
>>>  static int __devinit pcistub_match_one(struct pci_dev *dev,
>>>                                       struct pcistub_device_id *pdev_id)
>>>  {
>>> @@ -255,7 +336,7 @@ static int __devinit pcistub_match_one(s
>>>        return 0;
>>>  }
>>>
>>> -static int __devinit pcistub_match(struct pci_dev *dev)
>>> +static int __devinit pcistub_match(struct pci_dev *dev, int type)
>>>  {
>>>        struct pcistub_device_id *pdev_id;
>>>        unsigned long flags;
>>> @@ -263,6 +344,8 @@ static int __devinit pcistub_match(struc
>>>
>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>        list_for_each_entry(pdev_id, &pcistub_device_ids, slot_list) {
>>> +               if (pdev_id->type != type)
>>> +                       continue;
>>>                if (pcistub_match_one(dev, pdev_id)) {
>>>                        found = 1;
>>>                        break;
>>> @@ -285,12 +368,11 @@ static int __devinit pcistub_init_device
>>>         * would need to be called somewhere to free the memory allocated
>>>         * here and then to call kfree(pci_get_drvdata(psdev->dev)).
>>>         */
>>> -       dev_data = kzalloc(sizeof(*dev_data), GFP_ATOMIC);
>>> +       dev_data = pcistub_dev_data_alloc(dev);
>>>        if (!dev_data) {
>>>                err = -ENOMEM;
>>>                goto out;
>>>        }
>>> -       pci_set_drvdata(dev, dev_data);
>>>
>>>        dev_dbg(&dev->dev, "initializing config\n");
>>>
>>> @@ -317,6 +399,22 @@ static int __devinit pcistub_init_device
>>>        dev_dbg(&dev->dev, "reset device\n");
>>>        pciback_reset_device(dev);
>>>
>>> +       /* Classify the device so we know if it is PCI/PCIe and if it is
>>> +        * a bridge - this information is used for FLR logic. Also store
>>> +        * values if SBR/D3R reset logic was requested.
>>> +        */
>>> +       pciback_classify_device(dev);
>>> +       dev_data->no_flr = pcistub_match(dev, PCIBACK_ID_TYPE_NOFLR);
>>> +       if (!dev_data->no_flr) {
>>> +               dev_data->use_sbr = pcistub_match(dev, PCIBACK_ID_TYPE_SBR);
>>> +               dev_data->use_d3r = pcistub_match(dev, PCIBACK_ID_TYPE_D3R);
>>> +       }
>>> +
>>> +       /* Store the config space here where the device is off and ready to be
>>> +        * exported before any FLRs or other resets are done
>>> +        */
>>> +       pciback_store_config_space(dev);
>>> +
>>>        return 0;
>>>
>>>       config_release:
>>> @@ -414,7 +512,7 @@ static int __devinit pcistub_probe(struc
>>>
>>>        dev_dbg(&dev->dev, "probing...\n");
>>>
>>> -       if (pcistub_match(dev)) {
>>> +       if (pcistub_match(dev, PCIBACK_ID_TYPE_HIDE)) {
>>>
>>>                if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL
>>>                    && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
>>> @@ -851,7 +949,7 @@ static inline int str_to_quirk(const cha
>>>        return -EINVAL;
>>>  }
>>>
>>> -static int pcistub_device_id_add(int domain, int bus, int slot, int func)
>>> +static int pcistub_device_id_add(int domain, int bus, int slot, int func, int type)
>>>  {
>>>        struct pcistub_device_id *pci_dev_id;
>>>        unsigned long flags;
>>> @@ -860,12 +958,13 @@ static int pcistub_device_id_add(int dom
>>>        if (!pci_dev_id)
>>>                return -ENOMEM;
>>>
>>> +       pci_dev_id->type = type;
>>>        pci_dev_id->domain = domain;
>>>        pci_dev_id->bus = bus;
>>>        pci_dev_id->devfn = PCI_DEVFN(slot, func);
>>>
>>> -       pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
>>> -                domain, bus, slot, func);
>>> +       pr_debug("pciback: adding device ID type: %d for %04x:%02x:%02x.%01x\n",
>>> +                type, domain, bus, slot, func);
>>>
>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>        list_add_tail(&pci_dev_id->slot_list, &pcistub_device_ids);
>>> @@ -874,7 +973,7 @@ static int pcistub_device_id_add(int dom
>>>        return 0;
>>>  }
>>>
>>> -static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
>>> +static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
>>>  {
>>>        struct pcistub_device_id *pci_dev_id, *t;
>>>        int devfn = PCI_DEVFN(slot, func);
>>> @@ -884,7 +983,7 @@ static int pcistub_device_id_remove(int
>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>        list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
>>>
>>> -               if (pci_dev_id->domain == domain
>>> +               if (pci_dev_id->type == type && pci_dev_id->domain == domain
>>>                    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
>>>                        /* Don't break; here because it's possible the same
>>>                         * slot could be in the list more than once
>>> @@ -939,6 +1038,32 @@ static int pcistub_reg_add(int domain, i
>>>        return err;
>>>  }
>>>
>>> +static int pcistub_device_do_flr(int domain, int bus, int slot, int func)
>>> +{
>>> +       int err = 0;
>>> +       struct pcistub_device *psdev;
>>> +       struct pci_dev *dev;
>>> +
>>> +       psdev = pcistub_device_find(domain, bus, slot, func);
>>> +       if (!psdev || !psdev->dev) {
>>> +               err = -ENODEV;
>>> +               goto out;
>>> +       }
>>> +       dev = psdev->dev;
>>> +
>>> +       /* Do an FLR (or approximate) for the device on demand and
>>> +        * reload config
>>> +        */
>>> +       if (!disable_all_flr) {
>>> +               pciback_flr_device(dev);
>>> +       }
>>> +       else
>>> +               dev_dbg(&dev->dev, "FLR disabled for all devices\n");
>>> +
>>> +out:
>>> +       return err;
>>> +}
>>> +
>>>  static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
>>>                                size_t count)
>>>  {
>>> @@ -949,7 +1074,7 @@ static ssize_t pcistub_slot_add(struct d
>>>        if (err)
>>>                goto out;
>>>
>>> -       err = pcistub_device_id_add(domain, bus, slot, func);
>>> +       err = pcistub_device_id_add(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>>>
>>>       out:
>>>        if (!err)
>>> @@ -969,7 +1094,7 @@ static ssize_t pcistub_slot_remove(struc
>>>        if (err)
>>>                goto out;
>>>
>>> -       err = pcistub_device_id_remove(domain, bus, slot, func);
>>> +       err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>>>
>>>       out:
>>>        if (!err)
>>> @@ -987,6 +1112,10 @@ static ssize_t pcistub_slot_show(struct
>>>
>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>        list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
>>> +               /* only want devices set for hide, not reset entries */
>>> +               if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
>>> +                       continue;
>>> +
>>>                if (count >= PAGE_SIZE)
>>>                        break;
>>>
>>> @@ -1068,7 +1197,7 @@ static ssize_t pcistub_quirk_show(struct
>>>
>>>  DRIVER_ATTR(quirks, S_IRUSR | S_IWUSR, pcistub_quirk_show, pcistub_quirk_add);
>>>
>>> -static ssize_t permissive_add(struct device_driver *drv, const char *buf,
>>> +static ssize_t pcistub_permissive_add(struct device_driver *drv, const char *buf,
>>>                              size_t count)
>>>  {
>>>        int domain, bus, slot, func;
>>> @@ -1109,7 +1238,7 @@ static ssize_t permissive_add(struct dev
>>>        return err;
>>>  }
>>>
>>> -static ssize_t permissive_show(struct device_driver *drv, char *buf)
>>> +static ssize_t pcistub_permissive_show(struct device_driver *drv, char *buf)
>>>  {
>>>        struct pcistub_device *psdev;
>>>        struct pciback_dev_data *dev_data;
>>> @@ -1132,7 +1261,68 @@ static ssize_t permissive_show(struct de
>>>        return count;
>>>  }
>>>
>>> -DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add);
>>> +DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, pcistub_permissive_show, pcistub_permissive_add);
>>> +
>>> +static ssize_t pcistub_do_flr(struct device_driver *drv, const char *buf,
>>> +                                  size_t count)
>>> +{
>>> +       int domain, bus, slot, func;
>>> +       int err;
>>> +
>>> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
>>> +       if (err)
>>> +               goto out;
>>> +
>>> +       err = pcistub_device_do_flr(domain, bus, slot, func);
>>> +
>>> +out:
>>> +       if (!err)
>>> +               err = count;
>>> +       return err;
>>> +}
>>> +
>>> +DRIVER_ATTR(do_flr, S_IWUSR, NULL, pcistub_do_flr);
>>> +
>>> +static ssize_t pcistub_resets(struct device_driver *drv, const char *buf,
>>> +                                  size_t count)
>>> +{
>>> +       int domain, bus, slot, func;
>>> +       int type, err = 0;
>>> +
>>> +       /* string begins with reset type specifier sbr=|dr3=|noflr= */
>>> +       if (!strncmp(buf, "sbr=", 4)) {
>>> +               type = PCIBACK_ID_TYPE_SBR;
>>> +               buf += 4;
>>> +       } else if (!strncmp(buf, "d3r=", 4)) {
>>> +               type = PCIBACK_ID_TYPE_D3R;
>>> +               buf += 4;
>>> +       } else if (!strncmp(buf, "noflr=", 6)) {
>>> +               type = PCIBACK_ID_TYPE_NOFLR;
>>> +               buf += 6;
>>> +       } else {
>>> +               err = -EINVAL;
>>> +               goto out;
>>> +       }
>>> +
>>> +       /* check special wildcard noflr */
>>> +       if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "(*)", 3)) {
>>> +               disable_all_flr = 1;
>>> +               goto out;
>>> +       }
>>> +
>>> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
>>> +       if (err)
>>> +               goto out;
>>> +
>>> +       err = pcistub_device_id_add(domain, bus, slot, func, type);
>>> +
>>> +out:
>>> +       if (!err)
>>> +               err = count;
>>> +       return err;
>>> +}
>>> +
>>> +DRIVER_ATTR(resets, S_IWUSR, NULL, pcistub_resets);
>>>
>>>  #ifdef CONFIG_PCI_MSI
>>>
>>> @@ -1158,6 +1348,8 @@ static void pcistub_exit(void)
>>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_slots);
>>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_quirks);
>>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_permissive);
>>> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_do_flr);
>>> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_resets);
>>>
>>>        pci_unregister_driver(&pciback_pci_driver);
>>>        WARN_ON(unregister_msi_get_owner(pciback_get_owner));
>>> @@ -1165,35 +1357,27 @@ static void pcistub_exit(void)
>>>
>>>  static int __init pcistub_init(void)
>>>  {
>>> -       int pos = 0;
>>>        int err = 0;
>>> -       int domain, bus, slot, func;
>>> -       int parsed;
>>>
>>> -       if (pci_devs_to_hide && *pci_devs_to_hide) {
>>> -               do {
>>> -                       parsed = 0;
>>> -
>>> -                       err = sscanf(pci_devs_to_hide + pos,
>>> -                                    " (%x:%x:%x.%x) %n",
>>> -                                    &domain, &bus, &slot, &func, &parsed);
>>> -                       if (err != 4) {
>>> -                               domain = 0;
>>> -                               err = sscanf(pci_devs_to_hide + pos,
>>> -                                            " (%x:%x.%x) %n",
>>> -                                            &bus, &slot, &func, &parsed);
>>> -                               if (err != 3)
>>> -                                       goto parse_error;
>>> -                       }
>>> +       /* Parse device lists for hide, sbr, and d3r */
>>> +       err = pciback_parse_device_params(pci_devs_to_hide, PCIBACK_ID_TYPE_HIDE, pcistub_device_id_add);
>>> +       if (err)
>>> +               goto out;
>>>
>>> -                       err = pcistub_device_id_add(domain, bus, slot, func);
>>> -                       if (err)
>>> -                               goto out;
>>> +       err = pciback_parse_device_params(pci_devs_use_sbr, PCIBACK_ID_TYPE_SBR, pcistub_device_id_add);
>>> +       if (err)
>>> +               goto out;
>>>
>>> -                       /* if parsed<=0, we've reached the end of the string */
>>> -                       pos += parsed;
>>> -               } while (parsed > 0 && pci_devs_to_hide[pos]);
>>> -       }
>>> +       err = pciback_parse_device_params(pci_devs_use_d3r, PCIBACK_ID_TYPE_D3R, pcistub_device_id_add);
>>> +       if (err)
>>> +               goto out;
>>> +
>>> +       if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "(*)", 3))
>>> +               disable_all_flr = 1; /* check special wildcard noflr */
>>> +       else
>>> +               err = pciback_parse_device_params(pci_devs_no_flr, PCIBACK_ID_TYPE_NOFLR, pcistub_device_id_add);
>>> +       if (err)
>>> +               goto out;
>>>
>>>        /* If we're the first PCI Device Driver to register, we're the
>>>         * first one to get offered PCI devices as they become
>>> @@ -1217,6 +1401,12 @@ static int __init pcistub_init(void)
>>>        if (!err)
>>>                err = driver_create_file(&pciback_pci_driver.driver,
>>>                                         &driver_attr_permissive);
>>> +       if (!err)
>>> +               err = driver_create_file(&pciback_pci_driver.driver,
>>> +                                        &driver_attr_do_flr);
>>> +       if (!err)
>>> +               err = driver_create_file(&pciback_pci_driver.driver,
>>> +                                        &driver_attr_resets);
>>>
>>>        if (!err)
>>>                err = register_msi_get_owner(pciback_get_owner);
>>> @@ -1225,11 +1415,6 @@ static int __init pcistub_init(void)
>>>
>>>       out:
>>>        return err;
>>> -
>>> -      parse_error:
>>> -       printk(KERN_ERR "pciback: Error parsing pci_devs_to_hide at \"%s\"\n",
>>> -              pci_devs_to_hide + pos);
>>> -       return -EINVAL;
>>>  }
>>>
>>>  #ifndef MODULE
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 19:04:11.000000000 -0400
>>> @@ -109,7 +109,7 @@ void pciback_release_pci_dev(struct pcib
>>>        spin_unlock_irqrestore(&slot_dev->lock, flags);
>>>
>>>        if (found_dev)
>>> -               pcistub_put_pci_dev(found_dev);
>>> +               pcistub_put_pci_dev(found_dev, 0);
>>>  }
>>>
>>>  int pciback_init_devices(struct pciback_device *pdev)
>>> @@ -149,7 +149,7 @@ void pciback_release_devices(struct pcib
>>>                for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
>>>                        dev = slot_dev->slots[bus][slot];
>>>                        if (dev != NULL)
>>> -                               pcistub_put_pci_dev(dev);
>>> +                               pcistub_put_pci_dev(dev, 0);
>>>                }
>>>
>>>        kfree(slot_dev);
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c
>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 20:48:21.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 19:04:11.000000000 -0400
>>> @@ -162,7 +162,7 @@ void pciback_release_pci_dev(struct pcib
>>>        spin_unlock_irqrestore(&vpci_dev->lock, flags);
>>>
>>>        if (found_dev)
>>> -               pcistub_put_pci_dev(found_dev);
>>> +               pcistub_put_pci_dev(found_dev, 0);
>>>  }
>>>
>>>  int pciback_init_devices(struct pciback_device *pdev)
>>> @@ -202,7 +202,7 @@ void pciback_release_devices(struct pcib
>>>                list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
>>>                                         list) {
>>>                        list_del(&e->list);
>>> -                       pcistub_put_pci_dev(e->dev);
>>> +                       pcistub_put_pci_dev(e->dev, 0);
>>>                        kfree(e);
>>>                }
>>>        }
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_ids.h b/linux-2.6.18-xen.hg/include/linux/pci_ids.h
>>> --- a/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 20:48:23.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 19:04:11.000000000 -0400
>>> @@ -2259,6 +2259,14 @@
>>>  #define PCI_DEVICE_ID_INTEL_IXP2800    0x9004
>>>  #define PCI_DEVICE_ID_INTEL_S21152BB   0xb152
>>>
>>> +#define PCI_DEVICE_ID_INTEL_GMCHQ45 0x2e10
>>> +#define PCI_DEVICE_ID_INTEL_GMCHG45 0x2e20
>>> +#define PCI_DEVICE_ID_INTEL_MCHP45  0x2e20
>>> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
>>> +#define PCI_DEVICE_ID_INTEL_GMCHGM45 0x2a40
>>> +
>>> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
>>> +
>>>  #define PCI_VENDOR_ID_SCALEMP          0x8686
>>>  #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
>>>
>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_regs.h b/linux-2.6.18-xen.hg/include/linux/pci_regs.h
>>> --- a/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 20:48:23.000000000 -0400
>>> +++ b/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 19:04:11.000000000 -0400
>>> @@ -201,6 +201,7 @@
>>>  #define  PCI_CAP_ID_SHPC       0x0C    /* PCI Standard Hot-Plug Controller */
>>>  #define  PCI_CAP_ID_EXP        0x10    /* PCI Express */
>>>  #define  PCI_CAP_ID_MSIX       0x11    /* MSI-X */
>>> +#define  PCI_CAP_ID_AF      0x13    /* Advanced Features Capability */
>>>  #define PCI_CAP_LIST_NEXT      1       /* Next capability in the list */
>>>  #define PCI_CAP_FLAGS          2       /* Capability defined flags (16 bits) */
>>>  #define PCI_CAP_SIZEOF         4
>>> @@ -229,6 +230,11 @@
>>>  #define  PCI_PM_CTRL_DATA_SEL_MASK     0x1e00  /* Data select (??) */
>>>  #define  PCI_PM_CTRL_DATA_SCALE_MASK   0x6000  /* Data scale (??) */
>>>  #define  PCI_PM_CTRL_PME_STATUS        0x8000  /* PME pin status */
>>> +#define  PCI_PM_CTRL_DATA_DSTATE_MASK 0x3      /* D0 - D3 */
>>> +#define  PCI_PM_CTRL_D0 0x0
>>> +#define  PCI_PM_CTRL_D1 0x1
>>> +#define  PCI_PM_CTRL_D2 0x2
>>> +#define  PCI_PM_CTRL_D3HOT 0x3
>>>  #define PCI_PM_PPB_EXTENSIONS  6       /* PPB support extensions (??) */
>>>  #define  PCI_PM_PPB_B2_B3      0x40    /* Stop clock when in D3hot (??) */
>>>  #define  PCI_PM_BPCC_ENABLE    0x80    /* Bus power/clock control enable (??) */
>>> @@ -346,6 +352,7 @@
>>>  #define  PCI_EXP_DEVCAP_PWR_IND        0x4000  /* Power Indicator Present */
>>>  #define  PCI_EXP_DEVCAP_PWR_VAL        0x3fc0000 /* Slot Power Limit Value */
>>>  #define  PCI_EXP_DEVCAP_PWR_SCL        0xc000000 /* Slot Power Limit Scale */
>>> +#define  PCI_EXP_DEVCAP_FLR     0x10000000 /* Function Level Reset */
>>>  #define PCI_EXP_DEVCTL         8       /* Device Control */
>>>  #define  PCI_EXP_DEVCTL_CERE   0x0001  /* Correctable Error Reporting En. */
>>>  #define  PCI_EXP_DEVCTL_NFERE  0x0002  /* Non-Fatal Error Reporting Enable */
>>> @@ -358,6 +365,7 @@
>>>  #define  PCI_EXP_DEVCTL_AUX_PME        0x0400  /* Auxiliary Power PM Enable */
>>>  #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
>>>  #define  PCI_EXP_DEVCTL_READRQ 0x7000  /* Max_Read_Request_Size */
>>> +#define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
>>>  #define PCI_EXP_DEVSTA         10      /* Device Status */
>>>  #define  PCI_EXP_DEVSTA_CED    0x01    /* Correctable Error Detected */
>>>  #define  PCI_EXP_DEVSTA_NFED   0x02    /* Non-Fatal Error Detected */
>>> @@ -482,6 +490,17 @@
>>>  #define  PCI_ARI_CTRL_ACS      0x0002  /* ACS Function Groups Enable */
>>>  #define  PCI_ARI_CTRL_FG(x)    (((x) >> 4) & 7) /* Function Group */
>>>
>>> +/* Advanced Features Capability */
>>> +#define PCI_AF_LENFLD    0x02 /* Device length offset */
>>> +#define  PCI_AF_LENGTH   0x06
>>> +#define PCI_AF_DEVCAP    0x03 /* Device capabilities offset */
>>> +#define  PCI_AF_CAP_TP   0x01
>>> +#define  PCI_AF_CAP_FLR  0x02
>>> +#define PCI_AF_CTRL      0x04 /* Device CTRL offset */
>>> +#define  PCI_AF_CTRL_FLR 0x01
>>> +#define PCI_AF_STA       0x05 /* Device STATUS offset */
>>> +#define  PCI_AF_STA_TP   0x01
>>> +
>>>  /* Single Root I/O Virtualization */
>>>  #define PCI_SRIOV_CAP          0x04    /* SR-IOV Capabilities */
>>>  #define  PCI_SRIOV_CAP_VFM     0x01    /* VF Migration Capable */
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
>>> --- a/tools/firmware/hvmloader/hvmloader.c      2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/firmware/hvmloader/hvmloader.c      2009-06-07 19:04:11.000000000 -0400
>>> @@ -673,6 +673,7 @@ int main(void)
>>>         break;
>>>     default:
>>>         printf("No emulated VGA adaptor ...\n");
>>> +        vgabios_sz = round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
>>>         break;
>>>     }
>>>
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/console.h b/tools/ioemu-remote/console.h
>>> --- a/tools/ioemu-remote/console.h      2009-06-07 21:14:47.000000000 -0400
>>> +++ b/tools/ioemu-remote/console.h      2009-06-07 19:04:11.000000000 -0400
>>> @@ -290,6 +290,9 @@ void vga_hw_update(void);
>>>  void vga_hw_invalidate(void);
>>>  void vga_hw_screen_dump(const char *filename);
>>>
>>> +void unset_vga_acc(void);
>>> +void set_vga_acc(void);
>>> +
>>>  int is_graphic_console(void);
>>>  int is_fixedsize_console(void);
>>>  CharDriverState *text_console_init(const char *p);
>>> @@ -341,4 +344,9 @@ const char *readline_get_history(unsigne
>>>  void readline_start(const char *prompt, int is_password,
>>>                     ReadLineFunc *readline_func, void *opaque);
>>>
>>> +/* intel.c */
>>> +int intel_enter(void);
>>> +int intel_leave(void);
>>> +void intel_display_init(DisplayState *ds);
>>> +
>>>  #endif
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pass-through.c b/tools/ioemu-remote/hw/pass-through.c
>>> --- a/tools/ioemu-remote/hw/pass-through.c      2009-06-07 21:14:48.000000000 -0400
>>> +++ b/tools/ioemu-remote/hw/pass-through.c      2009-06-07 19:04:11.000000000 -0400
>>> @@ -90,6 +90,8 @@
>>>  #include "qemu-xen.h"
>>>  #include <unistd.h>
>>>
>>> +extern int vga_passthrough;
>>> +
>>>  struct php_dev {
>>>     struct pt_dev *pt_dev;
>>>     uint8_t valid;
>>> @@ -1573,10 +1575,11 @@ static int pt_dev_is_virtfn(struct pci_d
>>>
>>>  static int pt_register_regions(struct pt_dev *assigned_device)
>>>  {
>>> -    int i = 0;
>>> +    int i = 0, ret = 0;
>>>     uint32_t bar_data = 0;
>>>     struct pci_dev *pci_dev = assigned_device->pci_dev;
>>>     PCIDevice *d = &assigned_device->dev;
>>> +    uint16_t class, vendor_id;
>>>
>>>     /* Register PIO/MMIO BARs */
>>>     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
>>> @@ -1632,6 +1635,25 @@ static int pt_register_regions(struct pt
>>>             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
>>>     }
>>>
>>> +    /* Map legacy ioport and iomem, for specific devices */
>>> +    vendor_id = pci_read_word(pci_dev, 0x00);
>>> +    class = pci_read_word(pci_dev, 0x0a);
>>> +
>>> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
>>> +    if ( vga_passthrough && class == 0x0300 )
>>> +    {
>>> +        PT_LOG("add an intel graphic card\n");
>>> +
>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_ADD_MAPPING);
>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_ADD_MAPPING);
>>> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_ADD_MAPPING);
>>> +        if ( ret != 0 )
>>> +        {
>>> +            PT_LOG("legacy mapping failed!\n");
>>> +            return ret;
>>> +        }
>>> +    }
>>> +
>>>     return 0;
>>>  }
>>>
>>> @@ -1640,6 +1662,7 @@ static void pt_unregister_regions(struct
>>>     int i, type, ret;
>>>     uint32_t e_size;
>>>     PCIDevice *d = (PCIDevice*)assigned_device;
>>> +    uint16_t class, vendor_id;
>>>
>>>     for ( i = 0; i < PCI_NUM_REGIONS; i++ )
>>>     {
>>> @@ -1681,6 +1704,24 @@ static void pt_unregister_regions(struct
>>>
>>>     }
>>>
>>> +    /* unmap legacy ioport and iomem, for specific devices */
>>> +    vendor_id = pci_read_word(assigned_device->pci_dev, 0x00);
>>> +    class = pci_read_word(assigned_device->pci_dev, 0x0a);
>>> +
>>> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
>>> +    if ( vga_passthrough && class == 0x0300 )
>>> +    {
>>> +        PT_LOG("remove an intel graphic card\n");
>>> +
>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_REMOVE_MAPPING);
>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_REMOVE_MAPPING);
>>> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_REMOVE_MAPPING);
>>> +        if ( ret != 0 )
>>> +        {
>>> +            PT_LOG("legacy unmapping failed !\n");
>>> +        }
>>> +    }
>>> +
>>>  }
>>>
>>>  static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
>>> @@ -3759,7 +3800,7 @@ static struct pt_dev * register_real_dev
>>>     struct pci_config_cf8 machine_bdf;
>>>     char *key, *val;
>>>     int msi_translate, power_mgmt;
>>> -
>>> +
>>>     PT_LOG("Assigning real physical device %02x:%02x.%x ...\n",
>>>         r_bus, r_dev, r_func);
>>>
>>> @@ -3931,7 +3972,7 @@ static struct pt_dev * register_real_dev
>>>     }
>>>
>>>  out:
>>> -    PT_LOG("Real physical device %02x:%02x.%x registered successfuly!\n"
>>> +    PT_LOG("Real physical device %02x:%02x.%x registered successfully!\n"
>>>            "IRQ type = %s\n", r_bus, r_dev, r_func,
>>>            assigned_device->msi_trans_en? "MSI-INTx":"INTx");
>>>
>>> @@ -4113,3 +4154,47 @@ err:
>>>     return status;
>>>  }
>>>
>>> +u8 pt_pci_host_read_byte(int bus, int dev, int fn, u32 addr)
>>> +{
>>> +    struct pci_dev *pci_dev;
>>> +    u8             val;
>>> +
>>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>>> +    if (!pci_dev)
>>> +        return 0;
>>> +
>>> +    val = pci_read_byte(pci_dev, addr);
>>> +    pci_free_dev(pci_dev);
>>> +
>>> +    return val;
>>> +}
>>> +
>>> +u16 pt_pci_host_read_word(int bus, int dev, int fn, u32 addr)
>>> +{
>>> +    struct pci_dev *pci_dev;
>>> +    u16             val;
>>> +
>>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>>> +    if (!pci_dev)
>>> +        return 0;
>>> +
>>> +    val = pci_read_word(pci_dev, addr);
>>> +    pci_free_dev(pci_dev);
>>> +
>>> +    return val;
>>> +}
>>> +
>>> +u32 pt_pci_host_read_long(int bus, int dev, int fn, u32 addr)
>>> +{
>>> +    struct pci_dev *pci_dev;
>>> +    u32             val;
>>> +
>>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>>> +    if (!pci_dev)
>>> +        return 0;
>>> +
>>> +    val = pci_read_long(pci_dev, addr);
>>> +    pci_free_dev(pci_dev);
>>> +
>>> +    return val;
>>> +}
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pc.c b/tools/ioemu-remote/hw/pc.c
>>> --- a/tools/ioemu-remote/hw/pc.c        2009-06-07 21:14:47.000000000 -0400
>>> +++ b/tools/ioemu-remote/hw/pc.c        2009-06-07 19:04:11.000000000 -0400
>>> @@ -65,6 +65,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
>>>  extern uint8_t *acpi_tables;
>>>  extern size_t acpi_tables_len;
>>>
>>> +extern int vga_passthrough;
>>> +
>>>  static fdctrl_t *floppy_controller;
>>>  static RTCState *rtc_state;
>>>  static PITState *pit;
>>> @@ -984,6 +986,7 @@ vga_bios_error:
>>>
>>>     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
>>>
>>> +    if (!vga_passthrough) {
>>>     if (cirrus_vga_enabled) {
>>>         if (pci_enabled) {
>>>             pci_cirrus_vga_init(pci_bus,
>>> @@ -1010,6 +1013,7 @@ vga_bios_error:
>>>                          vga_ram_addr, vga_ram_size);
>>>         }
>>>     }
>>> +    }
>>>
>>>  #ifdef CONFIG_PASSTHROUGH
>>>     /* Pass-through Initialization
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pci.c b/tools/ioemu-remote/hw/pci.c
>>> --- a/tools/ioemu-remote/hw/pci.c       2009-06-07 21:14:47.000000000 -0400
>>> +++ b/tools/ioemu-remote/hw/pci.c       2009-06-07 19:04:11.000000000 -0400
>>> @@ -28,11 +28,14 @@
>>>  #include "virtio-net.h"
>>>  #include "sysemu.h"
>>>
>>> +#include "pass-through.h"
>>>  #include "exec-all.h"
>>>  #include "qemu-xen.h"
>>>
>>>  //#define DEBUG_PCI
>>>
>>> +extern int vga_passthrough;
>>> +
>>>  struct PCIBus {
>>>     int bus_num;
>>>     int devfn_min;
>>> @@ -611,7 +614,24 @@ uint32_t pci_data_read(void *opaque, uin
>>>         goto the_end;
>>>     }
>>>     config_addr = addr & 0xff;
>>> -    val = pci_dev->config_read(pci_dev, config_addr, len);
>>> +    if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
>>> +    {
>>> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>>> +
>>> +        if (config_addr == 0x52) // GMCH
>>> +            val = pt_pci_host_read_word(0, 0, 0, 0x52);
>>> +        if (config_addr == 0x02) // Device ID
>>> +        {
>>> +            if (len == 2)
>>> +                val = pt_pci_host_read_word(0, 0, 0, 0x00);
>>> +            else if (len == 4)
>>> +                val = pt_pci_host_read_long(0, 0, 0, 0x00);
>>> +        }
>>> +    } else if (vga_passthrough && pci_dev->devfn == 0x10 && // intel graphic card
>>> +               config_addr == 0xfc) // OpRegion address
>>> +        val = 0; // force to fall back to SMI mode
>>> +    else
>>> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>>>  #if defined(DEBUG_PCI)
>>>     printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",
>>>            pci_dev->name, config_addr, val, len);
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/vga.c b/tools/ioemu-remote/hw/vga.c
>>> --- a/tools/ioemu-remote/hw/vga.c       2009-06-07 21:14:47.000000000 -0400
>>> +++ b/tools/ioemu-remote/hw/vga.c       2009-06-07 19:04:11.000000000 -0400
>>> @@ -34,9 +34,9 @@
>>>
>>>  #include "qemu-timer.h"
>>>
>>> -//#define DEBUG_VGA
>>> -//#define DEBUG_VGA_MEM
>>> -//#define DEBUG_VGA_REG
>>> +#define DEBUG_VGA
>>> +#define DEBUG_VGA_MEM
>>> +#define DEBUG_VGA_REG
>>>
>>>  //#define DEBUG_BOCHS_VBE
>>>
>>> @@ -161,6 +161,18 @@ static uint8_t expand4to8[16];
>>>  static void vga_bios_init(VGAState *s);
>>>  static void vga_screen_dump(void *opaque, const char *filename);
>>>
>>> +static VGAState *xen_vga_state;
>>> +
>>> +void set_vga_acc(void)
>>> +{
>>> +    set_vram_mapping(xen_vga_state, xen_vga_state->lfb_addr, xen_vga_state->lfb_end);
>>> +}
>>> +
>>> +void unset_vga_acc(void)
>>> +{
>>> +    unset_vram_mapping(xen_vga_state);
>>> +}
>>> +
>>>  static void vga_dumb_update_retrace_info(VGAState *s)
>>>  {
>>>     (void) s;
>>> @@ -2473,8 +2485,6 @@ static void vga_bios_init(VGAState *s)
>>>  }
>>>
>>>
>>> -static VGAState *xen_vga_state;
>>> -
>>>  /* Allocate video memory in the GPFN space */
>>>  void xen_vga_populate_vram(uint64_t vram_addr, uint32_t vga_ram_size)
>>>  {
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/intel.c b/tools/ioemu-remote/intel.c
>>> --- a/tools/ioemu-remote/intel.c        1969-12-31 19:00:00.000000000 -0500
>>> +++ b/tools/ioemu-remote/intel.c        2009-06-07 19:04:11.000000000 -0400
>>> @@ -0,0 +1,494 @@
>>> +#include <stdio.h>
>>> +#include <stdlib.h>
>>> +#include <stdint.h>
>>> +#include <sys/mman.h>
>>> +#include <sys/types.h>
>>> +#include <sys/stat.h>
>>> +#include <fcntl.h>
>>> +#include <assert.h>
>>> +#include <signal.h>
>>> +#include <pci/pci.h>
>>> +
>>> +#include "qemu-common.h"
>>> +#include "console.h"
>>> +#include "sysemu.h"
>>> +
>>> +#define INTEL_DEBUG(format, args...)                                    \
>>> +    fprintf (stderr, "intel.c:%d:%s " format , __LINE__, __func__, ## args)
>>> +
>>> +#define TileW           128
>>> +#define TileH           8
>>> +
>>> +#define REG_DR_DSPASURF                0x7019C
>>> +#define REG_DR_DSPACNTR                0x70180
>>> +#define REG_DR_DSPASTRIDE      0x70188
>>> +#define REG_DR_PIPEACONF       0x70008
>>> +
>>> +#define REG_DR_DSPBSURF                0x7119C
>>> +#define REG_DR_DSPBCNTR                0x71180
>>> +#define REG_DR_DSPBSTRIDE      0x71188
>>> +#define REG_DR_PIPEBCONF       0x71008
>>> +
>>> +#define REG_DE_PIPEASRC                0x6001c
>>> +
>>> +extern int                      vga_passthrough;
>>> +uint32_t                        guest_framebuffer;
>>> +
>>> +static int                      display = 0;
>>> +
>>> +static int                      mmio_fd = -1;
>>> +static int                      mem_fd = -1;
>>> +static uint8_t                  *intel_mem = NULL;
>>> +static uint8_t                  *intel_mmio = NULL;
>>> +static int                      intel_force_full_update = 0;
>>> +static int                      intel_have_focus;
>>> +static int                      IntelPitch = 16;
>>> +static int                      IntelX = 1280;
>>> +static int                      IntelY = 1024;
>>> +static DisplayState             *lds = NULL;
>>> +static uint8_t                  *old_data = NULL;
>>> +static uint32_t                 intel_fb_base, intel_mmio_base;
>>> +static uint32_t                 map_s, map_d, map_size;
>>> +static int                      refresh;
>>> +
>>> +static void set_data_mappings(void);
>>> +static void unset_data_mappings(int mapping);
>>> +static void set_data_pointer(void);
>>> +static void intel_resize(DisplayState *ds);
>>> +
>>> +static inline unsigned int intel_get_reg(unsigned int reg)
>>> +{
>>> +    return *(unsigned int*)(intel_mmio + reg);
>>> +}
>>> +
>>> +static inline int is_linear(void)
>>> +{
>>> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
>>> +    if (((*dspacntr) & (1 << 10)) == 0)
>>> +        return 1;
>>> +    else
>>> +        return 0;
>>> +}
>>> +
>>> +static inline unsigned int intel_get_pitch(void)
>>> +{
>>> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
>>> +    return *dspastride;
>>> +}
>>> +
>>> +static inline unsigned int intel_get_offset(DisplaySurface *ds, int x, int y)
>>> +{
>>> +    return (y * ds->width + x) * 4;
>>> +}
>>> +
>>> +static void intel_update_linear(DisplaySurface *ds, int x, int y, int w, int h)
>>> +{
>>> +    int i, bpp = ds->pf.depth / 8;
>>> +    unsigned char *s, *d;
>>> +    s = ds->data;
>>> +    d = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
>>> +    s += (ds->linesize * y) + bpp * x;
>>> +    d += (ds->linesize * y) + bpp * x;
>>> +    for (i = 0; i < h; i++) {
>>> +        memcpy(d, s, w * bpp);
>>> +        s += ds->linesize;
>>> +        d += ds->linesize;
>>> +    }
>>> +}
>>> +
>>> +static void intel_force_linear(int linesize)
>>> +{
>>> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
>>> +    unsigned int *pipeaconf = (unsigned int *)(intel_mmio + REG_DR_PIPEACONF);
>>> +    unsigned int *dspasurf = (unsigned int *)(intel_mmio + REG_DR_DSPASURF);
>>> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
>>> +
>>> +    unsigned int *dspbcntr = (unsigned int *)(intel_mmio + REG_DR_DSPBCNTR);
>>> +    unsigned int *pipebconf = (unsigned int *)(intel_mmio + REG_DR_PIPEBCONF);
>>> +    unsigned int *dspbsurf = (unsigned int *)(intel_mmio + REG_DR_DSPBSURF);
>>> +    unsigned int *dspbstride = (unsigned int *)(intel_mmio + REG_DR_DSPBSTRIDE);
>>> +
>>> +    unsigned int surfa = 0, surfb = 0, pipea = 0, pipeb = 0;
>>> +    char pipebenabled = !!(*pipebconf & (1 << 30));
>>> +
>>> +
>>> +    INTEL_DEBUG("DSPASURF CTRL: 0x%x\n", intel_get_reg(REG_DR_DSPACNTR));
>>> +
>>> +    /* Disable surface */
>>> +    pipea = *pipeaconf & (0x3 << 18);
>>> +    *pipeaconf &= ~(0x3 << 18);
>>> +    *dspacntr |= (1 << 31);
>>> +    /* Address of the surface to map to */
>>> +    surfa = *dspasurf;
>>> +    *dspasurf = 0x00000000;
>>> +    *dspacntr &= ~(1 << 31);
>>> +    *dspasurf = 0x00000000;
>>> +    *pipeaconf |= pipea;
>>> +
>>> +    if (pipebenabled) {
>>> +        INTEL_DEBUG("PIPEBCONF enabled.\n");
>>> +
>>> +        /* Disable surface */
>>> +        pipeb = *pipebconf & (0x3 << 18);
>>> +        *pipebconf &= ~(0x3 << 18);
>>> +        *dspbcntr |= (1 << 31);
>>> +        /* Address of the surface to map to */
>>> +        surfb = *dspbsurf;
>>> +        *dspbsurf = 0x00000000;
>>> +        *dspbcntr &= ~(1 << 31);
>>> +        *dspbsurf = 0x00000000;
>>> +        *pipebconf |= pipeb;
>>> +    }
>>> +
>>> +    usleep(20000);
>>> +
>>> +    *pipeaconf &= ~(0x3 << 18);
>>> +    /* Enable surface linear mode */
>>> +    *dspacntr &= ~(1 << 10);
>>> +    if (linesize) *dspastride = linesize;
>>> +    *dspasurf = surfa;
>>> +    *dspacntr |= (1 << 31);
>>> +    *pipeaconf |= pipea;
>>> +
>>> +    if (pipebenabled) {
>>> +        *pipebconf &= ~(0x3 << 18);
>>> +        /* Enable surface linear mode */
>>> +        *dspbcntr &= ~(1 << 10);
>>> +        if (linesize) *dspbstride = linesize;
>>> +        *dspbsurf = surfb;
>>> +        *dspbcntr |= (1 << 31);
>>> +        *pipebconf |= pipeb;
>>> +    }
>>> +
>>> +    usleep(20000);
>>> +}
>>> +
>>> +static void intel_update(DisplayState *ds, int x, int y, int w, int h)
>>> +{
>>> +    if (intel_have_focus && !old_data && !map_size)
>>> +        intel_update_linear(ds->surface, x, y, w, h);
>>> +}
>>> +
>>> +static void set_fb_mapping(void)
>>> +{
>>> +    DisplaySurface *surf = lds->surface;
>>> +    int rc;
>>> +    unsigned long nr_pfn;
>>> +
>>> +    unset_vga_acc();
>>> +    fprintf(stderr, "set_fb_mapping: %x %x\n", (intel_fb_base + intel_get_reg(REG_DR_DSPASURF)), guest_framebuffer);
>>> +    nr_pfn = (surf->linesize * surf->height) >> TARGET_PAGE_BITS;
>>> +
>>> +    rc = xc_domain_memory_mapping(xc_handle,
>>> +            domid,
>>> +            (guest_framebuffer >> TARGET_PAGE_BITS),
>>> +            ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS),
>>> +            nr_pfn,
>>> +            DPCI_ADD_MAPPING);
>>> +    if (rc) {
>>> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
>>> +        return;
>>> +    }
>>> +    map_s = ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS);
>>> +    map_d = (guest_framebuffer >> TARGET_PAGE_BITS);
>>> +    map_size = nr_pfn;
>>> +}
>>> +
>>> +static void unset_fb_mapping(void)
>>> +{
>>> +    int rc;
>>> +
>>> +    fprintf(stderr, "unset_fb_mapping: %x %x\n", map_d, map_s);
>>> +
>>> +    rc = xc_domain_memory_mapping(xc_handle,
>>> +            domid,
>>> +            map_d,
>>> +            map_s,
>>> +            map_size,
>>> +            DPCI_REMOVE_MAPPING);
>>> +    if (rc) {
>>> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
>>> +        return;
>>> +    }
>>> +
>>> +    set_vga_acc();
>>> +    map_s = 0;
>>> +    map_d = 0;
>>> +    map_size = 0;
>>> +}
>>> +
>>> +static void intel_setdata(DisplayState *ds)
>>> +{
>>> +    if (map_size)
>>> +        unset_fb_mapping();
>>> +    set_fb_mapping();
>>> +}
>>> +
>>> +static void intel_resize_shared(DisplayState *ds, int w, int h, int depth, int linesize, void *pixels)
>>> +{
>>> +    DisplaySurface *surf = ds->surface;
>>> +
>>> +    if (!intel_have_focus) {
>>> +        surf->width = w;
>>> +        surf->height = h;
>>> +        intel_resize(ds);
>>> +        return;
>>> +    }
>>> +    if (depth == 32 && w == IntelX && h == IntelY)
>>> +        surf->flags = QEMU_ALLOCATED_FLAG;
>>> +    else
>>> +        surf->flags &= ~QEMU_ALLOCATED_FLAG;
>>> +    if (surf->flags & QEMU_ALLOCATED_FLAG) {
>>> +        surf->width = w;
>>> +        surf->height = h;
>>> +        surf->pf.depth = 32;
>>> +        surf->linesize = linesize;
>>> +        /* adjust linesize */
>>> +        intel_force_linear(linesize);
>>> +        set_data_mappings();
>>> +        if (refresh) {
>>> +            memcpy(surf->data, pixels, surf->linesize * surf->height);
>>> +            refresh = 0;
>>> +        }
>>> +        surf->data = pixels;
>>> +        intel_setdata(ds);
>>> +    } else {
>>> +        surf->width = w;
>>> +        surf->height = h;
>>> +        intel_resize(ds);
>>> +    }
>>> +}
>>> +
>>> +static void intel_resize(DisplayState *ds)
>>> +{
>>> +    DisplaySurface *surf = ds->surface;
>>> +    int old_linesize = surf->linesize;
>>> +
>>> +    if (surf->pf.depth == 32 && surf->width == IntelX && surf->height == IntelY)
>>> +      surf->flags = QEMU_ALLOCATED_FLAG;
>>> +    else
>>> +      surf->flags &= ~QEMU_ALLOCATED_FLAG;
>>> +
>>> +    if (is_buffer_shared(surf))
>>> +    {
>>> +      INTEL_DEBUG("intel_resize_shared: enable shared buffer, linesize %d\n",
>>> +                  surf->linesize);
>>> +      intel_force_linear(surf->linesize);
>>> +      set_data_mappings();
>>> +      if (refresh)
>>> +      {
>>> +        // Pixels doesn't exist anymore ??
>>> +        //memcpy(surf->data, pixels, surf->linesize * surf->height);
>>> +        refresh = 0;
>>> +      }
>>> +      intel_setdata(ds);
>>> +      return;
>>> +    }
>>> +
>>> +    INTEL_DEBUG("intel_resize: no shared buffer, linesize=%d\n", surf->linesize);
>>> +    surf->linesize = intel_get_pitch();
>>> +    if (map_size) {
>>> +        unset_fb_mapping();
>>> +        unset_data_mappings(1);
>>> +    }
>>> +    if (intel_have_focus && !is_linear()) {
>>> +        intel_force_linear(0);
>>> +    }
>>> +    surf->flags &= ~QEMU_ALLOCATED_FLAG;
>>> +    if (intel_have_focus && !old_data &&
>>> +        surf->width * surf->height <= IntelX * IntelY)
>>> +        set_data_mappings();
>>> +    else if (intel_have_focus && old_data &&
>>> +             surf->width * surf->height > IntelX * IntelY)
>>> +        unset_data_mappings(0);
>>> +    if (!old_data) {
>>> +        qemu_free(surf->data);
>>> +        surf->data = qemu_mallocz(surf->height * surf->linesize);
>>> +    } else {
>>> +        INTEL_DEBUG("intel_resize: set_data_pointer\n");
>>> +        set_data_pointer();
>>> +    }
>>> +    if (intel_have_focus)
>>> +        memset((unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)), 0x0, IntelX * IntelY);
>>> +    if (refresh) {
>>> +        if (old_data) {
>>> +            unsigned char *s, *d;
>>> +            int i;
>>> +            s = old_data;
>>> +            d = surf->data;
>>> +            for (i = 0; i < surf->height; i++) {
>>> +                memcpy(d, s, surf->width * 4);
>>> +                s += old_linesize;
>>> +                d += surf->linesize;
>>> +            }
>>> +        }
>>> +        refresh = 0;
>>> +    }
>>> +}
>>> +
>>> +static void intel_refresh(DisplayState *ds)
>>> +{
>>> +    vga_hw_update();
>>> +}
>>> +
>>> +static void intel_init_mapping(void)
>>> +{
>>> +    struct pci_access   *pci_bus;
>>> +    struct pci_dev      *pci_dev;
>>> +
>>> +    mmio_fd = open("/dev/mem", O_RDWR);
>>> +    if (mmio_fd == -1)
>>> +    {
>>> +        perror("open");
>>> +        exit(1);
>>> +    }
>>> +    mem_fd = open("/dev/mem", O_RDWR);
>>> +    if (mem_fd == -1)
>>> +    {
>>> +        perror("open");
>>> +        exit(1);
>>> +    }
>>> +
>>> +    pci_bus = pci_alloc();
>>> +    pci_init(pci_bus);
>>> +    pci_dev = pci_get_dev(pci_bus, 0, 0, 2, 0);
>>> +    pci_fill_info(pci_dev, PCI_FILL_BASES);
>>> +    intel_fb_base = pci_dev->base_addr[2] & 0xfffff000;
>>> +    intel_mmio_base = pci_dev->base_addr[0] & 0xfffff000;
>>> +    pci_free_dev(pci_dev);
>>> +    pci_cleanup(pci_bus);
>>> +
>>> +    INTEL_DEBUG("Map intel main mem 0x%x\n", intel_fb_base);
>>> +    intel_mem = mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED,
>>> +                     mem_fd, intel_fb_base);
>>> +    if (intel_mem == MAP_FAILED)
>>> +    {
>>> +        perror("mmap");
>>> +        exit(1);
>>> +    }
>>> +
>>> +    INTEL_DEBUG("Map intel mmio 0x%x\n", intel_mmio_base);
>>> +    intel_mmio = mmap(NULL, 4 * 1024 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED,
>>> +                      mmio_fd, intel_mmio_base);
>>> +    if (intel_mem == MAP_FAILED)
>>> +    {
>>> +        perror("mmap");
>>> +        exit(1);
>>> +    }
>>> +}
>>> +
>>> +static void set_data_pointer(void)
>>> +{
>>> +    DisplaySurface *surf = lds->surface;
>>> +
>>> +    surf->data = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
>>> +    surf->data = surf->data +
>>> +                surf->linesize * ((IntelY - surf->height) / 2) +
>>> +                4 * ((IntelX - surf->width) / 2);
>>> +}
>>> +
>>> +static void set_data_mappings(void)
>>> +{
>>> +    INTEL_DEBUG("set_data_mappings\n");
>>> +    if (!old_data)
>>> +        old_data = lds->surface->data;
>>> +    set_data_pointer();
>>> +}
>>> +
>>> +static void unset_data_mappings(int mapping)
>>> +{
>>> +    DisplaySurface *surf = lds->surface;
>>> +    if (!old_data)
>>> +        return;
>>> +    if (mapping) {
>>> +        uint8_t * buffer_pointer = surf->data;
>>> +        surf->data = old_data;
>>> +        old_data = NULL;
>>> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
>>> +        memcpy(surf->data,
>>> +                (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)),
>>> +                surf->linesize * surf->height);
>>> +        memcpy(buffer_pointer,
>>> +                surf->data,
>>> +                surf->linesize * surf->height);
>>> +    } else {
>>> +        uint8_t * buffer_pointer = surf->data;
>>> +        surf->data = old_data;
>>> +        old_data = NULL;
>>> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
>>> +        memcpy(surf->data,
>>> +                buffer_pointer,
>>> +                surf->linesize * surf->height);
>>> +    }
>>> +    INTEL_DEBUG("unset_data_mappings %d: success\n", mapping);
>>> +}
>>> +
>>> +static int intel_getfocus(void)
>>> +{
>>> +    return intel_have_focus;
>>> +}
>>> +
>>> +static void intel_focus(int focus)
>>> +{
>>> +    if (intel_have_focus == focus)
>>> +        return;
>>> +
>>> +    INTEL_DEBUG("intel_focus %d\n", focus);
>>> +    intel_have_focus = focus;
>>> +    if (focus) {
>>> +        if (!is_linear()) {
>>> +           IntelPitch = intel_get_reg(REG_DR_DSPASTRIDE);
>>> +           IntelX = ((intel_get_reg(REG_DE_PIPEASRC) >> 16) & 0xfff) + 1;
>>> +           IntelY = (intel_get_reg(REG_DE_PIPEASRC) & 0xfff) + 1;
>>> +           INTEL_DEBUG("Resolution is %dx%d\n", IntelX, IntelY);
>>> +        }
>>> +        refresh = 1;
>>> +        lds->listeners->dpy_resize = intel_resize;
>>> +        lds->listeners->dpy_setdata = intel_setdata;
>>> +        vga_hw_invalidate();
>>> +    } else {
>>> +        if (map_size) {
>>> +            unset_fb_mapping();
>>> +            unset_data_mappings(1);
>>> +        } else if (old_data) {
>>> +            unset_data_mappings(0);
>>> +        }
>>> +        lds->listeners->dpy_resize = NULL;
>>> +        lds->listeners->dpy_setdata = NULL;
>>> +        lds->surface->flags &= ~QEMU_ALLOCATED_FLAG;
>>> +    }
>>> +}
>>> +
>>> +int intel_enter(void)
>>> +{
>>> +    intel_focus(1);
>>> +    return 1;
>>> +}
>>> +
>>> +int intel_leave(void)
>>> +{
>>> +    intel_focus(0);
>>> +    return 1;
>>> +}
>>> +
>>> +void intel_display_init(DisplayState *ds)
>>> +{
>>> +    DisplaySurface *surf = ds->surface;
>>> +
>>> +    INTEL_DEBUG("\n");
>>> +
>>> +    intel_init_mapping();
>>> +
>>> +    INTEL_DEBUG("Frambuffer is at 0x%x\n", intel_get_reg(REG_DR_DSPASURF));
>>> +
>>> +    surf->flags = 0;
>>> +    surf->width = 640;
>>> +    surf->height = 480;
>>> +    surf->pf.depth = 32;
>>> +    intel_resize(ds);
>>> +    lds = ds;
>>> +
>>> +    ds->listeners->dpy_update = intel_update;
>>> +    ds->listeners->dpy_resize = intel_resize;
>>> +    ds->listeners->dpy_refresh = intel_refresh;
>>> +}
>>> \ No newline at end of file
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/vl.c b/tools/ioemu-remote/vl.c
>>> --- a/tools/ioemu-remote/vl.c   2009-06-07 21:14:47.000000000 -0400
>>> +++ b/tools/ioemu-remote/vl.c   2009-06-07 19:29:12.000000000 -0400
>>> @@ -233,6 +233,9 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_
>>>  #ifdef TARGET_I386
>>>  int win2k_install_hack = 0;
>>>  int rtc_td_hack = 0;
>>> +int vga_passthrough = 0;
>>> +const char *dom0_input = NULL;
>>> +int intel = 0;
>>>  #endif
>>>  int usb_enabled = 0;
>>>  int smp_cpus = 1;
>>> @@ -4039,6 +4042,9 @@ static void help(int exitcode)
>>>            "-disable-opengl disable OpenGL rendering, using SDL"
>>>  #endif
>>>  #endif
>>> +           "-vga_passthrough enable graphics card passthrough\n"
>>> +           "-dom0-input     enable dom0 controlling qemu\n"
>>> +           "-intel          use intel gfx\n"
>>>            "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n"
>>>            "-vga [std|cirrus|vmware|none]\n"
>>>            "                select video card type\n"
>>> @@ -4275,6 +4281,9 @@ enum {
>>>     QEMU_OPTION_domainname,
>>>     QEMU_OPTION_acpi,
>>>     QEMU_OPTION_vcpus,
>>> +    QEMU_OPTION_vga_passthrough,
>>> +    QEMU_OPTION_dom0_input,
>>> +    QEMU_OPTION_intel,
>>>
>>>     /* Debug/Expert options: */
>>>     QEMU_OPTION_serial,
>>> @@ -4448,6 +4457,9 @@ static const QEMUOption qemu_options[] =
>>>     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
>>>     { "vncunused", 0, QEMU_OPTION_vncunused },
>>>     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
>>> +    { "vga_passthrough", 0, QEMU_OPTION_vga_passthrough },
>>> +    { "dom0-input", HAS_ARG, QEMU_OPTION_dom0_input },
>>> +    { "intel", 0, QEMU_OPTION_intel },
>>>  #if defined(CONFIG_XEN) && !defined(CONFIG_DM)
>>>     { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid },
>>>     { "xen-create", 0, QEMU_OPTION_xen_create },
>>> @@ -5281,6 +5293,15 @@ int main(int argc, char **argv, char **e
>>>             case QEMU_OPTION_disable_opengl:
>>>                 opengl_enabled = 0;
>>>                 break;
>>> +            case QEMU_OPTION_vga_passthrough:
>>> +                vga_passthrough = 1;
>>> +                break;
>>> +            case QEMU_OPTION_dom0_input:
>>> +                dom0_input = optarg;
>>> +                break;
>>> +            case QEMU_OPTION_intel:
>>> +                intel = 1;
>>> +                break;
>>>             case QEMU_OPTION_direct_pci:
>>>                direct_pci = optarg;
>>>                 break;
>>> @@ -5876,6 +5897,14 @@ int main(int argc, char **argv, char **e
>>>             fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
>>>             exit(1);
>>>         }
>>> +
>>> +#ifdef CONFIG_DM
>>> +        if(vga_passthrough)
>>> +            fprintf(stderr, "Replace if initializing dom0_driver\n" );
>>> +#else
>>> +        dumb_display_init(ds);
>>> +#endif
>>> +
>>>     } else {
>>>  #if defined(CONFIG_CURSES)
>>>             if (curses) {
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/xen-hooks.mak b/tools/ioemu-remote/xen-hooks.mak
>>> --- a/tools/ioemu-remote/xen-hooks.mak  2009-06-07 21:14:47.000000000 -0400
>>> +++ b/tools/ioemu-remote/xen-hooks.mak  2009-06-07 19:04:12.000000000 -0400
>>> @@ -35,6 +35,7 @@ OBJS += exec-dm.o
>>>  OBJS += pci_emulation.o
>>>  OBJS += helper2.o
>>>  OBJS += battery_mgmt.o
>>> +OBJS += intel.o
>>>
>>>  ifdef CONFIG_STUBDOM
>>>  CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c
>>> --- a/tools/libxc/xc_hvm_build.c        2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/libxc/xc_hvm_build.c        2009-06-07 19:04:12.000000000 -0400
>>> @@ -1,7 +1,3 @@
>>> -/******************************************************************************
>>> - * xc_hvm_build.c
>>> - */
>>> -
>>>  #include <stddef.h>
>>>  #include <inttypes.h>
>>>  #include <stdlib.h>
>>> @@ -66,6 +62,82 @@ static void build_hvm_info(void *hvm_inf
>>>     hvm_info->checksum = -sum;
>>>  }
>>>
>>> +static int init_vgabios(int            xc_handle,
>>> +                        uint32_t       dom,
>>> +                        unsigned char *buffer,
>>> +                        uint32_t       bios_size)
>>> +{
>>> +    char                *va_bios = NULL;
>>> +    uint32_t            va_size = 0;
>>> +
>>> +    va_size = bios_size + bios_size % XC_PAGE_SIZE;
>>> +    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
>>> +                                   PROT_READ | PROT_WRITE, 0xC0);
>>> +    if (!va_bios)
>>> +    {
>>> +        IPRINTF("Unable to map vga bios!\n");
>>> +        return -1;
>>> +    }
>>> +
>>> +    if ( buffer != NULL)
>>> +        memcpy(va_bios, buffer, bios_size);
>>> +    else
>>> +        memset(va_bios, 0, bios_size);
>>> +
>>> +    munmap(va_bios, va_size);
>>> +    return 0;
>>> +}
>>> +
>>> +static int  setup_vga_pt(int            xc_handle,
>>> +                         uint32_t       dom)
>>> +{
>>> +    int                 rc = 0;
>>> +    unsigned char       *bios = NULL;
>>> +    int                 bios_size = 0;
>>> +    char                *c = NULL;
>>> +    char                checksum = 0;
>>> +
>>> +    IPRINTF("Setting up vga passthrough.\n");
>>> +
>>> +    /* Allocated 64K for the vga bios */
>>> +    if (!(bios = malloc(64 * 1024))) {
>>> +        IPRINTF("Error allocating memory for vga bios.\n");
>>> +        return -1;
>>> +    }
>>> +
>>> +#ifdef __linux__
>>> +    bios_size = xc_get_vgabios(bios, 64 * 1024);
>>> +#else
>>> +    bios_size = 0;
>>> +#endif /* __linux__ */
>>> +
>>> +    if (bios_size == 0)
>>> +    {
>>> +        IPRINTF("vga bios size is 0!\n");
>>> +        rc = -1;
>>> +        goto error;
>>> +    }
>>> +
>>> +    /* Adjust the bios checksum */
>>> +    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
>>> +        checksum += *c;
>>> +    if (checksum)
>>> +        bios[bios_size - 1] -= checksum;
>>> +    init_vgabios(xc_handle, dom, bios, bios_size);
>>> +
>>> +error:
>>> +    free(bios);
>>> +
>>> +    if( rc == -1 ) {
>>> +        IPRINTF("Error setting up vga passthrough.\n");
>>> +    }
>>> +    else {
>>> +        IPRINTF("Success setting up vga passthrough.\n");
>>> +    }
>>> +
>>> +    return rc;
>>> +}
>>> +
>>>  static int loadelfimage(
>>>     struct elf_binary *elf, int xch, uint32_t dom, unsigned long *parray)
>>>  {
>>> @@ -381,7 +453,8 @@ int xc_hvm_build_target_mem(int xc_handl
>>>                            uint32_t domid,
>>>                            int memsize,
>>>                            int target,
>>> -                           const char *image_name)
>>> +                           const char *image_name,
>>> +                           int vga_pt_enabled)
>>>  {
>>>     char *image;
>>>     int  sts;
>>> @@ -392,6 +465,12 @@ int xc_hvm_build_target_mem(int xc_handl
>>>         return -1;
>>>
>>>     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
>>> +    if ( vga_pt_enabled ) {
>>> +        sts |= setup_vga_pt(xc_handle, domid);
>>> +    } else {
>>> +        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
>>> +    }
>>> +
>>>
>>>     free(image);
>>>
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
>>> --- a/tools/libxc/xc_linux.c    2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/libxc/xc_linux.c    2009-06-07 19:04:12.000000000 -0400
>>> @@ -562,6 +562,57 @@ int xc_gnttab_set_max_grants(int xcg_han
>>>     return 0;
>>>  }
>>>
>>> +int xc_get_vgabios(unsigned char        *buf,
>>> +                   int                  len)
>>> +{
>>> +    int         mem;
>>> +    uint32_t    start, size = 0;
>>> +    uint16_t    magic = 0;
>>> +
>>> +    start = 0xC0000;
>>> +    if (len < size)
>>> +        return 0;
>>> +    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
>>> +        return 0;
>>> +
>>> +    /*
>>> +    ** Check if it a real bios extension.
>>> +    ** The magic number is 0xAA55.
>>> +    */
>>> +    if (start != lseek(mem, start, SEEK_SET))
>>> +        goto out;
>>> +    if (read(mem, &magic, 2) != 2)
>>> +        goto out;
>>> +    if (magic != 0xAA55)
>>> +        goto out;
>>> +
>>> +    /* Find the size of the rom extension */
>>> +    if (start != lseek(mem, start, SEEK_SET))
>>> +        goto out;
>>> +    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
>>> +        goto out;
>>> +    if (read(mem, &size, 1) != 1)
>>> +        goto out;
>>> +    /* This size is in 512K */
>>> +    size *= 512;
>>> +
>>> +    /*
>>> +    ** Set the file to the begining of the rombios,
>>> +    ** to start the copy.
>>> +    */
>>> +    if (start != lseek(mem, start, SEEK_SET))
>>> +    {
>>> +        size = 0;
>>> +        goto out;
>>> +    }
>>> +    if (size != read(mem, buf, size))
>>> +        size = 0;
>>> +
>>> +out:
>>> +    close(mem);
>>> +    return size;
>>> +}
>>> +
>>>  /*
>>>  * Local variables:
>>>  * mode: C
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
>>> --- a/tools/libxc/xenctrl.h     2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/libxc/xenctrl.h     2009-06-07 19:04:12.000000000 -0400
>>> @@ -145,6 +145,10 @@ int xc_waitdomain(
>>>     int *status,
>>>     int options);
>>>
>>> +int xc_get_vgabios(
>>> +    unsigned char       *bios,
>>> +    int                 len);
>>> +
>>>  #endif /* __linux__ */
>>>
>>>  /*
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
>>> --- a/tools/libxc/xenguest.h    2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/libxc/xenguest.h    2009-06-07 19:04:12.000000000 -0400
>>> @@ -134,7 +134,8 @@ int xc_hvm_build_target_mem(int xc_handl
>>>                             uint32_t domid,
>>>                             int memsize,
>>>                             int target,
>>> -                            const char *image_name);
>>> +                            const char *image_name,
>>> +                            int vga_pt_enabled);
>>>
>>>  int xc_hvm_build_mem(int xc_handle,
>>>                      uint32_t domid,
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
>>> --- a/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 19:04:12.000000000 -0400
>>> @@ -890,21 +890,21 @@ static PyObject *pyxc_hvm_build(XcObject
>>>     int i;
>>>  #endif
>>>     char *image;
>>> -    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
>>> +    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, vga_pt = 0;
>>>
>>>     static char *kwd_list[] = { "domid",
>>>                                 "memsize", "image", "target", "vcpus", "acpi",
>>> -                                "apic", NULL };
>>> -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
>>> +                                "apic", "vga_pt", NULL };
>>> +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
>>>                                       &dom, &memsize, &image, &target, &vcpus,
>>> -                                      &acpi, &apic) )
>>> +                                      &acpi, &apic, &vga_pt) )
>>>         return NULL;
>>>
>>>     if ( target == -1 )
>>>         target = memsize;
>>>
>>>     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
>>> -                                 target, image) != 0 )
>>> +                                 target, image, vga_pt) != 0 )
>>>         return pyxc_error_to_exception();
>>>
>>>  #if !defined(__ia64__)
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
>>> --- a/tools/python/xen/xend/image.py    2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/python/xen/xend/image.py    2009-06-07 19:04:12.000000000 -0400
>>> @@ -279,6 +279,9 @@ class ImageHandler:
>>>         vnc_config = {}
>>>         has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
>>>         has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
>>> +        has_vga_passthrough = int(vmConfig['platform'].get('vga_passthrough', 0)) != 0
>>> +        has_intel = int(vmConfig['platform'].get('intel', 0)) != 0
>>> +
>>>         opengl = 1
>>>         keymap = vmConfig['platform'].get("keymap")
>>>         for dev_uuid in vmConfig['console_refs']:
>>> @@ -302,7 +305,7 @@ class ImageHandler:
>>>             ret.append("-k")
>>>             ret.append(keymap)
>>>
>>> -        if has_vnc:
>>> +        if has_vnc and not has_vga_passthrough:
>>>             if not vnc_config:
>>>                 for key in ('vncunused', 'vnclisten', 'vncdisplay',
>>>                             'vncpasswd'):
>>> @@ -353,6 +356,15 @@ class ImageHandler:
>>>
>>>         if int(vmConfig['platform'].get('monitor', 0)) != 0:
>>>             ret = ret + ['-monitor', 'vc']
>>> +
>>> +        if has_vga_passthrough:
>>> +            ret.append('-vga_passthrough')
>>> +            dom0_input = str(vmConfig['platform'].get('dom0_input'))
>>> +            ret = ret + ['-dom0-input', dom0_input]
>>> +
>>> +        if has_intel:
>>> +            ret.append('-intel')
>>> +
>>>         return ret
>>>
>>>     def getDeviceModelArgs(self, restore = False):
>>> @@ -754,7 +766,9 @@ class HVMImageHandler(ImageHandler):
>>>         self.apic = int(vmConfig['platform'].get('apic', 0))
>>>         self.acpi = int(vmConfig['platform'].get('acpi', 0))
>>>         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
>>> -
>>> +        self.vga_pt = int(vmConfig['platform'].get('vga_passthrough', 0))
>>> +        self.dom0_input = str(vmConfig['platform'].get('dom0_input'))
>>> +        self.intel = int(vmConfig['platform'].get('intel', 0))
>>>
>>>     # Return a list of cmd line args to the device models based on the
>>>     # xm config file
>>> @@ -869,6 +883,7 @@ class HVMImageHandler(ImageHandler):
>>>         log.debug("vcpus          = %d", self.vm.getVCpuCount())
>>>         log.debug("acpi           = %d", self.acpi)
>>>         log.debug("apic           = %d", self.apic)
>>> +        log.debug("vga_pt         = %d", self.vga_pt)
>>>
>>>         rc = xc.hvm_build(domid          = self.vm.getDomid(),
>>>                           image          = self.loader,
>>> @@ -876,7 +891,8 @@ class HVMImageHandler(ImageHandler):
>>>                           target         = mem_mb,
>>>                           vcpus          = self.vm.getVCpuCount(),
>>>                           acpi           = self.acpi,
>>> -                          apic           = self.apic)
>>> +                          apic           = self.apic,
>>> +                          vga_pt         = self.vga_pt)
>>>         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
>>>
>>>         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
>>> --- a/tools/python/xen/xend/XendConfig.py       2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/python/xen/xend/XendConfig.py       2009-06-07 19:04:12.000000000 -0400
>>> @@ -171,6 +171,9 @@ XENAPI_PLATFORM_CFG_TYPES = {
>>>     'pci_msitranslate': int,
>>>     'pci_power_mgmt': int,
>>>     'xen_platform_pci': int,
>>> +    'vga_passthrough': int,
>>> +    'dom0_input': str,
>>> +    'intel': int,
>>>  }
>>>
>>>  # Xen API console 'other_config' keys.
>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
>>> --- a/tools/python/xen/xm/create.py     2009-06-07 20:44:47.000000000 -0400
>>> +++ b/tools/python/xen/xm/create.py     2009-06-07 19:04:12.000000000 -0400
>>> @@ -618,6 +618,18 @@ gopts.var('xen_platform_pci', val='0|1',
>>>            fn=set_int, default=1,
>>>            use="Is xen_platform_pci used?")
>>>
>>> +gopts.var('vga_passthrough', val='0|1',
>>> +           fn=set_int, default=None,
>>> +           use="Enable the passthrough for the graphic card.")
>>> +
>>> +gopts.var('dom0_input', val='DOM0_INPUT',
>>> +           fn=set_value, default=None,
>>> +           use="Input arguments for dom0 driver")
>>> +
>>> +gopts.var('intel', val='INTEL',
>>> +           fn=set_int, default=None,
>>> +           use="Use Intel GFX.")
>>> +
>>>  def err(msg):
>>>     """Print an error to stderr and exit.
>>>     """
>>> @@ -932,7 +944,8 @@ def configure_hvm(config_image, vals):
>>>              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
>>>              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
>>>              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
>>> -             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
>>> +             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
>>> +             'vga_passthrough', 'dom0_input', 'intel' ]
>>>
>>>     for a in args:
>>>         if a in vals.__dict__ and vals.__dict__[a] is not None:
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>>
>>>
>>
>> Where did this patch come from? I plan to try using a ati card with a
>> windows domU this week but first I need to port this patch to 2.6.29,
>> before I start I want to make sure I am working with the latest
>> version of the patch.
>>
>> Andy
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>

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

* Re: Experimental results for VGA passthrough
  2009-06-08 14:19                 ` Andrew Lyon
@ 2009-06-08 14:25                   ` Beng Heng, Ng
  2009-06-08 16:11                     ` Jean Guyader
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 14:25 UTC (permalink / raw)
  To: Andrew Lyon; +Cc: Xen-devel

Uses the driver included in the patch to initialize the graphics card.
This is my own flag. I'm not sure what Jean's plans are.

I've tested with the following gfx device.
- Intel IGD
- ATI Radeon HD 2600 XT

Will test nVidia GeForce 9500 GT.

- Beng Heng

Andrew Lyon wrote:
> On Mon, Jun 8, 2009 at 2:51 PM, Beng Heng, Ng<bengheng@eecs.umich.edu> wrote:
>> The patch was mostly originally from XCI, and subsequently the Xen 3.4
>> testing branch.
>>
>> Note that this does not include HID passthrough. It only demonstrates
>> VGA passthrough.
>>
>> Also, you need to specify the following in your DomU configuration.
>> vga_passthrough=1
>> intel=1
> 
> What does intel=1 do?
> 
>> dom0_input="0" (can ignore for now, since I did not include dom0 driver)
>>
>> I've only tried it for HVM guests. But it should work for PV too. I've
>> got good results on Windows DomU. On Linux, there was an error that says
>> the guest is trying to access unintialised BAR.
>>
>> - Beng Heng
>>
>> Andrew Lyon wrote:
>>> On Mon, Jun 8, 2009 at 6:36 AM, Beng Heng, Ng <bengheng@eecs.umich.edu> wrote:
>>>> Certainly. I tried this on Xen 3.4.1 rc1 pre, changeset 19645. Most of
>>>> these stuff are from Jean and his team. Hopefully more people can update
>>>> their results.
>>>>
>>>> - Beng Heng
>>>>
>>>> Jun Koi wrote:
>>>>> Hi Beng,
>>>>>
>>>>> Would you please send the patch you applied on top of Xen to the list?
>>>>> I think many people are interested in that.
>>>>>
>>>>> Thanks,
>>>>> Jun
>>>>>
>>>>>
>>>>>
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/controller.c      2009-06-07 19:04:11.000000000 -0400
>>>> @@ -208,7 +208,7 @@ void pciback_release_pci_dev(struct pcib
>>>>        }
>>>>
>>>>        spin_unlock_irqrestore(&dev_data->lock, flags);
>>>> -       pcistub_put_pci_dev(found_dev);
>>>> +       pcistub_put_pci_dev(found_dev, 0);
>>>>  }
>>>>
>>>>  int pciback_init_devices(struct pciback_device *pdev)
>>>> @@ -396,7 +396,7 @@ void pciback_release_devices(struct pcib
>>>>                list_for_each_entry_safe(dev_entry, d,
>>>>                                         &cntrl_entry->dev_list, list) {
>>>>                        list_del(&dev_entry->list);
>>>> -                       pcistub_put_pci_dev(dev_entry->dev);
>>>> +                       pcistub_put_pci_dev(dev_entry->dev, 0);
>>>>                        kfree(dev_entry);
>>>>                }
>>>>                list_del(&cntrl_entry->list);
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/passthrough.c     2009-06-07 19:04:11.000000000 -0400
>>>> @@ -88,7 +88,7 @@ void pciback_release_pci_dev(struct pcib
>>>>        spin_unlock_irqrestore(&dev_data->lock, flags);
>>>>
>>>>        if (found_dev)
>>>> -               pcistub_put_pci_dev(found_dev);
>>>> +               pcistub_put_pci_dev(found_dev, 1);
>>>>  }
>>>>
>>>>  int pciback_init_devices(struct pciback_device *pdev)
>>>> @@ -157,7 +157,7 @@ void pciback_release_devices(struct pcib
>>>>
>>>>        list_for_each_entry_safe(dev_entry, t, &dev_data->dev_list, list) {
>>>>                list_del(&dev_entry->list);
>>>> -               pcistub_put_pci_dev(dev_entry->dev);
>>>> +               pcistub_put_pci_dev(dev_entry->dev, 1);
>>>>                kfree(dev_entry);
>>>>        }
>>>>
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback.h 2009-06-07 19:04:11.000000000 -0400
>>>> @@ -25,6 +25,14 @@ struct pci_dev_entry {
>>>>  #define _PCIB_op_pending       (1)
>>>>  #define PCIB_op_pending                (1<<(_PCIB_op_pending))
>>>>
>>>> +#define PCIBACK_TYPE_UNKNOWN       0
>>>> +#define PCIBACK_TYPE_PCIe_ENDPOINT 1
>>>> +#define PCIBACK_TYPE_PCIe_BRIDGE   2
>>>> +#define PCIBACK_TYPE_PCI_BRIDGE    3
>>>> +#define PCIBACK_TYPE_PCI           4
>>>> +
>>>> +#define DEV_CLASS_PCI_PCI_BRIDGE 0x0604
>>>> +
>>>>  struct pciback_device {
>>>>        void *pci_dev_data;
>>>>        spinlock_t dev_lock;
>>>> @@ -48,6 +56,13 @@ struct pciback_dev_data {
>>>>        struct list_head config_fields;
>>>>        int permissive;
>>>>        int warned_on_write;
>>>> +       u32 dev_type;
>>>> +       int no_flr;
>>>> +       int exp_flr_offset;
>>>> +       int af_flr_offset;
>>>> +       int use_sbr;
>>>> +       int use_d3r;
>>>> +       u8 *cfg_space; /* saved config space for device */
>>>>  };
>>>>
>>>>  /* Get/Put PCI Devices that are hidden from the PCI Backend Domain */
>>>> @@ -56,11 +71,25 @@ struct pci_dev *pcistub_get_pci_dev_by_s
>>>>                                            int slot, int func);
>>>>  struct pci_dev *pcistub_get_pci_dev(struct pciback_device *pdev,
>>>>                                    struct pci_dev *dev);
>>>> -void pcistub_put_pci_dev(struct pci_dev *dev);
>>>> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr);
>>>> +
>>>> +/* Reference/unreference PCI Devices and stubs without changing the state */
>>>> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev);
>>>> +void pcistub_unref_pci_dev(struct pci_dev *dev);
>>>> +
>>>> +/* Store/reload config space for devices */
>>>> +void pciback_store_config_space(struct pci_dev *dev);
>>>> +void pciback_reload_config_space(struct pci_dev *dev);
>>>>
>>>>  /* Ensure a device is turned off or reset */
>>>>  void pciback_reset_device(struct pci_dev *pdev);
>>>>
>>>> +/* Do a function level reset (or approximage functionality) for device */
>>>> +void pciback_flr_device(struct pci_dev *dev);
>>>> +
>>>> +/* Helper to classify the device type */
>>>> +void pciback_classify_device(struct pci_dev *dev);
>>>> +
>>>>  /* Access a virtual configuration space for a PCI device */
>>>>  int pciback_config_init(void);
>>>>  int pciback_config_init_dev(struct pci_dev *dev);
>>>> @@ -102,6 +131,10 @@ void pciback_release_devices(struct pcib
>>>>  irqreturn_t pciback_handle_event(int irq, void *dev_id, struct pt_regs *regs);
>>>>  void pciback_do_op(void *data);
>>>>
>>>> +/* Parse and load device specific module parameters */
>>>> +int pciback_parse_device_params(const char *device_args, int type,
>>>> +                                       int (*add_func) (int domain, int bus, int slot, int func, int type));
>>>> +
>>>>  int pciback_xenbus_register(void);
>>>>  void pciback_xenbus_unregister(void);
>>>>
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pciback_ops.c     2009-06-07 19:04:11.000000000 -0400
>>>> @@ -5,20 +5,189 @@
>>>>  */
>>>>  #include <linux/module.h>
>>>>  #include <linux/wait.h>
>>>> +#include <linux/delay.h> /* For mdelay function */
>>>>  #include <asm/bitops.h>
>>>>  #include <xen/evtchn.h>
>>>>  #include "pciback.h"
>>>>
>>>> +#define PCIBACK_VENDOR_INTEL     0x8086
>>>> +#define PCIBACK_CLASS_ID_USB     0x0c03
>>>> +#define PCIBACK_CLASS_ID_VGA     0x0300
>>>> +#define PCIBACK_USB_FLRCTRL      0x4
>>>> +
>>>> +#define PCIBACK_IGFX_CAP09_OFFSET    0xa4
>>>> +#define PCIBACK_IGFX_CAP13_OFFSET    0xa4
>>>> +
>>>> +#define PCIBACK_IGFX_MEDIARST        0x0d
>>>> +#define PCIBACK_IGFX_MEDIARST_OFFSET 0xc0
>>>> +
>>>>  int verbose_request = 0;
>>>>  module_param(verbose_request, int, 0644);
>>>>
>>>> +struct pcistub_sbr_entry {
>>>> +       struct list_head dev_list;
>>>> +       struct pci_dev *dev;
>>>> +};
>>>> +
>>>> +struct pcistub_sbr_list {
>>>> +       struct list_head dev_list;
>>>> +       struct pci_dev *bridge;
>>>> +       struct pci_dev *dev;
>>>> +       int find_all;
>>>> +       int err;
>>>> +};
>>>> +
>>>> +/* Used to store the config state so it can be restored after
>>>> + * resets.
>>>> + */
>>>> +void pciback_store_config_space(struct pci_dev *dev)
>>>> +{
>>>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>>>> +       u32 *ptr = (u32*)dev_data->cfg_space;
>>>> +       int i, count = dev->cfg_size/sizeof(u32);
>>>> +
>>>> +       for (i = 0; i < count; i += sizeof(u32), ptr++)
>>>> +               pci_read_config_dword(dev, i, ptr);
>>>> +}
>>>> +
>>>> +/* Used to reload the config state after resets.
>>>> + */
>>>> +void pciback_reload_config_space(struct pci_dev *dev)
>>>> +{
>>>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>>>> +       u32 *ptr = (u32*)dev_data->cfg_space;
>>>> +       int i, val, count = dev->cfg_size/sizeof(u32);
>>>> +
>>>> +       for (i = 0; i < count; i += sizeof(u32), ptr++) {
>>>> +               pci_read_config_dword(dev, i, &val);
>>>> +               if (val != *ptr)
>>>> +                       pci_write_config_dword(dev, i, *ptr);
>>>> +       }
>>>> +}
>>>> +
>>>> +static void pciback_walk_bus_cb(struct pci_dev *dev, void *userdata)
>>>> +{
>>>> +       struct pcistub_sbr_list *list = (struct pcistub_sbr_list*)userdata;
>>>> +       struct pcistub_sbr_entry *entry;
>>>> +       struct pci_dev *dev_tmp;
>>>> +
>>>> +       if (list->err != 0)
>>>> +               return;
>>>> +
>>>> +       /* For PCIe endpoints we are only looking for co-assigned functions */
>>>> +       if (!list->find_all &&
>>>> +               (dev->bus->number != list->dev->bus->number ||
>>>> +                PCI_SLOT(dev->devfn) != PCI_SLOT(list->dev->devfn)))
>>>> +               return;
>>>> +
>>>> +       dev_tmp = pcistub_ref_pci_dev(dev);
>>>> +       if (dev_tmp == NULL) {
>>>> +               /* not controlled by pciback, fail */
>>>> +               list->err = ENXIO;
>>>> +               return;
>>>> +       }
>>>> +
>>>> +       entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
>>>> +       if (entry == NULL) {
>>>> +               pcistub_unref_pci_dev(dev_tmp);
>>>> +               list->err = ENOMEM;
>>>> +               return;
>>>> +       }
>>>> +
>>>> +       entry->dev = dev_tmp;
>>>> +       list_add_tail(&entry->dev_list, &list->dev_list);
>>>> +}
>>>> +
>>>> +static void pciback_cleanup_sbr_list(struct pcistub_sbr_list *list)
>>>> +{
>>>> +       struct pcistub_sbr_entry *entry;
>>>> +
>>>> +       list_for_each_entry(entry, &list->dev_list, dev_list) {
>>>> +               pcistub_unref_pci_dev(entry->dev);
>>>> +               kfree(entry);
>>>> +       }
>>>> +}
>>>> +
>>>> +/* Routine to find all devices and bridges that need to be reset
>>>> + * during a secondary bus reset. For PCIe this is simply all the
>>>> + * functions on the particular device. For PCI this is all devices
>>>> + * and bridges below the topmost PCI/PCI-X bridge. Note for PCI,
>>>> + * there is at least one something->PCI/PCI-X bridge to find since
>>>> + * the device is not on the host bus 0 and is on a PCI bus.
>>>> + */
>>>> +static int pciback_get_sbr_list(struct pci_dev *dev,
>>>> +       struct pcistub_sbr_list *list, int pcie_endpoint)
>>>> +{
>>>> +       struct pci_dev *bridge = dev->bus->self;
>>>> +       struct pci_dev *last = NULL;
>>>> +       int exp_pos;
>>>> +       u16 exp_caps = 0;
>>>> +
>>>> +       list->err = 0;
>>>> +       list->dev = dev;
>>>> +       INIT_LIST_HEAD(&list->dev_list);
>>>> +
>>>> +       if (!pcie_endpoint) {
>>>> +               while (bridge) {
>>>> +                       /* Looking for the uppermost PCI/PCI-X bridge. If it is not PCIe then
>>>> +                        * this is a PCI/PCI-X bridge. If it is PCIe then except the PCIe to
>>>> +                        * PCI/PCI-X type 7, the rest of the bridge types are PCIe so the last
>>>> +                        * bridge encountered was the topmost PCI/PCI-X bridge.
>>>> +                        */
>>>> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
>>>> +                       if (exp_pos != 0) {
>>>> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>>>> +                               if (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_PCI_BRIDGE)
>>>> +                                       break; /* don't want it in the list if it is a PCIe bridge */
>>>> +                       }
>>>> +                       last = bridge;
>>>> +                       bridge = last->bus->self;
>>>> +               }
>>>> +               list->bridge = last;
>>>> +               list->find_all = 1; /* find all devices/bridges below the topmost */
>>>> +       }
>>>> +       else {
>>>> +               if (bridge) {
>>>> +                       /* For PCIe, SBR logic is limited to PCIe endpoints behind a root/switch
>>>> +                        * port.
>>>> +                        */
>>>> +                       exp_pos = pci_find_capability(bridge, PCI_CAP_ID_EXP);
>>>> +                       if (likely(exp_pos != 0)) {
>>>> +                               pci_read_config_word(bridge, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>>>> +                               exp_caps = ((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4);
>>>> +                               if (exp_caps == PCI_EXP_TYPE_ROOT_PORT ||
>>>> +                                       exp_caps == PCI_EXP_TYPE_UPSTREAM ||
>>>> +                                       exp_caps == PCI_EXP_TYPE_DOWNSTREAM)
>>>> +                                       last = bridge;
>>>> +                       }
>>>> +               }
>>>> +               list->bridge = last;
>>>> +               list->find_all = 0; /* find just functions on this slot */
>>>> +       }
>>>> +
>>>> +       /* Sanity check, there may not be any appropriate bridge to reset */
>>>> +       if (!list->bridge) {
>>>> +               dev_dbg(&dev->dev, "No appropriate bridge to reset\n");
>>>> +               return ENXIO;
>>>> +       }
>>>> +
>>>> +       pci_walk_bus(list->bridge->subordinate, pciback_walk_bus_cb, list);
>>>> +
>>>> +       if (list->err) {
>>>> +               pciback_cleanup_sbr_list(list);
>>>> +               return list->err;
>>>> +       }
>>>> +
>>>> +       return 0;
>>>> +}
>>>> +
>>>>  /* Ensure a device is "turned off" and ready to be exported.
>>>>  * (Also see pciback_config_reset to ensure virtual configuration space is
>>>>  * ready to be re-exported)
>>>>  */
>>>>  void pciback_reset_device(struct pci_dev *dev)
>>>>  {
>>>> -       u16 cmd;
>>>> +       u16 cmd = 0;
>>>>
>>>>        /* Disable devices (but not bridges) */
>>>>        if (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) {
>>>> @@ -38,6 +207,425 @@ void pciback_reset_device(struct pci_dev
>>>>                }
>>>>        }
>>>>  }
>>>> +
>>>> +/* Do a PCIe type function level reset for a single function on this
>>>> + * device.
>>>> + */
>>>> +static void pciback_do_pcie_flr(struct pci_dev *dev, int exp_pos)
>>>> +{
>>>> +       u16 status = 0;
>>>> +
>>>> +       dev_dbg(&dev->dev, "doing PCIe FLR\n");
>>>> +
>>>> +       pci_block_user_cfg_access(dev);
>>>> +
>>>> +       /* Wait for Transaction Pending bit clean */
>>>> +       msleep(100);
>>>> +       pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
>>>> +       if (status & PCI_EXP_DEVSTA_TRPND) {
>>>> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
>>>> +               ssleep(1);
>>>> +               pci_read_config_word(dev, exp_pos + PCI_EXP_DEVSTA, &status);
>>>> +               if (status & PCI_EXP_DEVSTA_TRPND)
>>>> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
>>>> +       }
>>>> +
>>>> +       pci_write_config_word(dev, exp_pos + PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
>>>> +       mdelay(200);
>>>> +
>>>> +       pciback_reload_config_space(dev);
>>>> +
>>>> +       pci_unblock_user_cfg_access(dev);
>>>> +}
>>>> +
>>>> +/* Do a PCI type function level reset for a single function on this
>>>> + * device. This uses the Advanced Features Capability extensions to
>>>> + * the PCI spec.
>>>> + */
>>>> +static void pciback_do_pci_flr(struct pci_dev *dev, int af_pos, int clear_cmd)
>>>> +{
>>>> +       u8 status = 0;
>>>> +
>>>> +       dev_dbg(&dev->dev, "doing PCI FLR\n");
>>>> +
>>>> +       pci_block_user_cfg_access(dev);
>>>> +
>>>> +       /* Clear the command register to prevent new transactions */
>>>> +       if (clear_cmd)
>>>> +               pci_write_config_word(dev, PCI_COMMAND, 0);
>>>> +
>>>> +       /* Wait for Transaction Pending bit clean */
>>>> +       msleep(100);
>>>> +       pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
>>>> +       if (status & PCI_AF_STA_TP) {
>>>> +               dev_dbg(&dev->dev, "Busy after 100ms while trying to reset; sleeping for 1 second\n");
>>>> +               ssleep(1);
>>>> +               pci_read_config_byte(dev, af_pos + PCI_AF_STA, &status);
>>>> +               if (status & PCI_AF_STA_TP)
>>>> +                       dev_warn(&dev->dev, "Still busy after 1s; proceeding with reset anyway\n");
>>>> +       }
>>>> +
>>>> +       pci_write_config_byte(dev, af_pos + PCI_AF_CTRL, PCI_AF_CTRL_FLR);
>>>> +       mdelay(200);
>>>> +
>>>> +       pciback_reload_config_space(dev);
>>>> +
>>>> +       pci_unblock_user_cfg_access(dev);
>>>> +}
>>>> +
>>>> +/* Vendor specific resets. These can be set in the vendor specific
>>>> + * capabilities structures. Currently only the Intel USB and iGFX
>>>> + * reset is supported.
>>>> + */
>>>> +static int pciback_do_vendor_specific_reset(struct pci_dev *dev)
>>>> +{
>>>> +       struct pci_dev *gmch;
>>>> +       int vendor_pos, i;
>>>> +       u32 reg32 = 0;
>>>> +       u16 device_id, cmd;
>>>> +       u8 reg8 = 0;
>>>> +
>>>> +       dev_dbg(&dev->dev, "doing vendor specific resets\n");
>>>> +
>>>> +       if (dev->vendor != PCIBACK_VENDOR_INTEL)
>>>> +               return -ENXIO;
>>>> +
>>>> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
>>>> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0))
>>>> +                       return -ENXIO;
>>>> +
>>>> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
>>>> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
>>>> +               if (!gmch)
>>>> +                       return -ENXIO;
>>>> +
>>>> +               device_id = gmch->device;
>>>> +               pci_dev_put(gmch);
>>>> +
>>>> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHGM45)
>>>> +                       return -ENXIO;
>>>> +
>>>> +               /* Correct device and platform, assume vendor specific offset */
>>>> +               pci_read_config_dword(dev, PCIBACK_IGFX_CAP09_OFFSET, &reg32);
>>>> +               if ((reg32 & 0x000000FF) != PCI_CAP_ID_VNDR ||
>>>> +                       ((reg32 >> 16) & 0x000000FF) != 0x06 ||
>>>> +                       ((reg32 >> 24) & 0x000000F0) != 0x20)
>>>> +                       return -ENXIO;
>>>> +
>>>> +               vendor_pos = PCIBACK_IGFX_CAP09_OFFSET;
>>>> +       } else if ((dev->class >> 8) == PCIBACK_CLASS_ID_USB) {
>>>> +               vendor_pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
>>>> +               if (vendor_pos == 0)
>>>> +                       return -ENXIO;
>>>> +       }
>>>> +       else
>>>> +               return -ENXIO;
>>>> +
>>>> +       if ((dev->class >> 8) == PCIBACK_CLASS_ID_VGA) {
>>>> +               pci_write_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, PCIBACK_IGFX_MEDIARST);
>>>> +               for (i = 0; i <= 10; i++) {
>>>> +                       msleep(100);
>>>> +                       pci_read_config_byte(dev, PCIBACK_IGFX_MEDIARST_OFFSET, &reg8);
>>>> +                       if ((reg8 & 0x01) == 0)
>>>> +                               break;
>>>> +                       if (i == 10) {
>>>> +                               dev_warn(&dev->dev, "media not reset after 1s; skipping FLR\n");
>>>> +                               goto out;
>>>> +                       }
>>>> +               }
>>>> +
>>>> +               /* This specific reset will hang if the command register does not have
>>>> +                * memory space access enabled */
>>>> +               pci_read_config_word(dev, PCI_COMMAND, &cmd);
>>>> +               pci_write_config_word(dev, PCI_COMMAND, (cmd | PCI_COMMAND_MEMORY));
>>>> +               /* The rest is the same as a PCI AF FLR - use the same routine */
>>>> +               pciback_do_pci_flr(dev, vendor_pos, 0);
>>>> +               pci_write_config_word(dev, PCI_COMMAND, cmd);
>>>> +       } else {
>>>> +               pci_block_user_cfg_access(dev);
>>>> +
>>>> +               pci_write_config_byte(dev, vendor_pos + PCIBACK_USB_FLRCTRL, 1);
>>>> +               mdelay(200);
>>>> +
>>>> +               pciback_reload_config_space(dev);
>>>> +
>>>> +               pci_unblock_user_cfg_access(dev);
>>>> +       }
>>>> +
>>>> +out:
>>>> +       return 0;
>>>> +}
>>>> +
>>>> +/* Use a D0-D3-D0 device state transition to reset the device. This
>>>> + * is a good enough reset for some devices (like NICs).
>>>> + */
>>>> +static int pciback_do_dstate_transition_reset(struct pci_dev *dev)
>>>> +{
>>>> +       int pm_pos;
>>>> +       u32 pm_ctl = 0;
>>>> +
>>>> +       pm_pos = pci_find_capability(dev, PCI_CAP_ID_PM);
>>>> +       if (pm_pos == 0)
>>>> +               return -ENXIO;
>>>> +
>>>> +       dev_dbg(&dev->dev, "doing Dstate transition reset\n");
>>>> +
>>>> +       /* No_Soft_Reset - When set 1, this bit indicates that devices
>>>> +        * transitioning from D3hot to D0 because of PowerState commands
>>>> +        * do not perform an internal reset.
>>>> +        */
>>>> +       pci_read_config_dword(dev, pm_pos + PCI_PM_CTRL, &pm_ctl);
>>>> +       if (pm_ctl & PCI_PM_CTRL_NO_SOFT_RESET)
>>>> +               return -ENXIO;
>>>> +
>>>> +       pci_block_user_cfg_access(dev);
>>>> +
>>>> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
>>>> +       pm_ctl |= PCI_PM_CTRL_D3HOT;
>>>> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
>>>> +       mdelay(10);
>>>> +
>>>> +       pm_ctl &= ~PCI_PM_CTRL_STATE_MASK;
>>>> +       pm_ctl |= PCI_PM_CTRL_D0;
>>>> +       pci_write_config_word(dev, pm_pos + PCI_PM_CTRL, pm_ctl);
>>>> +       mdelay(10);
>>>> +
>>>> +       pciback_reload_config_space(dev);
>>>> +
>>>> +       pci_unblock_user_cfg_access(dev);
>>>> +
>>>> +       return 0;
>>>> +}
>>>> +
>>>> +/* Do a secondary bus reset on a bridge. This is only done if all
>>>> + * co-assignment rules are satisfied and if it was explicitly
>>>> + * requested via pciback parameters.
>>>> + */
>>>> +static int pciback_do_secondary_bus_reset(struct pci_dev *dev, u32 dev_type)
>>>> +{
>>>> +       struct pcistub_sbr_list sbr_list;
>>>> +       struct pcistub_sbr_entry *entry;
>>>> +       u16 pci_bctl = 0;
>>>> +       int err = 0;
>>>> +
>>>> +       /* Call helper to get the device list needed for the device type. */
>>>> +       err = pciback_get_sbr_list(dev, &sbr_list,
>>>> +                       (dev_type == PCIBACK_TYPE_PCIe_ENDPOINT ? 1 : 0));
>>>> +       if (err) {
>>>> +               dev_warn(&dev->dev,
>>>> +                       "secondary bus reset failed for device - all functions need to be co-assigned - err: %d\n", err);
>>>> +               return err;
>>>> +       }
>>>> +
>>>> +       pci_block_user_cfg_access(dev);
>>>> +
>>>> +       /* Reset the secondary bus and restore the PCI space for all the devfn found above.
>>>> +        */
>>>> +       pci_read_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, &pci_bctl);
>>>> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl | PCI_BRIDGE_CTL_BUS_RESET);
>>>> +       msleep(200);
>>>> +       pci_write_config_word(sbr_list.bridge, PCI_BRIDGE_CONTROL, pci_bctl);
>>>> +       msleep(200);
>>>> +
>>>> +       list_for_each_entry(entry, &sbr_list.dev_list, dev_list) {
>>>> +               pciback_reload_config_space(entry->dev);
>>>> +       }
>>>> +
>>>> +       pci_unblock_user_cfg_access(dev);
>>>> +
>>>> +       pciback_cleanup_sbr_list(&sbr_list);
>>>> +
>>>> +       return 0;
>>>> +}
>>>> +
>>>> +/* This function is used to do a function level reset on a singe
>>>> + * device/function. FLRs must be done on devices before they are
>>>> + * unassigned from one domain and passed through to another. The
>>>> + * preferred method is to do an actual FLR on the device but the
>>>> + * functionality may not be present or exposed. In the later case
>>>> + * we attempt to locate the capability even though it is not
>>>> + * chained into the capabilities list.
>>>> + *
>>>> + * In some cases, there is no way to perform the actual FLR so we
>>>> + * fall back to some alternate methods (which are not as effective
>>>> + * or useful).
>>>> + */
>>>> +void pciback_flr_device(struct pci_dev *dev)
>>>> +{
>>>> +       struct pciback_dev_data *dev_data = pci_get_drvdata(dev);
>>>> +       int err = 0;
>>>> +
>>>> +       if (dev_data->no_flr) {
>>>> +               dev_dbg(&dev->dev, "FLR disabled for device\n");
>>>> +               return;
>>>> +       }
>>>> +       dev_dbg(&dev->dev, "FLR invoked for device\n");
>>>> +
>>>> +       do {
>>>> +               /* First, always try to do an FLR */
>>>> +               if (dev_data->dev_type == PCIBACK_TYPE_PCIe_ENDPOINT &&
>>>> +                       dev_data->exp_flr_offset != 0) {
>>>> +                       pciback_do_pcie_flr(dev, dev_data->exp_flr_offset);
>>>> +                       break;
>>>> +               }
>>>> +               if (dev_data->dev_type == PCIBACK_TYPE_PCI &&
>>>> +                       dev_data->af_flr_offset != 0) {
>>>> +                       pciback_do_pci_flr(dev, dev_data->af_flr_offset, 1);
>>>> +                       break;
>>>> +               }
>>>> +
>>>> +               /* Next for integrated devices on the host bus 0, try some other methods */
>>>> +               if (dev->bus->number == 0) {
>>>> +                       err = pciback_do_vendor_specific_reset(dev);
>>>> +                       if (err && dev_data->use_d3r)
>>>> +                               err = pciback_do_dstate_transition_reset(dev);
>>>> +                       if (err)
>>>> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
>>>> +                                               "attempts to use vendor FLR or D-states unsuccessful\n");
>>>> +                       break;
>>>> +               }
>>>> +
>>>> +               /* Else attempt a secondary bus reset if all conditions are met */
>>>> +               if (dev_data->use_sbr) {
>>>> +                       err = pciback_do_secondary_bus_reset(dev, dev_data->dev_type);
>>>> +                       if (err)
>>>> +                               dev_warn(&dev->dev, "FLR functionality not supported; "
>>>> +                                               "attempts to use secondary bus reset unsuccessful;\n");
>>>> +                       break;
>>>> +               }
>>>> +
>>>> +               err = -ENODEV;
>>>> +       } while (0);
>>>> +
>>>> +       if (err)
>>>> +               dev_warn(&dev->dev, "FLR not performed for device\n");
>>>> +}
>>>> +
>>>> +/* Helper used to location the FLR capabilities for a PCIe device.
>>>> + * When the capability cannot be found in the chain but is present,
>>>> + * special logic is used to attempt to locate functionality.
>>>> + *
>>>> + * returns: the offset to the capability, zero if not found.
>>>> + */
>>>> +static int pciback_find_pcie_flr_caps(struct pci_dev *dev)
>>>> +{
>>>> +       int exp_pos;
>>>> +       u32 cap = 0;
>>>> +
>>>> +       /* First look for the PCIe FLR capabilities using the capabilities list */
>>>> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
>>>> +       if (exp_pos) {
>>>> +               pci_read_config_dword(dev, exp_pos + PCI_EXP_DEVCAP, &cap);
>>>> +               if (cap & PCI_EXP_DEVCAP_FLR) {
>>>> +                       return exp_pos;
>>>> +               }
>>>> +       }
>>>> +
>>>> +       return 0;
>>>> +}
>>>> +
>>>> +/* Helper used to location the AF FLR capabilities for a PCI device.
>>>> + * When the capability cannot be found in the chain but is present,
>>>> + * special logic is used to attempt to locate functionality.
>>>> + *
>>>> + * returns: the offset to the capability, zero if not found.
>>>> + */
>>>> +static int pciback_find_pci_flr_caps(struct pci_dev *dev)
>>>> +{
>>>> +       struct pci_dev *gmch;
>>>> +       int af_pos;
>>>> +       u16 device_id;
>>>> +       u8 cap = 0, reg8 = 0;
>>>> +
>>>> +       /* First look for the PCI AF capabilities for FLR using the capabilities list. This
>>>> +        * is only used on the devices on the root/host bus (integrated devices).
>>>> +        */
>>>> +       if (dev->bus->number != 0)
>>>> +               return 0;
>>>> +
>>>> +       af_pos = pci_find_capability(dev, PCI_CAP_ID_AF);
>>>> +       if (af_pos) {
>>>> +               pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
>>>> +               if (cap & PCI_AF_CAP_FLR) {
>>>> +                       return af_pos;
>>>> +               }
>>>> +       }
>>>> +
>>>> +       /* Next look for the unchained AF capabilities for FLR using specific
>>>> +        * logic. Currently only the graphics device on the Intel Q45 etc
>>>> +        * systems has special logic for locating the hidden FLR caps.
>>>> +     */
>>>> +       do {
>>>> +               if (dev->bus->number != 0 || dev->devfn != PCI_DEVFN(2,0) ||
>>>> +                       dev->vendor != PCIBACK_VENDOR_INTEL || (dev->class >> 8) != PCIBACK_CLASS_ID_VGA)
>>>> +                       break;
>>>> +
>>>> +               /* Locate the GMCH (north bridge) and test for specific Intel devices */
>>>> +               gmch = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
>>>> +               if (!gmch)
>>>> +                       break;
>>>> +
>>>> +               device_id = gmch->device;
>>>> +               pci_dev_put(gmch);
>>>> +
>>>> +               if (device_id != PCI_DEVICE_ID_INTEL_GMCHQ45 &&
>>>> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG45 &&
>>>> +                       device_id != PCI_DEVICE_ID_INTEL_GMCHG41)
>>>> +                       break;
>>>> +
>>>> +               /* Correct device and platform, assume AF offset */
>>>> +               af_pos = PCIBACK_IGFX_CAP13_OFFSET;
>>>> +               pci_read_config_byte(dev, af_pos + PCI_AF_LENFLD, &reg8);
>>>> +               if (reg8 == PCI_AF_LENGTH) {
>>>> +                       pci_read_config_byte(dev, af_pos + PCI_AF_DEVCAP, &cap);
>>>> +                       if (cap & PCI_AF_CAP_FLR) {
>>>> +                               return af_pos;
>>>> +                       }
>>>> +               }
>>>> +       } while (0);
>>>> +
>>>> +       /* Else not found */
>>>> +       return 0;
>>>> +}
>>>> +
>>>> +/* Classify the device, specifically determine if it is PCIe/PCI
>>>> + * and whether it is a PCIe endpoint, bridge, or other PCI device.
>>>> + */
>>>> +void pciback_classify_device(struct pci_dev *dev)
>>>> +{
>>>> +       struct pciback_dev_data *dev_data;
>>>> +       int exp_pos;
>>>> +       u16 exp_caps = 0;
>>>> +
>>>> +       dev_data = pci_get_drvdata(dev);
>>>> +       dev_data->dev_type = PCIBACK_TYPE_UNKNOWN;
>>>> +
>>>> +       exp_pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
>>>> +
>>>> +       if ((dev->class >> 8) != DEV_CLASS_PCI_PCI_BRIDGE) {
>>>> +               if (exp_pos != 0) {
>>>> +                       dev_data->dev_type = PCIBACK_TYPE_PCIe_ENDPOINT;
>>>> +                       dev_data->exp_flr_offset = pciback_find_pcie_flr_caps(dev);
>>>> +               } else {
>>>> +                       dev_data->dev_type = PCIBACK_TYPE_PCI;
>>>> +                       dev_data->af_flr_offset = pciback_find_pci_flr_caps(dev);
>>>> +               }
>>>> +               goto classify_done;
>>>> +       }
>>>> +
>>>> +       if (exp_pos == 0) {
>>>> +               dev_data->dev_type = PCIBACK_TYPE_PCI_BRIDGE;
>>>> +               goto classify_done;
>>>> +       }
>>>> +
>>>> +       pci_read_config_word(dev, exp_pos + PCI_EXP_FLAGS, &exp_caps);
>>>> +       dev_data->dev_type = (((exp_caps & PCI_EXP_FLAGS_TYPE) >> 4) == PCI_EXP_TYPE_PCI_BRIDGE) ? PCIBACK_TYPE_PCI_BRIDGE : PCIBACK_TYPE_PCIe_BRIDGE;
>>>> +
>>>> +classify_done:
>>>> +
>>>> +       return;
>>>> +}
>>>> +
>>>>  extern wait_queue_head_t aer_wait_queue;
>>>>  extern struct workqueue_struct *pciback_wq;
>>>>  /*
>>>> @@ -132,3 +720,51 @@ irqreturn_t pciback_handle_event(int irq
>>>>
>>>>        return IRQ_HANDLED;
>>>>  }
>>>> +
>>>> +/* Helper routine used to parse command line parameters passed to the
>>>> + * pciback module from the boot loader. These params all have the form
>>>> + * of a list of one or more devices, e.g.:
>>>> + * (XXXX:XX:XX.X)(XXXX:XX:XX.X)
>>>> + * Which is: (domain/segment:bus:dev.func)
>>>> + */
>>>> +int pciback_parse_device_params(const char *device_args, int type,
>>>> +                       int (*add_func) (int domain, int bus, int slot, int func, int type))
>>>> +{
>>>> +       int pos = 0;
>>>> +       int err = 0;
>>>> +       int domain, bus, slot, func;
>>>> +       int parsed;
>>>> +
>>>> +       if (device_args && *device_args) {
>>>> +               do {
>>>> +                       parsed = 0;
>>>> +
>>>> +                       err = sscanf(device_args + pos,
>>>> +                                    " (%x:%x:%x.%x) %n",
>>>> +                                    &domain, &bus, &slot, &func, &parsed);
>>>> +                       if (err != 4) {
>>>> +                               domain = 0;
>>>> +                               err = sscanf(device_args + pos,
>>>> +                                            " (%x:%x.%x) %n",
>>>> +                                            &bus, &slot, &func, &parsed);
>>>> +                               if (err != 3)
>>>> +                                       goto parse_error;
>>>> +                       }
>>>> +
>>>> +                       err = add_func(domain, bus, slot, func, type);
>>>> +                       if (err)
>>>> +                               goto out;
>>>> +
>>>> +                       /* if parsed<=0, we've reached the end of the string */
>>>> +                       pos += parsed;
>>>> +               } while (parsed > 0 && device_args[pos]);
>>>> +       }
>>>> +
>>>> +out:
>>>> +       return err;
>>>> +
>>>> +parse_error:
>>>> +       printk(KERN_ERR "pciback: Error parsing device parameters \"%s\" at \"%s\"\n",
>>>> +              device_args, device_args + pos);
>>>> +       return -EINVAL;
>>>> +}
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/pci_stub.c        2009-06-07 19:04:11.000000000 -0400
>>>> @@ -24,10 +24,28 @@ wait_queue_head_t aer_wait_queue;
>>>>  * We want to avoid in middle of AER ops, pciback devices is being removed
>>>>  */
>>>>  static DECLARE_RWSEM(pcistub_sem);
>>>> -module_param_named(hide, pci_devs_to_hide, charp, 0444);
>>>> +module_param_named(hide, pci_devs_to_hide, charp, S_IRUGO);
>>>> +
>>>> +static char *pci_devs_use_sbr = NULL;
>>>> +module_param_named(sbr, pci_devs_use_sbr, charp, S_IRUGO);
>>>> +
>>>> +static char *pci_devs_use_d3r = NULL;
>>>> +module_param_named(d3r, pci_devs_use_d3r, charp, S_IRUGO);
>>>> +
>>>> +static char *pci_devs_no_flr = NULL;
>>>> +module_param_named(noflr, pci_devs_no_flr, charp, S_IRUGO);
>>>> +
>>>> +/* Device id list holding different device type listings
>>>> + * for hiding devices and reset logic.
>>>> + */
>>>> +#define PCIBACK_ID_TYPE_HIDE  1
>>>> +#define PCIBACK_ID_TYPE_SBR   2
>>>> +#define PCIBACK_ID_TYPE_D3R   3
>>>> +#define PCIBACK_ID_TYPE_NOFLR 4
>>>>
>>>>  struct pcistub_device_id {
>>>>        struct list_head slot_list;
>>>> +       int type;
>>>>        int domain;
>>>>        unsigned char bus;
>>>>        unsigned int devfn;
>>>> @@ -56,6 +74,8 @@ static LIST_HEAD(pcistub_devices);
>>>>  static int initialize_devices = 0;
>>>>  static LIST_HEAD(seized_devices);
>>>>
>>>> +static int disable_all_flr = 0;
>>>> +
>>>>  static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev)
>>>>  {
>>>>        struct pcistub_device *psdev;
>>>> @@ -78,6 +98,23 @@ static struct pcistub_device *pcistub_de
>>>>        return psdev;
>>>>  }
>>>>
>>>> +static struct pciback_dev_data *pcistub_dev_data_alloc(struct pci_dev *dev)
>>>> +{
>>>> +       struct pciback_dev_data *dev_data;
>>>> +
>>>> +       dev_dbg(&dev->dev, "pcistub_dev_data_alloc\n");
>>>> +
>>>> +       dev_data = kzalloc(sizeof(*dev_data) + dev->cfg_size, GFP_ATOMIC);
>>>> +       if (!dev_data)
>>>> +               return NULL;
>>>> +
>>>> +       pci_set_drvdata(dev, dev_data);
>>>> +
>>>> +       dev_data->cfg_space = (u8*)(dev_data) + sizeof(*dev_data);
>>>> +
>>>> +       return dev_data;
>>>> +}
>>>> +
>>>>  /* Don't call this directly as it's called by pcistub_device_put */
>>>>  static void pcistub_device_release(struct kref *kref)
>>>>  {
>>>> @@ -200,7 +237,7 @@ struct pci_dev *pcistub_get_pci_dev(stru
>>>>        return found_dev;
>>>>  }
>>>>
>>>> -void pcistub_put_pci_dev(struct pci_dev *dev)
>>>> +void pcistub_put_pci_dev(struct pci_dev *dev, int do_flr)
>>>>  {
>>>>        struct pcistub_device *psdev, *found_psdev = NULL;
>>>>        unsigned long flags;
>>>> @@ -220,6 +257,13 @@ void pcistub_put_pci_dev(struct pci_dev
>>>>        * pcistub and pciback when AER is in processing
>>>>        */
>>>>        down_write(&pcistub_sem);
>>>> +
>>>> +       /* For pass-through devices, do an FLR (or approximate) for the device
>>>> +        * before it is put back and ready for the next domain
>>>> +        */
>>>> +       if (!disable_all_flr && do_flr)
>>>> +               pciback_flr_device(dev);
>>>> +
>>>>        /* Cleanup our device
>>>>         * (so it's ready for the next domain)
>>>>         */
>>>> @@ -235,6 +279,43 @@ void pcistub_put_pci_dev(struct pci_dev
>>>>        up_write(&pcistub_sem);
>>>>  }
>>>>
>>>> +struct pci_dev *pcistub_ref_pci_dev(struct pci_dev *dev)
>>>> +{
>>>> +       struct pcistub_device *psdev;
>>>> +       struct pci_dev *found_dev = NULL;
>>>> +       unsigned long flags;
>>>> +
>>>> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
>>>> +
>>>> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
>>>> +               if (psdev->dev == dev) {
>>>> +                       pcistub_device_get(psdev); /* just a ref count */
>>>> +                       found_dev = psdev->dev;
>>>> +                       break;
>>>> +               }
>>>> +       }
>>>> +
>>>> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
>>>> +       return found_dev;
>>>> +}
>>>> +
>>>> +void pcistub_unref_pci_dev(struct pci_dev *dev)
>>>> +{
>>>> +       struct pcistub_device *psdev;
>>>> +       unsigned long flags;
>>>> +
>>>> +       spin_lock_irqsave(&pcistub_devices_lock, flags);
>>>> +
>>>> +       list_for_each_entry(psdev, &pcistub_devices, dev_list) {
>>>> +               if (psdev->dev == dev) {
>>>> +                       pcistub_device_get(psdev); /* just an unref count */
>>>> +                       break;
>>>> +               }
>>>> +       }
>>>> +
>>>> +       spin_unlock_irqrestore(&pcistub_devices_lock, flags);
>>>> +}
>>>> +
>>>>  static int __devinit pcistub_match_one(struct pci_dev *dev,
>>>>                                       struct pcistub_device_id *pdev_id)
>>>>  {
>>>> @@ -255,7 +336,7 @@ static int __devinit pcistub_match_one(s
>>>>        return 0;
>>>>  }
>>>>
>>>> -static int __devinit pcistub_match(struct pci_dev *dev)
>>>> +static int __devinit pcistub_match(struct pci_dev *dev, int type)
>>>>  {
>>>>        struct pcistub_device_id *pdev_id;
>>>>        unsigned long flags;
>>>> @@ -263,6 +344,8 @@ static int __devinit pcistub_match(struc
>>>>
>>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>>        list_for_each_entry(pdev_id, &pcistub_device_ids, slot_list) {
>>>> +               if (pdev_id->type != type)
>>>> +                       continue;
>>>>                if (pcistub_match_one(dev, pdev_id)) {
>>>>                        found = 1;
>>>>                        break;
>>>> @@ -285,12 +368,11 @@ static int __devinit pcistub_init_device
>>>>         * would need to be called somewhere to free the memory allocated
>>>>         * here and then to call kfree(pci_get_drvdata(psdev->dev)).
>>>>         */
>>>> -       dev_data = kzalloc(sizeof(*dev_data), GFP_ATOMIC);
>>>> +       dev_data = pcistub_dev_data_alloc(dev);
>>>>        if (!dev_data) {
>>>>                err = -ENOMEM;
>>>>                goto out;
>>>>        }
>>>> -       pci_set_drvdata(dev, dev_data);
>>>>
>>>>        dev_dbg(&dev->dev, "initializing config\n");
>>>>
>>>> @@ -317,6 +399,22 @@ static int __devinit pcistub_init_device
>>>>        dev_dbg(&dev->dev, "reset device\n");
>>>>        pciback_reset_device(dev);
>>>>
>>>> +       /* Classify the device so we know if it is PCI/PCIe and if it is
>>>> +        * a bridge - this information is used for FLR logic. Also store
>>>> +        * values if SBR/D3R reset logic was requested.
>>>> +        */
>>>> +       pciback_classify_device(dev);
>>>> +       dev_data->no_flr = pcistub_match(dev, PCIBACK_ID_TYPE_NOFLR);
>>>> +       if (!dev_data->no_flr) {
>>>> +               dev_data->use_sbr = pcistub_match(dev, PCIBACK_ID_TYPE_SBR);
>>>> +               dev_data->use_d3r = pcistub_match(dev, PCIBACK_ID_TYPE_D3R);
>>>> +       }
>>>> +
>>>> +       /* Store the config space here where the device is off and ready to be
>>>> +        * exported before any FLRs or other resets are done
>>>> +        */
>>>> +       pciback_store_config_space(dev);
>>>> +
>>>>        return 0;
>>>>
>>>>       config_release:
>>>> @@ -414,7 +512,7 @@ static int __devinit pcistub_probe(struc
>>>>
>>>>        dev_dbg(&dev->dev, "probing...\n");
>>>>
>>>> -       if (pcistub_match(dev)) {
>>>> +       if (pcistub_match(dev, PCIBACK_ID_TYPE_HIDE)) {
>>>>
>>>>                if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL
>>>>                    && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) {
>>>> @@ -851,7 +949,7 @@ static inline int str_to_quirk(const cha
>>>>        return -EINVAL;
>>>>  }
>>>>
>>>> -static int pcistub_device_id_add(int domain, int bus, int slot, int func)
>>>> +static int pcistub_device_id_add(int domain, int bus, int slot, int func, int type)
>>>>  {
>>>>        struct pcistub_device_id *pci_dev_id;
>>>>        unsigned long flags;
>>>> @@ -860,12 +958,13 @@ static int pcistub_device_id_add(int dom
>>>>        if (!pci_dev_id)
>>>>                return -ENOMEM;
>>>>
>>>> +       pci_dev_id->type = type;
>>>>        pci_dev_id->domain = domain;
>>>>        pci_dev_id->bus = bus;
>>>>        pci_dev_id->devfn = PCI_DEVFN(slot, func);
>>>>
>>>> -       pr_debug("pciback: wants to seize %04x:%02x:%02x.%01x\n",
>>>> -                domain, bus, slot, func);
>>>> +       pr_debug("pciback: adding device ID type: %d for %04x:%02x:%02x.%01x\n",
>>>> +                type, domain, bus, slot, func);
>>>>
>>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>>        list_add_tail(&pci_dev_id->slot_list, &pcistub_device_ids);
>>>> @@ -874,7 +973,7 @@ static int pcistub_device_id_add(int dom
>>>>        return 0;
>>>>  }
>>>>
>>>> -static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
>>>> +static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
>>>>  {
>>>>        struct pcistub_device_id *pci_dev_id, *t;
>>>>        int devfn = PCI_DEVFN(slot, func);
>>>> @@ -884,7 +983,7 @@ static int pcistub_device_id_remove(int
>>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>>        list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
>>>>
>>>> -               if (pci_dev_id->domain == domain
>>>> +               if (pci_dev_id->type == type && pci_dev_id->domain == domain
>>>>                    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
>>>>                        /* Don't break; here because it's possible the same
>>>>                         * slot could be in the list more than once
>>>> @@ -939,6 +1038,32 @@ static int pcistub_reg_add(int domain, i
>>>>        return err;
>>>>  }
>>>>
>>>> +static int pcistub_device_do_flr(int domain, int bus, int slot, int func)
>>>> +{
>>>> +       int err = 0;
>>>> +       struct pcistub_device *psdev;
>>>> +       struct pci_dev *dev;
>>>> +
>>>> +       psdev = pcistub_device_find(domain, bus, slot, func);
>>>> +       if (!psdev || !psdev->dev) {
>>>> +               err = -ENODEV;
>>>> +               goto out;
>>>> +       }
>>>> +       dev = psdev->dev;
>>>> +
>>>> +       /* Do an FLR (or approximate) for the device on demand and
>>>> +        * reload config
>>>> +        */
>>>> +       if (!disable_all_flr) {
>>>> +               pciback_flr_device(dev);
>>>> +       }
>>>> +       else
>>>> +               dev_dbg(&dev->dev, "FLR disabled for all devices\n");
>>>> +
>>>> +out:
>>>> +       return err;
>>>> +}
>>>> +
>>>>  static ssize_t pcistub_slot_add(struct device_driver *drv, const char *buf,
>>>>                                size_t count)
>>>>  {
>>>> @@ -949,7 +1074,7 @@ static ssize_t pcistub_slot_add(struct d
>>>>        if (err)
>>>>                goto out;
>>>>
>>>> -       err = pcistub_device_id_add(domain, bus, slot, func);
>>>> +       err = pcistub_device_id_add(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>>>>
>>>>       out:
>>>>        if (!err)
>>>> @@ -969,7 +1094,7 @@ static ssize_t pcistub_slot_remove(struc
>>>>        if (err)
>>>>                goto out;
>>>>
>>>> -       err = pcistub_device_id_remove(domain, bus, slot, func);
>>>> +       err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
>>>>
>>>>       out:
>>>>        if (!err)
>>>> @@ -987,6 +1112,10 @@ static ssize_t pcistub_slot_show(struct
>>>>
>>>>        spin_lock_irqsave(&device_ids_lock, flags);
>>>>        list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
>>>> +               /* only want devices set for hide, not reset entries */
>>>> +               if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
>>>> +                       continue;
>>>> +
>>>>                if (count >= PAGE_SIZE)
>>>>                        break;
>>>>
>>>> @@ -1068,7 +1197,7 @@ static ssize_t pcistub_quirk_show(struct
>>>>
>>>>  DRIVER_ATTR(quirks, S_IRUSR | S_IWUSR, pcistub_quirk_show, pcistub_quirk_add);
>>>>
>>>> -static ssize_t permissive_add(struct device_driver *drv, const char *buf,
>>>> +static ssize_t pcistub_permissive_add(struct device_driver *drv, const char *buf,
>>>>                              size_t count)
>>>>  {
>>>>        int domain, bus, slot, func;
>>>> @@ -1109,7 +1238,7 @@ static ssize_t permissive_add(struct dev
>>>>        return err;
>>>>  }
>>>>
>>>> -static ssize_t permissive_show(struct device_driver *drv, char *buf)
>>>> +static ssize_t pcistub_permissive_show(struct device_driver *drv, char *buf)
>>>>  {
>>>>        struct pcistub_device *psdev;
>>>>        struct pciback_dev_data *dev_data;
>>>> @@ -1132,7 +1261,68 @@ static ssize_t permissive_show(struct de
>>>>        return count;
>>>>  }
>>>>
>>>> -DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, permissive_show, permissive_add);
>>>> +DRIVER_ATTR(permissive, S_IRUSR | S_IWUSR, pcistub_permissive_show, pcistub_permissive_add);
>>>> +
>>>> +static ssize_t pcistub_do_flr(struct device_driver *drv, const char *buf,
>>>> +                                  size_t count)
>>>> +{
>>>> +       int domain, bus, slot, func;
>>>> +       int err;
>>>> +
>>>> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
>>>> +       if (err)
>>>> +               goto out;
>>>> +
>>>> +       err = pcistub_device_do_flr(domain, bus, slot, func);
>>>> +
>>>> +out:
>>>> +       if (!err)
>>>> +               err = count;
>>>> +       return err;
>>>> +}
>>>> +
>>>> +DRIVER_ATTR(do_flr, S_IWUSR, NULL, pcistub_do_flr);
>>>> +
>>>> +static ssize_t pcistub_resets(struct device_driver *drv, const char *buf,
>>>> +                                  size_t count)
>>>> +{
>>>> +       int domain, bus, slot, func;
>>>> +       int type, err = 0;
>>>> +
>>>> +       /* string begins with reset type specifier sbr=|dr3=|noflr= */
>>>> +       if (!strncmp(buf, "sbr=", 4)) {
>>>> +               type = PCIBACK_ID_TYPE_SBR;
>>>> +               buf += 4;
>>>> +       } else if (!strncmp(buf, "d3r=", 4)) {
>>>> +               type = PCIBACK_ID_TYPE_D3R;
>>>> +               buf += 4;
>>>> +       } else if (!strncmp(buf, "noflr=", 6)) {
>>>> +               type = PCIBACK_ID_TYPE_NOFLR;
>>>> +               buf += 6;
>>>> +       } else {
>>>> +               err = -EINVAL;
>>>> +               goto out;
>>>> +       }
>>>> +
>>>> +       /* check special wildcard noflr */
>>>> +       if (type == PCIBACK_ID_TYPE_NOFLR && !strncmp(buf, "(*)", 3)) {
>>>> +               disable_all_flr = 1;
>>>> +               goto out;
>>>> +       }
>>>> +
>>>> +       err = str_to_slot(buf, &domain, &bus, &slot, &func);
>>>> +       if (err)
>>>> +               goto out;
>>>> +
>>>> +       err = pcistub_device_id_add(domain, bus, slot, func, type);
>>>> +
>>>> +out:
>>>> +       if (!err)
>>>> +               err = count;
>>>> +       return err;
>>>> +}
>>>> +
>>>> +DRIVER_ATTR(resets, S_IWUSR, NULL, pcistub_resets);
>>>>
>>>>  #ifdef CONFIG_PCI_MSI
>>>>
>>>> @@ -1158,6 +1348,8 @@ static void pcistub_exit(void)
>>>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_slots);
>>>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_quirks);
>>>>        driver_remove_file(&pciback_pci_driver.driver, &driver_attr_permissive);
>>>> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_do_flr);
>>>> +       driver_remove_file(&pciback_pci_driver.driver, &driver_attr_resets);
>>>>
>>>>        pci_unregister_driver(&pciback_pci_driver);
>>>>        WARN_ON(unregister_msi_get_owner(pciback_get_owner));
>>>> @@ -1165,35 +1357,27 @@ static void pcistub_exit(void)
>>>>
>>>>  static int __init pcistub_init(void)
>>>>  {
>>>> -       int pos = 0;
>>>>        int err = 0;
>>>> -       int domain, bus, slot, func;
>>>> -       int parsed;
>>>>
>>>> -       if (pci_devs_to_hide && *pci_devs_to_hide) {
>>>> -               do {
>>>> -                       parsed = 0;
>>>> -
>>>> -                       err = sscanf(pci_devs_to_hide + pos,
>>>> -                                    " (%x:%x:%x.%x) %n",
>>>> -                                    &domain, &bus, &slot, &func, &parsed);
>>>> -                       if (err != 4) {
>>>> -                               domain = 0;
>>>> -                               err = sscanf(pci_devs_to_hide + pos,
>>>> -                                            " (%x:%x.%x) %n",
>>>> -                                            &bus, &slot, &func, &parsed);
>>>> -                               if (err != 3)
>>>> -                                       goto parse_error;
>>>> -                       }
>>>> +       /* Parse device lists for hide, sbr, and d3r */
>>>> +       err = pciback_parse_device_params(pci_devs_to_hide, PCIBACK_ID_TYPE_HIDE, pcistub_device_id_add);
>>>> +       if (err)
>>>> +               goto out;
>>>>
>>>> -                       err = pcistub_device_id_add(domain, bus, slot, func);
>>>> -                       if (err)
>>>> -                               goto out;
>>>> +       err = pciback_parse_device_params(pci_devs_use_sbr, PCIBACK_ID_TYPE_SBR, pcistub_device_id_add);
>>>> +       if (err)
>>>> +               goto out;
>>>>
>>>> -                       /* if parsed<=0, we've reached the end of the string */
>>>> -                       pos += parsed;
>>>> -               } while (parsed > 0 && pci_devs_to_hide[pos]);
>>>> -       }
>>>> +       err = pciback_parse_device_params(pci_devs_use_d3r, PCIBACK_ID_TYPE_D3R, pcistub_device_id_add);
>>>> +       if (err)
>>>> +               goto out;
>>>> +
>>>> +       if (pci_devs_no_flr && *pci_devs_no_flr && !strncmp(pci_devs_no_flr, "(*)", 3))
>>>> +               disable_all_flr = 1; /* check special wildcard noflr */
>>>> +       else
>>>> +               err = pciback_parse_device_params(pci_devs_no_flr, PCIBACK_ID_TYPE_NOFLR, pcistub_device_id_add);
>>>> +       if (err)
>>>> +               goto out;
>>>>
>>>>        /* If we're the first PCI Device Driver to register, we're the
>>>>         * first one to get offered PCI devices as they become
>>>> @@ -1217,6 +1401,12 @@ static int __init pcistub_init(void)
>>>>        if (!err)
>>>>                err = driver_create_file(&pciback_pci_driver.driver,
>>>>                                         &driver_attr_permissive);
>>>> +       if (!err)
>>>> +               err = driver_create_file(&pciback_pci_driver.driver,
>>>> +                                        &driver_attr_do_flr);
>>>> +       if (!err)
>>>> +               err = driver_create_file(&pciback_pci_driver.driver,
>>>> +                                        &driver_attr_resets);
>>>>
>>>>        if (!err)
>>>>                err = register_msi_get_owner(pciback_get_owner);
>>>> @@ -1225,11 +1415,6 @@ static int __init pcistub_init(void)
>>>>
>>>>       out:
>>>>        return err;
>>>> -
>>>> -      parse_error:
>>>> -       printk(KERN_ERR "pciback: Error parsing pci_devs_to_hide at \"%s\"\n",
>>>> -              pci_devs_to_hide + pos);
>>>> -       return -EINVAL;
>>>>  }
>>>>
>>>>  #ifndef MODULE
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/slot.c    2009-06-07 19:04:11.000000000 -0400
>>>> @@ -109,7 +109,7 @@ void pciback_release_pci_dev(struct pcib
>>>>        spin_unlock_irqrestore(&slot_dev->lock, flags);
>>>>
>>>>        if (found_dev)
>>>> -               pcistub_put_pci_dev(found_dev);
>>>> +               pcistub_put_pci_dev(found_dev, 0);
>>>>  }
>>>>
>>>>  int pciback_init_devices(struct pciback_device *pdev)
>>>> @@ -149,7 +149,7 @@ void pciback_release_devices(struct pcib
>>>>                for (slot = 0; slot < PCI_SLOT_MAX; slot++) {
>>>>                        dev = slot_dev->slots[bus][slot];
>>>>                        if (dev != NULL)
>>>> -                               pcistub_put_pci_dev(dev);
>>>> +                               pcistub_put_pci_dev(dev, 0);
>>>>                }
>>>>
>>>>        kfree(slot_dev);
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c
>>>> --- a/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 20:48:21.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/drivers/xen/pciback/vpci.c    2009-06-07 19:04:11.000000000 -0400
>>>> @@ -162,7 +162,7 @@ void pciback_release_pci_dev(struct pcib
>>>>        spin_unlock_irqrestore(&vpci_dev->lock, flags);
>>>>
>>>>        if (found_dev)
>>>> -               pcistub_put_pci_dev(found_dev);
>>>> +               pcistub_put_pci_dev(found_dev, 0);
>>>>  }
>>>>
>>>>  int pciback_init_devices(struct pciback_device *pdev)
>>>> @@ -202,7 +202,7 @@ void pciback_release_devices(struct pcib
>>>>                list_for_each_entry_safe(e, tmp, &vpci_dev->dev_list[slot],
>>>>                                         list) {
>>>>                        list_del(&e->list);
>>>> -                       pcistub_put_pci_dev(e->dev);
>>>> +                       pcistub_put_pci_dev(e->dev, 0);
>>>>                        kfree(e);
>>>>                }
>>>>        }
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_ids.h b/linux-2.6.18-xen.hg/include/linux/pci_ids.h
>>>> --- a/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 20:48:23.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/include/linux/pci_ids.h       2009-06-07 19:04:11.000000000 -0400
>>>> @@ -2259,6 +2259,14 @@
>>>>  #define PCI_DEVICE_ID_INTEL_IXP2800    0x9004
>>>>  #define PCI_DEVICE_ID_INTEL_S21152BB   0xb152
>>>>
>>>> +#define PCI_DEVICE_ID_INTEL_GMCHQ45 0x2e10
>>>> +#define PCI_DEVICE_ID_INTEL_GMCHG45 0x2e20
>>>> +#define PCI_DEVICE_ID_INTEL_MCHP45  0x2e20
>>>> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
>>>> +#define PCI_DEVICE_ID_INTEL_GMCHGM45 0x2a40
>>>> +
>>>> +#define PCI_DEVICE_ID_INTEL_GMCHG41 0x2e30
>>>> +
>>>>  #define PCI_VENDOR_ID_SCALEMP          0x8686
>>>>  #define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
>>>>
>>>> diff -rupN --ignore-blank-lines-X diffignore a/linux-2.6.18-xen.hg/include/linux/pci_regs.h b/linux-2.6.18-xen.hg/include/linux/pci_regs.h
>>>> --- a/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 20:48:23.000000000 -0400
>>>> +++ b/linux-2.6.18-xen.hg/include/linux/pci_regs.h      2009-06-07 19:04:11.000000000 -0400
>>>> @@ -201,6 +201,7 @@
>>>>  #define  PCI_CAP_ID_SHPC       0x0C    /* PCI Standard Hot-Plug Controller */
>>>>  #define  PCI_CAP_ID_EXP        0x10    /* PCI Express */
>>>>  #define  PCI_CAP_ID_MSIX       0x11    /* MSI-X */
>>>> +#define  PCI_CAP_ID_AF      0x13    /* Advanced Features Capability */
>>>>  #define PCI_CAP_LIST_NEXT      1       /* Next capability in the list */
>>>>  #define PCI_CAP_FLAGS          2       /* Capability defined flags (16 bits) */
>>>>  #define PCI_CAP_SIZEOF         4
>>>> @@ -229,6 +230,11 @@
>>>>  #define  PCI_PM_CTRL_DATA_SEL_MASK     0x1e00  /* Data select (??) */
>>>>  #define  PCI_PM_CTRL_DATA_SCALE_MASK   0x6000  /* Data scale (??) */
>>>>  #define  PCI_PM_CTRL_PME_STATUS        0x8000  /* PME pin status */
>>>> +#define  PCI_PM_CTRL_DATA_DSTATE_MASK 0x3      /* D0 - D3 */
>>>> +#define  PCI_PM_CTRL_D0 0x0
>>>> +#define  PCI_PM_CTRL_D1 0x1
>>>> +#define  PCI_PM_CTRL_D2 0x2
>>>> +#define  PCI_PM_CTRL_D3HOT 0x3
>>>>  #define PCI_PM_PPB_EXTENSIONS  6       /* PPB support extensions (??) */
>>>>  #define  PCI_PM_PPB_B2_B3      0x40    /* Stop clock when in D3hot (??) */
>>>>  #define  PCI_PM_BPCC_ENABLE    0x80    /* Bus power/clock control enable (??) */
>>>> @@ -346,6 +352,7 @@
>>>>  #define  PCI_EXP_DEVCAP_PWR_IND        0x4000  /* Power Indicator Present */
>>>>  #define  PCI_EXP_DEVCAP_PWR_VAL        0x3fc0000 /* Slot Power Limit Value */
>>>>  #define  PCI_EXP_DEVCAP_PWR_SCL        0xc000000 /* Slot Power Limit Scale */
>>>> +#define  PCI_EXP_DEVCAP_FLR     0x10000000 /* Function Level Reset */
>>>>  #define PCI_EXP_DEVCTL         8       /* Device Control */
>>>>  #define  PCI_EXP_DEVCTL_CERE   0x0001  /* Correctable Error Reporting En. */
>>>>  #define  PCI_EXP_DEVCTL_NFERE  0x0002  /* Non-Fatal Error Reporting Enable */
>>>> @@ -358,6 +365,7 @@
>>>>  #define  PCI_EXP_DEVCTL_AUX_PME        0x0400  /* Auxiliary Power PM Enable */
>>>>  #define  PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  /* Enable No Snoop */
>>>>  #define  PCI_EXP_DEVCTL_READRQ 0x7000  /* Max_Read_Request_Size */
>>>> +#define  PCI_EXP_DEVCTL_BCR_FLR 0x8000  /* Bridge Configuration Retry / FLR */
>>>>  #define PCI_EXP_DEVSTA         10      /* Device Status */
>>>>  #define  PCI_EXP_DEVSTA_CED    0x01    /* Correctable Error Detected */
>>>>  #define  PCI_EXP_DEVSTA_NFED   0x02    /* Non-Fatal Error Detected */
>>>> @@ -482,6 +490,17 @@
>>>>  #define  PCI_ARI_CTRL_ACS      0x0002  /* ACS Function Groups Enable */
>>>>  #define  PCI_ARI_CTRL_FG(x)    (((x) >> 4) & 7) /* Function Group */
>>>>
>>>> +/* Advanced Features Capability */
>>>> +#define PCI_AF_LENFLD    0x02 /* Device length offset */
>>>> +#define  PCI_AF_LENGTH   0x06
>>>> +#define PCI_AF_DEVCAP    0x03 /* Device capabilities offset */
>>>> +#define  PCI_AF_CAP_TP   0x01
>>>> +#define  PCI_AF_CAP_FLR  0x02
>>>> +#define PCI_AF_CTRL      0x04 /* Device CTRL offset */
>>>> +#define  PCI_AF_CTRL_FLR 0x01
>>>> +#define PCI_AF_STA       0x05 /* Device STATUS offset */
>>>> +#define  PCI_AF_STA_TP   0x01
>>>> +
>>>>  /* Single Root I/O Virtualization */
>>>>  #define PCI_SRIOV_CAP          0x04    /* SR-IOV Capabilities */
>>>>  #define  PCI_SRIOV_CAP_VFM     0x01    /* VF Migration Capable */
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
>>>> --- a/tools/firmware/hvmloader/hvmloader.c      2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/firmware/hvmloader/hvmloader.c      2009-06-07 19:04:11.000000000 -0400
>>>> @@ -673,6 +673,7 @@ int main(void)
>>>>         break;
>>>>     default:
>>>>         printf("No emulated VGA adaptor ...\n");
>>>> +        vgabios_sz = round_option_rom((*(uint8_t *)(VGABIOS_PHYSICAL_ADDRESS+2)) * 512);
>>>>         break;
>>>>     }
>>>>
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/console.h b/tools/ioemu-remote/console.h
>>>> --- a/tools/ioemu-remote/console.h      2009-06-07 21:14:47.000000000 -0400
>>>> +++ b/tools/ioemu-remote/console.h      2009-06-07 19:04:11.000000000 -0400
>>>> @@ -290,6 +290,9 @@ void vga_hw_update(void);
>>>>  void vga_hw_invalidate(void);
>>>>  void vga_hw_screen_dump(const char *filename);
>>>>
>>>> +void unset_vga_acc(void);
>>>> +void set_vga_acc(void);
>>>> +
>>>>  int is_graphic_console(void);
>>>>  int is_fixedsize_console(void);
>>>>  CharDriverState *text_console_init(const char *p);
>>>> @@ -341,4 +344,9 @@ const char *readline_get_history(unsigne
>>>>  void readline_start(const char *prompt, int is_password,
>>>>                     ReadLineFunc *readline_func, void *opaque);
>>>>
>>>> +/* intel.c */
>>>> +int intel_enter(void);
>>>> +int intel_leave(void);
>>>> +void intel_display_init(DisplayState *ds);
>>>> +
>>>>  #endif
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pass-through.c b/tools/ioemu-remote/hw/pass-through.c
>>>> --- a/tools/ioemu-remote/hw/pass-through.c      2009-06-07 21:14:48.000000000 -0400
>>>> +++ b/tools/ioemu-remote/hw/pass-through.c      2009-06-07 19:04:11.000000000 -0400
>>>> @@ -90,6 +90,8 @@
>>>>  #include "qemu-xen.h"
>>>>  #include <unistd.h>
>>>>
>>>> +extern int vga_passthrough;
>>>> +
>>>>  struct php_dev {
>>>>     struct pt_dev *pt_dev;
>>>>     uint8_t valid;
>>>> @@ -1573,10 +1575,11 @@ static int pt_dev_is_virtfn(struct pci_d
>>>>
>>>>  static int pt_register_regions(struct pt_dev *assigned_device)
>>>>  {
>>>> -    int i = 0;
>>>> +    int i = 0, ret = 0;
>>>>     uint32_t bar_data = 0;
>>>>     struct pci_dev *pci_dev = assigned_device->pci_dev;
>>>>     PCIDevice *d = &assigned_device->dev;
>>>> +    uint16_t class, vendor_id;
>>>>
>>>>     /* Register PIO/MMIO BARs */
>>>>     for ( i = 0; i < PCI_BAR_ENTRIES; i++ )
>>>> @@ -1632,6 +1635,25 @@ static int pt_register_regions(struct pt
>>>>             (uint32_t)(pci_dev->rom_size), (uint32_t)(pci_dev->rom_base_addr));
>>>>     }
>>>>
>>>> +    /* Map legacy ioport and iomem, for specific devices */
>>>> +    vendor_id = pci_read_word(pci_dev, 0x00);
>>>> +    class = pci_read_word(pci_dev, 0x0a);
>>>> +
>>>> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
>>>> +    if ( vga_passthrough && class == 0x0300 )
>>>> +    {
>>>> +        PT_LOG("add an intel graphic card\n");
>>>> +
>>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_ADD_MAPPING);
>>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_ADD_MAPPING);
>>>> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_ADD_MAPPING);
>>>> +        if ( ret != 0 )
>>>> +        {
>>>> +            PT_LOG("legacy mapping failed!\n");
>>>> +            return ret;
>>>> +        }
>>>> +    }
>>>> +
>>>>     return 0;
>>>>  }
>>>>
>>>> @@ -1640,6 +1662,7 @@ static void pt_unregister_regions(struct
>>>>     int i, type, ret;
>>>>     uint32_t e_size;
>>>>     PCIDevice *d = (PCIDevice*)assigned_device;
>>>> +    uint16_t class, vendor_id;
>>>>
>>>>     for ( i = 0; i < PCI_NUM_REGIONS; i++ )
>>>>     {
>>>> @@ -1681,6 +1704,24 @@ static void pt_unregister_regions(struct
>>>>
>>>>     }
>>>>
>>>> +    /* unmap legacy ioport and iomem, for specific devices */
>>>> +    vendor_id = pci_read_word(assigned_device->pci_dev, 0x00);
>>>> +    class = pci_read_word(assigned_device->pci_dev, 0x0a);
>>>> +
>>>> +    PT_LOG("Real device vendor_id=0x%x class=0x%x\n", vendor_id, class);
>>>> +    if ( vga_passthrough && class == 0x0300 )
>>>> +    {
>>>> +        PT_LOG("remove an intel graphic card\n");
>>>> +
>>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3B0, 0x3B0, 0xb, DPCI_REMOVE_MAPPING);
>>>> +        ret = xc_domain_ioport_mapping(xc_handle, domid, 0x3C0, 0x3C0, 32, DPCI_REMOVE_MAPPING);
>>>> +        ret |= xc_domain_memory_mapping(xc_handle, domid, 0xa0, 0xa0, 32, DPCI_REMOVE_MAPPING);
>>>> +        if ( ret != 0 )
>>>> +        {
>>>> +            PT_LOG("legacy unmapping failed !\n");
>>>> +        }
>>>> +    }
>>>> +
>>>>  }
>>>>
>>>>  static uint8_t find_cap_offset(struct pci_dev *pci_dev, uint8_t cap)
>>>> @@ -3759,7 +3800,7 @@ static struct pt_dev * register_real_dev
>>>>     struct pci_config_cf8 machine_bdf;
>>>>     char *key, *val;
>>>>     int msi_translate, power_mgmt;
>>>> -
>>>> +
>>>>     PT_LOG("Assigning real physical device %02x:%02x.%x ...\n",
>>>>         r_bus, r_dev, r_func);
>>>>
>>>> @@ -3931,7 +3972,7 @@ static struct pt_dev * register_real_dev
>>>>     }
>>>>
>>>>  out:
>>>> -    PT_LOG("Real physical device %02x:%02x.%x registered successfuly!\n"
>>>> +    PT_LOG("Real physical device %02x:%02x.%x registered successfully!\n"
>>>>            "IRQ type = %s\n", r_bus, r_dev, r_func,
>>>>            assigned_device->msi_trans_en? "MSI-INTx":"INTx");
>>>>
>>>> @@ -4113,3 +4154,47 @@ err:
>>>>     return status;
>>>>  }
>>>>
>>>> +u8 pt_pci_host_read_byte(int bus, int dev, int fn, u32 addr)
>>>> +{
>>>> +    struct pci_dev *pci_dev;
>>>> +    u8             val;
>>>> +
>>>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>>>> +    if (!pci_dev)
>>>> +        return 0;
>>>> +
>>>> +    val = pci_read_byte(pci_dev, addr);
>>>> +    pci_free_dev(pci_dev);
>>>> +
>>>> +    return val;
>>>> +}
>>>> +
>>>> +u16 pt_pci_host_read_word(int bus, int dev, int fn, u32 addr)
>>>> +{
>>>> +    struct pci_dev *pci_dev;
>>>> +    u16             val;
>>>> +
>>>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>>>> +    if (!pci_dev)
>>>> +        return 0;
>>>> +
>>>> +    val = pci_read_word(pci_dev, addr);
>>>> +    pci_free_dev(pci_dev);
>>>> +
>>>> +    return val;
>>>> +}
>>>> +
>>>> +u32 pt_pci_host_read_long(int bus, int dev, int fn, u32 addr)
>>>> +{
>>>> +    struct pci_dev *pci_dev;
>>>> +    u32             val;
>>>> +
>>>> +    pci_dev = pci_get_dev(dpci_infos.pci_access, 0, bus, dev, fn);
>>>> +    if (!pci_dev)
>>>> +        return 0;
>>>> +
>>>> +    val = pci_read_long(pci_dev, addr);
>>>> +    pci_free_dev(pci_dev);
>>>> +
>>>> +    return val;
>>>> +}
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pc.c b/tools/ioemu-remote/hw/pc.c
>>>> --- a/tools/ioemu-remote/hw/pc.c        2009-06-07 21:14:47.000000000 -0400
>>>> +++ b/tools/ioemu-remote/hw/pc.c        2009-06-07 19:04:11.000000000 -0400
>>>> @@ -65,6 +65,8 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
>>>>  extern uint8_t *acpi_tables;
>>>>  extern size_t acpi_tables_len;
>>>>
>>>> +extern int vga_passthrough;
>>>> +
>>>>  static fdctrl_t *floppy_controller;
>>>>  static RTCState *rtc_state;
>>>>  static PITState *pit;
>>>> @@ -984,6 +986,7 @@ vga_bios_error:
>>>>
>>>>     register_ioport_write(0xf0, 1, 1, ioportF0_write, NULL);
>>>>
>>>> +    if (!vga_passthrough) {
>>>>     if (cirrus_vga_enabled) {
>>>>         if (pci_enabled) {
>>>>             pci_cirrus_vga_init(pci_bus,
>>>> @@ -1010,6 +1013,7 @@ vga_bios_error:
>>>>                          vga_ram_addr, vga_ram_size);
>>>>         }
>>>>     }
>>>> +    }
>>>>
>>>>  #ifdef CONFIG_PASSTHROUGH
>>>>     /* Pass-through Initialization
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/pci.c b/tools/ioemu-remote/hw/pci.c
>>>> --- a/tools/ioemu-remote/hw/pci.c       2009-06-07 21:14:47.000000000 -0400
>>>> +++ b/tools/ioemu-remote/hw/pci.c       2009-06-07 19:04:11.000000000 -0400
>>>> @@ -28,11 +28,14 @@
>>>>  #include "virtio-net.h"
>>>>  #include "sysemu.h"
>>>>
>>>> +#include "pass-through.h"
>>>>  #include "exec-all.h"
>>>>  #include "qemu-xen.h"
>>>>
>>>>  //#define DEBUG_PCI
>>>>
>>>> +extern int vga_passthrough;
>>>> +
>>>>  struct PCIBus {
>>>>     int bus_num;
>>>>     int devfn_min;
>>>> @@ -611,7 +614,24 @@ uint32_t pci_data_read(void *opaque, uin
>>>>         goto the_end;
>>>>     }
>>>>     config_addr = addr & 0xff;
>>>> -    val = pci_dev->config_read(pci_dev, config_addr, len);
>>>> +    if (vga_passthrough && pci_dev->devfn == 0x00) //Host Bridge
>>>> +    {
>>>> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>>>> +
>>>> +        if (config_addr == 0x52) // GMCH
>>>> +            val = pt_pci_host_read_word(0, 0, 0, 0x52);
>>>> +        if (config_addr == 0x02) // Device ID
>>>> +        {
>>>> +            if (len == 2)
>>>> +                val = pt_pci_host_read_word(0, 0, 0, 0x00);
>>>> +            else if (len == 4)
>>>> +                val = pt_pci_host_read_long(0, 0, 0, 0x00);
>>>> +        }
>>>> +    } else if (vga_passthrough && pci_dev->devfn == 0x10 && // intel graphic card
>>>> +               config_addr == 0xfc) // OpRegion address
>>>> +        val = 0; // force to fall back to SMI mode
>>>> +    else
>>>> +        val = pci_dev->config_read(pci_dev, config_addr, len);
>>>>  #if defined(DEBUG_PCI)
>>>>     printf("pci_config_read: %s: addr=%02x val=%08x len=%d\n",
>>>>            pci_dev->name, config_addr, val, len);
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/hw/vga.c b/tools/ioemu-remote/hw/vga.c
>>>> --- a/tools/ioemu-remote/hw/vga.c       2009-06-07 21:14:47.000000000 -0400
>>>> +++ b/tools/ioemu-remote/hw/vga.c       2009-06-07 19:04:11.000000000 -0400
>>>> @@ -34,9 +34,9 @@
>>>>
>>>>  #include "qemu-timer.h"
>>>>
>>>> -//#define DEBUG_VGA
>>>> -//#define DEBUG_VGA_MEM
>>>> -//#define DEBUG_VGA_REG
>>>> +#define DEBUG_VGA
>>>> +#define DEBUG_VGA_MEM
>>>> +#define DEBUG_VGA_REG
>>>>
>>>>  //#define DEBUG_BOCHS_VBE
>>>>
>>>> @@ -161,6 +161,18 @@ static uint8_t expand4to8[16];
>>>>  static void vga_bios_init(VGAState *s);
>>>>  static void vga_screen_dump(void *opaque, const char *filename);
>>>>
>>>> +static VGAState *xen_vga_state;
>>>> +
>>>> +void set_vga_acc(void)
>>>> +{
>>>> +    set_vram_mapping(xen_vga_state, xen_vga_state->lfb_addr, xen_vga_state->lfb_end);
>>>> +}
>>>> +
>>>> +void unset_vga_acc(void)
>>>> +{
>>>> +    unset_vram_mapping(xen_vga_state);
>>>> +}
>>>> +
>>>>  static void vga_dumb_update_retrace_info(VGAState *s)
>>>>  {
>>>>     (void) s;
>>>> @@ -2473,8 +2485,6 @@ static void vga_bios_init(VGAState *s)
>>>>  }
>>>>
>>>>
>>>> -static VGAState *xen_vga_state;
>>>> -
>>>>  /* Allocate video memory in the GPFN space */
>>>>  void xen_vga_populate_vram(uint64_t vram_addr, uint32_t vga_ram_size)
>>>>  {
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/intel.c b/tools/ioemu-remote/intel.c
>>>> --- a/tools/ioemu-remote/intel.c        1969-12-31 19:00:00.000000000 -0500
>>>> +++ b/tools/ioemu-remote/intel.c        2009-06-07 19:04:11.000000000 -0400
>>>> @@ -0,0 +1,494 @@
>>>> +#include <stdio.h>
>>>> +#include <stdlib.h>
>>>> +#include <stdint.h>
>>>> +#include <sys/mman.h>
>>>> +#include <sys/types.h>
>>>> +#include <sys/stat.h>
>>>> +#include <fcntl.h>
>>>> +#include <assert.h>
>>>> +#include <signal.h>
>>>> +#include <pci/pci.h>
>>>> +
>>>> +#include "qemu-common.h"
>>>> +#include "console.h"
>>>> +#include "sysemu.h"
>>>> +
>>>> +#define INTEL_DEBUG(format, args...)                                    \
>>>> +    fprintf (stderr, "intel.c:%d:%s " format , __LINE__, __func__, ## args)
>>>> +
>>>> +#define TileW           128
>>>> +#define TileH           8
>>>> +
>>>> +#define REG_DR_DSPASURF                0x7019C
>>>> +#define REG_DR_DSPACNTR                0x70180
>>>> +#define REG_DR_DSPASTRIDE      0x70188
>>>> +#define REG_DR_PIPEACONF       0x70008
>>>> +
>>>> +#define REG_DR_DSPBSURF                0x7119C
>>>> +#define REG_DR_DSPBCNTR                0x71180
>>>> +#define REG_DR_DSPBSTRIDE      0x71188
>>>> +#define REG_DR_PIPEBCONF       0x71008
>>>> +
>>>> +#define REG_DE_PIPEASRC                0x6001c
>>>> +
>>>> +extern int                      vga_passthrough;
>>>> +uint32_t                        guest_framebuffer;
>>>> +
>>>> +static int                      display = 0;
>>>> +
>>>> +static int                      mmio_fd = -1;
>>>> +static int                      mem_fd = -1;
>>>> +static uint8_t                  *intel_mem = NULL;
>>>> +static uint8_t                  *intel_mmio = NULL;
>>>> +static int                      intel_force_full_update = 0;
>>>> +static int                      intel_have_focus;
>>>> +static int                      IntelPitch = 16;
>>>> +static int                      IntelX = 1280;
>>>> +static int                      IntelY = 1024;
>>>> +static DisplayState             *lds = NULL;
>>>> +static uint8_t                  *old_data = NULL;
>>>> +static uint32_t                 intel_fb_base, intel_mmio_base;
>>>> +static uint32_t                 map_s, map_d, map_size;
>>>> +static int                      refresh;
>>>> +
>>>> +static void set_data_mappings(void);
>>>> +static void unset_data_mappings(int mapping);
>>>> +static void set_data_pointer(void);
>>>> +static void intel_resize(DisplayState *ds);
>>>> +
>>>> +static inline unsigned int intel_get_reg(unsigned int reg)
>>>> +{
>>>> +    return *(unsigned int*)(intel_mmio + reg);
>>>> +}
>>>> +
>>>> +static inline int is_linear(void)
>>>> +{
>>>> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
>>>> +    if (((*dspacntr) & (1 << 10)) == 0)
>>>> +        return 1;
>>>> +    else
>>>> +        return 0;
>>>> +}
>>>> +
>>>> +static inline unsigned int intel_get_pitch(void)
>>>> +{
>>>> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
>>>> +    return *dspastride;
>>>> +}
>>>> +
>>>> +static inline unsigned int intel_get_offset(DisplaySurface *ds, int x, int y)
>>>> +{
>>>> +    return (y * ds->width + x) * 4;
>>>> +}
>>>> +
>>>> +static void intel_update_linear(DisplaySurface *ds, int x, int y, int w, int h)
>>>> +{
>>>> +    int i, bpp = ds->pf.depth / 8;
>>>> +    unsigned char *s, *d;
>>>> +    s = ds->data;
>>>> +    d = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
>>>> +    s += (ds->linesize * y) + bpp * x;
>>>> +    d += (ds->linesize * y) + bpp * x;
>>>> +    for (i = 0; i < h; i++) {
>>>> +        memcpy(d, s, w * bpp);
>>>> +        s += ds->linesize;
>>>> +        d += ds->linesize;
>>>> +    }
>>>> +}
>>>> +
>>>> +static void intel_force_linear(int linesize)
>>>> +{
>>>> +    unsigned int *dspacntr = (unsigned int *)(intel_mmio + REG_DR_DSPACNTR);
>>>> +    unsigned int *pipeaconf = (unsigned int *)(intel_mmio + REG_DR_PIPEACONF);
>>>> +    unsigned int *dspasurf = (unsigned int *)(intel_mmio + REG_DR_DSPASURF);
>>>> +    unsigned int *dspastride = (unsigned int *)(intel_mmio + REG_DR_DSPASTRIDE);
>>>> +
>>>> +    unsigned int *dspbcntr = (unsigned int *)(intel_mmio + REG_DR_DSPBCNTR);
>>>> +    unsigned int *pipebconf = (unsigned int *)(intel_mmio + REG_DR_PIPEBCONF);
>>>> +    unsigned int *dspbsurf = (unsigned int *)(intel_mmio + REG_DR_DSPBSURF);
>>>> +    unsigned int *dspbstride = (unsigned int *)(intel_mmio + REG_DR_DSPBSTRIDE);
>>>> +
>>>> +    unsigned int surfa = 0, surfb = 0, pipea = 0, pipeb = 0;
>>>> +    char pipebenabled = !!(*pipebconf & (1 << 30));
>>>> +
>>>> +
>>>> +    INTEL_DEBUG("DSPASURF CTRL: 0x%x\n", intel_get_reg(REG_DR_DSPACNTR));
>>>> +
>>>> +    /* Disable surface */
>>>> +    pipea = *pipeaconf & (0x3 << 18);
>>>> +    *pipeaconf &= ~(0x3 << 18);
>>>> +    *dspacntr |= (1 << 31);
>>>> +    /* Address of the surface to map to */
>>>> +    surfa = *dspasurf;
>>>> +    *dspasurf = 0x00000000;
>>>> +    *dspacntr &= ~(1 << 31);
>>>> +    *dspasurf = 0x00000000;
>>>> +    *pipeaconf |= pipea;
>>>> +
>>>> +    if (pipebenabled) {
>>>> +        INTEL_DEBUG("PIPEBCONF enabled.\n");
>>>> +
>>>> +        /* Disable surface */
>>>> +        pipeb = *pipebconf & (0x3 << 18);
>>>> +        *pipebconf &= ~(0x3 << 18);
>>>> +        *dspbcntr |= (1 << 31);
>>>> +        /* Address of the surface to map to */
>>>> +        surfb = *dspbsurf;
>>>> +        *dspbsurf = 0x00000000;
>>>> +        *dspbcntr &= ~(1 << 31);
>>>> +        *dspbsurf = 0x00000000;
>>>> +        *pipebconf |= pipeb;
>>>> +    }
>>>> +
>>>> +    usleep(20000);
>>>> +
>>>> +    *pipeaconf &= ~(0x3 << 18);
>>>> +    /* Enable surface linear mode */
>>>> +    *dspacntr &= ~(1 << 10);
>>>> +    if (linesize) *dspastride = linesize;
>>>> +    *dspasurf = surfa;
>>>> +    *dspacntr |= (1 << 31);
>>>> +    *pipeaconf |= pipea;
>>>> +
>>>> +    if (pipebenabled) {
>>>> +        *pipebconf &= ~(0x3 << 18);
>>>> +        /* Enable surface linear mode */
>>>> +        *dspbcntr &= ~(1 << 10);
>>>> +        if (linesize) *dspbstride = linesize;
>>>> +        *dspbsurf = surfb;
>>>> +        *dspbcntr |= (1 << 31);
>>>> +        *pipebconf |= pipeb;
>>>> +    }
>>>> +
>>>> +    usleep(20000);
>>>> +}
>>>> +
>>>> +static void intel_update(DisplayState *ds, int x, int y, int w, int h)
>>>> +{
>>>> +    if (intel_have_focus && !old_data && !map_size)
>>>> +        intel_update_linear(ds->surface, x, y, w, h);
>>>> +}
>>>> +
>>>> +static void set_fb_mapping(void)
>>>> +{
>>>> +    DisplaySurface *surf = lds->surface;
>>>> +    int rc;
>>>> +    unsigned long nr_pfn;
>>>> +
>>>> +    unset_vga_acc();
>>>> +    fprintf(stderr, "set_fb_mapping: %x %x\n", (intel_fb_base + intel_get_reg(REG_DR_DSPASURF)), guest_framebuffer);
>>>> +    nr_pfn = (surf->linesize * surf->height) >> TARGET_PAGE_BITS;
>>>> +
>>>> +    rc = xc_domain_memory_mapping(xc_handle,
>>>> +            domid,
>>>> +            (guest_framebuffer >> TARGET_PAGE_BITS),
>>>> +            ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS),
>>>> +            nr_pfn,
>>>> +            DPCI_ADD_MAPPING);
>>>> +    if (rc) {
>>>> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
>>>> +        return;
>>>> +    }
>>>> +    map_s = ((intel_fb_base + intel_get_reg(REG_DR_DSPASURF)) >> TARGET_PAGE_BITS);
>>>> +    map_d = (guest_framebuffer >> TARGET_PAGE_BITS);
>>>> +    map_size = nr_pfn;
>>>> +}
>>>> +
>>>> +static void unset_fb_mapping(void)
>>>> +{
>>>> +    int rc;
>>>> +
>>>> +    fprintf(stderr, "unset_fb_mapping: %x %x\n", map_d, map_s);
>>>> +
>>>> +    rc = xc_domain_memory_mapping(xc_handle,
>>>> +            domid,
>>>> +            map_d,
>>>> +            map_s,
>>>> +            map_size,
>>>> +            DPCI_REMOVE_MAPPING);
>>>> +    if (rc) {
>>>> +        fprintf(stderr, "xc_domain_memory_mapping failed %d\n", rc);
>>>> +        return;
>>>> +    }
>>>> +
>>>> +    set_vga_acc();
>>>> +    map_s = 0;
>>>> +    map_d = 0;
>>>> +    map_size = 0;
>>>> +}
>>>> +
>>>> +static void intel_setdata(DisplayState *ds)
>>>> +{
>>>> +    if (map_size)
>>>> +        unset_fb_mapping();
>>>> +    set_fb_mapping();
>>>> +}
>>>> +
>>>> +static void intel_resize_shared(DisplayState *ds, int w, int h, int depth, int linesize, void *pixels)
>>>> +{
>>>> +    DisplaySurface *surf = ds->surface;
>>>> +
>>>> +    if (!intel_have_focus) {
>>>> +        surf->width = w;
>>>> +        surf->height = h;
>>>> +        intel_resize(ds);
>>>> +        return;
>>>> +    }
>>>> +    if (depth == 32 && w == IntelX && h == IntelY)
>>>> +        surf->flags = QEMU_ALLOCATED_FLAG;
>>>> +    else
>>>> +        surf->flags &= ~QEMU_ALLOCATED_FLAG;
>>>> +    if (surf->flags & QEMU_ALLOCATED_FLAG) {
>>>> +        surf->width = w;
>>>> +        surf->height = h;
>>>> +        surf->pf.depth = 32;
>>>> +        surf->linesize = linesize;
>>>> +        /* adjust linesize */
>>>> +        intel_force_linear(linesize);
>>>> +        set_data_mappings();
>>>> +        if (refresh) {
>>>> +            memcpy(surf->data, pixels, surf->linesize * surf->height);
>>>> +            refresh = 0;
>>>> +        }
>>>> +        surf->data = pixels;
>>>> +        intel_setdata(ds);
>>>> +    } else {
>>>> +        surf->width = w;
>>>> +        surf->height = h;
>>>> +        intel_resize(ds);
>>>> +    }
>>>> +}
>>>> +
>>>> +static void intel_resize(DisplayState *ds)
>>>> +{
>>>> +    DisplaySurface *surf = ds->surface;
>>>> +    int old_linesize = surf->linesize;
>>>> +
>>>> +    if (surf->pf.depth == 32 && surf->width == IntelX && surf->height == IntelY)
>>>> +      surf->flags = QEMU_ALLOCATED_FLAG;
>>>> +    else
>>>> +      surf->flags &= ~QEMU_ALLOCATED_FLAG;
>>>> +
>>>> +    if (is_buffer_shared(surf))
>>>> +    {
>>>> +      INTEL_DEBUG("intel_resize_shared: enable shared buffer, linesize %d\n",
>>>> +                  surf->linesize);
>>>> +      intel_force_linear(surf->linesize);
>>>> +      set_data_mappings();
>>>> +      if (refresh)
>>>> +      {
>>>> +        // Pixels doesn't exist anymore ??
>>>> +        //memcpy(surf->data, pixels, surf->linesize * surf->height);
>>>> +        refresh = 0;
>>>> +      }
>>>> +      intel_setdata(ds);
>>>> +      return;
>>>> +    }
>>>> +
>>>> +    INTEL_DEBUG("intel_resize: no shared buffer, linesize=%d\n", surf->linesize);
>>>> +    surf->linesize = intel_get_pitch();
>>>> +    if (map_size) {
>>>> +        unset_fb_mapping();
>>>> +        unset_data_mappings(1);
>>>> +    }
>>>> +    if (intel_have_focus && !is_linear()) {
>>>> +        intel_force_linear(0);
>>>> +    }
>>>> +    surf->flags &= ~QEMU_ALLOCATED_FLAG;
>>>> +    if (intel_have_focus && !old_data &&
>>>> +        surf->width * surf->height <= IntelX * IntelY)
>>>> +        set_data_mappings();
>>>> +    else if (intel_have_focus && old_data &&
>>>> +             surf->width * surf->height > IntelX * IntelY)
>>>> +        unset_data_mappings(0);
>>>> +    if (!old_data) {
>>>> +        qemu_free(surf->data);
>>>> +        surf->data = qemu_mallocz(surf->height * surf->linesize);
>>>> +    } else {
>>>> +        INTEL_DEBUG("intel_resize: set_data_pointer\n");
>>>> +        set_data_pointer();
>>>> +    }
>>>> +    if (intel_have_focus)
>>>> +        memset((unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)), 0x0, IntelX * IntelY);
>>>> +    if (refresh) {
>>>> +        if (old_data) {
>>>> +            unsigned char *s, *d;
>>>> +            int i;
>>>> +            s = old_data;
>>>> +            d = surf->data;
>>>> +            for (i = 0; i < surf->height; i++) {
>>>> +                memcpy(d, s, surf->width * 4);
>>>> +                s += old_linesize;
>>>> +                d += surf->linesize;
>>>> +            }
>>>> +        }
>>>> +        refresh = 0;
>>>> +    }
>>>> +}
>>>> +
>>>> +static void intel_refresh(DisplayState *ds)
>>>> +{
>>>> +    vga_hw_update();
>>>> +}
>>>> +
>>>> +static void intel_init_mapping(void)
>>>> +{
>>>> +    struct pci_access   *pci_bus;
>>>> +    struct pci_dev      *pci_dev;
>>>> +
>>>> +    mmio_fd = open("/dev/mem", O_RDWR);
>>>> +    if (mmio_fd == -1)
>>>> +    {
>>>> +        perror("open");
>>>> +        exit(1);
>>>> +    }
>>>> +    mem_fd = open("/dev/mem", O_RDWR);
>>>> +    if (mem_fd == -1)
>>>> +    {
>>>> +        perror("open");
>>>> +        exit(1);
>>>> +    }
>>>> +
>>>> +    pci_bus = pci_alloc();
>>>> +    pci_init(pci_bus);
>>>> +    pci_dev = pci_get_dev(pci_bus, 0, 0, 2, 0);
>>>> +    pci_fill_info(pci_dev, PCI_FILL_BASES);
>>>> +    intel_fb_base = pci_dev->base_addr[2] & 0xfffff000;
>>>> +    intel_mmio_base = pci_dev->base_addr[0] & 0xfffff000;
>>>> +    pci_free_dev(pci_dev);
>>>> +    pci_cleanup(pci_bus);
>>>> +
>>>> +    INTEL_DEBUG("Map intel main mem 0x%x\n", intel_fb_base);
>>>> +    intel_mem = mmap(NULL, 0x10000000, PROT_READ | PROT_WRITE, MAP_SHARED,
>>>> +                     mem_fd, intel_fb_base);
>>>> +    if (intel_mem == MAP_FAILED)
>>>> +    {
>>>> +        perror("mmap");
>>>> +        exit(1);
>>>> +    }
>>>> +
>>>> +    INTEL_DEBUG("Map intel mmio 0x%x\n", intel_mmio_base);
>>>> +    intel_mmio = mmap(NULL, 4 * 1024 * 1024, PROT_READ | PROT_WRITE, MAP_SHARED,
>>>> +                      mmio_fd, intel_mmio_base);
>>>> +    if (intel_mem == MAP_FAILED)
>>>> +    {
>>>> +        perror("mmap");
>>>> +        exit(1);
>>>> +    }
>>>> +}
>>>> +
>>>> +static void set_data_pointer(void)
>>>> +{
>>>> +    DisplaySurface *surf = lds->surface;
>>>> +
>>>> +    surf->data = (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF));
>>>> +    surf->data = surf->data +
>>>> +                surf->linesize * ((IntelY - surf->height) / 2) +
>>>> +                4 * ((IntelX - surf->width) / 2);
>>>> +}
>>>> +
>>>> +static void set_data_mappings(void)
>>>> +{
>>>> +    INTEL_DEBUG("set_data_mappings\n");
>>>> +    if (!old_data)
>>>> +        old_data = lds->surface->data;
>>>> +    set_data_pointer();
>>>> +}
>>>> +
>>>> +static void unset_data_mappings(int mapping)
>>>> +{
>>>> +    DisplaySurface *surf = lds->surface;
>>>> +    if (!old_data)
>>>> +        return;
>>>> +    if (mapping) {
>>>> +        uint8_t * buffer_pointer = surf->data;
>>>> +        surf->data = old_data;
>>>> +        old_data = NULL;
>>>> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
>>>> +        memcpy(surf->data,
>>>> +                (unsigned char *)(intel_mem + intel_get_reg(REG_DR_DSPASURF)),
>>>> +                surf->linesize * surf->height);
>>>> +        memcpy(buffer_pointer,
>>>> +                surf->data,
>>>> +                surf->linesize * surf->height);
>>>> +    } else {
>>>> +        uint8_t * buffer_pointer = surf->data;
>>>> +        surf->data = old_data;
>>>> +        old_data = NULL;
>>>> +        surf->data = realloc(surf->data, surf->linesize * surf->height);
>>>> +        memcpy(surf->data,
>>>> +                buffer_pointer,
>>>> +                surf->linesize * surf->height);
>>>> +    }
>>>> +    INTEL_DEBUG("unset_data_mappings %d: success\n", mapping);
>>>> +}
>>>> +
>>>> +static int intel_getfocus(void)
>>>> +{
>>>> +    return intel_have_focus;
>>>> +}
>>>> +
>>>> +static void intel_focus(int focus)
>>>> +{
>>>> +    if (intel_have_focus == focus)
>>>> +        return;
>>>> +
>>>> +    INTEL_DEBUG("intel_focus %d\n", focus);
>>>> +    intel_have_focus = focus;
>>>> +    if (focus) {
>>>> +        if (!is_linear()) {
>>>> +           IntelPitch = intel_get_reg(REG_DR_DSPASTRIDE);
>>>> +           IntelX = ((intel_get_reg(REG_DE_PIPEASRC) >> 16) & 0xfff) + 1;
>>>> +           IntelY = (intel_get_reg(REG_DE_PIPEASRC) & 0xfff) + 1;
>>>> +           INTEL_DEBUG("Resolution is %dx%d\n", IntelX, IntelY);
>>>> +        }
>>>> +        refresh = 1;
>>>> +        lds->listeners->dpy_resize = intel_resize;
>>>> +        lds->listeners->dpy_setdata = intel_setdata;
>>>> +        vga_hw_invalidate();
>>>> +    } else {
>>>> +        if (map_size) {
>>>> +            unset_fb_mapping();
>>>> +            unset_data_mappings(1);
>>>> +        } else if (old_data) {
>>>> +            unset_data_mappings(0);
>>>> +        }
>>>> +        lds->listeners->dpy_resize = NULL;
>>>> +        lds->listeners->dpy_setdata = NULL;
>>>> +        lds->surface->flags &= ~QEMU_ALLOCATED_FLAG;
>>>> +    }
>>>> +}
>>>> +
>>>> +int intel_enter(void)
>>>> +{
>>>> +    intel_focus(1);
>>>> +    return 1;
>>>> +}
>>>> +
>>>> +int intel_leave(void)
>>>> +{
>>>> +    intel_focus(0);
>>>> +    return 1;
>>>> +}
>>>> +
>>>> +void intel_display_init(DisplayState *ds)
>>>> +{
>>>> +    DisplaySurface *surf = ds->surface;
>>>> +
>>>> +    INTEL_DEBUG("\n");
>>>> +
>>>> +    intel_init_mapping();
>>>> +
>>>> +    INTEL_DEBUG("Frambuffer is at 0x%x\n", intel_get_reg(REG_DR_DSPASURF));
>>>> +
>>>> +    surf->flags = 0;
>>>> +    surf->width = 640;
>>>> +    surf->height = 480;
>>>> +    surf->pf.depth = 32;
>>>> +    intel_resize(ds);
>>>> +    lds = ds;
>>>> +
>>>> +    ds->listeners->dpy_update = intel_update;
>>>> +    ds->listeners->dpy_resize = intel_resize;
>>>> +    ds->listeners->dpy_refresh = intel_refresh;
>>>> +}
>>>> \ No newline at end of file
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/vl.c b/tools/ioemu-remote/vl.c
>>>> --- a/tools/ioemu-remote/vl.c   2009-06-07 21:14:47.000000000 -0400
>>>> +++ b/tools/ioemu-remote/vl.c   2009-06-07 19:29:12.000000000 -0400
>>>> @@ -233,6 +233,9 @@ CharDriverState *virtcon_hds[MAX_VIRTIO_
>>>>  #ifdef TARGET_I386
>>>>  int win2k_install_hack = 0;
>>>>  int rtc_td_hack = 0;
>>>> +int vga_passthrough = 0;
>>>> +const char *dom0_input = NULL;
>>>> +int intel = 0;
>>>>  #endif
>>>>  int usb_enabled = 0;
>>>>  int smp_cpus = 1;
>>>> @@ -4039,6 +4042,9 @@ static void help(int exitcode)
>>>>            "-disable-opengl disable OpenGL rendering, using SDL"
>>>>  #endif
>>>>  #endif
>>>> +           "-vga_passthrough enable graphics card passthrough\n"
>>>> +           "-dom0-input     enable dom0 controlling qemu\n"
>>>> +           "-intel          use intel gfx\n"
>>>>            "-portrait       rotate graphical output 90 deg left (only PXA LCD)\n"
>>>>            "-vga [std|cirrus|vmware|none]\n"
>>>>            "                select video card type\n"
>>>> @@ -4275,6 +4281,9 @@ enum {
>>>>     QEMU_OPTION_domainname,
>>>>     QEMU_OPTION_acpi,
>>>>     QEMU_OPTION_vcpus,
>>>> +    QEMU_OPTION_vga_passthrough,
>>>> +    QEMU_OPTION_dom0_input,
>>>> +    QEMU_OPTION_intel,
>>>>
>>>>     /* Debug/Expert options: */
>>>>     QEMU_OPTION_serial,
>>>> @@ -4448,6 +4457,9 @@ static const QEMUOption qemu_options[] =
>>>>     { "pciemulation", HAS_ARG, QEMU_OPTION_pci_emulation },
>>>>     { "vncunused", 0, QEMU_OPTION_vncunused },
>>>>     { "vcpus", HAS_ARG, QEMU_OPTION_vcpus },
>>>> +    { "vga_passthrough", 0, QEMU_OPTION_vga_passthrough },
>>>> +    { "dom0-input", HAS_ARG, QEMU_OPTION_dom0_input },
>>>> +    { "intel", 0, QEMU_OPTION_intel },
>>>>  #if defined(CONFIG_XEN) && !defined(CONFIG_DM)
>>>>     { "xen-domid", HAS_ARG, QEMU_OPTION_xen_domid },
>>>>     { "xen-create", 0, QEMU_OPTION_xen_create },
>>>> @@ -5281,6 +5293,15 @@ int main(int argc, char **argv, char **e
>>>>             case QEMU_OPTION_disable_opengl:
>>>>                 opengl_enabled = 0;
>>>>                 break;
>>>> +            case QEMU_OPTION_vga_passthrough:
>>>> +                vga_passthrough = 1;
>>>> +                break;
>>>> +            case QEMU_OPTION_dom0_input:
>>>> +                dom0_input = optarg;
>>>> +                break;
>>>> +            case QEMU_OPTION_intel:
>>>> +                intel = 1;
>>>> +                break;
>>>>             case QEMU_OPTION_direct_pci:
>>>>                direct_pci = optarg;
>>>>                 break;
>>>> @@ -5876,6 +5897,14 @@ int main(int argc, char **argv, char **e
>>>>             fprintf(stderr, "fatal: -nographic can't be used with -curses\n");
>>>>             exit(1);
>>>>         }
>>>> +
>>>> +#ifdef CONFIG_DM
>>>> +        if(vga_passthrough)
>>>> +            fprintf(stderr, "Replace if initializing dom0_driver\n" );
>>>> +#else
>>>> +        dumb_display_init(ds);
>>>> +#endif
>>>> +
>>>>     } else {
>>>>  #if defined(CONFIG_CURSES)
>>>>             if (curses) {
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/ioemu-remote/xen-hooks.mak b/tools/ioemu-remote/xen-hooks.mak
>>>> --- a/tools/ioemu-remote/xen-hooks.mak  2009-06-07 21:14:47.000000000 -0400
>>>> +++ b/tools/ioemu-remote/xen-hooks.mak  2009-06-07 19:04:12.000000000 -0400
>>>> @@ -35,6 +35,7 @@ OBJS += exec-dm.o
>>>>  OBJS += pci_emulation.o
>>>>  OBJS += helper2.o
>>>>  OBJS += battery_mgmt.o
>>>> +OBJS += intel.o
>>>>
>>>>  ifdef CONFIG_STUBDOM
>>>>  CPPFLAGS += $(TARGET_CPPFLAGS) -DNEED_CPU_H \
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_hvm_build.c b/tools/libxc/xc_hvm_build.c
>>>> --- a/tools/libxc/xc_hvm_build.c        2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/libxc/xc_hvm_build.c        2009-06-07 19:04:12.000000000 -0400
>>>> @@ -1,7 +1,3 @@
>>>> -/******************************************************************************
>>>> - * xc_hvm_build.c
>>>> - */
>>>> -
>>>>  #include <stddef.h>
>>>>  #include <inttypes.h>
>>>>  #include <stdlib.h>
>>>> @@ -66,6 +62,82 @@ static void build_hvm_info(void *hvm_inf
>>>>     hvm_info->checksum = -sum;
>>>>  }
>>>>
>>>> +static int init_vgabios(int            xc_handle,
>>>> +                        uint32_t       dom,
>>>> +                        unsigned char *buffer,
>>>> +                        uint32_t       bios_size)
>>>> +{
>>>> +    char                *va_bios = NULL;
>>>> +    uint32_t            va_size = 0;
>>>> +
>>>> +    va_size = bios_size + bios_size % XC_PAGE_SIZE;
>>>> +    va_bios = xc_map_foreign_range(xc_handle, dom, va_size,
>>>> +                                   PROT_READ | PROT_WRITE, 0xC0);
>>>> +    if (!va_bios)
>>>> +    {
>>>> +        IPRINTF("Unable to map vga bios!\n");
>>>> +        return -1;
>>>> +    }
>>>> +
>>>> +    if ( buffer != NULL)
>>>> +        memcpy(va_bios, buffer, bios_size);
>>>> +    else
>>>> +        memset(va_bios, 0, bios_size);
>>>> +
>>>> +    munmap(va_bios, va_size);
>>>> +    return 0;
>>>> +}
>>>> +
>>>> +static int  setup_vga_pt(int            xc_handle,
>>>> +                         uint32_t       dom)
>>>> +{
>>>> +    int                 rc = 0;
>>>> +    unsigned char       *bios = NULL;
>>>> +    int                 bios_size = 0;
>>>> +    char                *c = NULL;
>>>> +    char                checksum = 0;
>>>> +
>>>> +    IPRINTF("Setting up vga passthrough.\n");
>>>> +
>>>> +    /* Allocated 64K for the vga bios */
>>>> +    if (!(bios = malloc(64 * 1024))) {
>>>> +        IPRINTF("Error allocating memory for vga bios.\n");
>>>> +        return -1;
>>>> +    }
>>>> +
>>>> +#ifdef __linux__
>>>> +    bios_size = xc_get_vgabios(bios, 64 * 1024);
>>>> +#else
>>>> +    bios_size = 0;
>>>> +#endif /* __linux__ */
>>>> +
>>>> +    if (bios_size == 0)
>>>> +    {
>>>> +        IPRINTF("vga bios size is 0!\n");
>>>> +        rc = -1;
>>>> +        goto error;
>>>> +    }
>>>> +
>>>> +    /* Adjust the bios checksum */
>>>> +    for ( c = (char*)bios; c < ((char*)bios + bios_size); c++ )
>>>> +        checksum += *c;
>>>> +    if (checksum)
>>>> +        bios[bios_size - 1] -= checksum;
>>>> +    init_vgabios(xc_handle, dom, bios, bios_size);
>>>> +
>>>> +error:
>>>> +    free(bios);
>>>> +
>>>> +    if( rc == -1 ) {
>>>> +        IPRINTF("Error setting up vga passthrough.\n");
>>>> +    }
>>>> +    else {
>>>> +        IPRINTF("Success setting up vga passthrough.\n");
>>>> +    }
>>>> +
>>>> +    return rc;
>>>> +}
>>>> +
>>>>  static int loadelfimage(
>>>>     struct elf_binary *elf, int xch, uint32_t dom, unsigned long *parray)
>>>>  {
>>>> @@ -381,7 +453,8 @@ int xc_hvm_build_target_mem(int xc_handl
>>>>                            uint32_t domid,
>>>>                            int memsize,
>>>>                            int target,
>>>> -                           const char *image_name)
>>>> +                           const char *image_name,
>>>> +                           int vga_pt_enabled)
>>>>  {
>>>>     char *image;
>>>>     int  sts;
>>>> @@ -392,6 +465,12 @@ int xc_hvm_build_target_mem(int xc_handl
>>>>         return -1;
>>>>
>>>>     sts = xc_hvm_build_internal(xc_handle, domid, memsize, target, image, image_size);
>>>> +    if ( vga_pt_enabled ) {
>>>> +        sts |= setup_vga_pt(xc_handle, domid);
>>>> +    } else {
>>>> +        sts |= init_vgabios(xc_handle, domid, NULL, 0x800);
>>>> +    }
>>>> +
>>>>
>>>>     free(image);
>>>>
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xc_linux.c b/tools/libxc/xc_linux.c
>>>> --- a/tools/libxc/xc_linux.c    2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/libxc/xc_linux.c    2009-06-07 19:04:12.000000000 -0400
>>>> @@ -562,6 +562,57 @@ int xc_gnttab_set_max_grants(int xcg_han
>>>>     return 0;
>>>>  }
>>>>
>>>> +int xc_get_vgabios(unsigned char        *buf,
>>>> +                   int                  len)
>>>> +{
>>>> +    int         mem;
>>>> +    uint32_t    start, size = 0;
>>>> +    uint16_t    magic = 0;
>>>> +
>>>> +    start = 0xC0000;
>>>> +    if (len < size)
>>>> +        return 0;
>>>> +    if ((mem = open("/dev/mem", O_RDONLY)) < 0)
>>>> +        return 0;
>>>> +
>>>> +    /*
>>>> +    ** Check if it a real bios extension.
>>>> +    ** The magic number is 0xAA55.
>>>> +    */
>>>> +    if (start != lseek(mem, start, SEEK_SET))
>>>> +        goto out;
>>>> +    if (read(mem, &magic, 2) != 2)
>>>> +        goto out;
>>>> +    if (magic != 0xAA55)
>>>> +        goto out;
>>>> +
>>>> +    /* Find the size of the rom extension */
>>>> +    if (start != lseek(mem, start, SEEK_SET))
>>>> +        goto out;
>>>> +    if (lseek(mem, 2, SEEK_CUR) != (start + 2))
>>>> +        goto out;
>>>> +    if (read(mem, &size, 1) != 1)
>>>> +        goto out;
>>>> +    /* This size is in 512K */
>>>> +    size *= 512;
>>>> +
>>>> +    /*
>>>> +    ** Set the file to the begining of the rombios,
>>>> +    ** to start the copy.
>>>> +    */
>>>> +    if (start != lseek(mem, start, SEEK_SET))
>>>> +    {
>>>> +        size = 0;
>>>> +        goto out;
>>>> +    }
>>>> +    if (size != read(mem, buf, size))
>>>> +        size = 0;
>>>> +
>>>> +out:
>>>> +    close(mem);
>>>> +    return size;
>>>> +}
>>>> +
>>>>  /*
>>>>  * Local variables:
>>>>  * mode: C
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
>>>> --- a/tools/libxc/xenctrl.h     2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/libxc/xenctrl.h     2009-06-07 19:04:12.000000000 -0400
>>>> @@ -145,6 +145,10 @@ int xc_waitdomain(
>>>>     int *status,
>>>>     int options);
>>>>
>>>> +int xc_get_vgabios(
>>>> +    unsigned char       *bios,
>>>> +    int                 len);
>>>> +
>>>>  #endif /* __linux__ */
>>>>
>>>>  /*
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/libxc/xenguest.h b/tools/libxc/xenguest.h
>>>> --- a/tools/libxc/xenguest.h    2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/libxc/xenguest.h    2009-06-07 19:04:12.000000000 -0400
>>>> @@ -134,7 +134,8 @@ int xc_hvm_build_target_mem(int xc_handl
>>>>                             uint32_t domid,
>>>>                             int memsize,
>>>>                             int target,
>>>> -                            const char *image_name);
>>>> +                            const char *image_name,
>>>> +                            int vga_pt_enabled);
>>>>
>>>>  int xc_hvm_build_mem(int xc_handle,
>>>>                      uint32_t domid,
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
>>>> --- a/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/python/xen/lowlevel/xc/xc.c 2009-06-07 19:04:12.000000000 -0400
>>>> @@ -890,21 +890,21 @@ static PyObject *pyxc_hvm_build(XcObject
>>>>     int i;
>>>>  #endif
>>>>     char *image;
>>>> -    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
>>>> +    int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1, vga_pt = 0;
>>>>
>>>>     static char *kwd_list[] = { "domid",
>>>>                                 "memsize", "image", "target", "vcpus", "acpi",
>>>> -                                "apic", NULL };
>>>> -    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiii", kwd_list,
>>>> +                                "apic", "vga_pt", NULL };
>>>> +    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iis|iiiii", kwd_list,
>>>>                                       &dom, &memsize, &image, &target, &vcpus,
>>>> -                                      &acpi, &apic) )
>>>> +                                      &acpi, &apic, &vga_pt) )
>>>>         return NULL;
>>>>
>>>>     if ( target == -1 )
>>>>         target = memsize;
>>>>
>>>>     if ( xc_hvm_build_target_mem(self->xc_handle, dom, memsize,
>>>> -                                 target, image) != 0 )
>>>> +                                 target, image, vga_pt) != 0 )
>>>>         return pyxc_error_to_exception();
>>>>
>>>>  #if !defined(__ia64__)
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py
>>>> --- a/tools/python/xen/xend/image.py    2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/python/xen/xend/image.py    2009-06-07 19:04:12.000000000 -0400
>>>> @@ -279,6 +279,9 @@ class ImageHandler:
>>>>         vnc_config = {}
>>>>         has_vnc = int(vmConfig['platform'].get('vnc', 0)) != 0
>>>>         has_sdl = int(vmConfig['platform'].get('sdl', 0)) != 0
>>>> +        has_vga_passthrough = int(vmConfig['platform'].get('vga_passthrough', 0)) != 0
>>>> +        has_intel = int(vmConfig['platform'].get('intel', 0)) != 0
>>>> +
>>>>         opengl = 1
>>>>         keymap = vmConfig['platform'].get("keymap")
>>>>         for dev_uuid in vmConfig['console_refs']:
>>>> @@ -302,7 +305,7 @@ class ImageHandler:
>>>>             ret.append("-k")
>>>>             ret.append(keymap)
>>>>
>>>> -        if has_vnc:
>>>> +        if has_vnc and not has_vga_passthrough:
>>>>             if not vnc_config:
>>>>                 for key in ('vncunused', 'vnclisten', 'vncdisplay',
>>>>                             'vncpasswd'):
>>>> @@ -353,6 +356,15 @@ class ImageHandler:
>>>>
>>>>         if int(vmConfig['platform'].get('monitor', 0)) != 0:
>>>>             ret = ret + ['-monitor', 'vc']
>>>> +
>>>> +        if has_vga_passthrough:
>>>> +            ret.append('-vga_passthrough')
>>>> +            dom0_input = str(vmConfig['platform'].get('dom0_input'))
>>>> +            ret = ret + ['-dom0-input', dom0_input]
>>>> +
>>>> +        if has_intel:
>>>> +            ret.append('-intel')
>>>> +
>>>>         return ret
>>>>
>>>>     def getDeviceModelArgs(self, restore = False):
>>>> @@ -754,7 +766,9 @@ class HVMImageHandler(ImageHandler):
>>>>         self.apic = int(vmConfig['platform'].get('apic', 0))
>>>>         self.acpi = int(vmConfig['platform'].get('acpi', 0))
>>>>         self.guest_os_type = vmConfig['platform'].get('guest_os_type')
>>>> -
>>>> +        self.vga_pt = int(vmConfig['platform'].get('vga_passthrough', 0))
>>>> +        self.dom0_input = str(vmConfig['platform'].get('dom0_input'))
>>>> +        self.intel = int(vmConfig['platform'].get('intel', 0))
>>>>
>>>>     # Return a list of cmd line args to the device models based on the
>>>>     # xm config file
>>>> @@ -869,6 +883,7 @@ class HVMImageHandler(ImageHandler):
>>>>         log.debug("vcpus          = %d", self.vm.getVCpuCount())
>>>>         log.debug("acpi           = %d", self.acpi)
>>>>         log.debug("apic           = %d", self.apic)
>>>> +        log.debug("vga_pt         = %d", self.vga_pt)
>>>>
>>>>         rc = xc.hvm_build(domid          = self.vm.getDomid(),
>>>>                           image          = self.loader,
>>>> @@ -876,7 +891,8 @@ class HVMImageHandler(ImageHandler):
>>>>                           target         = mem_mb,
>>>>                           vcpus          = self.vm.getVCpuCount(),
>>>>                           acpi           = self.acpi,
>>>> -                          apic           = self.apic)
>>>> +                          apic           = self.apic,
>>>> +                          vga_pt         = self.vga_pt)
>>>>         rc['notes'] = { 'SUSPEND_CANCEL': 1 }
>>>>
>>>>         rc['store_mfn'] = xc.hvm_get_param(self.vm.getDomid(),
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py
>>>> --- a/tools/python/xen/xend/XendConfig.py       2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/python/xen/xend/XendConfig.py       2009-06-07 19:04:12.000000000 -0400
>>>> @@ -171,6 +171,9 @@ XENAPI_PLATFORM_CFG_TYPES = {
>>>>     'pci_msitranslate': int,
>>>>     'pci_power_mgmt': int,
>>>>     'xen_platform_pci': int,
>>>> +    'vga_passthrough': int,
>>>> +    'dom0_input': str,
>>>> +    'intel': int,
>>>>  }
>>>>
>>>>  # Xen API console 'other_config' keys.
>>>> diff -rupN --ignore-blank-lines-X diffignore a/tools/python/xen/xm/create.py b/tools/python/xen/xm/create.py
>>>> --- a/tools/python/xen/xm/create.py     2009-06-07 20:44:47.000000000 -0400
>>>> +++ b/tools/python/xen/xm/create.py     2009-06-07 19:04:12.000000000 -0400
>>>> @@ -618,6 +618,18 @@ gopts.var('xen_platform_pci', val='0|1',
>>>>            fn=set_int, default=1,
>>>>            use="Is xen_platform_pci used?")
>>>>
>>>> +gopts.var('vga_passthrough', val='0|1',
>>>> +           fn=set_int, default=None,
>>>> +           use="Enable the passthrough for the graphic card.")
>>>> +
>>>> +gopts.var('dom0_input', val='DOM0_INPUT',
>>>> +           fn=set_value, default=None,
>>>> +           use="Input arguments for dom0 driver")
>>>> +
>>>> +gopts.var('intel', val='INTEL',
>>>> +           fn=set_int, default=None,
>>>> +           use="Use Intel GFX.")
>>>> +
>>>>  def err(msg):
>>>>     """Print an error to stderr and exit.
>>>>     """
>>>> @@ -932,7 +944,8 @@ def configure_hvm(config_image, vals):
>>>>              'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci', 'hpet',
>>>>              'guest_os_type', 'hap', 'opengl', 'cpuid', 'cpuid_check',
>>>>              'viridian', 'xen_extended_power_mgmt', 'pci_msitranslate',
>>>> -             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci' ]
>>>> +             'vpt_align', 'pci_power_mgmt', 'xen_platform_pci',
>>>> +             'vga_passthrough', 'dom0_input', 'intel' ]
>>>>
>>>>     for a in args:
>>>>         if a in vals.__dict__ and vals.__dict__[a] is not None:
>>>>
>>>> _______________________________________________
>>>> Xen-devel mailing list
>>>> Xen-devel@lists.xensource.com
>>>> http://lists.xensource.com/xen-devel
>>>>
>>>>
>>> Where did this patch come from? I plan to try using a ati card with a
>>> windows domU this week but first I need to port this patch to 2.6.29,
>>> before I start I want to make sure I am working with the latest
>>> version of the patch.
>>>
>>> Andy
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
  2009-06-08 14:25                   ` Beng Heng, Ng
@ 2009-06-08 16:11                     ` Jean Guyader
  2009-06-08 16:15                       ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Jean Guyader @ 2009-06-08 16:11 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: Andrew Lyon, Xen-devel

2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
> Uses the driver included in the patch to initialize the graphics card.
> This is my own flag. I'm not sure what Jean's plans are.

The intel code for qemu you've found is not made for that.

Jean

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

* Re: Experimental results for VGA passthrough
  2009-06-08 16:11                     ` Jean Guyader
@ 2009-06-08 16:15                       ` Beng Heng, Ng
  2009-06-08 16:19                         ` Beng Heng, Ng
  2009-06-09 16:05                         ` Jean Guyader
  0 siblings, 2 replies; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 16:15 UTC (permalink / raw)
  To: Jean Guyader; +Cc: Andrew Lyon, Xen-devel

Could you elaborate? Thanks.

- Beng Heng

Jean Guyader wrote:
> 2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>> Uses the driver included in the patch to initialize the graphics card.
>> This is my own flag. I'm not sure what Jean's plans are.
> 
> The intel code for qemu you've found is not made for that.
> 
> Jean
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
  2009-06-08 16:15                       ` Beng Heng, Ng
@ 2009-06-08 16:19                         ` Beng Heng, Ng
  2009-06-09 22:28                           ` Jean Guyader
  2009-06-09 16:05                         ` Jean Guyader
  1 sibling, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 16:19 UTC (permalink / raw)
  To: Jean Guyader; +Cc: Andrew Lyon, Xen-devel

Also, you mentioned earlier that we need to return some fake values to
the host bridge. Would appreciate if you could explain, or refer me to
some writeups on this. Thanks.

- Beng Heng

Beng Heng, Ng wrote:
> Could you elaborate? Thanks.
> 
> - Beng Heng
> 
> Jean Guyader wrote:
>> 2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>>> Uses the driver included in the patch to initialize the graphics card.
>>> This is my own flag. I'm not sure what Jean's plans are.
>> The intel code for qemu you've found is not made for that.
>>
>> Jean
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
  2009-06-08 16:15                       ` Beng Heng, Ng
  2009-06-08 16:19                         ` Beng Heng, Ng
@ 2009-06-09 16:05                         ` Jean Guyader
  2009-06-09 17:44                           ` Beng Heng, Ng
  1 sibling, 1 reply; 28+ messages in thread
From: Jean Guyader @ 2009-06-09 16:05 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: Andrew Lyon, Xen-devel

Sure. intel is like SDL or VNC, it's another frontend driver for qemu
that render on the intel framebuffer directly.
We use that to display other vm when we gave the intel GPU to another vm.

Jean

2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
> Could you elaborate? Thanks.
>
> - Beng Heng
>
> Jean Guyader wrote:
>> 2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>>> Uses the driver included in the patch to initialize the graphics card.
>>> This is my own flag. I'm not sure what Jean's plans are.
>>
>> The intel code for qemu you've found is not made for that.
>>
>> Jean
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>

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

* Re: Experimental results for VGA passthrough
  2009-06-09 16:05                         ` Jean Guyader
@ 2009-06-09 17:44                           ` Beng Heng, Ng
  0 siblings, 0 replies; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-09 17:44 UTC (permalink / raw)
  To: Jean Guyader; +Cc: Xen-devel

Appreciate that. Thanks!

- Beng Heng

Jean Guyader wrote:
> Sure. intel is like SDL or VNC, it's another frontend driver for qemu
> that render on the intel framebuffer directly.
> We use that to display other vm when we gave the intel GPU to another vm.
> 
> Jean
> 

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

* Re: Experimental results for VGA passthrough
  2009-06-08 16:19                         ` Beng Heng, Ng
@ 2009-06-09 22:28                           ` Jean Guyader
  0 siblings, 0 replies; 28+ messages in thread
From: Jean Guyader @ 2009-06-09 22:28 UTC (permalink / raw)
  To: Beng Heng, Ng; +Cc: Andrew Lyon, Xen-devel

Yes, here are the value we need to fake and the raison why:
  - GMCH, when the vgabios execute at actually check this register in
the host bridge (bdf 0:0.0, offset 0x52). On the intel platform this
register is there to identify the amount of stolen memory and
therefore the supported resolution in legacy mode (VGA/VESA).
  - VID/DID. Linux check that. If it doesn't match with the graphic
card it doesn't reconise the chipset and doesn't create the agpgart.
  - OpRegion address. Not sure about this one, but when you
shutdown/sleep vista if this value is present the driver will try to
save some information in a ACPI NVS region.

All those register are public you can find some more information about
those here:
www.intel.com/Assets/PDF/datasheet/319970.pdf

Jean

2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
> Also, you mentioned earlier that we need to return some fake values to
> the host bridge. Would appreciate if you could explain, or refer me to
> some writeups on this. Thanks.
>
> - Beng Heng
>
> Beng Heng, Ng wrote:
>> Could you elaborate? Thanks.
>>
>> - Beng Heng
>>
>> Jean Guyader wrote:
>>> 2009/6/8 Beng Heng, Ng <bengheng@eecs.umich.edu>:
>>>> Uses the driver included in the patch to initialize the graphics card.
>>>> This is my own flag. I'm not sure what Jean's plans are.
>>> The intel code for qemu you've found is not made for that.
>>>
>>> Jean
>>>
>>> _______________________________________________
>>> Xen-devel mailing list
>>> Xen-devel@lists.xensource.com
>>> http://lists.xensource.com/xen-devel
>>
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>
>

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

* Re: Experimental results for VGA passthrough
  2009-06-08 21:08     ` Beng Heng, Ng
@ 2009-06-09  1:39       ` Beng Heng, Ng
  0 siblings, 0 replies; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-09  1:39 UTC (permalink / raw)
  Cc: xen-devel

Here's a very concise summary of my test results.

The gfx used were
- Intel GMA 4500
- ATI Radeon HD 2600 XT
- nVidia GeForce 9500 GT

Each card is set as the primary adapter in turn, and passed through to
DomU is attempted. The respective gfx drivers are installed if DomU
manages to boot up.

Gfx     Ubuntu64        XP               Vista
------------------------------------------------------
Intel   Hang            Low Res/Color    Low Res/Color
ATI     Hang            Normal           Normal
nVidia  Blank Screen    Blank Screen     Blank Screen

Would appreciate any comments or suggestions to perhaps improve the
above situation. Thanks.

- Beng Heng

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

* Re: Experimental results for VGA passthrough
  2009-06-08 20:59   ` Beng Heng, Ng
@ 2009-06-08 21:08     ` Beng Heng, Ng
  2009-06-09  1:39       ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 21:08 UTC (permalink / raw)
  To: djmagee; +Cc: xen-devel

Perhaps I should clarify that the low resolution with Intel driver is
observed in Windows XP. It works fine in Vista. I was able to run 3DMark
on Vista.

- Beng Heng

Beng Heng, Ng wrote:
> I noticed that Xen does not boot if only the Intel IGD is present and
> selected, i.e. only one graphics device.
> 
> Also, I'm not able to get high resolution if I passthrough Intel IGD and
> install the Intel Graphics Media Accelerator driver. Ironically, I can
> get higher resolution and color if I remove the driver. Has anyone
> encountered similar observations before?
> 
> - Beng Heng
> 
> djmagee@mageenet.net wrote:
>> The DQ45CB does not have enough PCI Express lanes to drive the IGD and a
>> x16 graphics card at the same time.
>>  
>> -----Original Message-----
>> From: xen-devel-bounces@lists.xensource.com
>> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Beng Heng,
>> Ng
>> Sent: Thursday, June 04, 2009 11:09 AM
>> To: xen-devel
>> Subject: [Xen-devel] Experimental results for VGA passthrough
>>
>> Hi,
>>
>> I tried patching Xen 3.4 Testing c/s 19628 with vga passthrough code
>> (less HID passthrough), and did some tests. I made some modifications in
>> pci_setup to skip loading the emulated VGA bios and pci_load_option_roms
>> to load the passthrough VGA bios. My setup uses Intel DQ45CB and ATI
>> HD2600XT.
>>
>> The BDFs for the relevant devices are:
>> Intel IGD  00:02.0
>> ATI gfx    01:00.0, 01:00.1
>> There's 2 BDFs for ATI because one of them is for the Audio. Both have
>> to be passed through simultaneously.
>>
>> In the first scenario, Intel IGD is set up as the primary for Dom0. The
>> ATI gfx is passed through to DomU. Interestingly, it is the screen that
>> is connected to Intel's output that displays DomU (albeit with few
>> colors and low resolution). However, in the Device Manager, ATI is
>> reported. I believe this is because Intel's address space is being
>> mapped, instead of ATI's. Shutting down DomU does not return the display
>> to Dom0. The display remains at the last screen showing DomU shutting
>> down. Except for the shutting down phase, I've recorded the observations
>> in the first attachment.
>>
>> In the second scenario, Intel IGD is passed through to DomU. The ATI gfx
>> is thus absent. However, when DomU is booted, there is an IOMMU page
>> fault. This is shown in the second attachment starting from Line 659.
>> The system subsequently hangs. Does anyone have an explanation to what's
>> going on in this case?
>>
>> So, VGA passthrough works, but seems extremely flaky. Any
>> comments/suggestions to correct the problems observed will be greatly
>> appreciated.
>>
>> Thanks.
>>
>> - Beng Heng
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: Experimental results for VGA passthrough
  2009-06-07 18:21 ` djmagee
@ 2009-06-08 20:59   ` Beng Heng, Ng
  2009-06-08 21:08     ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-08 20:59 UTC (permalink / raw)
  To: djmagee; +Cc: xen-devel

I noticed that Xen does not boot if only the Intel IGD is present and
selected, i.e. only one graphics device.

Also, I'm not able to get high resolution if I passthrough Intel IGD and
install the Intel Graphics Media Accelerator driver. Ironically, I can
get higher resolution and color if I remove the driver. Has anyone
encountered similar observations before?

- Beng Heng

djmagee@mageenet.net wrote:
> The DQ45CB does not have enough PCI Express lanes to drive the IGD and a
> x16 graphics card at the same time.
>  
> -----Original Message-----
> From: xen-devel-bounces@lists.xensource.com
> [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Beng Heng,
> Ng
> Sent: Thursday, June 04, 2009 11:09 AM
> To: xen-devel
> Subject: [Xen-devel] Experimental results for VGA passthrough
> 
> Hi,
> 
> I tried patching Xen 3.4 Testing c/s 19628 with vga passthrough code
> (less HID passthrough), and did some tests. I made some modifications in
> pci_setup to skip loading the emulated VGA bios and pci_load_option_roms
> to load the passthrough VGA bios. My setup uses Intel DQ45CB and ATI
> HD2600XT.
> 
> The BDFs for the relevant devices are:
> Intel IGD  00:02.0
> ATI gfx    01:00.0, 01:00.1
> There's 2 BDFs for ATI because one of them is for the Audio. Both have
> to be passed through simultaneously.
> 
> In the first scenario, Intel IGD is set up as the primary for Dom0. The
> ATI gfx is passed through to DomU. Interestingly, it is the screen that
> is connected to Intel's output that displays DomU (albeit with few
> colors and low resolution). However, in the Device Manager, ATI is
> reported. I believe this is because Intel's address space is being
> mapped, instead of ATI's. Shutting down DomU does not return the display
> to Dom0. The display remains at the last screen showing DomU shutting
> down. Except for the shutting down phase, I've recorded the observations
> in the first attachment.
> 
> In the second scenario, Intel IGD is passed through to DomU. The ATI gfx
> is thus absent. However, when DomU is booted, there is an IOMMU page
> fault. This is shown in the second attachment starting from Line 659.
> The system subsequently hangs. Does anyone have an explanation to what's
> going on in this case?
> 
> So, VGA passthrough works, but seems extremely flaky. Any
> comments/suggestions to correct the problems observed will be greatly
> appreciated.
> 
> Thanks.
> 
> - Beng Heng

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

* RE: Experimental results for VGA passthrough
  2009-06-04 15:09 Beng Heng, Ng
@ 2009-06-07 18:21 ` djmagee
  2009-06-08 20:59   ` Beng Heng, Ng
  0 siblings, 1 reply; 28+ messages in thread
From: djmagee @ 2009-06-07 18:21 UTC (permalink / raw)
  To: Beng Heng, Ng, xen-devel

The DQ45CB does not have enough PCI Express lanes to drive the IGD and a
x16 graphics card at the same time.
 
-----Original Message-----
From: xen-devel-bounces@lists.xensource.com
[mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Beng Heng,
Ng
Sent: Thursday, June 04, 2009 11:09 AM
To: xen-devel
Subject: [Xen-devel] Experimental results for VGA passthrough

Hi,

I tried patching Xen 3.4 Testing c/s 19628 with vga passthrough code
(less HID passthrough), and did some tests. I made some modifications in
pci_setup to skip loading the emulated VGA bios and pci_load_option_roms
to load the passthrough VGA bios. My setup uses Intel DQ45CB and ATI
HD2600XT.

The BDFs for the relevant devices are:
Intel IGD  00:02.0
ATI gfx    01:00.0, 01:00.1
There's 2 BDFs for ATI because one of them is for the Audio. Both have
to be passed through simultaneously.

In the first scenario, Intel IGD is set up as the primary for Dom0. The
ATI gfx is passed through to DomU. Interestingly, it is the screen that
is connected to Intel's output that displays DomU (albeit with few
colors and low resolution). However, in the Device Manager, ATI is
reported. I believe this is because Intel's address space is being
mapped, instead of ATI's. Shutting down DomU does not return the display
to Dom0. The display remains at the last screen showing DomU shutting
down. Except for the shutting down phase, I've recorded the observations
in the first attachment.

In the second scenario, Intel IGD is passed through to DomU. The ATI gfx
is thus absent. However, when DomU is booted, there is an IOMMU page
fault. This is shown in the second attachment starting from Line 659.
The system subsequently hangs. Does anyone have an explanation to what's
going on in this case?

So, VGA passthrough works, but seems extremely flaky. Any
comments/suggestions to correct the problems observed will be greatly
appreciated.

Thanks.

- Beng Heng

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

* Experimental results for VGA passthrough
@ 2009-06-04 15:09 Beng Heng, Ng
  2009-06-07 18:21 ` djmagee
  0 siblings, 1 reply; 28+ messages in thread
From: Beng Heng, Ng @ 2009-06-04 15:09 UTC (permalink / raw)
  To: xen-devel

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

Hi,

I tried patching Xen 3.4 Testing c/s 19628 with vga passthrough code
(less HID passthrough), and did some tests. I made some modifications in
pci_setup to skip loading the emulated VGA bios and pci_load_option_roms
to load the passthrough VGA bios. My setup uses Intel DQ45CB and ATI
HD2600XT.

The BDFs for the relevant devices are:
Intel IGD  00:02.0
ATI gfx    01:00.0, 01:00.1
There's 2 BDFs for ATI because one of them is for the Audio. Both have
to be passed through simultaneously.

In the first scenario, Intel IGD is set up as the primary for Dom0. The
ATI gfx is passed through to DomU. Interestingly, it is the screen that
is connected to Intel's output that displays DomU (albeit with few
colors and low resolution). However, in the Device Manager, ATI is
reported. I believe this is because Intel's address space is being
mapped, instead of ATI's. Shutting down DomU does not return the display
to Dom0. The display remains at the last screen showing DomU shutting
down. Except for the shutting down phase, I've recorded the observations
in the first attachment.

In the second scenario, Intel IGD is passed through to DomU. The ATI gfx
is thus absent. However, when DomU is booted, there is an IOMMU page
fault. This is shown in the second attachment starting from Line 659.
The system subsequently hangs. Does anyone have an explanation to what's
going on in this case?

So, VGA passthrough works, but seems extremely flaky. Any
comments/suggestions to correct the problems observed will be greatly
appreciated.

Thanks.

- Beng Heng


[-- Attachment #2: 03062009.mp4 --]
[-- Type: video/mp4, Size: 3806848 bytes --]

[-- Attachment #3: vgapt.log --]
[-- Type: text/plain, Size: 40823 bytes --]


AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
Login incorrect

login:  __  __            _____ _  _    _             _                   
 \ \/ /___ _ __   |___ /| || |  / |   _ __ ___/ |   _ __  _ __ ___ 
  \  // _ \ '_ \    |_ \| || |_ | |__| '__/ __| |__| '_ \| '__/ _ \
  /  \  __/ | | |  ___) |__   _|| |__| | | (__| |__| |_) | | |  __/
 /_/\_\___|_| |_| |____(_) |_|(_)_|  |_|  \___|_|  | .__/|_|  \___|
                                                   |_|             
(XEN) Xen version 3.4.1-rc1-pre (root@xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) Thu Jun  4 01:37:06 EDT 2009
(XEN) Latest ChangeSet: Mon Jun 01 14:56:17 2009 +0100 19628:29d7e3522cc5
(XEN) Command line: loglvl=all guest_loglvl=all dom0_mem=1G com1=115200,8n1 console=com1 iommu=1
(XEN) Video information:
(XEN)  VGA is text mode 80x25, font 8x16
(XEN)  VBE/DDC methods: V2; EDID transfer time: 1 seconds
(XEN) Disc information:
(XEN)  Found 0 MBR signatures
(XEN)  Found 1 EDD information structures
(XEN) Xen-e820 RAM map:
(XEN)  0000000000000000 - 000000000009e800 (usable)
(XEN)  000000000009e800 - 00000000000a0000 (reserved)
(XEN)  00000000000e0000 - 0000000000100000 (reserved)
(XEN)  0000000000100000 - 000000007d6c1000 (usable)
(XEN)  000000007d6c1000 - 000000007d704000 (ACPI NVS)
(XEN)  000000007d704000 - 000000007d826000 (reserved)
(XEN)  000000007d826000 - 000000007d83a000 (ACPI NVS)
(XEN)  000000007d83a000 - 000000007d93c000 (reserved)
(XEN)  000000007d93c000 - 000000007d93d000 (ACPI NVS)
(XEN)  000000007d93d000 - 000000007d942000 (reserved)
(XEN)  000000007d942000 - 000000007d94c000 (ACPI data)
(XEN)  000000007d94c000 - 000000007d967000 (ACPI NVS)
(XEN)  000000007d967000 - 000000007d986000 (reserved)
(XEN)  000000007d986000 - 000000007d98c000 (ACPI NVS)
(XEN)  000000007d98c000 - 000000007db00000 (usable)
(XEN)  000000007dc00000 - 0000000080000000 (reserved)
(XEN)  00000000fed1c000 - 00000000fed20000 (reserved)
(XEN)  00000000ff000000 - 0000000100000000 (reserved)
(XEN)  0000000100000000 - 000000017c000000 (usable)
(XEN) System RAM: 3991MB (4087628kB)
(XEN) ACPI: RSDP 000F03C0, 0024 (r2  INTEL)
(XEN) ACPI: XSDT 7D94AE18, 005C (r1 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: FACP 7D949D98, 00F4 (r4  INTEL    A M I  6222004 MSFT    10013)
(XEN) ACPI: DSDT 7D942018, 6818 (r1 INTEL  DQ45CB         4F INTL 20051117)
(XEN) ACPI: FACS 7D952F40, 0040
(XEN) ACPI: APIC 7D949F18, 006C (r2 INTEL  DQ45CB         4F MSFT    10013)
(XEN) ACPI: MCFG 7D954E18, 003C (r1 INTEL  DQ45CB         4F MSFT       97)
(XEN) ACPI: ASF! 7D953D18, 00A0 (r32 INTEL  DQ45CB         4F TFSM    F4240)
(XEN) ACPI: SPCR 7D954D18, 0050 (r1 INTEL  DQ45CB         4F AMI.        3)
(XEN) ACPI: TCPA 7D954C98, 0032 (r2 INTEL  DQ45CB         4F MSFT  1000013)
(XEN) ACPI: DMAR 7D93CC18, 0110 (r1 INTEL  DQ45CB         4F INTL        1)
(XEN) NUMA turned off
(XEN) Faking a node at 0000000000000000-000000017c000000
(XEN) Domain heap initialised
(XEN) DMI 2.4 present.
(XEN) Using APIC driver default
(XEN) ACPI: PM-Timer IO Port: 0x408
(XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[404,0], pm1x_evt[400,0]
(XEN) ACPI:                  wakeup_vec[7d952f4c], vec_size[20]
(XEN) ACPI: Local APIC address 0xfee00000
(XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
(XEN) Processor #0 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
(XEN) Processor #1 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
(XEN) Processor #2 7:7 APIC version 20
(XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
(XEN) Processor #3 7:7 APIC version 20
(XEN) ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
(XEN) IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
(XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
(XEN) ACPI: IRQ0 used by override.
(XEN) ACPI: IRQ2 used by override.
(XEN) ACPI: IRQ9 used by override.
(XEN) Enabling APIC mode:  Flat.  Using 1 I/O APICs
(XEN) [VT-D]dmar.c:485: Host address width 36
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed90000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1b.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed91000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed92000
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:3.3
(XEN) [VT-D]dmar.c:494: found ACPI_DMAR_DRHD
(XEN) [VT-D]dmar.c:349: dmaru->address = fed93000
(XEN) [VT-D]dmar.c:358: found INCLUDE_ALL
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1d.7
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.0
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.1
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.2
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:1a.7
(XEN) [VT-D]dmar.c:498: found ACPI_DMAR_RMRR
(XEN) [VT-D]dmar.c:300: found endpoint: bdf = 0:2.0
(XEN) Intel VT-d DMAR tables have been parsed.
(XEN) Using ACPI (MADT) for SMP configuration information
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Initializing CPU#0
(XEN) Detected 2499.782 MHz processor.
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 0
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN) HVM: VMX enabled
(XEN) Intel machine check reporting enabled on CPU#0.
(XEN) CPU0: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU0 has no CMCI support
(XEN) CPU0: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 1/1 eip 8c000
(XEN) Initializing CPU#1
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 1
(XEN) Intel machine check reporting enabled on CPU#1.
(XEN) CPU1: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU1 has no CMCI support
(XEN) CPU1: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 2/2 eip 8c000
(XEN) Initializing CPU#2
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 2
(XEN) Intel machine check reporting enabled on CPU#2.
(XEN) CPU2: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU2 has no CMCI support
(XEN) CPU2: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Booting processor 3/3 eip 8c000
(XEN) Initializing CPU#3
(XEN) CPU: L1 I cache: 32K, L1 D cache: 32K
(XEN) CPU: L2 cache: 3072K
(XEN) CPU: Physical Processor ID: 0
(XEN) CPU: Processor Core ID: 3
(XEN) Intel machine check reporting enabled on CPU#3.
(XEN) CPU3: Thermal monitoring enabled (TM2)
(XEN) CMCI: CPU3 has no CMCI support
(XEN) CPU3: Intel(R) Core(TM)2 Quad  CPU   Q9300  @ 2.50GHz stepping 07
(XEN) Total of 4 processors activated.
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1
(XEN) checking TSC synchronization across 4 CPUs: passed.
(XEN) Platform timer is 3.579MHz ACPI PM Timer
(XEN) microcode.c:73:d32767 microcode: CPU1 resumed
(XEN) Brought up 4 CPUs
(XEN) microcode.c:73:d32767 microcode: CPU2 resumed
(XEN) microcode.c:73:d32767 microcode: CPU3 resumed
(XEN) Intel VT-d Snoop Control not supported.
(XEN) Intel VT-d DMA Passthrough not supported.
(XEN) Intel VT-d Queued Invalidation not supported.
(XEN) Intel VT-d Interrupt Remapping not supported.
(XEN) I/O virtualisation enabled
(XEN) I/O virtualisation for PV guests disabled
(XEN) CPUIDLE: disabled due to no HPET. Force enable with 'cpuidle'.
(XEN) ACPI sleep modes: S3
(XEN) mcheck_poll: Machine check polling timer started.
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:3.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:19.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 0:1b.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.3
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1f.5
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.0
(XEN) [VT-D]iommu.c:1245:d32767 domain_context_mapping:PCIe: bdf = 1:0.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:0.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 2:1.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1d.7
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.0
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.1
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.2
(XEN) [VT-D]iommu.c:1252:d32767 domain_context_mapping:PCI: bdf = 0:1a.7
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff57000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff55000
(XEN) [VT-D]iommu.c:620: iommu_enable_translation: iommu->reg = ffff828bfff54000
(XEN) *** LOADING DOMAIN 0 ***
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80200000 memsz=0x49ef18
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8069f000 memsz=0xf82b8
(XEN) elf_parse_binary: phdr: paddr=0xffffffff80798000 memsz=0xc0d
(XEN) elf_parse_binary: phdr: paddr=0xffffffff8079a000 memsz=0xe2da8
(XEN) elf_parse_binary: memory: 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) elf_xen_parse_note: GUEST_OS = "linux"
(XEN) elf_xen_parse_note: GUEST_VERSION = "2.6"
(XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0"
(XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000
(XEN) elf_xen_parse_note: PADDR_OFFSET = 0xffffffff80000000
(XEN) elf_xen_parse_note: ENTRY = 0xffffffff80200000
(XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff80206000
(XEN) elf_xen_parse_note: unknown xen elf note (0xd)
(XEN) elf_xen_parse_note: FEATURES = "writable_page_tables|writable_descriptor_tables|auto_translated_physmap|pae_pgdir_above_4gb|supervisor_mode_kernel"
(XEN) elf_xen_parse_note: LOADER = "generic"
(XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1
(XEN) elf_xen_addr_calc_check: addresses:
(XEN)     virt_base        = 0xffffffff80000000
(XEN)     elf_paddr_offset = 0xffffffff80000000
(XEN)     virt_offset      = 0x0
(XEN)     virt_kstart      = 0xffffffff80200000
(XEN)     virt_kend        = 0xffffffff8087cda8
(XEN)     virt_entry       = 0xffffffff80200000
(XEN)     p2m_base         = 0xffffffffffffffff
(XEN)  Xen  kernel: 64-bit, lsb, compat32
(XEN)  Dom0 kernel: 64-bit, lsb, paddr 0xffffffff80200000 -> 0xffffffff8087cda8
(XEN) PHYSICAL MEMORY ARRANGEMENT:
(XEN)  Dom0 alloc.:   0000000174000000->0000000176000000 (253952 pages to be allocated)
(XEN) VIRTUAL MEMORY ARRANGEMENT:
(XEN)  Loaded kernel: ffffffff80200000->ffffffff8087cda8
(XEN)  Init. ramdisk: ffffffff8087d000->ffffffff80fc0000
(XEN)  Phys-Mach map: ffffffff80fc0000->ffffffff811c0000
(XEN)  Start info:    ffffffff811c0000->ffffffff811c04b4
(XEN)  Page tables:   ffffffff811c1000->ffffffff811ce000
(XEN)  Boot stack:    ffffffff811ce000->ffffffff811cf000
(XEN)  TOTAL:         ffffffff80000000->ffffffff81400000
(XEN)  ENTRY ADDRESS: ffffffff80200000
(XEN) Dom0 has maximum 4 VCPUs
(XEN) elf_load_binary: phdr 0 at 0xffffffff80200000 -> 0xffffffff8069ef18
(XEN) elf_load_binary: phdr 1 at 0xffffffff8069f000 -> 0xffffffff807972b8
(XEN) elf_load_binary: phdr 2 at 0xffffffff80798000 -> 0xffffffff80798c0d
(XEN) elf_load_binary: phdr 3 at 0xffffffff8079a000 -> 0xffffffff807e0088
(XEN) Scrubbing Free RAM: .............................done.
(XEN) Xen trace buffers: disabled
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen)
(XEN) Freed 128kB init memory.
kernel direct mapping tables up to 40800000 @ 11ce000-13d5000
Bootdata ok (command line is root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0))
Linux version 2.6.18.8-xen0 (root@xxx.xxx.xxx.xxx) (gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) ) #1 SMP Wed Jun 3 20:45:36 EDT 2009
BIOS-provided physical RAM map:
 Xen: 0000000000000000 - 0000000040800000 (usable)
DMI 2.4 present.
No mptable found.
  >>> ERROR: Invalid checksum
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled)
ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled)
ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled)
ACPI: IOAPIC (id[0x00] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 0, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
Setting APIC routing to xen
Using ACPI (MADT) for SMP configuration information
Allocating PCI resources starting at 88000000 (gap: 80000000:7ed1c000)
Built 1 zonelists.  Total pages: 260580
Kernel command line: root=UUID=c1a25e24-42d5-42ae-b1ec-9475ae1da2b1 ro xencons=ttyS console=tty0 console=ttyS0 pciback.hide=(00:02.0)
Initializing CPU#0
PID hash table entries: 4096 (order: 12, 32768 bytes)
Xen reported: 2499.718 MHz processor.
Console: colour VGA+ 80x25
Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes)
Inode-cache hash table entries: 65536 (order: 7, 524288 bytes)
Software IO TLB enabled: 
 Aperture:     64 megabytes
 Kernel range: ffff880002407000 - ffff880006407000
 Address size: 27 bits
PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
Memory: 947704k/1056768k available (4024k kernel code, 100700k reserved, 1625k data, 216k init)
Calibrating delay using timer specific routine.. 5000.84 BogoMIPS (lpj=25004222)
Mount-cache hash table entries: 256
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 0
SMP alternatives: switching to UP code
ACPI: Core revision 20060707
SMP alternatives: switching to SMP code
Initializing CPU#1
Initializing CPU#2
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 1
Brought up 4 CPUs
Initializing CPU#3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 3
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 3072K
CPU: Physical Processor ID: 0
CPU: Processor Core ID: 2
migration_cost=33
checking if image is initramfs... it is
Freeing initrd memory: 7436k freed
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: BIOS Bug: MCFG area at e0000000 is not E820-reserved
PCI: Not using MMCONFIG.
PCI: Using configuration type 1
ACPI: Interpreter enabled
ACPI: Using IOAPIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Transparent bridge - 0000:00:1e.0
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs *3 4 5 6 7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 *7 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKH] (IRQs *3 4 5 6 7 10 11 12 14 15)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
(XEN) io_apic.c:2139: 
(XEN) ioapic_guest_write: apic=0, pin=4, old_irq=4, new_irq=4
(XEN) ioapic_guest_write: old_entry=000009f1, new_entry=000109f1
(XEN) ioapic_guest_write: Attempt to modify IO-APIC pin for in-use IRQ!
pnp: PnP ACPI: found 10 devices
xen_mem: Initialising balloon driver.
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
pnp: 00:02: ioport range 0xa20-0xa3f has been reserved
pnp: 00:02: ioport range 0xa00-0xa1f has been reserved
pnp: 00:02: ioport range 0xb78-0xb7f has been reserved
pnp: 00:02: ioport range 0xf78-0xf7f has been reserved
pnp: 00:09: ioport range 0x400-0x47f could not be reserved
pnp: 00:09: ioport range 0x1180-0x119f has been reserved
pnp: 00:09: ioport range 0x500-0x57f has been reserved
(XEN) PCI add device 00:00.0
(XEN) PCI add device 00:01.0
(XEN) PCI add device 00:02.0
pciback 0000:00:02.0: seizing device
(XEN) PCI add device 00:03.0
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:03.3
(XEN) PCI add device 00:19.0
(XEN) PCI add device 00:1a.0
(XEN) PCI add device 00:1a.1
(XEN) PCI add device 00:1a.2
(XEN) PCI add device 00:1a.7
(XEN) PCI add device 00:1b.0
(XEN) PCI add device 00:1d.0
(XEN) PCI add device 00:1d.1
(XEN) PCI add device 00:1d.2
(XEN) PCI add device 00:1d.7
(XEN) PCI add device 00:1e.0
(XEN) PCI add device 00:1f.0
(XEN) PCI add device 00:1f.2
(XEN) PCI add device 00:1f.3
(XEN) PCI add device 00:1f.5
(XEN) PCI add device 01:00.0
(XEN) PCI add device 01:00.1
(XEN) PCI add device 02:00.0
(XEN) PCI add device 02:01.0
PCI: Ignore bogus resource 6 [0:0] of 0000:00:02.0
PCI: Bridge: 0000:00:01.0
  IO window: c000-cfff
  MEM window: c0000000-d00fffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1e.0
  IO window: b000-bfff
  MEM window: d0800000-d08fffff
  PREFETCH window: 88000000-880fffff
GSI 16 sharing vector 0xB0 and IRQ 16
ACPI: PCI Interrupt 0000:00:01.0[A] -> GSI 16 (level, low) -> IRQ 16
NET: Registered protocol family 2
IP route cache hash table entries: 32768 (order: 6, 262144 bytes)
TCP established hash table entries: 131072 (order: 9, 2097152 bytes)
TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
TCP reno registered
IA-32 Microcode Update Driver: v1.14a-xen <tigran@veritas.com>
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
0000:00:1a.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
0000:00:1d.7 EHCI: BIOS handoff failed (BIOS bug ?) 01010001
floppy0: Unable to grab DMA2 for the floppy driver
floppy0: no floppy controllers found
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
HP CISS Driver (v 3.6.10)
Intel(R) PRO/1000 Network Driver - version 7.1.9-k4
Copyright (c) 1999-2006 Intel Corporation.
(XEN) PCI add device 02:00.0
GSI 17 sharing vector 0xB8 and IRQ 17
ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 21 (level, low) -> IRQ 17
e1000: 0000:02:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:34:34:a8
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000e: Intel(R) PRO/1000 Network Driver - 0.3.3.3-k4
e1000e: Copyright (c) 1999-2008 Intel Corporation.
(XEN) PCI add device 00:19.0
GSI 18 sharing vector 0xC0 and IRQ 18
ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 18
eth1: (PCI Express:2.5GB/s:Width x1) 00:1c:c0:7d:61:d7
eth1: Intel(R) PRO/1000 Network Connection
eth1: MAC: 7, PHY: 8, PBA No: ffffff-0ff
pcnet32.c:v1.32 18.Mar.2006 tsbogend@alpha.franken.de
e100: Intel(R) PRO/100 Network Driver, 3.5.10-k2-NAPI
e100: Copyright(c) 1999-2005 Intel Corporation
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Xen virtual console successfully installed as ttyS0
Event-channel device installed.
blktap_device_init: blktap device major 254
blktap_ring_init: blktap ring major: 253
netfront: Initialising virtual ethernet driver.
ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16
ACPI: PCI interrupt for device 0000:00:02.0 disabled
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
(XEN) PCI add device 00:03.2
(XEN) PCI add device 00:1f.5
Adaptec aacraid driver (1.1-5[2409]-mh2)
3ware Storage Controller device driver for Linux v1.26.02.001.
(XEN) PCI add device 00:1f.2
GSI 19 sharing vector 0xD0 and IRQ 19
ACPI: PCI Interrupt 0000:00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq led clo pio slum part 
ata1: SATA max UDMA/133 cmd 0xFFFFC2000002A100 ctl 0x0 bmdma 0x0 irq 254
ata2: SATA max UDMA/133 cmd 0xFFFFC2000002A180 ctl 0x0 bmdma 0x0 irq 254
ata3: SATA max UDMA/133 cmd 0xFFFFC2000002A200 ctl 0x0 bmdma 0x0 irq 254
ata4: SATA max UDMA/133 cmd 0xFFFFC2000002A280 ctl 0x0 bmdma 0x0 irq 254
ata5: SATA max UDMA/133 cmd 0xFFFFC2000002A300 ctl 0x0 bmdma 0x0 irq 254
ata6: SATA max UDMA/133 cmd 0xFFFFC2000002A380 ctl 0x0 bmdma 0x0 irq 254
scsi0 : ahci
ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
ata1.00: ATA-8, max UDMA/133, 976773168 sectors: LBA48 NCQ (depth 31/32)
ata1.00: ata1: dev 0 multi count 16
ata1.00: configured for UDMA/133
scsi1 : ahci
ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata2.00: ATAPI, max UDMA/100
ata2.00: configured for UDMA/100
scsi2 : ahci
ata3: SATA link down (SStatus 0 SControl 300)
scsi3 : ahci
ata4: SATA link down (SStatus 0 SControl 300)
scsi4 : ahci
ata5: SATA link down (SStatus 0 SControl 300)
scsi5 : ahci
ata6: SATA link down (SStatus 0 SControl 300)
  Vendor: ATA       Model: WDC WD5001AALS-0  Rev: 01.0
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: TSSTcorp  Model: CDDVDW SH-S223Q   Rev: SB00
  Type:   CD-ROM                             ANSI SCSI revision: 05
(XEN) PCI add device 00:1f.5
ata_piix 0000:00:1f.5: MAP [ P0 -- P1 -- ]
ACPI: PCI Interrupt 0000:00:1f.5[B] -> GSI 19 (level, low) -> IRQ 19
ata7: SATA max UDMA/133 cmd 0xD170 ctl 0xD162 bmdma 0xD130 irq 19
ata8: SATA max UDMA/133 cmd 0xD150 ctl 0xD142 bmdma 0xD138 irq 19
scsi6 : ata_piix
ATA: abnormal status 0x7F on port 0xD177
scsi7 : ata_piix
ATA: abnormal status 0x7F on port 0xD157
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 976773168 512-byte hdwr sectors (500108 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
sd 0:0:0:0: Attached scsi disk sda
Fusion MPT base driver 3.04.01
Copyright (c) 1999-2005 LSI Logic Corporation
Fusion MPT SPI Host driver 3.04.01
usbmon: debugfs is not available
USB Universal Host Controller Interface driver v3.0
(XEN) PCI add device 00:1a.0
ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16
uhci_hcd 0000:00:1a.0: UHCI Host Controller
uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
uhci_hcd 0000:00:1a.0: irq 16, io base 0x0000d0e0
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.1
ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 17
uhci_hcd 0000:00:1a.1: UHCI Host Controller
uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 2
uhci_hcd 0000:00:1a.1: irq 17, io base 0x0000d0c0
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
(XEN) PCI add device 00:1a.2
GSI 20 sharing vector 0x21 and IRQ 20
ACPI: PCI Interrupt 0000:00:1a.2[C] -> GSI 18 (level, low) -> IRQ 20
uhci_hcd 0000:00:1a.2: UHCI Host Controller
uhci_hcd 0000:00:1a.2: new USB bus registered, assigned bus number 3
uhci_hcd 0000:00:1a.2: irq 20, io base 0x0000d0a0
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.0
GSI 21 sharing vector 0x29 and IRQ 21
ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 21
uhci_hcd 0000:00:1d.0: UHCI Host Controller
uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 4
uhci_hcd 0000:00:1d.0: irq 21, io base 0x0000d080
usb usb4: configuration #1 chosen from 1 choice
hub 4-0:1.0: USB hub found
hub 4-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.1
ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19
uhci_hcd 0000:00:1d.1: UHCI Host Controller
uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 5
uhci_hcd 0000:00:1d.1: irq 19, io base 0x0000d060
usb usb5: configuration #1 chosen from 1 choice
hub 5-0:1.0: USB hub found
hub 5-0:1.0: 2 ports detected
(XEN) PCI add device 00:1d.2
ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 20
uhci_hcd 0000:00:1d.2: UHCI Host Controller
uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 6
uhci_hcd 0000:00:1d.2: irq 20, io base 0x0000d040
usb usb6: configuration #1 chosen from 1 choice
hub 6-0:1.0: USB hub found
hub 6-0:1.0: 2 ports detected
usb 3-1: new full speed USB device using uhci_hcd and address 2
usb 3-1: configuration #1 chosen from 1 choice
hub 3-1:1.0: USB hub found
hub 3-1:1.0: 4 ports detected
usb 3-1.1: new low speed USB device using uhci_hcd and address 3
usb 3-1.1: configuration #1 chosen from 1 choice
input: HID 04f3:0801 as /class/input/input0
input: USB HID v1.10 Keyboard [HID 04f3:0801] on usb-0000:00:1a.2-1.1
input: HID 04f3:0801 as /class/input/input1
input: USB HID v1.10 Mouse [HID 04f3:0801] on usb-0000:00:1a.2-1.1
usbcore: registered new driver usbhid
/usr/src/xen-3.4-testing.19628.vgapt.2/linux-2.6.18-xen.hg/drivers/usb/input/hid-core.c: v2.6:USB HID core driver
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
mice: PS/2 mouse device common for all mice
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
device-mapper: ioctl: 4.7.0-ioctl (2006-06-24) initialised: dm-devel@redhat.com
TCP bic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Bridge firewalling registered
PCI IO multiplexer device installed.
ACPI: (supports S0 S1 S3 S4 S5)
BIOS EDD facility v0.16 2004-Jun-25, 1 devices found
Freeing unused kernel memory: 216k freed
Mounting proc filesystem
Mounting sysfs filesystem
Creating /dev
Creating initial device nodes
Loading /lib/kbd/keymaps/i386/qwerty/us.map
Setting up hotplug.
Creating block device nodes.
Creating character device nodes.
Creating root device.
Mounting root filesystem.
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting.  Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Setting up other filesystems.
Switching to new root and running init.
		Welcome to Fedora 
		Press 'I' to enter interactive startup.
Starting udev: G[  OK  ]
Setting hostname xxx.xxx.xxx.xxx:  [  OK  ]
Jun 04 10:15:48 | DM multipath kernel driver not loaded
Setting up Logical Volume Management: File descriptor 7 left open
[  OK  ]
Checking filesystems
Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/sda2 
/: clean, 2579435/6111232 files, 12471113/24418800 blocks
[  OK  ]
Remounting root filesystem in read-write mode:  [  OK  ]
Mounting local filesystems:  mount: special device UUID=4405-A494 does not exist
FATAL: Module fuse not found.
ntfs-3g-mount: fuse device is missing, try 'modprobe fuse' as root
[FAILED]
Enabling local filesystem quotas:  quotaon: Warning: No quota format detected in the kernel.
[  OK  ]
Enabling /etc/fstab swaps:  swapon: /proc/swaps: unexpected file format
[  OK  ]
Entering non-interactive startup
Applying Intel CPU microcode update: FATAL: Module microcode not found.
[  OK  ]ERROR: Module microcode does not exist in /proc/modules

ip6tables: Applying firewall rules: FATAL: Module ip6_tables not found.
ip6tables-restore v1.4.1.1: ip6tables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
[FAILED]
iptables: Applying firewall rules: FATAL: Module ip_tables not found.
iptables-restore v1.4.1.1: iptables-restore: unable to initialize table 'filter'

Error occurred at line: 3
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[FAILED]
Starting auditd: [FAILED]
Starting system logger: [  OK  ]
Starting irqbalance: [  OK  ]
Starting rpcbind: [  OK  ]
Starting NFS statd: [FAILED]
Starting RPC idmapd: FATAL: Module sunrpc not found.
FATAL: Error running install command for sunrpc
Error: RPC MTAB does not exist.
Starting system message bus: [  OK  ]
Starting HAL daemon: [  OK  ]
Setting network parameters... [  OK  ]
Starting NetworkManager daemon: [  OK  ]
Starting portreserve: [  OK  ]
Starting Bluetooth services:[  OK  ]
Starting sendmail: [  OK  ]
Starting sm-client: [  OK  ]
Starting console mouse services: [  OK  ]
Starting httpd: [  OK  ]
Starting crond: [  OK  ][  OK  ]
Starting kerneloops:[  OK  ]
Starting atd: [  OK  ][  OK  ]
Starting Avahi daemon... [  OK  ]
Starting cups: [  OK  ]
Starting anacron: [  OK  ]
Starting sshd: [  OK  ]

Fedora release 10 (Cambridge)
Kernel 2.6.18.8-xen0 on an x86_64 (ttyS0)

xxx.xxx.xxx.xxx login: (XEN) [VT-D]iommu.c:1364:d0 domain_context_unmap:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 7e000000 REASON 2 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 7e000
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 1f0
(XEN)     l2[1f0] = 0
(XEN)     l2[1f0] not present
(XEN) [VT-D]iommu.c:1252:d0 domain_context_mapping:PCI: bdf = 0:2.0
(XEN) [VT-D]io.c:251:d0 VT-d irq bind: m_irq = 10 device = 2 intx = 0
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3b0 f_mport=3b0 np=b
(XEN) domctl.c:886:d0 ioport_map:add f_gport=3c0 f_mport=3c0 np=20
(XEN) domctl.c:835:d0 memory_map:add: gfn=a0 mfn=a0 nr_mfns=20
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) [VT-D]iommu.c:722: iommu_page_fault: iommu->reg = ffff828bfff56000
(XEN) [VT-D]iommu.c:691: iommu_fault_status: Fault Overflow
(XEN) [VT-D]iommu.c:694: iommu_fault_status: Primary Pending Fault
(XEN) [VT-D]iommu.c:676: iommu_fault:DMA Write: 0:2.0 addr 6c1ba000 REASON 5 iommu->reg = ffff828bfff56000
(XEN) print_vtd_entries: iommu = ffff83017bfe2600 bdf = 0:2:0 gmfn = 6c1ba
(XEN)     root_entry = ffff83017bfb8000
(XEN)     root_entry[0] = 17763a001
(XEN)     context = ffff83017763a000
(XEN)     context[10] = 201_17635a001
(XEN)     l3 = ffff83017635a000
(XEN)     l3_index = 1
(XEN)     l3[1] = 12ae77003
(XEN)     l2 = ffff83012ae77000
(XEN)     l2_index = 160
(XEN)     l2[160] = 0
(XEN)     l2[160] not present
(XEN) Assertion '(sp == 0) || (peoi[sp-1].vector < vector)' failed at irq.c:322
(XEN) ----[ Xen-3.4.1-rc1-pre  x86_64  debug=y  Not tainted ]----
(XEN) CPU:    0
(XEN) RIP:    e008:[<ffff828c80147b5f>] do_IRQ+0x11d/0x42e
(XEN) RFLAGS: 0000000000010046   CONTEXT: hypervisor
(XEN) rax: 00000000000000b8   rbx: ffff828c802b4100   rcx: 0000000000000001
(XEN) rdx: ffff828c80239340   rsi: 0000000000000001   rdi: 00000000000000b8
(XEN) rbp: ffff828c80287da8   rsp: ffff828c80287d48   r8:  0000000000000002
(XEN) r9:  0000000000000004   r10: ffff828c802c5360   r11: 000000206772e721
(XEN) r12: ffff828c80287db8   r13: ffff828c80118de9   r14: ffff8301776222f0
(XEN) r15: ffff83017bfe22f0   cr0: 0000000080050033   cr4: 00000000000026f0
(XEN) cr3: 000000016e01e000   cr2: 000000000089aba0
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff828c80287d48:
(XEN)    0000000000000001 0000000000000010 00007d737fd78277 ffff828c802b4124
(XEN)    000000b8000000b8 ffff828c802b4100 00000000000000b8 ffff828c80239180
(XEN)    0000000000000000 ffff828c80118de9 ffff83017bfe22f8 ffff83017bfe22f0
(XEN)    00007d737fd78227 ffff828c80141406 ffff83017bfe22f0 ffff83017bfe22f8
(XEN)    ffff828c80118de9 0000000000000000 ffff828c80287e88 ffff828c80239180
(XEN)    000000206772e721 ffff828c802c5360 0000000000000004 0000000000000002
(XEN)    0000000000000000 0000000000000002 ffff828c802c5440 ffff828c80239120
(XEN)    ffff828c80239180 000000b800000000 ffff828c8011b46a 000000000000e008
(XEN)    0000000000000246 ffff828c80287e60 0000000000000000 ffff828c8011d13d
(XEN)    0000000000000002 ffff828c80239120 0000002065a91d8f ffff828c80239180
(XEN)    ffff828c80287ed8 ffff828c8011d26d ffff828c80287ea8 ffff828c80239180
(XEN)    ffff83017bfe22f0 0000000000000000 0000000001154820 ffff828c80287f28
(XEN)    ffff828c8029e900 ffff828c8029f900 ffff828c80287f18 ffff828c8011b29f
(XEN)    ffff83007d4fe000 ffff83007d4fe000 0000000001154820 0000000001154820
(XEN)    00002b5875a9e538 0000000000000000 00007d737fd780b7 ffff828c801d0296
(XEN)    0000000000000000 00002b5875a9e538 0000000001154820 0000000001154820
(XEN)    0000000000000000 00002b5875a9e538 0000000000000000 0000003a92d6da70
(XEN)    0000003aacd1aebc 0000000000000000 0000000001154820 0000003aacf6e940
(XEN)    0000000000000000 00002b5875a9e520 00002b5875a9e538 0000009800000000
(XEN)    0000003aaccd9727 000000000000e033 0000000000000246 00002b5875a9e4c8
(XEN) Xen call trace:
(XEN)    [<ffff828c80147b5f>] do_IRQ+0x11d/0x42e
(XEN)    [<ffff828c80141406>] common_interrupt+0x26/0x30
(XEN)    [<ffff828c8011b46a>] _spin_unlock_irq+0x22/0x23
(XEN)    [<ffff828c8011d26d>] timer_softirq_action+0x10c/0x350
(XEN)    [<ffff828c8011b29f>] do_softirq+0x6f/0x80
(XEN)    
(XEN) 
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) Assertion '(sp == 0) || (peoi[sp-1].vector < vector)' failed at irq.c:322
(XEN) ****************************************
(XEN) 
(XEN) Reboot in five seconds...
(XEN) Resetting with ACPI MEMORY or I/O RESET_REG.

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

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

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

end of thread, other threads:[~2009-06-09 22:28 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-04 17:09 Experimental results for VGA passthrough Beng Heng, Ng
2009-06-04 17:43 ` Jean Guyader
2009-06-04 18:27   ` Beng Heng, Ng
     [not found]     ` <f68b66460906041220w243c4982pe0b485347f13fa50@mail.gmail.com>
     [not found]       ` <4A2820D0.3010301@eecs.umich.edu>
     [not found]         ` <f68b66460906041241y4a5bbdaax99761a87d05ad5cb@mail.gmail.com>
2009-06-05  1:30           ` Beng Heng, Ng
2009-06-05  6:55             ` Jean Guyader
2009-06-05 23:00               ` Beng Heng, Ng
2009-06-05 23:01                 ` Beng Heng, Ng
2009-06-06  9:59                   ` Jean Guyader
2009-06-06 22:40                     ` Beng Heng, Ng
2009-06-07  3:07       ` Beng Heng, Ng
2009-06-07  3:42         ` Jun Koi
2009-06-08  5:36           ` Beng Heng, Ng
2009-06-08  8:29             ` Andrew Lyon
2009-06-08 13:51               ` Beng Heng, Ng
2009-06-08 14:09                 ` Beng Heng, Ng
2009-06-08 14:19                 ` Andrew Lyon
2009-06-08 14:25                   ` Beng Heng, Ng
2009-06-08 16:11                     ` Jean Guyader
2009-06-08 16:15                       ` Beng Heng, Ng
2009-06-08 16:19                         ` Beng Heng, Ng
2009-06-09 22:28                           ` Jean Guyader
2009-06-09 16:05                         ` Jean Guyader
2009-06-09 17:44                           ` Beng Heng, Ng
  -- strict thread matches above, loose matches on Subject: below --
2009-06-04 15:09 Beng Heng, Ng
2009-06-07 18:21 ` djmagee
2009-06-08 20:59   ` Beng Heng, Ng
2009-06-08 21:08     ` Beng Heng, Ng
2009-06-09  1:39       ` Beng Heng, Ng

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.