xen-2015-09-08-tag
The following changes since commit 8611280505119e296757a60711a881341603fa5a:
target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-2015-09-08-tag
for you to fetch changes up to ba2250ad148997b1352aba976aac66b55410e7e4:
xen/pt: Use XEN_PT_LOG properly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)
----------------------------------------------------------------
Xen branch xen-2015-09-08
----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreq
Jan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handling
Konrad Rzeszutek Wilk (7):
xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting xen/pt: Update comments with proper function name.
xen/pt: Make xen_pt_msi_set_enable static
xen/pt: xen_host_pci_config_read returns -errno, not -1 on failure
xen: use errno instead of rc for xc_domain_add_to_physmap xen/pt/msi: Add the register value when printing logging and error messages xen/pt: Use XEN_PT_LOG properly to guard against compiler warnings.
Michael S. Tsirkin (1):
i440fx: make types configurable at run-time
Tiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough
hw/pci-assign: split pci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work
igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge
xen, gfx passthrough: register host bridge specific to passthrough xen, gfx passthrough: add opregion mapping
configure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-) create mode 100644 hw/i386/pci-assign-load-rom.c create mode 100644 hw/xen/xen_pt_graphics.c create mode 100644 include/hw/pci/pci-assign.h
[Qemu-devel] [PULL 01/19] xen-hvm: Add trace to ioreq
From: Don Slutz <[email protected]>
--- trace-events | 7 +++++++ xen-hvm.c | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+)
trace-events +7 -0
@@ -936,6 +936,13 @@ xen_map_portio_range(uint32_t id, uint64_t start_addr, uint64_t end_addr) "id: % xen_unmap_portio_range(uint32_t id, uint64_t start_addr, uint64_t end_addr) "id: %u start: %#"PRIx64" end: %#"PRIx64 xen_map_pcidev(uint32_t id, uint8_t bus, uint8_t dev, uint8_t func) "id: %u bdf: %02x.%02x.%02x" xen_unmap_pcidev(uint32_t id, uint8_t bus, uint8_t dev, uint8_t func) "id: %u bdf: %02x.%02x.%02x" +handle_ioreq(void *req, uint32_t type, uint32_t dir, uint32_t df, uint32_t data_is_ptr, uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O=%p type=%d dir=%d df=%d ptr=%d port=%#"PRIx64" data=%#"PRIx64" count=%d size=%d" +handle_ioreq_read(void *req, uint32_t type, uint32_t df, uint32_t data_is_ptr, uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O=%p read type=%d df=%d ptr=%d port=%#"PRIx64" data=%#"PRIx64" count=%d size=%d" +handle_ioreq_write(void *req, uint32_t type, uint32_t df, uint32_t data_is_ptr, uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O=%p write type=%d df=%d ptr=%d port=%#"PRIx64" data=%#"PRIx64" count=%d size=%d" +cpu_ioreq_pio(void *req, uint32_t dir, uint32_t df, uint32_t data_is_ptr, uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O=%p pio dir=%d df=%d ptr=%d port=%#"PRIx64" data=%#"PRIx64" count=%d size=%d" +cpu_ioreq_pio_read_reg(void *req, uint64_t data, uint64_t addr, uint32_t size) "I/O=%p pio read reg data=%#"PRIx64" port=%#"PRIx64" size=%d" +cpu_ioreq_pio_write_reg(void *req, uint64_t data, uint64_t addr, uint32_t size) "I/O=%p pio write reg data=%#"PRIx64" port=%#"PRIx64" size=%d" +cpu_ioreq_move(void *req, uint32_t dir, uint32_t df, uint32_t data_is_ptr, uint64_t addr, uint64_t data, uint32_t count, uint32_t size) "I/O=%p copy dir=%d df=%d ptr=%d port=%#"PRIx64" data=%#"PRIx64" count=%d size=%d" # xen-mapcache.c xen_map_cache(uint64_t phys_addr) "want %#"PRIx64
xen-hvm.c +21 -0
@@ -814,9 +814,14 @@ static void cpu_ioreq_pio(ioreq_t *req) {uint32_t i; +trace_cpu_ioreq_pio (req, req->dir, req->df, req->data_is_ptr, req->addr, + req->data, req->count, req->size); +if (req->dir ==IOREQ_READ ) {if (!req->data_is_ptr) { req->data =do_inp (req->addr, req->size); +trace_cpu_ioreq_pio_read_reg (req, req->data, req->addr, + req->size); }else {uint32_t tmp;
@@ -827,6 +832,8 @@ static void cpu_ioreq_pio(ioreq_t *req) } }else if (req->dir ==IOREQ_WRITE ) {if (!req->data_is_ptr) { +trace_cpu_ioreq_pio_write_reg (req, req->data, req->addr, + req->size);do_outp (req->addr, req->size, req->data); }else {for (i =0 ; i < req->count; i++) {
@@ -843,6 +850,9 @@ static void cpu_ioreq_move(ioreq_t *req) {uint32_t i; +trace_cpu_ioreq_move (req, req->dir, req->df, req->data_is_ptr, req->addr, + req->data, req->count, req->size); +if (!req->data_is_ptr) {if (req->dir ==IOREQ_READ ) {for (i =0 ; i < req->count; i++) {
@@ -915,11 +925,18 @@ static void handle_vmport_ioreq(XenIOState *state, ioreq_t *req)static void handle_ioreq (XenIOState *state,ioreq_t *req) { +trace_handle_ioreq (req, req->type, req->dir, req->df, req->data_is_ptr, + req->addr, req->data, req->count, req->size); +if (!req->data_is_ptr && (req->dir ==IOREQ_WRITE ) && (req->size <sizeof (target_ulong))) { req->data &= ((target_ulong )1 << (8 * req->size)) -1 ; } +if (req->dir ==IOREQ_WRITE ) +trace_handle_ioreq_write (req, req->type, req->df, req->data_is_ptr, + req->addr, req->data, req->count, req->size); +switch (req->type) {case IOREQ_TYPE_PIO :cpu_ioreq_pio (req);
@@ -959,6 +976,10 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)default :hw_error ("Invalid ioreq type 0x%x\n" , req->type); } +if (req->dir ==IOREQ_READ ) { +trace_handle_ioreq_read (req, req->type, req->df, req->data_is_ptr, + req->addr, req->data, req->count, req->size); + } }static int handle_buffered_iopage (XenIOState *state)
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 02/19] i440fx: make types configurable at run-time
In reply to Stefano StabelliniFrom: "Michael S. Tsirkin" <[email protected]>
IGD passthrough wants to supply a different pci and host devices, inheriting i440fx devices. Make types configurable.
--- hw/i386/pc_piix.c | 4 +++- hw/pci-host/piix.c | 9 ++++----- include/hw/i386/pc.h | 6 +++++- 3 files changed, 12 insertions(+), 7 deletions(-)
hw/i386/pc_piix.c +3 -1
@@ -196,7 +196,9 @@ static void pc_init1(MachineState *machine) }if (pci_enabled) { - pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi, + pci_bus = i440fx_init(TYPE_I440FX_PCI_HOST_BRIDGE, + TYPE_I440FX_PCI_DEVICE, + &i440fx_state, &piix3_devfn, &isa_bus, gsi, system_memory, system_io, machine->ram_size, pcms->below_4g_mem_size, pcms->above_4g_mem_size,
hw/pci-host/piix.c +4 -5
@@ -40,7 +40,6 @@* http://download.intel.com/design/chipsets/datashts/29054901.pdf */ -#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"#define I440FX_PCI_HOST_BRIDGE (obj) \ OBJECT_CHECK(I440FXState, (obj), TYPE_I440FX_PCI_HOST_BRIDGE)
@@ -95,7 +94,6 @@ typedef struct PIIX3State {#define PIIX3_PCI_DEVICE (obj) \ OBJECT_CHECK(PIIX3State, (obj), TYPE_PIIX3_PCI_DEVICE) -#define TYPE_I440FX_PCI_DEVICE "i440FX"#define I440FX_PCI_DEVICE (obj) \ OBJECT_CHECK(PCII440FXState, (obj), TYPE_I440FX_PCI_DEVICE)
@@ -305,7 +303,8 @@ static void i440fx_realize(PCIDevice *dev, Error **errp) dev->config[I440FX_SMRAM ] =0x02 ; } -PCIBus *i440fx_init(PCII440FXState **pi440fx_state, +PCIBus *i440fx_init(const char *host_type, const char *pci_type, + PCII440FXState **pi440fx_state, int *piix3_devfn, ISABus **isa_bus, qemu_irq *pic, MemoryRegion *address_space_mem,
@@ -325,7 +324,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,unsigned i;I440FXState *i440fx; - dev =qdev_create (NULL ,TYPE_I440FX_PCI_HOST_BRIDGE ); + dev =qdev_create (NULL , host_type); s =PCI_HOST_BRIDGE (dev); b =pci_bus_new (dev,NULL , pci_address_space, address_space_io,0 ,TYPE_PCI_BUS );
@@ -333,7 +332,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state,object_property_add_child (qdev_get_machine (),"i440fx" ,OBJECT (dev),NULL );qdev_init_nofail (dev); - d =pci_create_simple (b,0 ,TYPE_I440FX_PCI_DEVICE ); + d =pci_create_simple (b,0 , pci_type); *pi440fx_state =I440FX_PCI_DEVICE (d); f = *pi440fx_state; f->system_memory = address_space_mem;
include/hw/i386/pc.h +5 -1
@@ -219,7 +219,11 @@ extern int no_hpet;struct PCII440FXState ;typedef struct PCII440FXState PCII440FXState ; -PCIBus *i440fx_init(PCII440FXState **pi440fx_state, int *piix_devfn, +#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost" +#define TYPE_I440FX_PCI_DEVICE "i440FX" + +PCIBus *i440fx_init(const char *host_type, const char *pci_type, + PCII440FXState **pi440fx_state, int *piix_devfn, ISABus **isa_bus, qemu_irq *pic, MemoryRegion *address_space_mem, MemoryRegion *address_space_io,
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 03/19] pc_init1: pass parameters just with types
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
Pass types to configure pc_init1().
--- hw/i386/pc_piix.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
hw/i386/pc_piix.c +8 -6
@@ -76,7 +76,8 @@ static bool has_reserved_memory = true;static bool kvmclock_enabled = true;/* PC hardware initialisation */ -static void pc_init1 (MachineState *machine) +static void pc_init1 (MachineState *machine, +const char *host_type,const char *pci_type) {PCMachineState *pcms =PC_MACHINE (machine);MemoryRegion *system_memory =get_system_memory ();
@@ -196,8 +197,8 @@ static void pc_init1(MachineState *machine) }if (pci_enabled) { - pci_bus = i440fx_init(TYPE_I440FX_PCI_HOST_BRIDGE, - TYPE_I440FX_PCI_DEVICE, + pci_bus = i440fx_init(host_type, + pci_type, &i440fx_state, &piix3_devfn, &isa_bus, gsi, system_memory, system_io, machine->ram_size, pcms->below_4g_mem_size,
@@ -416,7 +417,7 @@ static void pc_init_isa(MachineState *machine) }x86_cpu_compat_kvm_no_autoenable (FEAT_KVM ,1 <<KVM_FEATURE_PV_EOI );enable_compat_apic_id_mode (); -pc_init1 (machine); +pc_init1 (machine,TYPE_I440FX_PCI_HOST_BRIDGE ,TYPE_I440FX_PCI_DEVICE ); }#ifdef CONFIG_XEN
@@ -424,7 +425,7 @@ static void pc_xen_hvm_init(MachineState *machine) {PCIBus *bus; -pc_init1 (machine); +pc_init1 (machine,TYPE_I440FX_PCI_HOST_BRIDGE ,TYPE_I440FX_PCI_DEVICE ); bus =pci_find_primary_bus ();if (bus !=NULL ) {
@@ -440,7 +441,8 @@ static void pc_xen_hvm_init(MachineState *machine)if (compat) { \compat (machine); \ } \ -pc_init1 (machine); \ +pc_init1 (machine,TYPE_I440FX_PCI_HOST_BRIDGE , \ +TYPE_I440FX_PCI_DEVICE ); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn)
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 04/19] piix: create host bridge to passthrough
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
Implement a pci host bridge specific to passthrough. Actually this just inherits the standard one. And we also just expose a minimal real host bridge pci configuration subset.
--- hw/pci-host/piix.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/hw/i386/pc.h | 2 ++ 2 files changed, 84 insertions(+)
hw/pci-host/piix.c +82 -0
@@ -739,6 +739,87 @@ static const TypeInfo i440fx_info = { .class_init = i440fx_class_init, }; +/* IGD Passthrough Host Bridge. */ +typedef struct { +uint8_t offset; +uint8_t len; +}IGDHostInfo ; + +/* Here we just expose minimal host bridge offset subset. */ +static const IGDHostInfo igd_host_bridge_infos[] = { + {0x08 ,2 },/* revision id */ + {0x2c ,2 },/* sybsystem vendor id */ + {0x2e ,2 },/* sybsystem id */ + {0x50 ,2 },/* SNB: processor graphics control register */ + {0x52 ,2 },/* processor graphics control register */ + {0xa4 ,4 },/* SNB: graphics base of stolen memory */ + {0xa8 ,4 },/* SNB: base of GTT stolen memory */ +}; + +static int host_pci_config_read (int pos,int len,uint32_t val) +{ +char path[PATH_MAX ]; +int config_fd; +ssize_t size =sizeof (path); +/* Access real host bridge. */ +int rc =snprintf (path, size,"/sys/bus/pci/devices/%04x:%02x:%02x.%d/%s" , +0 ,0 ,0 ,0 ,"config" ); + +if (rc >= size || rc <0 ) { +return -ENODEV ; + } + + config_fd =open (path,O_RDWR ); +if (config_fd <0 ) { +return -ENODEV ; + } + +do { + rc =pread (config_fd, (uint8_t *)&val, len, pos); + }while (rc <0 && (errno ==EINTR || errno ==EAGAIN )); +if (rc != len) { +return -errno; + } + +return 0 ; +} + +static int igd_pt_i440fx_initfn (struct PCIDevice *pci_dev) +{ +uint32_t val =0 ; +int rc, i, num; +int pos, len; + + num =ARRAY_SIZE (igd_host_bridge_infos); +for (i =0 ; i < num; i++) { + pos = igd_host_bridge_infos[i].offset; + len = igd_host_bridge_infos[i].len; + rc =host_pci_config_read (pos, len, val); +if (rc) { +return -ENODEV ; + } +pci_default_write_config (pci_dev, pos, val, len); + } + +return 0 ; +} + +static void igd_passthrough_i440fx_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); +PCIDeviceClass *k =PCI_DEVICE_CLASS (klass); + + k->init = igd_pt_i440fx_initfn; + dc->desc ="IGD Passthrough Host bridge" ; +} + +static const TypeInfo igd_passthrough_i440fx_info = { + .name =TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE , + .parent =TYPE_I440FX_PCI_DEVICE , + .instance_size =sizeof (PCII440FXState), + .class_init = igd_passthrough_i440fx_class_init, +}; +static const char *i440fx_pcihost_root_bus_path (PCIHostState *host_bridge,PCIBus *rootbus) {
@@ -780,6 +861,7 @@ static const TypeInfo i440fx_pcihost_info = {static void i440fx_register_types (void ) {type_register_static (&i440fx_info); +type_register_static (&igd_passthrough_i440fx_info);type_register_static (&piix3_pci_type_info);type_register_static (&piix3_info);type_register_static (&piix3_xen_info);
include/hw/i386/pc.h +2 -0
@@ -222,6 +222,8 @@ typedef struct PCII440FXState PCII440FXState;#define TYPE_I440FX_PCI_HOST_BRIDGE "i440FX-pcihost"#define TYPE_I440FX_PCI_DEVICE "i440FX" +#define TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE "igd-passthrough-i440FX" + PCIBus *i440fx_init(const char *host_type, const char *pci_type, PCII440FXState **pi440fx_state, int *piix_devfn, ISABus **isa_bus, qemu_irq *pic,
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 05/19] hw/pci-assign: split pci-assign.c
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
We will try to reuse assign_dev_load_option_rom in xen side, and especially its a good beginning to unify pci assign codes both on kvm and xen in the future.
--- hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++++-------------------------------- hw/i386/pci-assign-load-rom.c | 93 +++++++++++++++++++++++++++++++++++++++++ include/hw/pci/pci-assign.h | 27 ++++++++++++ 4 files changed, 128 insertions(+), 75 deletions(-) create mode 100644 hw/i386/pci-assign-load-rom.c create mode 100644 include/hw/pci/pci-assign.h
hw/i386/Makefile.objs +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_XEN) += ../xenpv/ xen/ obj-y += kvmvapic.o obj-y += acpi-build.o +obj-y += pci-assign-load-rom.o gen-hex-y += hw/i386/acpi-dsdt.hex gen-hex-y += hw/i386/q35-acpi-dsdt.hex
hw/i386/kvm/pci-assign.c +7 -75
103 lines not on this page · raw message
hw/i386/pci-assign-load-rom.c new file +93 -0
93 lines not on this page · raw message
include/hw/pci/pci-assign.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* This work is licensed under the terms of the GNU GPL, version 2. See +* the COPYING file in the top-level directory. +* +* Just split from hw/i386/kvm/pci-assign.c. +*/ +#ifndef PCI_ASSIGN_H +#define PCI_ASSIGN_H + +#include "hw/pci/pci.h" + +//#define DEVICE_ASSIGNMENT_DEBUG + +#ifdef DEVICE_ASSIGNMENT_DEBUG +#define DEBUG (fmt, ...) \ + do { \ + fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__); \ + } while (0) +#else +#define DEBUG (fmt, ...) +#endif + +void *pci_assign_dev_load_option_rom (PCIDevice *dev,struct Object *owner, +int *size,unsigned int domain, +unsigned int bus,unsigned int slot, +unsigned int function); +#endif /* PCI_ASSIGN_H */
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 06/19] xen, gfx passthrough: basic graphics passthrough support
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
basic gfx passthrough support:
- add a vga type for gfx passthrough
- register/unregister legacy VGA I/O ports and MMIOs for passthrough GFX
--- hw/core/machine.c | 20 ++++++++ hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 ++ hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 4 ++ hw/xen/xen_pt.h | 10 +++- hw/xen/xen_pt_graphics.c | 111 ++++++++++++++++++++++++++++++++++++++++++ include/hw/boards.h | 1 + qemu-options.hx | 3 ++ vl.c | 10 ++++ 10 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 hw/xen/xen_pt_graphics.c
hw/core/machine.c +20 -0
@@ -226,6 +226,20 @@ static void machine_set_usb(Object *obj, bool value, Error **errp) ms->usb_disabled = !value; } +static bool machine_get_igd_gfx_passthru (Object *obj,Error **errp) +{ +MachineState *ms =MACHINE (obj); + +return ms->igd_gfx_passthru; +} + +static void machine_set_igd_gfx_passthru (Object *obj,bool value,Error **errp) +{ +MachineState *ms =MACHINE (obj); + + ms->igd_gfx_passthru = value; +} +static char *machine_get_firmware (Object *obj,Error **errp) {MachineState *ms =MACHINE (obj);
@@ -388,6 +402,12 @@ static void machine_initfn(Object *obj)object_property_set_description (obj,"usb" ,"Set on/off to enable/disable usb" ,NULL ); +object_property_add_bool (obj,"igd-passthru" , + machine_get_igd_gfx_passthru, + machine_set_igd_gfx_passthru,NULL ); +object_property_set_description (obj,"igd-passthru" , +"Set on/off to enable/disable igd passthrou" , +NULL );object_property_add_str (obj,"firmware" , machine_get_firmware, machine_set_firmware,NULL );
hw/xen/Makefile.objs +1 -0
@@ -3,3 +3,4 @@ common-obj-$(CONFIG_XEN_BACKEND) += xen_backend.o xen_devconfig.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen-host-pci-device.o obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o +obj-$(CONFIG_XEN_PCI_PASSTHROUGH) += xen_pt.o xen_pt_config_init.o xen_pt_msi.o xen_pt_graphics.o
hw/xen/xen-host-pci-device.c +5 -0
@@ -376,6 +376,11 @@ int xen_host_pci_device_get(XenHostPCIDevice *d, uint16_t domain, goto error; } d->irq = v; + rc =xen_host_pci_get_hex_value (d,"class" , &v); +if (rc) { + goto error; + } + d->class_code = v; d->is_virtfn =xen_host_pci_dev_is_virtfn (d);return 0 ;
hw/xen/xen-host-pci-device.h +1 -0
@@ -25,6 +25,7 @@ typedef struct XenHostPCIDevice {uint16_t vendor_id;uint16_t device_id; +uint32_t class_code;int irq;XenHostPCIIORegion io_regions[PCI_NUM_REGIONS -1 ];
hw/xen/xen_pt.c +4 -0
@@ -502,6 +502,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s, uint16_t *cmd) d->rom.size, d->rom.base_addr); } +xen_pt_register_vga_regions (d);return 0 ; }
@@ -801,6 +802,7 @@ out:static void xen_pt_unregister_device (PCIDevice *d) {XenPCIPassthroughState *s =XEN_PT_DEVICE (d); +XenHostPCIDevice *host_dev = &s->real_device;uint8_t machine_irq = s->machine_irq;uint8_t intx =xen_pt_pci_intx (s);int rc;
@@ -844,6 +846,8 @@ static void xen_pt_unregister_device(PCIDevice *d)/* delete all emulated config registers */ xen_pt_config_delete (s); +xen_pt_unregister_vga_regions (host_dev); +memory_listener_unregister (&s->memory_listener);memory_listener_unregister (&s->io_listener);
hw/xen/xen_pt.h +9 -1
@@ -305,5 +305,13 @@ static inline bool xen_pt_has_msix_mapping(XenPCIPassthroughState *s, int bar) return s->msix && s->msix->bar_index == bar; } - +extern bool has_igd_gfx_passthru; +static inline bool is_igd_vga_passthrough (XenHostPCIDevice *dev) +{ +return (has_igd_gfx_passthru + && ((dev->class_code >>0x8 ) ==PCI_CLASS_DISPLAY_VGA )); +} +int xen_pt_register_vga_regions (XenHostPCIDevice *dev); +int xen_pt_unregister_vga_regions (XenHostPCIDevice *dev); +int xen_pt_setup_vga (XenPCIPassthroughState *s,XenHostPCIDevice *dev);#endif /* !XEN_PT_H */
hw/xen/xen_pt_graphics.c new file +111 -0
111 lines not on this page · raw message
include/hw/boards.h +1 -0
@@ -137,6 +137,7 @@ struct MachineState {bool mem_merge;bool usb;bool usb_disabled; +bool igd_gfx_passthru;char *firmware;bool iommu;bool suppress_vmdesc;
qemu-options.hx +3 -0
@@ -38,6 +38,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" " mem-merge=on|off controls memory merge support (default: on)\n" " iommu=on|off controls emulated Intel IOMMU (VT-d) support (default=off)\n" + " igd-passthru=on|off controls IGD GFX passthrough support (default=off)\n" " aes-key-wrap=on|off controls support for AES key wrapping (default=on)\n" " dea-key-wrap=on|off controls support for DEA key wrapping (default=on)\n" " suppress-vmdesc=on|off disables self-describing migration (default=off)\n",
@@ -55,6 +56,8 @@ than one accelerator specified, the next one is used if the previous one fails to initialize. @item kernel_irqchip=on|off Enables in-kernel irqchip support for the chosen accelerator when available. +@item gfx_passthru=on|off +Enables IGD GFX passthrough support for the chosen machine when available. @item vmport=on|off|auto Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the value based on accel. For accel=xen the default is off otherwise the default
vl.c +10 -0
@@ -1338,6 +1338,13 @@ static inline void semihosting_arg_fallback(const char *file, const char *cmd) } } +/* Now we still need this for compatibility with XEN. */ +bool has_igd_gfx_passthru; +static void igd_gfx_passthru (void ) +{ + has_igd_gfx_passthru = current_machine->igd_gfx_passthru; +} +/***********************************************************/ /* USB devices */
@@ -4528,6 +4535,9 @@ int main(int argc, char **argv, char **envp)exit (1 ); } +/* Check if IGD GFX passthrough. */ +igd_gfx_passthru (); +/* init generic devices */ if (qemu_opts_foreach (qemu_find_opts ("device" ), device_init_func,NULL ,NULL )) {
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 07/19] xen, gfx passthrough: retrieve VGA BIOS to work
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
Now we retrieve VGA bios like kvm stuff in qemu but we need to fix Device Identification in case if its not matched with the real IGD device since Seabios is always trying to compare this ID to work out VGA BIOS.
--- hw/xen/xen_pt.c | 10 ++++++ hw/xen/xen_pt.h | 5 +++ hw/xen/xen_pt_graphics.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+)
hw/xen/xen_pt.c +10 -0
@@ -725,6 +725,16 @@ static int xen_pt_initfn(PCIDevice *d) s->memory_listener = xen_pt_memory_listener; s->io_listener = xen_pt_io_listener; +/* Setup VGA bios for passthrough GFX */ +if ((s->real_device.domain ==0 ) && (s->real_device.bus ==0 ) && + (s->real_device.dev ==2 ) && (s->real_device.func ==0 )) { +if (xen_pt_setup_vga (s, &s->real_device) <0 ) { +XEN_PT_ERR (d,"Setup VGA BIOS of passthrough GFX failed!\n" ); +xen_host_pci_device_put (&s->real_device); +return -1 ; + } + } +/* Handle real device's MMIO/PIO BARs */ xen_pt_register_regions (s, &cmd);
hw/xen/xen_pt.h +5 -0
@@ -305,6 +305,11 @@ static inline bool xen_pt_has_msix_mapping(XenPCIPassthroughState *s, int bar)return s->msix && s->msix->bar_index == bar; } +extern void *pci_assign_dev_load_option_rom (PCIDevice *dev, +struct Object *owner,int *size, +unsigned int domain, +unsigned int bus,unsigned int slot, +unsigned int function);extern bool has_igd_gfx_passthru;static inline bool is_igd_vga_passthrough (XenHostPCIDevice *dev) {
hw/xen/xen_pt_graphics.c +79 -0
82 lines not on this page · raw message
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 08/19] igd gfx passthrough: create a isa bridge
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
Currently IGD drivers always need to access PCH by 1f.0. But we don't want to poke that directly to get ID, and although in real world different GPU should have different PCH. But actually the different PCH DIDs likely map to different PCH SKUs. We do the same thing for the GPU. For PCH, the different SKUs are going to be all the same silicon design and implementation, just different features turn on and off with fuses. The SW interfaces should be consistent across all SKUs in a given family (eg LPT). But just same features may not be supported.
Most of these different PCH features probably don't matter to the Gfx driver, but obviously any difference in display port connections will so it should be fine with any PCH in case of passthrough.
So currently use one PCH version, 0x8c4e, to cover all HSW(Haswell) scenarios, 0x9cc3 for BDW(Broadwell).
--- hw/i386/pc_piix.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/hw/i386/pc.h | 1 + 2 files changed, 113 insertions(+)
hw/i386/pc_piix.c +112 -0
@@ -882,6 +882,118 @@ static void pc_i440fx_0_10_machine_options(MachineClass *m)DEFINE_I440FX_MACHINE (v0_10,"pc-0.10" , pc_compat_0_13, pc_i440fx_0_10_machine_options); +typedef struct { +uint16_t gpu_device_id; +uint16_t pch_device_id; +uint8_t pch_revision_id; +}IGDDeviceIDInfo ; + +/* In real world different GPU should have different PCH. But actually +* the different PCH DIDs likely map to different PCH SKUs. We do the +* same thing for the GPU. For PCH, the different SKUs are going to be +* all the same silicon design and implementation, just different +* features turn on and off with fuses. The SW interfaces should be +* consistent across all SKUs in a given family (eg LPT). But just same +* features may not be supported. +* +* Most of these different PCH features probably don't matter to the +* Gfx driver, but obviously any difference in display port connections +* will so it should be fine with any PCH in case of passthrough. +* +* So currently use one PCH version, 0x8c4e, to cover all HSW(Haswell) +* scenarios, 0x9cc3 for BDW(Broadwell). +*/ +static const IGDDeviceIDInfo igd_combo_id_infos[] = { +/* HSW Classic */ + {0x0402 ,0x8c4e ,0x04 },/* HSWGT1D, HSWD_w7 */ + {0x0406 ,0x8c4e ,0x04 },/* HSWGT1M, HSWM_w7 */ + {0x0412 ,0x8c4e ,0x04 },/* HSWGT2D, HSWD_w7 */ + {0x0416 ,0x8c4e ,0x04 },/* HSWGT2M, HSWM_w7 */ + {0x041E ,0x8c4e ,0x04 },/* HSWGT15D, HSWD_w7 */ +/* HSW ULT */ + {0x0A06 ,0x8c4e ,0x04 },/* HSWGT1UT, HSWM_w7 */ + {0x0A16 ,0x8c4e ,0x04 },/* HSWGT2UT, HSWM_w7 */ + {0x0A26 ,0x8c4e ,0x06 },/* HSWGT3UT, HSWM_w7 */ + {0x0A2E ,0x8c4e ,0x04 },/* HSWGT3UT28W, HSWM_w7 */ + {0x0A1E ,0x8c4e ,0x04 },/* HSWGT2UX, HSWM_w7 */ + {0x0A0E ,0x8c4e ,0x04 },/* HSWGT1ULX, HSWM_w7 */ +/* HSW CRW */ + {0x0D26 ,0x8c4e ,0x04 },/* HSWGT3CW, HSWM_w7 */ + {0x0D22 ,0x8c4e ,0x04 },/* HSWGT3CWDT, HSWD_w7 */ +/* HSW Server */ + {0x041A ,0x8c4e ,0x04 },/* HSWSVGT2, HSWD_w7 */ +/* HSW SRVR */ + {0x040A ,0x8c4e ,0x04 },/* HSWSVGT1, HSWD_w7 */ +/* BSW */ + {0x1606 ,0x9cc3 ,0x03 },/* BDWULTGT1, BDWM_w7 */ + {0x1616 ,0x9cc3 ,0x03 },/* BDWULTGT2, BDWM_w7 */ + {0x1626 ,0x9cc3 ,0x03 },/* BDWULTGT3, BDWM_w7 */ + {0x160E ,0x9cc3 ,0x03 },/* BDWULXGT1, BDWM_w7 */ + {0x161E ,0x9cc3 ,0x03 },/* BDWULXGT2, BDWM_w7 */ + {0x1602 ,0x9cc3 ,0x03 },/* BDWHALOGT1, BDWM_w7 */ + {0x1612 ,0x9cc3 ,0x03 },/* BDWHALOGT2, BDWM_w7 */ + {0x1622 ,0x9cc3 ,0x03 },/* BDWHALOGT3, BDWM_w7 */ + {0x162B ,0x9cc3 ,0x03 },/* BDWHALO28W, BDWM_w7 */ + {0x162A ,0x9cc3 ,0x03 },/* BDWGT3WRKS, BDWM_w7 */ + {0x162D ,0x9cc3 ,0x03 },/* BDWGT3SRVR, BDWM_w7 */ +}; + +static void isa_bridge_class_init (ObjectClass *klass,void *data) +{ +DeviceClass *dc =DEVICE_CLASS (klass); +PCIDeviceClass *k =PCI_DEVICE_CLASS (klass); + + dc->desc ="ISA bridge faked to support IGD PT" ; + k->vendor_id =PCI_VENDOR_ID_INTEL ; + k->class_id =PCI_CLASS_BRIDGE_ISA ; +}; + +static TypeInfo isa_bridge_info = { + .name ="igd-passthrough-isa-bridge" , + .parent =TYPE_PCI_DEVICE , + .instance_size =sizeof (PCIDevice), + .class_init = isa_bridge_class_init, +}; + +static void pt_graphics_register_types (void ) +{ +type_register_static (&isa_bridge_info); +} +type_init (pt_graphics_register_types) + +void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id) +{ +struct PCIDevice *bridge_dev; +int i, num; +uint16_t pch_dev_id =0xffff ; +uint8_t pch_rev_id; + + num =ARRAY_SIZE (igd_combo_id_infos); +for (i =0 ; i < num; i++) { +if (gpu_dev_id == igd_combo_id_infos[i].gpu_device_id) { + pch_dev_id = igd_combo_id_infos[i].pch_device_id; + pch_rev_id = igd_combo_id_infos[i].pch_revision_id; + } + } + +if (pch_dev_id ==0xffff ) { +return ; + } + +/* Currently IGD drivers always need to access PCH by 1f.0. */ + bridge_dev =pci_create_simple (bus,PCI_DEVFN (0x1f ,0 ), +"igd-passthrough-isa-bridge" ); + +/* +* Note that vendor id is always PCI_VENDOR_ID_INTEL. +*/ +if (!bridge_dev) { +fprintf (stderr,"set igd-passthrough-isa-bridge failed!\n" ); +return ; + } +pci_config_set_device_id (bridge_dev->config, pch_dev_id); +pci_config_set_revision (bridge_dev->config, pch_rev_id); +}static void isapc_machine_options (MachineClass *m) {
include/hw/i386/pc.h +1 -0
@@ -726,4 +726,5 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); (m)->compat_props = props; \ } while (0) +extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);#endif
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 09/19] xen, gfx passthrough: register a isa bridge
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
Currently we just register this isa bridge when we use IGD passthrough in Xen side.
--- hw/xen/xen_pt.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
hw/xen/xen_pt.c +22 -0
@@ -56,6 +56,7 @@#include "hw/pci/pci.h" #include "hw/xen/xen.h" +#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "xen_pt.h" #include "qemu/range.h"
@@ -684,6 +685,17 @@ static const MemoryListener xen_pt_io_listener = { .priority = 10, }; +static void +xen_igd_passthrough_isa_bridge_create (XenPCIPassthroughState *s, +XenHostPCIDevice *dev) +{ +uint16_t gpu_dev_id; +PCIDevice *d = &s->dev; + + gpu_dev_id = dev->device_id; +igd_passthrough_isa_bridge_create (d->bus, gpu_dev_id); +} +/* init */ static int xen_pt_initfn (PCIDevice *d)
@@ -728,11 +740,21 @@ static int xen_pt_initfn(PCIDevice *d)/* Setup VGA bios for passthrough GFX */ if ((s->real_device.domain ==0 ) && (s->real_device.bus ==0 ) && (s->real_device.dev ==2 ) && (s->real_device.func ==0 )) { +if (!is_igd_vga_passthrough (&s->real_device)) { +XEN_PT_ERR (d,"Need to enable igd-passthru if you're trying" +" to passthrough IGD GFX.\n" ); +xen_host_pci_device_put (&s->real_device); +return -1 ; + } +if (xen_pt_setup_vga (s, &s->real_device) <0 ) {XEN_PT_ERR (d,"Setup VGA BIOS of passthrough GFX failed!\n" );xen_host_pci_device_put (&s->real_device);return -1 ; } + +/* Register ISA bridge for passthrough GFX. */ +xen_igd_passthrough_isa_bridge_create (s, &s->real_device); }/* Handle real device's MMIO/PIO BARs */
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 10/19] xen, gfx passthrough: register host bridge specific to passthrough
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
Just register that pci host bridge specific to passthrough.
--- hw/i386/pc_piix.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
hw/i386/pc_piix.c +13 -2
@@ -50,7 +50,8 @@#include "cpu.h" #include "qemu/error-report.h" #ifdef CONFIG_XEN -# include <xen/hvm/hvm_info_table.h> +#include <xen/hvm/hvm_info_table.h> +#include "hw/xen/xen_pt.h" #endif #include "migration/migration.h"
@@ -421,11 +422,21 @@ static void pc_init_isa(MachineState *machine) }#ifdef CONFIG_XEN +static void pc_xen_hvm_init_pci (MachineState *machine) +{ +const char *pci_type = has_igd_gfx_passthru ? +TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE :TYPE_I440FX_PCI_DEVICE ; + +pc_init1 (machine, +TYPE_I440FX_PCI_HOST_BRIDGE , + pci_type); +} +static void pc_xen_hvm_init (MachineState *machine) {PCIBus *bus; -pc_init1 (machine,TYPE_I440FX_PCI_HOST_BRIDGE ,TYPE_I440FX_PCI_DEVICE ); +pc_xen_hvm_init_pci (machine); bus =pci_find_primary_bus ();if (bus !=NULL ) {
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 11/19] xen, gfx passthrough: add opregion mapping
In reply to Stefano StabelliniFrom: Tiejun Chen <[email protected]>
The OpRegion shouldn't be mapped 1:1 because the address in the host can't be used in the guest directly.
This patch traps read and write access to the opregion of the Intel GPU config space (offset 0xfc).
The original patch is from Jean Guyader <[email protected]>
--- hw/xen/xen_pt.h | 6 +++- hw/xen/xen_pt_config_init.c | 51 +++++++++++++++++++++++++-- hw/xen/xen_pt_graphics.c | 82 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 3 deletions(-)
hw/xen/xen_pt.h +5 -1
@@ -40,6 +40,9 @@ typedef struct XenPCIPassthroughState XenPCIPassthroughState;#define XEN_PT_DEVICE (obj) \ OBJECT_CHECK(XenPCIPassthroughState, (obj), TYPE_XEN_PT_DEVICE) +uint32_t igd_read_opregion (XenPCIPassthroughState *s); +void igd_write_opregion (XenPCIPassthroughState *s,uint32_t val); +/* function type for config reg */ typedef int (*xen_pt_conf_reg_init ) (XenPCIPassthroughState *, XenPTRegInfo *, uint32_t real_offset,
@@ -66,8 +69,9 @@ typedef int (*xen_pt_conf_byte_read)#define XEN_PT_BAR_ALLF 0xFFFFFFFF#define XEN_PT_BAR_UNMAPPED (-1) -#define PCI_CAP_MAX 48 +#define XEN_PCI_CAP_MAX 48 +#define XEN_PCI_INTEL_OPREGION 0xfc typedef enum { XEN_PT_GRP_TYPE_HARDWIRED = 0, /* 0 Hardwired reg group */
hw/xen/xen_pt_config_init.c +49 -2
87 lines not on this page · raw message
hw/xen/xen_pt_graphics.c +82 -0
103 lines not on this page · raw message
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 12/19] xen-hvm: When using xc_domain_add_to_physmap also include errno when reporting
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
.errors - as it will most likely have the proper error value.
--- xen-hvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
xen-hvm.c +2 -2
@@ -348,7 +348,7 @@ go_physmap: rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) {DPRINTF ("add_to_physmap MFN %" PRI_xen_pfn" to PFN %" - PRI_xen_pfn" failed: %d\n" , idx, gpfn, rc); + PRI_xen_pfn" failed: %d (errno: %d)\n" , idx, gpfn, rc, errno);return -rc; } }
@@ -425,7 +425,7 @@ static int xen_remove_from_physmap(XenIOState *state, rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) {fprintf (stderr,"add_to_physmap MFN %" PRI_xen_pfn" to PFN %" - PRI_xen_pfn" failed: %d\n" , idx, gpfn, rc); + PRI_xen_pfn" failed: %d (errno: %d)\n" , idx, gpfn, rc, errno);return -rc; } }
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 13/19] xen/HVM: atomically access pointers in bufioreq handling
In reply to Stefano StabelliniFrom: Jan Beulich <[email protected]>
The number of slots per page being 511 (i.e. not a power of two) means that the (32-bit) read and write indexes going beyond 2^32 will likely disturb operation. The hypervisor side gets I/O req server creation extended so we can indicate that we're using suitable atomic accesses where needed, allowing it to atomically canonicalize both pointers when both have gone through at least one cycle.
The Xen side counterpart (which is not a functional prereq to this change, albeit a build one) went in already (commit b7007bc6f9).
--- configure | 27 +++++++++++++++++++++++++++ include/hw/xen/xen_common.h | 12 +++++++++++- xen-hvm.c | 26 ++++++++++++++++++-------- 3 files changed, 56 insertions(+), 9 deletions(-)
configure +27 -0
@@ -1889,6 +1889,33 @@ int main(void) { xc_gnttab_open(NULL, 0); xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); + xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); + return 0; +} +EOF + compile_prog "" "$xen_libs" + then + xen_ctrl_version=460 + xen=yes + + # Xen 4.5 + elif + cat > $TMPC <<EOF && +#include <xenctrl.h> +#include <xenstore.h> +#include <stdint.h> +#include <xen/hvm/hvm_info_table.h> +#if !defined(HVM_MAX_VCPUS) +# error HVM_MAX_VCPUS not defined +#endif +int main(void) { + xc_interface *xc; + xs_daemon_open(); + xc = xc_interface_open(0, 0, 0); + xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0); + xc_gnttab_open(NULL, 0); + xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); + xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); xc_hvm_create_ioreq_server(xc, 0, 0, NULL); return 0; }
include/hw/xen/xen_common.h +11 -1
@@ -186,6 +186,15 @@ static inline int xen_get_vmport_regs_pfn(XenXC xc, domid_t dom, }#endif +/* Xen before 4.6 */ +#if CONFIG_XEN_CTRL_INTERFACE_VERSION <460 + +#ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC +#define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2 +#endif + +#endif +/* Xen before 4.5 */ #if CONFIG_XEN_CTRL_INTERFACE_VERSION <450
@@ -370,7 +379,8 @@ static inline void xen_unmap_pcidev(XenXC xc, domid_t dom,static inline int xen_create_ioreq_server (XenXC xc,domid_t dom,ioservid_t *ioservid) { -int rc =xc_hvm_create_ioreq_server (xc, dom,1 , ioservid); +int rc =xc_hvm_create_ioreq_server (xc, dom,HVM_IOREQSRV_BUFIOREQ_ATOMIC , + ioservid);if (rc ==0 ) {trace_xen_ioreq_server_create (*ioservid);
xen-hvm.c +18 -8
@@ -984,19 +984,30 @@ static void handle_ioreq(XenIOState *state, ioreq_t *req)static int handle_buffered_iopage (XenIOState *state) { +buffered_iopage_t *buf_page = state->buffered_io_page;buf_ioreq_t *buf_req =NULL ;ioreq_t req;int qw; -if (!state->buffered_io_page) { +if (!buf_page) {return 0 ; }memset (&req,0x00 ,sizeof (req)); -while (state->buffered_io_page->read_pointer != state->buffered_io_page->write_pointer) { - buf_req = &state->buffered_io_page->buf_ioreq[ - state->buffered_io_page->read_pointer %IOREQ_BUFFER_SLOT_NUM ]; +for (;;) { +uint32_t rdptr = buf_page->read_pointer, wrptr; + +xen_rmb (); + wrptr = buf_page->write_pointer; +xen_rmb (); +if (rdptr != buf_page->read_pointer) { +continue ; + } +if (rdptr == wrptr) { +break ; + } + buf_req = &buf_page->buf_ioreq[rdptr %IOREQ_BUFFER_SLOT_NUM ]; req.size =1UL << buf_req->size; req.count =1 ; req.addr = buf_req->addr;
@@ -1008,15 +1019,14 @@ static int handle_buffered_iopage(XenIOState *state) req.data_is_ptr =0 ; qw = (req.size ==8 );if (qw) { - buf_req = &state->buffered_io_page->buf_ioreq[ - (state->buffered_io_page->read_pointer +1 ) %IOREQ_BUFFER_SLOT_NUM ]; + buf_req = &buf_page->buf_ioreq[(rdptr +1 ) % +IOREQ_BUFFER_SLOT_NUM ]; req.data |= ((uint64_t )buf_req->data) <<32 ; }handle_ioreq (state, &req); -xen_mb (); - state->buffered_io_page->read_pointer += qw ?2 :1 ; +atomic_add (&buf_page->read_pointer, qw +1 ); }return req.count;
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 14/19] xen/pt: Update comments with proper function name.
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
It has changed but the comments still refer to the old names.
--- hw/xen/xen_pt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/xen/xen_pt.c +2 -2
@@ -379,7 +379,7 @@ static void xen_pt_pci_write_config(PCIDevice *d, uint32_t addr, } } -/* need to shift back before passing them to xen_host_pci_device */ +/* need to shift back before passing them to xen_host_pci_set_block. */ val >>= (addr &3 ) <<3 ;memory_region_transaction_commit ();
@@ -407,7 +407,7 @@ out: (uint8_t *)&val + index, len);if (rc <0 ) { -XEN_PT_ERR (d,"pci_write_block failed. return value: %d.\n" , rc); +XEN_PT_ERR (d,"xen_host_pci_set_block failed. return value: %d.\n" , rc); } } }
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 15/19] xen/pt: Make xen_pt_msi_set_enable static
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
As we do not use it outside our code.
--- hw/xen/xen_pt.h | 1 - hw/xen/xen_pt_msi.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
hw/xen/xen_pt.h +0 -1
@@ -293,7 +293,6 @@ static inline uint8_t xen_pt_pci_intx(XenPCIPassthroughState *s) }/* MSI/MSI-X */ -int xen_pt_msi_set_enable (XenPCIPassthroughState *s,bool en);int xen_pt_msi_setup (XenPCIPassthroughState *s);int xen_pt_msi_update (XenPCIPassthroughState *d);void xen_pt_msi_disable (XenPCIPassthroughState *s);
hw/xen/xen_pt_msi.c +1 -1
@@ -220,7 +220,7 @@ static int msi_msix_disable(XenPCIPassthroughState *s,* MSI virtualization functions */ -int xen_pt_msi_set_enable (XenPCIPassthroughState *s,bool enable) +static int xen_pt_msi_set_enable (XenPCIPassthroughState *s,bool enable) {XEN_PT_LOG (&s->dev,"%s MSI.\n" , enable ?"enabling" :"disabling" );
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 16/19] xen/pt: xen_host_pci_config_read returns -errno, not -1 on failure
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
However the init routines assume that on errors the return code is -1 (as the libxc API is) - while those xen_host_* routines follow another paradigm - negative errno on return, 0 on success.
--- hw/xen/xen_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/xen/xen_pt.c +1 -1
@@ -729,7 +729,7 @@ static int xen_pt_initfn(PCIDevice *d)/* Initialize virtualized PCI configuration (Extended 256 Bytes) */ if (xen_host_pci_get_block (&s->real_device,0 , d->config, -PCI_CONFIG_SPACE_SIZE ) ==-1 ) { +PCI_CONFIG_SPACE_SIZE ) <0 ) {xen_host_pci_device_put (&s->real_device);return -1 ; }
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 17/19] xen: use errno instead of rc for xc_domain_add_to_physmap
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
In Xen 4.6 commit cd2f100f0f61b3f333d52d1737dd73f02daee592 "libxc: Fix do_memory_op to return negative value on errors" made the libxc API less odd-ball: On errors, return value is -1 and error code is in errno. On success the return value is either 0 or an positive value.
Since we could be running with an old toolstack in which the Exx value is in rc or the newer, we add an wrapper around the xc_domain_add_to_physmap (called xen_xc_domain_add_to_physmap) which will always return the EXX.
Xen 4.6 did not change the libxc functions mentioned (same parameters) so we piggyback on the fact that Xen 4.6 has a new function:
commit 504ed2053362381ac01b98db9313454488b7db40 "tools/libxc: Expose new hypercall xc_reserved_device_memory_map" and check for that.
--- configure | 1 + include/hw/xen/xen_common.h | 22 ++++++++++++++++++++++ xen-hvm.c | 4 ++-- 3 files changed, 25 insertions(+), 2 deletions(-)
configure +1 -0
@@ -1890,6 +1890,7 @@ int main(void) { xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0); xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000); xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL); + xc_reserved_device_memory_map(xc, 0, 0, 0, 0, NULL, 0); return 0; } EOF
include/hw/xen/xen_common.h +22 -0
@@ -417,4 +417,26 @@ static inline int xen_set_ioreq_server_state(XenXC xc, domid_t dom,#endif +#if CONFIG_XEN_CTRL_INTERFACE_VERSION <460 +static inline int xen_xc_domain_add_to_physmap (XenXC xch,uint32_t domid, +unsigned int space, +unsigned long idx, +xen_pfn_t gpfn) +{ +return xc_domain_add_to_physmap (xch, domid, space, idx, gpfn); +} +#else +static inline int xen_xc_domain_add_to_physmap (XenXC xch,uint32_t domid, +unsigned int space, +unsigned long idx, +xen_pfn_t gpfn) +{ +/* In Xen 4.6 rc is -1 and errno contains the error value. */ +int rc =xc_domain_add_to_physmap (xch, domid, space, idx, gpfn); +if (rc ==-1 ) +return errno; +return rc; +} +#endif +#endif /* QEMU_HW_XEN_COMMON_H */
xen-hvm.c +2 -2
@@ -345,7 +345,7 @@ go_physmap:unsigned long idx = pfn + i;xen_pfn_t gpfn = start_gpfn + i; - rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn); + rc =xen_xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) {DPRINTF ("add_to_physmap MFN %" PRI_xen_pfn" to PFN %" PRI_xen_pfn" failed: %d (errno: %d)\n" , idx, gpfn, rc, errno);
@@ -422,7 +422,7 @@ static int xen_remove_from_physmap(XenIOState *state,xen_pfn_t idx = start_addr + i;xen_pfn_t gpfn = phys_offset + i; - rc =xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn); + rc =xen_xc_domain_add_to_physmap (xen_xc, xen_domid, XENMAPSPACE_gmfn, idx, gpfn);if (rc) {fprintf (stderr,"add_to_physmap MFN %" PRI_xen_pfn" to PFN %" PRI_xen_pfn" failed: %d (errno: %d)\n" , idx, gpfn, rc, errno);
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 18/19] xen/pt/msi: Add the register value when printing logging and error messages
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
We would like to know what the MSI register value is to help in troubleshooting in the field. As such modify the logging logic to include such details in xen_pt_msgctrl_reg_write.
--- hw/xen/xen_pt_config_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/xen/xen_pt_config_init.c +3 -3
@@ -1102,7 +1102,7 @@ static int xen_pt_msgctrl_reg_write(XenPCIPassthroughState *s,/* setup MSI pirq for the first time */ if (!msi->initialized) {/* Init physical one */ -XEN_PT_LOG (&s->dev,"setup MSI\n" ); +XEN_PT_LOG (&s->dev,"setup MSI (register: %x).\n" , *val);if (xen_pt_msi_setup (s)) {/* We do not broadcast the error to the framework code, so * that MSI errors are contained in MSI emulation code and
@@ -1110,12 +1110,12 @@ static int xen_pt_msgctrl_reg_write(XenPCIPassthroughState *s,* Guest MSI would be actually not working. */ *val &= ~PCI_MSI_FLAGS_ENABLE ; -XEN_PT_WARN (&s->dev,"Can not map MSI.\n" ); +XEN_PT_WARN (&s->dev,"Can not map MSI (register: %x)!\n" , *val);return 0 ; }if (xen_pt_msi_update (s)) { *val &= ~PCI_MSI_FLAGS_ENABLE ; -XEN_PT_WARN (&s->dev,"Can not bind MSI\n" ); +XEN_PT_WARN (&s->dev,"Can not bind MSI (register: %x)!\n" , *val);return 0 ; } msi->initialized = true;
Signature · 1 line
1.7.10.4
[Qemu-devel] [PULL 19/19] xen/pt: Use XEN_PT_LOG properly to guard against compiler warnings.
In reply to Stefano StabelliniFrom: Konrad Rzeszutek Wilk <[email protected]>
If XEN_PT_LOGGING_ENABLED is enabled the XEN_PT_LOG macros start using the first argument. Which means if within the function there is only one user of the argument ('d') and XEN_PT_LOGGING_ENABLED is not set, we get compiler warnings. This is not the case now but with the "xen/pt: Use xen_host_pci_get_[byte|word] instead of dev.config" we will hit - so this sync up the function to the rest of them.
--- hw/xen/xen_pt_config_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/xen/xen_pt_config_init.c +1 -1
@@ -1434,7 +1434,7 @@ static int xen_pt_msixctrl_reg_init(XenPCIPassthroughState *s, reg_field =pci_get_word (d->config + real_offset);if (reg_field &PCI_MSIX_FLAGS_ENABLE ) { -XEN_PT_LOG (d,"MSIX already enabled, disabling it first\n" ); +XEN_PT_LOG (&s->dev,"MSIX already enabled, disabling it first\n" );xen_host_pci_set_word (&s->real_device, real_offset, reg_field & ~PCI_MSIX_FLAGS_ENABLE ); }
Signature · 1 line
1.7.10.4
Quoted 8 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.gittags/xen-2015-09-08-tag
Quoted 8 lines
for you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Hi. I'm afraid this fails to build on OSX (and probably Windows too, though that build hasn't run yet):
CC i386-softmmu/hw/i386/pci-assign-load-rom.o
/Users/pm215/src/qemu/hw/i386/pci-assign-load-rom.c:6:10: fatal error:
'sys/io.h' file not found
#include <sys/io.h>
^ CC alpha-softmmu/hw/alpha/pci.o
1 error generated.
thanks
-- PMM
Quoted 22 lines · Peter Maydell
Quoted 8 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.gittags/xen-2015-09-08-tagQuoted 8 lines
for you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Hi. I'm afraid this fails to build on OSX (and probably Windows too, though that build hasn't run yet):
Quoted 7 lines
CC
i386-softmmu/hw/i386/pci-assign-load-rom.o
/Users/pm215/src/qemu/hw/i386/pci-assign-load-rom.c:6:10: fatal error:
'sys/io.h' file not found#include <sys/io.h> ^CC
alpha-softmmu/hw/alpha/pci.o
1 error generated.
Tiejun,
this is caused by 33d33242b7d802e6c994f3d56ecba96a66465dc3, "hw/pci-assign: split pci-assign.c". Could you please double-check non-Linux builds?
I suspect that the fix would be quite small, but I don't have an OSX or a Windows build environment to try it.
Speak about build environments, Peter, would you care to share your scripts and setup so that I can run similar tests in the future on my own? I have no OSX machines so I tried to do a Windows cross-compile, following http://wiki.qemu.org/Hosts/W32 on Debian 7, but I failed very early with an "ERROR: zlib check failed".
Quoted 31 lines · Stefano Stabellini
Quoted 22 lines · Peter Maydell
Quoted 8 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.gittags/xen-2015-09-08-tagQuoted 8 lines
for you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Hi. I'm afraid this fails to build on OSX (and probably Windows too, though that build hasn't run yet):
Quoted 7 lines
CC
i386-softmmu/hw/i386/pci-assign-load-rom.o
/Users/pm215/src/qemu/hw/i386/pci-assign-load-rom.c:6:10: fatal error:
'sys/io.h' file not found#include <sys/io.h> ^CC
alpha-softmmu/hw/alpha/pci.o
1 error generated.
Quoted 5 lines
Tiejun,
this is caused by
33d33242b7d802e6c994f3d56ecba96a66465dc3, "hw/pci-assign: splitpci-assign.c". Could you please double-check non-Linux builds?
I found another issue introduced by the gfx passthrough series on Windows:
../hw/pci-host/piix.o: In function `host_pci_config_read':/root/qemu/hw/pci-host/piix.c:778: undefined reference to `_pread'
It is introduced by:
commit fdb70721ba0496a767137e5505dd27627d19c4a8
Author: Tiejun Chen <[email protected]> Date: Wed Jul 15 13:37:43 2015 +0800
piix: create host bridge to passthrough
You might have to replace the pread call with lseek and read.
Quoted 8 lines · Stefano Stabellini
I found another issue introduced by the gfx passthrough series on Windows:
../hw/pci-host/piix.o: In function `host_pci_config_read':/root/qemu/hw/pci-host/piix.c:778: undefined reference to `_pread'It is introduced by:
Quoted 8 lines
commit
fdb70721ba0496a767137e5505dd27627d19c4a8Author: Tiejun Chen <[email protected]> Date: Wed Jul 15 13:37:43 2015 +0800piix: create host bridge to passthrough
You might have to replace the pread call with lseek and read.
Will passthrough even work on Windows and OSX hosts? Consider whether we should be building this code on those hosts at all...
thanks
-- PMM
Quoted 46 lines · Stefano Stabellini
Quoted 31 lines · Stefano Stabellini
Quoted 22 lines · Peter Maydell
Quoted 8 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.gittags/xen-2015-09-08-tagQuoted 8 lines
for you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Hi. I'm afraid this fails to build on OSX (and probably Windows too, though that build hasn't run yet):
Quoted 7 lines
CC
i386-softmmu/hw/i386/pci-assign-load-rom.o
/Users/pm215/src/qemu/hw/i386/pci-assign-load-rom.c:6:10: fatal error:
'sys/io.h' file not found#include <sys/io.h> ^CC
alpha-softmmu/hw/alpha/pci.o
1 error generated.Quoted 5 lines
Tiejun,
this is caused by
33d33242b7d802e6c994f3d56ecba96a66465dc3, "hw/pci-assign: splitpci-assign.c". Could you please double-check non-Linux builds?I found another issue introduced by the gfx passthrough series on Windows:
../hw/pci-host/piix.o: In function `host_pci_config_read':/root/qemu/hw/pci-host/piix.c:778: undefined reference to `_pread'It is introduced by:
Quoted 9 lines
commit
fdb70721ba0496a767137e5505dd27627d19c4a8Author: Tiejun Chen <[email protected]> Date: Wed Jul 15 13:37:43 2015 +0800piix: create host bridge to passthrough
You might have to replace the pread call with lseek and read.
This is also surprising to me. Just see xen_host_pci_config_xxxx() inside /hw/xen/xen-host-pci-device.c, there are so many this pread usage(). So I really don't understand what's difference between these two files.
Thanks
Tiejun
Quoted 16 lines · Tiejun
Quoted 15 lines · Stefano Stabellini
I found another issue introduced by the gfx passthrough series on Windows:
../hw/pci-host/piix.o: In function `host_pci_config_read':/root/qemu/hw/pci-host/piix.c:778: undefined reference to `_pread'It is introduced by:
commit
fdb70721ba0496a767137e5505dd27627d19c4a8Author: Tiejun Chen <[email protected]> Date: Wed Jul 15 13:37:43 2015 +0800piix: create host bridge to passthrough
Quoted 6 lines
Quoted 2 lines
You might have to replace the pread call with lseek and read.
This is also surprising to me. Just see
xen_host_pci_config_xxxx()inside /hw/xen/xen-host-pci-device.c, there are so many this preadusage(). So I really don't understand what's difference between these two files.
xen-host-pci-device.c is only compiled if CONFIG_XEN_PCI_PASSTHROUGH was set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.
thanks
-- PMM
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.
Okay. This actually shouldn't be enabled on Windows so what about this?
hw/pci-host/piix.c +4 -0
@@ -739,6 +739,7 @@ static const TypeInfo i440fx_info = { .class_init = i440fx_class_init, }; +#ifndef _WIN32 /* IGD Passthrough Host Bridge. */ typedef struct { uint8_t offset;
@@ -819,6 +820,7 @@ static const TypeInfo igd_passthrough_i440fx_info = { .instance_size = sizeof(PCII440FXState), .class_init = igd_passthrough_i440fx_class_init, }; +#endif static const char *i440fx_pcihost_root_bus_path (PCIHostState *host_bridge,PCIBus *rootbus)
@@ -861,7 +863,9 @@ static const TypeInfo i440fx_pcihost_info = {static void i440fx_register_types (void ) {type_register_static (&i440fx_info); +#ifndef _WIN32type_register_static (&igd_passthrough_i440fx_info); +#endif type_register_static (&piix3_pci_type_info);type_register_static (&piix3_info);type_register_static (&piix3_xen_info);
Thanks
Tiejun
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
I think it would be nicer to replace the pread than introducing ifdefs.
Quoted 34 lines
hw/pci-host/piix.c +4
-0@@ -739,6 +739,7 @@ static const TypeInfo i440fx_info = { .class_init = i440fx_class_init, }; +#ifndef _WIN32 /* IGD Passthrough Host Bridge. */ typedef struct { uint8_t offset;@@ -819,6 +820,7 @@ static const TypeInfo igd_passthrough_i440fx_info = { .instance_size = sizeof(PCII440FXState), .class_init = igd_passthrough_i440fx_class_init, }; +#endif static const char *i440fx_pcihost_root_bus_path (PCIHostState *host_bridge,PCIBus *rootbus)@@ -861,7 +863,9 @@ static const TypeInfo i440fx_pcihost_info = {static void i440fx_register_types (void ) {type_register_static (&i440fx_info); +#ifndef _WIN32type_register_static (&igd_passthrough_i440fx_info); +#endif type_register_static (&piix3_pci_type_info);type_register_static (&piix3_info);type_register_static (&piix3_xen_info);Thanks
Tiejun
CC Michael
Quoted 9 lines · Stefano Stabellini
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
I think it would be nicer to replace the pread than introducing ifdefs.
Something like:
---
Replace pread with read to avoid build breakages on Windows
hw/pci-host/piix.c +4 -1
@@ -774,8 +774,11 @@ static int host_pci_config_read(int pos, int len, uint32_t val)return -ENODEV ; } +if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) {return -errno;
Quoted 11 lines · Stefano Stabellini
CC Michael
Quoted 8 lines · Stefano Stabellini
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
Quoted 8 lines
Quoted 1 line
I think it would be nicer to replace the pread than introducing ifdefs.
Something like:
---
Replace pread with read to avoid build breakages on WindowsSigned-off-by Stefano Stabellini <[email protected]>
I'd prefer a wrapper that does the right thing. No sense in doubling the # of system calls for everyone.
Quoted 18 lines
hw/pci-host/piix.c +4
-1@@ -774,8 +774,11 @@ static int host_pci_config_read(int pos, int len, uint32_t val)return -ENODEV ; } +if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) {return -errno;
Quoted 16 lines · Michael S. Tsirkin
Quoted 15 lines · Stefano Stabellini
CC Michael
Quoted 9 lines · Stefano Stabellini
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
I think it would be nicer to replace the pread than introducing ifdefs.
Something like:
Quoted 7 lines
Quoted 4 lines
---
Replace pread with read to avoid build breakages on WindowsSigned-off-by Stefano Stabellini <[email protected]>I'd prefer a wrapper that does the right thing. No sense in doubling the # of system calls for everyone.
If this was done on an hot path I would agree with you, but it is just one call at initialization time (igd_pt_i440fx_initfn).
Quoted 18 lines
Quoted 17 lines
hw/pci-host/piix.c +4
-1@@ -774,8 +774,11 @@ static int host_pci_config_read(int pos, int len, uint32_t val)return -ENODEV ; } +if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) {return -errno;
Quoted 20 lines · Stefano Stabellini
Quoted 19 lines · Michael S. Tsirkin
Quoted 18 lines · Stefano Stabellini
CC Michael
Quoted 9 lines · Stefano Stabellini
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
I think it would be nicer to replace the pread than introducing ifdefs.
Something like:
---
Replace pread with read to avoid build breakages on Windows
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Stefano Stabellini <[email protected]>I'd prefer a wrapper that does the right thing. No sense in doubling the # of system calls for everyone.
If this was done on an hot path I would agree with you, but it is just one call at initialization time (
igd_pt_i440fx_initfn).
I missed this fact. OK then.
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
hw/pci-host/piix.c +4
-1@@ -774,8 +774,11 @@ static int host_pci_config_read(int pos, int len, uint32_t val)return -ENODEV ; } +if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) {return -errno;
Quoted 23 lines · Michael S. Tsirkin
Quoted 22 lines · Stefano Stabellini
Quoted 21 lines · Michael S. Tsirkin
Quoted 19 lines · Stefano Stabellini
CC Michael
Quoted 9 lines · Stefano Stabellini
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
I think it would be nicer to replace the pread than introducing ifdefs.
Something like:
---
Replace pread with read to avoid build breakages on WindowsSigned-off-by Stefano Stabellini <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
I'd prefer a wrapper that does the right thing. No sense in doubling the # of system calls for everyone.
If this was done on an hot path I would agree with you, but it is just one call at initialization time (
igd_pt_i440fx_initfn).I missed this fact. OK then.
Thanks! I'll fold it the offending patch
(http://marc.info/?l=qemu-devel&m=144174596628052&w=2) and resend.
Quoted 19 lines
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
hw/pci-host/piix.c +4
-1@@ -774,8 +774,11 @@ static int host_pci_config_read(int pos, int len, uint32_t val)return -ENODEV ; } +if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) {return -errno;
Michael S. Tsirkin
Reviewed-byQuoted 27 lines · Stefano Stabellini
Quoted 26 lines · Michael S. Tsirkin
Quoted 25 lines · Stefano Stabellini
Quoted 23 lines · Michael S. Tsirkin
Quoted 11 lines · Stefano Stabellini
CC Michael
Quoted 8 lines · Stefano Stabellini
Quoted 6 lines · Tiejun
Quoted 4 lines
xen-host-pci-device.cis only compiled ifCONFIG_XEN_PCI_PASSTHROUGHwas set by configure. That won't be the case on OSX or Windows, where the Xen headers don't exist.Okay. This actually shouldn't be enabled on Windows so what about this?
Quoted 8 lines
Quoted 1 line
I think it would be nicer to replace the pread than introducing ifdefs.
Something like:
---
Replace pread with read to avoid build breakages on WindowsSigned-off-by Stefano Stabellini <[email protected]>I'd prefer a wrapper that does the right thing. No sense in doubling the # of system calls for everyone.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
If this was done on an hot path I would agree with you, but it is just one call at initialization time (
igd_pt_i440fx_initfn).I missed this fact. OK then.
Thanks! I'll fold it the offending patch
(http://marc.info/?l=qemu-devel&m=144174596628052&w=2) and resend.
Quoted 19 lines
Quoted 19 lines
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
hw/pci-host/piix.c +4
-1@@ -774,8 +774,11 @@ static int host_pci_config_read(int pos, int len, uint32_t val)return -ENODEV ; } +if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) {return -errno;
Quoted 6 lines
Quoted 3 lines
Thanks! I'll fold it the offending patch
(http://marc.info/?l=qemu-devel&m=144174596628052&w=2) and resend.Reviewed-by Michael S. Tsirkin <[email protected]>
Michale and Stefano,
Thanks a lot :)
Tiejun
hw/pci-host/piix.c static int host_pci_config_read(int pos, int len, uint32_t val) · line 782
Quoted 7 lines · Stefano Stabellini
hw/pci-host/piix.c +4
-1+if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));
This leaks config_fd.
Paolo
Quoted 10 lines · Paolo Bonzini
hw/pci-host/piix.c static int host_pci_config_read(int pos, int len, uint32_t val) · line 782
Quoted 7 lines · Stefano Stabellini
hw/pci-host/piix.c +4
-1+if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));This leaks
config_fd.
I don't follow, it leaks config_fd where?
Quoted 10 lines · Stefano Stabellini
Quoted 9 lines · Paolo Bonzini
Quoted 9 lines · Stefano Stabellini
Quoted 7 lines
Quoted 7 lines
hw/pci-host/piix.c +4
-1+if (lseek (config_fd, pos,SEEK_SET ) != pos) { +return -errno; + }do { - rc =pread (config_fd, (uint8_t *)&val, len, pos); + rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));
Quoted 2 lines
Quoted 1 line
Quoted 1 line
This leaks
config_fd.I don't follow, it leaks
config_fdwhere?
Where lseek returns -errno (and IIRC in other places in the same function).
Paolo
Quoted 13 lines · Paolo Bonzini
Quoted 10 lines · Stefano Stabellini
Quoted 9 lines · Paolo Bonzini
Quoted 9 lines · Stefano Stabellini
Quoted 7 lines
Quoted 7 lines
(quoted diff) +4
-1+ if (lseek(config_fd, pos, SEEK_SET) != pos) { + return -errno; + } do { - rc = pread(config_fd, (uint8_t *)&val, len, pos); + rc = read(config_fd, (uint8_t *)&val, len); } while (rc < 0 && (errno == EINTR || errno == EAGAIN));
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
This leaks
config_fd.I don't follow, it leaks
config_fdwhere?Where lseek returns -errno (and IIRC in other places in the same function).
Do you mean we need this change?
hw/pci-host/piix.c +3 -0
@@ -775,15 +775,18 @@ static int host_pci_config_read(int pos, int len, uint32_t val) }if (lseek (config_fd, pos,SEEK_SET ) != pos) { +close (config_fd);return -errno; }do { rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) { +close (config_fd);return -errno; } +close (config_fd);return 0 ; }
Thanks
Tiejun
Quoted 14 lines · Tiejun
Quoted 13 lines · Paolo Bonzini
Quoted 10 lines · Stefano Stabellini
Quoted 9 lines · Paolo Bonzini
Quoted 9 lines · Stefano Stabellini
Quoted 7 lines
Quoted 7 lines
(quoted diff) +4
-1+ if (lseek(config_fd, pos, SEEK_SET) != pos) { + return -errno; + } do { - rc = pread(config_fd, (uint8_t *)&val, len, pos); + rc = read(config_fd, (uint8_t *)&val, len); } while (rc < 0 && (errno == EINTR || errno == EAGAIN));
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
Quoted 1 line
This leaks
config_fd.I don't follow, it leaks
config_fdwhere?Where lseek returns -errno (and IIRC in other places in the same function).
Do you mean we need this change?
Yes, please send out a separate patch. Add my Acked-by.
Quoted 28 lines
hw/pci-host/piix.c +3
-0@@ -775,15 +775,18 @@ static int host_pci_config_read(int pos, int len, uint32_t val) }if (lseek (config_fd, pos,SEEK_SET ) != pos) { +close (config_fd);return -errno; }do { rc =read (config_fd, (uint8_t *)&val, len); }while (rc <0 && (errno ==EINTR || errno ==EAGAIN ));if (rc != len) { +close (config_fd);return -errno; } +close (config_fd);return 0 ; }Thanks
Tiejun
Quoted 5 lines · Stefano Stabellini
Speak about build environments, Peter, would you care to share your scripts and setup so that I can run similar tests in the future on my own? I have no OSX machines so I tried to do a Windows cross-compile, following http://wiki.qemu.org/Hosts/W32 on Debian 7, but I failed very early with an "ERROR: zlib check failed".
My build scripts are at
https://git.linaro.org/people/peter.maydell/misc-scripts.git
(in particular pull-buildtest runs the test and remake-merge-builds does the one-time configure-each-build-tree setup.) But they're really just doing a make/make check. I don't have scripts for getting the cross-compile environment set up in the first place, I'm afraid.
Your error message means you're missing the zlib cross library. Fedora provides packaged versions of all the cross libs, but for Debian you have to download them from the upstream websites and stick them in a directory somewhere.
My (Ubuntu-based) instructions from last time somebody asked:
https://lists.gnu.org/archive/html/qemu-devel/2015-04/msg00688.html
thanks
-- PMM
Quoted 31 lines · Stefano Stabellini
Quoted 22 lines · Peter Maydell
Quoted 8 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.gittags/xen-2015-09-08-tagQuoted 8 lines
for you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Hi. I'm afraid this fails to build on OSX (and probably Windows too, though that build hasn't run yet):
Quoted 7 lines
CC
i386-softmmu/hw/i386/pci-assign-load-rom.o
/Users/pm215/src/qemu/hw/i386/pci-assign-load-rom.c:6:10: fatal error:
'sys/io.h' file not found#include <sys/io.h> ^CC
alpha-softmmu/hw/alpha/pci.o
1 error generated.
Quoted 5 lines
Tiejun,
this is caused by
33d33242b7d802e6c994f3d56ecba96a66465dc3, "hw/pci-assign: splitpci-assign.c". Could you please double-check non-Linux builds?
Its interesting.
As you see this short log, "hw/pci-assign: split pci-assign.c", so this means I just extract something from the original hw/i386/kvm/pci-assign.c, and here so I just keep those original head files residing hw/i386/kvm/pci-assign.c, and I didn't introduce anything new.
So its very probably that you still can't compile successfully even without my commit on OSX/Windows, right? I think Peter may be right,
"Will passthrough even work on Windows and OSX hosts? Consider whether we should be building this code on those hosts at all..."
I prefer this isn't what we did previously.
Quoted 4 lines
I suspect that the fix would be quite small, but I don't have an OSX or a Windows build environment to try it.
I haven't a this build environment as well. But I think right now you can remove "#include <sys/io.h>" to fix this simply since looks this is redundant actually.
hw/i386/pci-assign: remove one head file
This is redundant actually but really break OS/Windows build.
hw/i386/pci-assign-load-rom.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdio.h> #include <unistd.h> -#include <sys/io.h> #include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h>
At least I can build this under Linux,
./configure --target-list=x86_64-softmmu && make
Thanks
Tiejun
Quoted 7 lines
Speak about build environments, Peter, would you care to share your scripts and setup so that I can run similar tests in the future on my own? I have no OSX machines so I tried to do a Windows cross-compile, following http://wiki.qemu.org/Hosts/W32 on Debian 7, but I failed very early with an "ERROR: zlib check failed".
Quoted 46 lines · Tiejun
Quoted 38 lines · Stefano Stabellini
Quoted 27 lines · Peter Maydell
Quoted 13 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)
are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git
tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:Quoted 7 lines
xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings.
(2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Hi. I'm afraid this fails to build on OSX (and probably Windows too, though that build hasn't run yet):
Quoted 7 lines
CC
i386-softmmu/hw/i386/pci-assign-load-rom.o
/Users/pm215/src/qemu/hw/i386/pci-assign-load-rom.c:6:10: fatal error:
'sys/io.h' file not found#include <sys/io.h> ^CC
alpha-softmmu/hw/alpha/pci.o
1 error generated.Quoted 5 lines
Tiejun,
this is caused by
33d33242b7d802e6c994f3d56ecba96a66465dc3, "hw/pci-assign: splitpci-assign.c". Could you please double-check non-Linux builds?
Quoted 6 lines
Its interesting.
As you see this short log, "hw/pci-assign: split
pci-assign.c", so this means I just extract something from the originalhw/i386/kvm/pci-assign.c, and here so I just keep those original head files residinghw/i386/kvm/pci-assign.c, and I didn't introduce anything new.
hw/i386/kvm/pci-assign.c is only built if configure set CONFIG_KVM, which it won't do on Windows or OSX builds.
It sounds like your patch has incorrectly moved code out of files which are compiled only if KVM is present, or only if we're doing Xen PCI passthrough, and into compiled-for-everything files.
Quoted 2 lines
So its very probably that you still can't compile successfully even without my commit on OSX/Windows, right?
OSX and Windows build fine on master at the moment; I check this for every pull request.
thanks
-- PMM
Quoted 5 lines
Quoted 4 lines
As you see this short log, "hw/pci-assign: split
pci-assign.c", so this means I just extract something from the originalhw/i386/kvm/pci-assign.c, and here so I just keep those original head files residinghw/i386/kvm/pci-assign.c, and I didn't introduce anything new.
Quoted 7 lines
hw/i386/kvm/pci-assign.cis only built if configure setCONFIG_KVM, which it won't do on Windows or OSX builds.It sounds like your patch has incorrectly moved code out of files which are compiled only if KVM is present, or only if we're doing Xen PCI passthrough, and into compiled-for-everything files.
Yes, we want to share this chunk of codes between Xen and Kvm. Just to this error, could we remove #include <sys/io.h>? As I mentioned I still can compile this file without this head file.
Thanks
Tiejun
Quoted 8 lines · Tiejun
Quoted 8 lines
Quoted 4 lines
As you see this short log, "hw/pci-assign: split
pci-assign.c", so this means I just extract something from the originalhw/i386/kvm/pci-assign.c, and here so I just keep those original head files residinghw/i386/kvm/pci-assign.c, and I didn't introduce anything new.
hw/i386/kvm/pci-assign.cis only built if configure setCONFIG_KVM, which it won't do on Windows or OSX builds.
Quoted 8 lines
Quoted 4 lines
It sounds like your patch has incorrectly moved code out of files which are compiled only if KVM is present, or only if we're doing Xen PCI passthrough, and into compiled-for-everything files.
Yes, we want to share this chunk of codes between Xen and Kvm. Just to this error, could we remove #include <
sys/io.h>? As I mentioned I still can compile this file without this head file.
And #include <sys/mman.h>, but it does seem to still work on Linux after removing them
Stefano,
I have two questions,
#1. Which qemu version is this igd stuff going into? 2.6?
#2. Is this igd stuff going into qemu-xen inside xen? Any plan to go into xen 4.6?
Thanks
Tiejun
Quoted 78 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use XEN_PT_LOG properly to guard against compiler warnings. (2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreqJan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handlingKonrad Rzeszutek Wilk (7):
xen-hvm: When usingxc_domain_add_to_physmapalso include errno when reporting xen/pt: Update comments with proper function name.
xen/pt: Makexen_pt_msi_set_enablestatic
xen/pt:xen_host_pci_config_readreturns -errno, not -1 on failure
xen: use errno instead of rc forxc_domain_add_to_physmapxen/pt/msi: Add the register value when printing logging and error messages xen/pt: UseXEN_PT_LOGproperly to guard against compiler warnings.Michael S. Tsirkin (1):
i440fx: make types configurable at run-timeTiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough
hw/pci-assign: splitpci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work
igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge
xen, gfx passthrough: register host bridge specific to passthrough xen, gfx passthrough: add opregion mappingconfigure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-)create mode 100644
hw/i386/pci-assign-load-rom.ccreate mode 100644hw/xen/xen_pt_graphics.ccreate mode 100644include/hw/pci/pci-assign.h_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
It is going to be in QEMU 2.5 and qemu-xen 4.7.
Quoted 96 lines · Tiejun
Stefano,
I have two questions,
#1. Which qemu version is this igd stuff going into? 2.6?
#2. Is this igd stuff going into qemu-xen inside xen? Any plan to go into xen 4.6?Thanks
TiejunQuoted 83 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git
tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings.
(2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreqJan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handlingKonrad Rzeszutek Wilk (7):
xen-hvm: When usingxc_domain_add_to_physmapalso include errno when
reporting
xen/pt: Update comments with proper function name. xen/pt: Makexen_pt_msi_set_enablestatic
xen/pt:xen_host_pci_config_readreturns -errno, not -1 on failure
xen: use errno instead of rc forxc_domain_add_to_physmapxen/pt/msi: Add the register value when printing logging and error
messages
xen/pt: UseXEN_PT_LOGproperly to guard against compiler warnings.Michael S. Tsirkin (1):
i440fx: make types configurable at run-timeTiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough
hw/pci-assign: splitpci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work
igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge
xen, gfx passthrough: register host bridge specific to passthrough xen, gfx passthrough: add opregion mappingconfigure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-)create mode 100644
hw/i386/pci-assign-load-rom.ccreate mode 100644hw/xen/xen_pt_graphics.ccreate mode 100644include/hw/pci/pci-assign.h_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 1 line · Stefano Stabellini
It is going to be in QEMU 2.5 and qemu-xen 4.7.
Thanks for your reply.
Do we have any possibility of just merging this series into qemu-xen 4.6? We really want to support IGD passthrough on xen 4.6 if possible :)
Thanks
Tiejun
Quoted 100 lines · Tiejun
Quoted 96 lines
Stefano,
I have two questions,
#1. Which qemu version is this igd stuff going into? 2.6?
#2. Is this igd stuff going into qemu-xen inside xen? Any plan to go into xen 4.6?Thanks
TiejunQuoted 83 lines · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git
tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings.
(2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreqJan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handlingKonrad Rzeszutek Wilk (7):
xen-hvm: When usingxc_domain_add_to_physmapalso include errno when
reporting
xen/pt: Update comments with proper function name. xen/pt: Makexen_pt_msi_set_enablestatic
xen/pt:xen_host_pci_config_readreturns -errno, not -1 on failure
xen: use errno instead of rc forxc_domain_add_to_physmapxen/pt/msi: Add the register value when printing logging and error
messages
xen/pt: UseXEN_PT_LOGproperly to guard against compiler warnings.Michael S. Tsirkin (1):
i440fx: make types configurable at run-timeTiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough
hw/pci-assign: splitpci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work
igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge
xen, gfx passthrough: register host bridge specific to passthrough xen, gfx passthrough: add opregion mappingconfigure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-)create mode 100644
hw/i386/pci-assign-load-rom.ccreate mode 100644hw/xen/xen_pt_graphics.ccreate mode 100644include/hw/pci/pci-assign.h_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
No, unfortunately it is not possible at this stage of the release cycle. But users can still use QEMU 2.5 (as soon as it is released, which should be in a couple of months) with Xen 4.6 as there is not a strong tie between QEMU releases and Xen releases.
Quoted 119 lines · Tiejun
Quoted 1 line · Stefano Stabellini
It is going to be in QEMU 2.5 and qemu-xen 4.7.
Thanks for your reply.
Do we have any possibility of just merging this series into qemu-xen 4.6? We really want to support IGD passthrough on xen 4.6 if possible :)
Thanks
TiejunQuoted 107 lines · Tiejun
Quoted 103 lines
Stefano,
I have two questions,
#1. Which qemu version is this igd stuff going into? 2.6?
#2. Is this igd stuff going into qemu-xen inside xen? Any plan to go into xen
4.6?Thanks
TiejunQuoted 1 line · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:Quoted 20 lines
target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git
tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings.
(2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreqQuoted 5 lines
Jan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handlingKonrad Rzeszutek Wilk (7):
xen-hvm: When usingxc_domain_add_to_physmapalso include errnowhen
Quoted 4 lines
reporting
xen/pt: Update comments with proper function name. xen/pt: Makexen_pt_msi_set_enablestatic xen/pt:xen_host_pci_config_readreturns -errno, not -1 onfailure
Quoted 2 lines
xen: use errno instead of rc for
xc_domain_add_to_physmapxen/pt/msi: Add the register value when printing logging anderror
Quoted 2 lines
messages
xen/pt: UseXEN_PT_LOGproperly to guard against compilerwarnings.
Quoted 4 lines
Michael S. Tsirkin (1):
i440fx: make types configurable at run-timeQuoted 9 lines
Tiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough hw/pci-assign: splitpci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge xen, gfx passthrough: register host bridge specific topassthrough
Quoted 36 lines
xen, gfx passthrough: add opregion mapping
configure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-)create mode 100644
hw/i386/pci-assign-load-rom.ccreate mode 100644hw/xen/xen_pt_graphics.ccreate mode 100644include/hw/pci/pci-assign.h_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Hi,
Quoted 5 lines · Stefano Stabellini
No, unfortunately it is not possible at this stage of the release cycle. But users can still use QEMU 2.5 (as soon as it is released, which should be in a couple of months) with Xen 4.6 as there is not a strong tie between QEMU releases and Xen releases.
Is backport to qemu-xen-4.6 possible *after* Xen 4.6.0 has been released? So basicly for Xen 4.6.1.
There's value in having this feature available out-of-the-box, with stock Xen, without having to replace qemu with a custom build/version.
Thanks,
-- Pasi
Quoted 125 lines · Tiejun
Quoted 119 lines · Stefano Stabellini
Quoted 1 line
It is going to be in QEMU 2.5 and qemu-xen 4.7.
Thanks for your reply.
Do we have any possibility of just merging this series into qemu-xen 4.6? We really want to support IGD passthrough on xen 4.6 if possible :)
Thanks
TiejunQuoted 107 lines · Tiejun
Quoted 103 lines
Stefano,
I have two questions,
#1. Which qemu version is this igd stuff going into? 2.6?
#2. Is this igd stuff going into qemu-xen inside xen? Any plan to go into xen
4.6?Thanks
TiejunQuoted 1 line · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:Quoted 20 lines
target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git
tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings.
(2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreqQuoted 5 lines
Jan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handlingKonrad Rzeszutek Wilk (7):
xen-hvm: When usingxc_domain_add_to_physmapalso include errnowhen
Quoted 4 lines
reporting
xen/pt: Update comments with proper function name. xen/pt: Makexen_pt_msi_set_enablestatic xen/pt:xen_host_pci_config_readreturns -errno, not -1 onfailure
Quoted 2 lines
xen: use errno instead of rc for
xc_domain_add_to_physmapxen/pt/msi: Add the register value when printing logging anderror
Quoted 2 lines
messages
xen/pt: UseXEN_PT_LOGproperly to guard against compilerwarnings.
Quoted 4 lines
Michael S. Tsirkin (1):
i440fx: make types configurable at run-timeQuoted 9 lines
Tiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough hw/pci-assign: splitpci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge xen, gfx passthrough: register host bridge specific topassthrough
Quoted 36 lines
xen, gfx passthrough: add opregion mapping
configure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-)create mode 100644
hw/i386/pci-assign-load-rom.ccreate mode 100644hw/xen/xen_pt_graphics.ccreate mode 100644include/hw/pci/pci-assign.h_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 10 lines · Pasi Kärkkäinen
Hi,
Quoted 5 lines · Stefano Stabellini
No, unfortunately it is not possible at this stage of the release cycle. But users can still use QEMU 2.5 (as soon as it is released, which should be in a couple of months) with Xen 4.6 as there is not a strong tie between QEMU releases and Xen releases.
Is backport to qemu-xen-4.6 possible *after* Xen 4.6.0 has been released? So basicly for Xen 4.6.1.
I don't think so, this is not backport material (which is basically only fixes).
Quoted 1 line
There's value in having this feature available out-of-the-box, with stock Xen, without having to replace qemu with a custom build/version.
Of course, and it will be, in Xen 4.7.
Quoted 130 lines
Thanks,
-- Pasi
Quoted 125 lines · Tiejun
Quoted 119 lines · Stefano Stabellini
Quoted 1 line
It is going to be in QEMU 2.5 and qemu-xen 4.7.
Thanks for your reply.
Do we have any possibility of just merging this series into qemu-xen 4.6? We really want to support IGD passthrough on xen 4.6 if possible :)
Thanks
TiejunQuoted 107 lines · Tiejun
Quoted 103 lines
Stefano,
I have two questions,
#1. Which qemu version is this igd stuff going into? 2.6?
#2. Is this igd stuff going into qemu-xen inside xen? Any plan to go into xen
4.6?Thanks
TiejunQuoted 1 line · Stefano Stabellini
The following changes since commit
8611280505119e296757a60711a881341603fa5a:Quoted 20 lines
target-microblaze: Use setcond for pcmp* (2015-09-08 08:49:33 +0200)are available in the git repository at:
git://xenbits.xen.org/people/sstabellini/qemu-dm.git
tags/xen-2015-09-08-tagfor you to fetch changes up to
ba2250ad148997b1352aba976aac66b55410e7e4:xen/pt: Use
XEN_PT_LOGproperly to guard against compiler warnings.
(2015-09-08 15:21:56 +0000)----------------------------------------------------------------
Xen branch xen-2015-09-08----------------------------------------------------------------
Don Slutz (1):
xen-hvm: Add trace to ioreqQuoted 5 lines
Jan Beulich (1):
xen/HVM: atomically access pointers in bufioreq handlingKonrad Rzeszutek Wilk (7):
xen-hvm: When usingxc_domain_add_to_physmapalso include errnowhen
Quoted 4 lines
reporting
xen/pt: Update comments with proper function name. xen/pt: Makexen_pt_msi_set_enablestatic xen/pt:xen_host_pci_config_readreturns -errno, not -1 onfailure
Quoted 2 lines
xen: use errno instead of rc for
xc_domain_add_to_physmapxen/pt/msi: Add the register value when printing logging anderror
Quoted 2 lines
messages
xen/pt: UseXEN_PT_LOGproperly to guard against compilerwarnings.
Quoted 4 lines
Michael S. Tsirkin (1):
i440fx: make types configurable at run-timeQuoted 9 lines
Tiejun Chen (9):
pc_init1: pass parameters just with types
piix: create host bridge to passthrough hw/pci-assign: splitpci-assign.c
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: retrieve VGA BIOS to work igd gfx passthrough: create a isa bridge
xen, gfx passthrough: register a isa bridge xen, gfx passthrough: register host bridge specific topassthrough
Quoted 36 lines
xen, gfx passthrough: add opregion mapping
configure | 28 +++++ hw/core/machine.c | 20 +++ hw/i386/Makefile.objs | 1 + hw/i386/kvm/pci-assign.c | 82 ++----------- hw/i386/pc_piix.c | 139 ++++++++++++++++++++- hw/i386/pci-assign-load-rom.c | 93 ++++++++++++++ hw/pci-host/piix.c | 91 +++++++++++++- hw/xen/Makefile.objs | 1 + hw/xen/xen-host-pci-device.c | 5 + hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt.c | 42 ++++++- hw/xen/xen_pt.h | 22 +++- hw/xen/xen_pt_config_init.c | 59 ++++++++- hw/xen/xen_pt_graphics.c | 272 +++++++++++++++++++++++++++++++++++++++++ hw/xen/xen_pt_msi.c | 2 +- include/hw/boards.h | 1 + include/hw/i386/pc.h | 9 +- include/hw/pci/pci-assign.h | 27 ++++ include/hw/xen/xen_common.h | 34 +++++- qemu-options.hx | 3 + trace-events | 7 ++ vl.c | 10 ++ xen-hvm.c | 55 +++++++-- 23 files changed, 891 insertions(+), 113 deletions(-)create mode 100644
hw/i386/pci-assign-load-rom.ccreate mode 100644hw/xen/xen_pt_graphics.ccreate mode 100644include/hw/pci/pci-assign.h_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel