Re: [Qemu-devel] [PATCH v3] qemu-kvm/pci-assign: 64 bits bar emulation

2012-12-23 Thread Gleb Natapov
On Thu, Dec 20, 2012 at 11:07:23AM +0800, Xudong Hao wrote:
> Enable 64 bits bar emulation.
> 
> v3 changes from v2:
> - Leave original error string and drop the leading 016.
> 
> v2 changes from v1:
> - Change 0lx% to 0x%016 when print a 64 bit variable.
> 
> Test pass with the current seabios which already support 64bit pci bars.
> 
> Signed-off-by: Xudong Hao 
Alex, is this OK with you now?

> ---
>  hw/kvm/pci-assign.c |   14 ++
>  1 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c
> index 7a0998c..2271a2e 100644
> --- a/hw/kvm/pci-assign.c
> +++ b/hw/kvm/pci-assign.c
> @@ -46,6 +46,7 @@
>  #define IORESOURCE_IRQ  0x0400
>  #define IORESOURCE_DMA  0x0800
>  #define IORESOURCE_PREFETCH 0x2000  /* No side effects */
> +#define IORESOURCE_MEM_64   0x0010
>  
>  //#define DEVICE_ASSIGNMENT_DEBUG
>  
> @@ -442,9 +443,13 @@ static int assigned_dev_register_regions(PCIRegion 
> *io_regions,
>  
>  /* handle memory io regions */
>  if (cur_region->type & IORESOURCE_MEM) {
> -int t = cur_region->type & IORESOURCE_PREFETCH
> -? PCI_BASE_ADDRESS_MEM_PREFETCH
> -: PCI_BASE_ADDRESS_SPACE_MEMORY;
> +int t = PCI_BASE_ADDRESS_SPACE_MEMORY;
> +if (cur_region->type & IORESOURCE_PREFETCH) {
> +t |= PCI_BASE_ADDRESS_MEM_PREFETCH;
> +}
> +if (cur_region->type & IORESOURCE_MEM_64) {
> +t |= PCI_BASE_ADDRESS_MEM_TYPE_64;
> +}
>  
>  /* map physical memory */
>  pci_dev->v_addrs[i].u.r_virtbase = mmap(NULL, cur_region->size,
> @@ -632,7 +637,8 @@ again:
>  rp->valid = 0;
>  rp->resource_fd = -1;
>  size = end - start + 1;
> -flags &= IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH;
> +flags &= IORESOURCE_IO | IORESOURCE_MEM | IORESOURCE_PREFETCH
> + | IORESOURCE_MEM_64;
>  if (size == 0 || (flags & ~IORESOURCE_PREFETCH) == 0) {
>  continue;
>  }
> -- 
> 1.5.5

--
Gleb.



Re: [Qemu-devel] [PATCH] arm: vexpress: Clear sysctl cfgctrl start bit

2012-12-23 Thread Peter Maydell
On 22 December 2012 19:03, Christoffer Dall
 wrote:
> The start bit should only be set to indicate that a function call is
> underway, right now.  When done with function, clear it.

Looks plausible but I'd like a crosscheck that this is how the hardware
really behaves.

-- PMM



Re: [Qemu-devel] [PATCH v3] qemu-kvm/pci-assign: 64 bits bar emulation

2012-12-23 Thread Andreas Färber
Am 20.12.2012 04:07, schrieb Xudong Hao:
> Enable 64 bits bar emulation.
> 
> v3 changes from v2:
> - Leave original error string and drop the leading 016.
> 
> v2 changes from v1:
> - Change 0lx% to 0x%016 when print a 64 bit variable.
> 
> Test pass with the current seabios which already support 64bit pci bars.
> 
> Signed-off-by: Xudong Hao 

If this is for qemu.git as indicated by the recient, "qemu-kvm" is
misleading and should be dropped from subject.
Also, change logs are supposed to go under --- or into a cover letter.
Probably the maintainers can fix this for you if the code is fine.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



[Qemu-devel] [RFC 3/8] uhci: do not use old_portio-style callbacks

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 hw/usb/hcd-uhci.c |   43 +--
 1 file changed, 33 insertions(+), 10 deletions(-)

diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index d053791..cc47635 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1213,18 +1213,41 @@ static void uhci_frame_timer(void *opaque)
 qemu_mod_timer(s->frame_timer, s->expire_time);
 }
 
-static const MemoryRegionPortio uhci_portio[] = {
-{ 0, 32, 2, .write = uhci_ioport_writew, },
-{ 0, 32, 2, .read = uhci_ioport_readw, },
-{ 0, 32, 4, .write = uhci_ioport_writel, },
-{ 0, 32, 4, .read = uhci_ioport_readl, },
-{ 0, 32, 1, .write = uhci_ioport_writeb, },
-{ 0, 32, 1, .read = uhci_ioport_readb, },
-PORTIO_END_OF_LIST()
-};
+static uint64_t uhci_ioport_read(void *opaque, hwaddr addr, unsigned int size)
+{
+switch (size) {
+case 1:
+return uhci_ioport_readb(opaque, (uint32_t)addr);
+case 2:
+return uhci_ioport_readw(opaque, (uint32_t)addr);
+case 4:
+return uhci_ioport_readl(opaque, (uint32_t)addr);
+default:
+return ~0UL;
+}
+}
+
+static void uhci_ioport_write(void *opaque, hwaddr addr, uint64_t data,
+  unsigned int size)
+{
+switch (size) {
+case 1:
+uhci_ioport_writeb(opaque, (uint32_t)addr, (uint32_t)data);
+break;
+case 2:
+uhci_ioport_writew(opaque, (uint32_t)addr, (uint32_t)data);
+break;
+case 4:
+uhci_ioport_writel(opaque, (uint32_t)addr, (uint32_t)data);
+break;
+default:
+break;
+}
+}
 
 static const MemoryRegionOps uhci_ioport_ops = {
-.old_portio = uhci_portio,
+.read = uhci_ioport_read,
+.write = uhci_ioport_write,
 };
 
 static USBPortOps uhci_port_ops = {
-- 
1.7.10.4




[Qemu-devel] [RFC 0/8] Remove old_portio usage

2012-12-23 Thread Hervé Poussineau
These proposed patches aim at removing the .old_portio member of
MemoryRegionOps structure, and replacing their usage by .read/.write
handlers.

Patches 2 to 6 are already ready to be committed.
However, patches 7 and 8 depend of patch 1, where a better solution
needs to be found.

That way, faked I/O address space can be removed from architectures
which don't have it (MIPS, PowerPC...), and commits like
a178274efabcbbc5d44805b51def874e47051325 ("PPC: pseries: Remove hack
for PIO window") can be reapplied.

Hervé Poussineau (8):
  pc: disable bochs bios debug ports (do not apply!)
  xen_platform: do not use old_portio-style callbacks
  uhci: do not use old_portio-style callbacks
  acpi-piix4: do not use old_portio-style callbacks
  vga/qxl: do not use portio_list_init/portio_list_add
  isa: use memory regions instead of portio_list_* functions
  ioport: remove now useless portio_list_* functions
  memory: remove old_portio-style callbacks support

 hw/acpi_piix4.c   |   91 +-
 hw/isa-bus.c  |  127 +++--
 hw/isa.h  |2 +-
 hw/pc.c   |6 +++
 hw/qxl.c  |4 +-
 hw/usb/hcd-uhci.c |   43 +-
 hw/vga.c  |8 +---
 hw/xen_platform.c |   21 +
 ioport.c  |  121 --
 ioport.h  |   19 
 memory.c  |   44 ---
 memory.h  |4 --
 12 files changed, 217 insertions(+), 273 deletions(-)

-- 
1.7.10.4




[Qemu-devel] [RFC 1/8] pc: disable bochs bios debug ports (do not apply!)

2012-12-23 Thread Hervé Poussineau
This patch must not be applied as-is.
Some patches to use MemoryRegion have already been sent to
mailing list, but none has been applied yet.
---
 hw/pc.c |6 ++
 1 file changed, 6 insertions(+)

diff --git a/hw/pc.c b/hw/pc.c
index b11e7c4..7f98955 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -524,6 +524,7 @@ static void handle_a20_line_change(void *opaque, int irq, 
int level)
 cpu_x86_set_a20(cpu, level);
 }
 
+#if 0
 /***/
 /* Bochs BIOS debug ports */
 
@@ -551,6 +552,7 @@ static void bochs_bios_write(void *opaque, uint32_t addr, 
uint32_t val)
 exit((val << 1) | 1);
 }
 }
+#endif
 
 int e820_add_entry(uint64_t address, uint64_t length, uint32_t type)
 {
@@ -569,6 +571,7 @@ int e820_add_entry(uint64_t address, uint64_t length, 
uint32_t type)
 return index;
 }
 
+#if 0
 static const MemoryRegionPortio bochs_bios_portio_list[] = {
 { 0x500, 1, 1, .write = bochs_bios_write, }, /* 0x500 */
 { 0x501, 1, 1, .write = bochs_bios_write, }, /* 0x501 */
@@ -576,6 +579,7 @@ static const MemoryRegionPortio bochs_bios_portio_list[] = {
 { 0x8900, 1, 1, .write = bochs_bios_write, }, /* 0x8900 */
 PORTIO_END_OF_LIST(),
 };
+#endif
 
 static void *bochs_bios_init(void)
 {
@@ -584,11 +588,13 @@ static void *bochs_bios_init(void)
 size_t smbios_len;
 uint64_t *numa_fw_cfg;
 int i, j;
+#if 0
 PortioList *bochs_bios_port_list = g_new(PortioList, 1);
 
 portio_list_init(bochs_bios_port_list, bochs_bios_portio_list,
  NULL, "bochs-bios");
 portio_list_add(bochs_bios_port_list, get_system_io(), 0x0);
+#endif
 
 fw_cfg = fw_cfg_init(BIOS_CFG_IOPORT, BIOS_CFG_IOPORT + 1, 0, 0);
 
-- 
1.7.10.4




[Qemu-devel] [RFC 8/8] memory: remove old_portio-style callbacks support

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 memory.c |   44 
 memory.h |4 
 2 files changed, 48 deletions(-)

diff --git a/memory.c b/memory.c
index 7419853..ea3bb8a 100644
--- a/memory.c
+++ b/memory.c
@@ -365,21 +365,6 @@ static void access_with_adjusted_size(hwaddr addr,
 }
 }
 
-static const MemoryRegionPortio *find_portio(MemoryRegion *mr, uint64_t offset,
- unsigned width, bool write)
-{
-const MemoryRegionPortio *mrp;
-
-for (mrp = mr->ops->old_portio; mrp->size; ++mrp) {
-if (offset >= mrp->offset && offset < mrp->offset + mrp->len
-&& width == mrp->size
-&& (write ? (bool)mrp->write : (bool)mrp->read)) {
-return mrp;
-}
-}
-return NULL;
-}
-
 static void memory_region_iorange_read(IORange *iorange,
uint64_t offset,
unsigned width,
@@ -390,21 +375,6 @@ static void memory_region_iorange_read(IORange *iorange,
 MemoryRegion *mr = mrio->mr;
 
 offset += mrio->offset;
-if (mr->ops->old_portio) {
-const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset,
-width, false);
-
-*data = ((uint64_t)1 << (width * 8)) - 1;
-if (mrp) {
-*data = mrp->read(mr->opaque, offset);
-} else if (width == 2) {
-mrp = find_portio(mr, offset - mrio->offset, 1, false);
-assert(mrp);
-*data = mrp->read(mr->opaque, offset) |
-(mrp->read(mr->opaque, offset + 1) << 8);
-}
-return;
-}
 *data = 0;
 access_with_adjusted_size(offset, data, width,
   mr->ops->impl.min_access_size,
@@ -422,20 +392,6 @@ static void memory_region_iorange_write(IORange *iorange,
 MemoryRegion *mr = mrio->mr;
 
 offset += mrio->offset;
-if (mr->ops->old_portio) {
-const MemoryRegionPortio *mrp = find_portio(mr, offset - mrio->offset,
-width, true);
-
-if (mrp) {
-mrp->write(mr->opaque, offset, data);
-} else if (width == 2) {
-mrp = find_portio(mr, offset - mrio->offset, 1, true);
-assert(mrp);
-mrp->write(mr->opaque, offset, data & 0xff);
-mrp->write(mr->opaque, offset + 1, data >> 8);
-}
-return;
-}
 access_with_adjusted_size(offset, &data, width,
   mr->ops->impl.min_access_size,
   mr->ops->impl.max_access_size,
diff --git a/memory.h b/memory.h
index 9462bfd..bdde0d0 100644
--- a/memory.h
+++ b/memory.h
@@ -103,10 +103,6 @@ struct MemoryRegionOps {
  bool unaligned;
 } impl;
 
-/* If .read and .write are not present, old_portio may be used for
- * backwards compatibility with old portio registration
- */
-const MemoryRegionPortio *old_portio;
 /* If .read and .write are not present, old_mmio may be used for
  * backwards compatibility with old mmio registration
  */
-- 
1.7.10.4




[Qemu-devel] [RFC 6/8] isa: use memory regions instead of portio_list_* functions

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 hw/isa-bus.c |  127 --
 hw/isa.h |2 +-
 2 files changed, 125 insertions(+), 4 deletions(-)

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 144a88e..d22f432 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -104,19 +104,140 @@ void isa_register_ioport(ISADevice *dev, MemoryRegion 
*io, uint16_t start)
 isa_init_ioport(dev, start);
 }
 
+typedef struct PortioState {
+const char *name; /* debug purposes */
+uint16_t start;
+uint16_t offset;
+const MemoryRegionPortio *pio_start;
+void *opaque;
+} PortioState;
+
+static const MemoryRegionPortio *portio_find(const MemoryRegionPortio *mrp,
+ uint64_t offset,
+ unsigned int width, bool write,
+ bool smaller)
+{
+for (; mrp->size; ++mrp) {
+if (offset >= mrp->offset && offset < mrp->offset + mrp->len
+&& (width == mrp->size || (smaller && width < mrp->size))
+&& (write ? (bool)mrp->write : (bool)mrp->read)) {
+return mrp;
+}
+}
+return NULL;
+}
+
+static uint64_t portio_read(void *opaque, hwaddr addr, unsigned int size)
+{
+const PortioState *s = opaque;
+const MemoryRegionPortio *mrp;
+
+addr += s->offset;
+mrp = portio_find(s->pio_start, addr, size, false, false);
+if (mrp) {
+return mrp->read(s->opaque, s->start + addr);
+} else if (size == 2) {
+uint64_t data;
+mrp = portio_find(s->pio_start, addr, 1, false, false);
+assert(mrp);
+data = mrp->read(s->opaque, s->start + addr) |
+  (mrp->read(s->opaque, s->start + addr + 1) << 8);
+return data;
+}
+qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid read from 0x%x size=%d",
+  s->name, s->start + (int)addr, size);
+return -1U;
+}
+
+static void portio_write(void *opaque, hwaddr addr, uint64_t data,
+ unsigned int size)
+{
+const PortioState *s = opaque;
+const MemoryRegionPortio *mrp;
+
+addr += s->offset;
+mrp = portio_find(s->pio_start, addr, size, true, false);
+if (mrp) {
+mrp->write(s->opaque, s->start + addr, data);
+return;
+} else if (size == 2) {
+mrp = portio_find(s->pio_start, addr, 1, true, false);
+assert(mrp);
+mrp->write(s->opaque, s->start + addr, data & 0xff);
+mrp->write(s->opaque, s->start + addr + 1, data >> 8);
+return;
+}
+qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid write to 0x%x size=%d",
+  s->name, s->start + (int)addr, size);
+}
+
+static bool portio_accepts(void *opaque, hwaddr addr, unsigned int size,
+   bool is_write)
+{
+const PortioState *s = opaque;
+const MemoryRegionPortio *mrp;
+
+addr += s->offset;
+mrp = portio_find(s->pio_start, addr, size, is_write, true);
+return (mrp != NULL);
+}
+
+const MemoryRegionOps portio_ops = {
+.read = portio_read,
+.write = portio_write,
+.valid.accepts = portio_accepts,
+.endianness = DEVICE_LITTLE_ENDIAN,
+};
+
+static void isa_register_portio_list_1(ISADevice *dev, uint16_t start,
+   uint16_t offset, uint16_t end,
+   const MemoryRegionPortio *pio_start,
+   void *opaque, const char *name)
+{
+MemoryRegion *mr = g_new(MemoryRegion, 1);
+PortioState *s = g_new(PortioState, 1);
+
+s->name = name;
+s->start = start;
+s->offset = offset;
+s->pio_start = pio_start;
+s->opaque = opaque;
+memory_region_init_io(mr, &portio_ops, s, name, end - offset);
+memory_region_add_subregion(isa_address_space_io(dev),
+start + offset, mr);
+}
+
 void isa_register_portio_list(ISADevice *dev, uint16_t start,
   const MemoryRegionPortio *pio_start,
   void *opaque, const char *name)
 {
-PortioList *piolist = g_new(PortioList, 1);
+const MemoryRegionPortio *pio, *first;
+uint16_t end;
 
 /* START is how we should treat DEV, regardless of the actual
contents of the portio array.  This is how the old code
actually handled e.g. the FDC device.  */
 isa_init_ioport(dev, start);
 
-portio_list_init(piolist, pio_start, opaque, name);
-portio_list_add(piolist, isabus->address_space_io, start);
+assert(pio_start->size);
+
+first = pio_start;
+end = 0;
+for (pio = pio_start; pio->size; pio++) {
+assert(pio->offset >= first->offset);
+if (pio->offset > first->offset + first->len) {
+isa_register_portio_list_1(dev, start, first->offset, end,
+   pio_start, opaque, name);
+first = pio;
+end = 0;
+   

[Qemu-devel] [RFC 7/8] ioport: remove now useless portio_list_* functions

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 ioport.c |  121 --
 ioport.h |   19 --
 2 files changed, 140 deletions(-)

diff --git a/ioport.c b/ioport.c
index 6e4ca0d..05f8026 100644
--- a/ioport.c
+++ b/ioport.c
@@ -329,124 +329,3 @@ uint32_t cpu_inl(pio_addr_t addr)
 LOG_IOPORT("inl : %04"FMT_pioaddr" %08"PRIx32"\n", addr, val);
 return val;
 }
-
-void portio_list_init(PortioList *piolist,
-  const MemoryRegionPortio *callbacks,
-  void *opaque, const char *name)
-{
-unsigned n = 0;
-
-while (callbacks[n].size) {
-++n;
-}
-
-piolist->ports = callbacks;
-piolist->nr = 0;
-piolist->regions = g_new0(MemoryRegion *, n);
-piolist->aliases = g_new0(MemoryRegion *, n);
-piolist->address_space = NULL;
-piolist->opaque = opaque;
-piolist->name = name;
-}
-
-void portio_list_destroy(PortioList *piolist)
-{
-g_free(piolist->regions);
-g_free(piolist->aliases);
-}
-
-static void portio_list_add_1(PortioList *piolist,
-  const MemoryRegionPortio *pio_init,
-  unsigned count, unsigned start,
-  unsigned off_low, unsigned off_high)
-{
-MemoryRegionPortio *pio;
-MemoryRegionOps *ops;
-MemoryRegion *region, *alias;
-unsigned i;
-
-/* Copy the sub-list and null-terminate it.  */
-pio = g_new(MemoryRegionPortio, count + 1);
-memcpy(pio, pio_init, sizeof(MemoryRegionPortio) * count);
-memset(pio + count, 0, sizeof(MemoryRegionPortio));
-
-/* Adjust the offsets to all be zero-based for the region.  */
-for (i = 0; i < count; ++i) {
-pio[i].offset -= off_low;
-}
-
-ops = g_new0(MemoryRegionOps, 1);
-ops->old_portio = pio;
-
-region = g_new(MemoryRegion, 1);
-alias = g_new(MemoryRegion, 1);
-/*
- * Use an alias so that the callback is called with an absolute address,
- * rather than an offset relative to to start + off_low.
- */
-memory_region_init_io(region, ops, piolist->opaque, piolist->name,
-  INT64_MAX);
-memory_region_init_alias(alias, piolist->name,
- region, start + off_low, off_high - off_low);
-memory_region_add_subregion(piolist->address_space,
-start + off_low, alias);
-piolist->regions[piolist->nr] = region;
-piolist->aliases[piolist->nr] = alias;
-++piolist->nr;
-}
-
-void portio_list_add(PortioList *piolist,
- MemoryRegion *address_space,
- uint32_t start)
-{
-const MemoryRegionPortio *pio, *pio_start = piolist->ports;
-unsigned int off_low, off_high, off_last, count;
-
-piolist->address_space = address_space;
-
-/* Handle the first entry specially.  */
-off_last = off_low = pio_start->offset;
-off_high = off_low + pio_start->len;
-count = 1;
-
-for (pio = pio_start + 1; pio->size != 0; pio++, count++) {
-/* All entries must be sorted by offset.  */
-assert(pio->offset >= off_last);
-off_last = pio->offset;
-
-/* If we see a hole, break the region.  */
-if (off_last > off_high) {
-portio_list_add_1(piolist, pio_start, count, start, off_low,
-  off_high);
-/* ... and start collecting anew.  */
-pio_start = pio;
-off_low = off_last;
-off_high = off_low + pio->len;
-count = 0;
-} else if (off_last + pio->len > off_high) {
-off_high = off_last + pio->len;
-}
-}
-
-/* There will always be an open sub-list.  */
-portio_list_add_1(piolist, pio_start, count, start, off_low, off_high);
-}
-
-void portio_list_del(PortioList *piolist)
-{
-MemoryRegion *mr, *alias;
-unsigned i;
-
-for (i = 0; i < piolist->nr; ++i) {
-mr = piolist->regions[i];
-alias = piolist->aliases[i];
-memory_region_del_subregion(piolist->address_space, alias);
-memory_region_destroy(alias);
-memory_region_destroy(mr);
-g_free((MemoryRegionOps *)mr->ops);
-g_free(mr);
-g_free(alias);
-piolist->regions[i] = NULL;
-piolist->aliases[i] = NULL;
-}
-}
diff --git a/ioport.h b/ioport.h
index 23441cb..cb06bff 100644
--- a/ioport.h
+++ b/ioport.h
@@ -56,23 +56,4 @@ uint32_t cpu_inl(pio_addr_t addr);
 struct MemoryRegion;
 struct MemoryRegionPortio;
 
-typedef struct PortioList {
-const struct MemoryRegionPortio *ports;
-struct MemoryRegion *address_space;
-unsigned nr;
-struct MemoryRegion **regions;
-struct MemoryRegion **aliases;
-void *opaque;
-const char *name;
-} PortioList;
-
-void portio_list_init(PortioList *piolist,
-  const struct MemoryRegionPortio *callbacks,
-  void *opaque, const char *name);
-void portio_l

[Qemu-devel] [RFC 4/8] acpi-piix4: do not use old_portio-style callbacks

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 hw/acpi_piix4.c |   91 ---
 1 file changed, 40 insertions(+), 51 deletions(-)

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 0b5b0d3..22704af 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -526,68 +526,57 @@ static const MemoryRegionOps piix4_gpe_ops = {
 .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
-static uint32_t pci_up_read(void *opaque, uint32_t addr)
+static uint64_t pci_read(void *opaque, hwaddr addr, unsigned int size)
 {
 PIIX4PMState *s = opaque;
-uint32_t val;
-
-/* Manufacture an "up" value to cause a device check on any hotplug
- * slot with a device.  Extra device checks are harmless. */
-val = s->pci0_slot_device_present & s->pci0_hotplug_enable;
-
-PIIX4_DPRINTF("pci_up_read %x\n", val);
-return val;
-}
-
-static uint32_t pci_down_read(void *opaque, uint32_t addr)
-{
-PIIX4PMState *s = opaque;
-uint32_t val = s->pci0_status.down;
+uint32_t val = 0;
+
+switch (addr) {
+case PCI_UP_BASE - PCI_HOTPLUG_ADDR:
+/* Manufacture an "up" value to cause a device check on any hotplug
+ * slot with a device.  Extra device checks are harmless. */
+val = s->pci0_slot_device_present & s->pci0_hotplug_enable;
+PIIX4_DPRINTF("pci_up_read %x\n", val);
+break;
+case PCI_DOWN_BASE - PCI_HOTPLUG_ADDR:
+val = s->pci0_status.down;
+PIIX4_DPRINTF("pci_down_read %x\n", val);
+break;
+case PCI_EJ_BASE - PCI_HOTPLUG_ADDR:
+/* No feature defined yet */
+PIIX4_DPRINTF("pci_features_read %x\n", val);
+break;
+case PCI_RMV_BASE - PCI_HOTPLUG_ADDR:
+val = s->pci0_hotplug_enable;
+break;
+default:
+break;
+}
 
-PIIX4_DPRINTF("pci_down_read %x\n", val);
 return val;
 }
 
-static uint32_t pci_features_read(void *opaque, uint32_t addr)
-{
-/* No feature defined yet */
-PIIX4_DPRINTF("pci_features_read %x\n", 0);
-return 0;
-}
-
-static void pciej_write(void *opaque, uint32_t addr, uint32_t val)
-{
-acpi_piix_eject_slot(opaque, val);
-
-PIIX4_DPRINTF("pciej write %x <== %d\n", addr, val);
-}
-
-static uint32_t pcirmv_read(void *opaque, uint32_t addr)
+static void pci_write(void *opaque, hwaddr addr, uint64_t data,
+  unsigned int size)
 {
-PIIX4PMState *s = opaque;
-
-return s->pci0_hotplug_enable;
+switch (addr) {
+case PCI_EJ_BASE - PCI_HOTPLUG_ADDR:
+acpi_piix_eject_slot(opaque, (uint32_t)data);
+PIIX4_DPRINTF("pciej write %x <== % " PRIu64 "\n", addr, data);
+break;
+default:
+break;
+}
 }
 
 static const MemoryRegionOps piix4_pci_ops = {
-.old_portio = (MemoryRegionPortio[]) {
-{
-.offset = PCI_UP_BASE - PCI_HOTPLUG_ADDR,   .len = 4, .size = 4,
-.read = pci_up_read,
-},{
-.offset = PCI_DOWN_BASE - PCI_HOTPLUG_ADDR, .len = 4, .size = 4,
-.read = pci_down_read,
-},{
-.offset = PCI_EJ_BASE - PCI_HOTPLUG_ADDR,   .len = 4, .size = 4,
-.read = pci_features_read,
-.write = pciej_write,
-},{
-.offset = PCI_RMV_BASE - PCI_HOTPLUG_ADDR,  .len = 4, .size = 4,
-.read = pcirmv_read,
-},
-PORTIO_END_OF_LIST()
+.read = pci_read,
+.write = pci_write,
+.endianness = DEVICE_NATIVE_ENDIAN,
+.valid = {
+.min_access_size = 4,
+.max_access_size = 4,
 },
-.endianness = DEVICE_LITTLE_ENDIAN,
 };
 
 static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
-- 
1.7.10.4




[Qemu-devel] [RFC 2/8] xen_platform: do not use old_portio-style callbacks

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 hw/xen_platform.c |   21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/hw/xen_platform.c b/hw/xen_platform.c
index a54e7a2..ad7cb06 100644
--- a/hw/xen_platform.c
+++ b/hw/xen_platform.c
@@ -280,7 +280,8 @@ static void platform_fixed_ioport_init(PCIXenPlatformState* 
s)
 
 /* Xen Platform PCI Device */
 
-static uint32_t xen_platform_ioport_readb(void *opaque, uint32_t addr)
+static uint64_t xen_platform_ioport_readb(void *opaque, hwaddr addr,
+  unsigned int size)
 {
 if (addr == 0) {
 return platform_fixed_ioport_readb(opaque, 0);
@@ -289,30 +290,28 @@ static uint32_t xen_platform_ioport_readb(void *opaque, 
uint32_t addr)
 }
 }
 
-static void xen_platform_ioport_writeb(void *opaque, uint32_t addr, uint32_t 
val)
+static void xen_platform_ioport_writeb(void *opaque, hwaddr addr,
+   uint64_t val, unsigned int size)
 {
 PCIXenPlatformState *s = opaque;
 
 switch (addr) {
 case 0: /* Platform flags */
-platform_fixed_ioport_writeb(opaque, 0, val);
+platform_fixed_ioport_writeb(opaque, 0, (uint32_t)val);
 break;
 case 8:
-log_writeb(s, val);
+log_writeb(s, (uint32_t)val);
 break;
 default:
 break;
 }
 }
 
-static MemoryRegionPortio xen_pci_portio[] = {
-{ 0, 0x100, 1, .read = xen_platform_ioport_readb, },
-{ 0, 0x100, 1, .write = xen_platform_ioport_writeb, },
-PORTIO_END_OF_LIST()
-};
-
 static const MemoryRegionOps xen_pci_io_ops = {
-.old_portio = xen_pci_portio,
+.read  = xen_platform_ioport_readb,
+.write = xen_platform_ioport_writeb,
+.impl.min_access_size = 1,
+.impl.max_access_size = 1,
 };
 
 static void platform_ioport_bar_setup(PCIXenPlatformState *d)
-- 
1.7.10.4




[Qemu-devel] [RFC 5/8] vga/qxl: do not use portio_list_init/portio_list_add

2012-12-23 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau 
---
 hw/qxl.c |4 +---
 hw/vga.c |8 ++--
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index 96887c4..7982524 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -2048,7 +2048,6 @@ static int qxl_init_primary(PCIDevice *dev)
 {
 PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);
 VGACommonState *vga = &qxl->vga;
-PortioList *qxl_vga_port_list = g_new(PortioList, 1);
 int rc;
 
 qxl->id = 0;
@@ -2056,8 +2055,7 @@ static int qxl_init_primary(PCIDevice *dev)
 vga->vram_size_mb = qxl->vga.vram_size >> 20;
 vga_common_init(vga);
 vga_init(vga, pci_address_space(dev), pci_address_space_io(dev), false);
-portio_list_init(qxl_vga_port_list, qxl_vga_portio_list, vga, "vga");
-portio_list_add(qxl_vga_port_list, pci_address_space_io(dev), 0x3b0);
+isa_register_portio_list(NULL, 0x3b0, qxl_vga_portio_list, vga, "vga");
 
 vga->ds = graphic_console_init(qxl_hw_update, qxl_hw_invalidate,
qxl_hw_screen_dump, qxl_hw_text_update, 
qxl);
diff --git a/hw/vga.c b/hw/vga.c
index c266161..ccdb997 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2349,8 +2349,6 @@ void vga_init(VGACommonState *s, MemoryRegion 
*address_space,
 {
 MemoryRegion *vga_io_memory;
 const MemoryRegionPortio *vga_ports, *vbe_ports;
-PortioList *vga_port_list = g_new(PortioList, 1);
-PortioList *vbe_port_list = g_new(PortioList, 1);
 
 qemu_register_reset(vga_reset, s);
 
@@ -2365,12 +2363,10 @@ void vga_init(VGACommonState *s, MemoryRegion 
*address_space,
 1);
 memory_region_set_coalescing(vga_io_memory);
 if (init_vga_ports) {
-portio_list_init(vga_port_list, vga_ports, s, "vga");
-portio_list_add(vga_port_list, address_space_io, 0x3b0);
+isa_register_portio_list(NULL, 0x3b0, vga_ports, s, "vga");
 }
 if (vbe_ports) {
-portio_list_init(vbe_port_list, vbe_ports, s, "vbe");
-portio_list_add(vbe_port_list, address_space_io, 0x1ce);
+isa_register_portio_list(NULL, 0x1ce, vbe_ports, s, "vbe");
 }
 }
 
-- 
1.7.10.4




Re: [Qemu-devel] [PATCH] arm: vexpress: Clear sysctl cfgctrl start bit

2012-12-23 Thread Christoffer Dall
On Sun, Dec 23, 2012 at 6:01 AM, Peter Maydell  wrote:
> On 22 December 2012 19:03, Christoffer Dall
>  wrote:
>> The start bit should only be set to indicate that a function call is
>> underway, right now.  When done with function, clear it.
>
> Looks plausible but I'd like a crosscheck that this is how the hardware
> really behaves.
>
sure, on my vexpress box that's certainly the case by experimentation though.

-Christoffer



Re: [Qemu-devel] [PATCH 2/2] qxl: change rom so that 4096 < size < 8192

2012-12-23 Thread Alon Levy
On Thu, Dec 13, 2012 at 01:05:48PM +0100, Gerd Hoffmann wrote:
> On 12/13/12 12:36, Alon Levy wrote:
> > This is a simpler solution to 869981, where migration breaks since qxl's
> > rom bar size has changed. Instead of ignoring fields in QXLRom, which is 
> > what has
> > actually changed, we remove some of the modes, a mechanism already
> > accounted for by the guest. To reach exactly two pages and not one, we
> > remove two out of four orientations, the remaining are normal and right
> > turn (chosen arbitrarily). Leaving only normal would result in a single
> > page which would also break migration.
> > 
> > Added assertions to ensure changes in spice-protocol in the future
> > causing increase or decrease of page size will result in failure at
> > startup (could do this compile time also but not sure how).
> 
> The assertions are not in the patch.
> 
> >  #define QXL_MODE_EX(x_res, y_res) \
> >  QXL_MODE_16_32(x_res, y_res, 0),  \
> > -QXL_MODE_16_32(y_res, x_res, 1),  \
> > -QXL_MODE_16_32(x_res, y_res, 2),  \
> > -QXL_MODE_16_32(y_res, x_res, 3)
> > +QXL_MODE_16_32(x_res, y_res, 1)
> 
> Why do you leave orientation = 1 in?  Just to keep the size above 4K?
> Shouldn't we just hardcode the rom size to 8k instead?  Then assert that
> everything fits into 8k?  Or even better add a compile time check?
> 
> While being at it it might be a good idea to move the mode table to a
> fixed, large enougth offset (say 0x4096), so it doesn't move around
> again in case we extend QXLRom one more time.

This solution is breaking backward compatibility like Yonit pointed
out. The fact that I can't produce a user that would break because of
this doesn't prove there is no such user. I suggest we go back to the
original patch I posted, breaking it into two like you requested. What
do you say?

> 
> cheers,
>   Gerd
> 



Re: [Qemu-devel] [PATCH] qxl: use correct rom size for revision < 4

2012-12-23 Thread Alon Levy
On Thu, Dec 13, 2012 at 03:43:46PM +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> >> That is indeed a better solution, but it does change functionality. I
> >> think it is correct but I'd like to get some other opinions - Uri,
> >> Arnon, Yonit, Soren - any problems with dropping these?
> >>
> > Orientation is used in the Windows Display driver. It is used to set
> > dmDisplayOrientation in DEVMODEW structure
> > (http://msdn.microsoft.com/en-us/library/windows/hardware/ff552837(v=vs.85).aspx).
> 
> What is supposed to happen in case the guest picks a mode with
> orientation != 0?
> 
> > So, I'm not sure we can just drop it. Moreover, we need at least 2 of
> > the orientations, one for AxB resolution and the other for BxA.
> 
> How do I switch a windows guest into 600x800?

AFAIR it is just another mode that appears in the mode list, i.e. when
enumerating the modes via the windows API or via the GUI.

> 
> cheers,
>   Gerd
> 
> 



Re: [Qemu-devel] [PATCH 0/2 v2] introduce visitor for parsing suffixed integer

2012-12-23 Thread Anthony Liguori
Igor Mammedov  writes:

> v2:
>  * Naming changes:
> - s/visit_type_uint_suffixed_int/visit_type_suffixed_int/
> - use 'suffix_factor' instead of 'unit'
>  * Added  documentation to visit_type_suffixed_int()
>  * Fixed errp check.
>  * Style fixes

This is not how visitors are supposed to be used.

Just treat tsc_freq as a string property and parse it in the setter.

Regards,

Anthony Liguori

>
> Reference to previous version dicussion:
> http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg00758.html
>
> Git tree for testing:
> https://github.com/imammedo/qemu/tree/type_suffixed_int_v2
>
> Igor Mammedov (2):
>   add visitor for parsing int[KMGT] input string
>   target-i386: use visit_type_suffixed_int() to parse tsc_freq property
> value
>
>  qapi/qapi-dealloc-visitor.c |  8 
>  qapi/qapi-visit-core.c  | 35 +++
>  qapi/qapi-visit-core.h  |  4 
>  qapi/string-input-visitor.c | 25 +
>  target-i386/cpu.c   |  3 ++-
>  5 files changed, 74 insertions(+), 1 deletion(-)
>
> -- 
> 1.7.11.7



Re: [Qemu-devel] [PATCH 1/2] libcacard: use LDFLAGS to produce i686 with --cpu=i386

2012-12-23 Thread Alon Levy
On Wed, Dec 19, 2012 at 09:33:28AM +0100, Paolo Bonzini wrote:
> Il 28/11/2012 10:53, Alon Levy ha scritto:
> >> Il 28/11/2012 10:16, Alon Levy ha scritto:
> >>> > > diff --git a/roms/openbios b/roms/openbios
> >>> > > index f095c85..d1d2787 16
> >>> > > --- a/roms/openbios
> >>> > > +++ b/roms/openbios
> >>> > > @@ -1 +1 @@
> >>> > > -Subproject commit f095c858136896d236931357b8d597f407286f71
> >>> > > +Subproject commit d1d2787f87167edf487a60e61b9168514d5a7434
> >> > 
> >> > This is probably unwanted.
> > Yes, my bad. I'll drop it in the pull request.
> > 
> 
> Are you going to send it soon?

I didn't manage to do this, I guess your new series includes this? I'll
try to review it.

> 
> Paolo



[Qemu-devel] [PATCH] usb/redirect.c: unbreak compilation due to include/char/char.h

2012-12-23 Thread Alon Levy
Broken since:

commit 927d4878b0ff319ed87fed9363f314613b0a5ed9
Author: Paolo Bonzini 
Date:   Mon Dec 17 18:20:05 2012 +0100

softmmu: move remaining include files to include/ subdirectories

Signed-off-by: Alon Levy 
---
 hw/usb/redirect.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index b65e868..0abe1ff 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -30,6 +30,7 @@
 #include "monitor/monitor.h"
 #include "sysemu/sysemu.h"
 #include "qemu/iov.h"
+#include "char/char.h"
 
 #include 
 #include 
-- 
1.8.0.1




Re: [Qemu-devel] [PATCH] configure: allow disabling pixman if not needed

2012-12-23 Thread Anthony Liguori
Robert Schiele  writes:

> When we build neither any system emulation targets nor the tools there
> is actually no need for pixman library.  In that case do not enforce
> presence of that library on the system.
>
> Signed-off-by: Robert Schiele 

Applied. Thanks.

Regards,

Anthony Liguori

> ---
> This allows to reduce dependencies in case you build only user
> emulation targets.
>
>  configure |   18 --
>  target-unicore32/helper.c |2 ++
>  2 files changed, 18 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 994f731..7043b5a 100755
> --- a/configure
> +++ b/configure
> @@ -647,6 +647,8 @@ for opt do
>;;
>--without-system-pixman) pixman="internal"
>;;
> +  --without-pixman) pixman="none"
> +  ;;
>--disable-sdl) sdl="no"
>;;
>--enable-sdl) sdl="yes"
> @@ -2118,13 +2120,25 @@ fi
>  # pixman support probe
>  
>  if test "$pixman" = ""; then
> -  if $pkg_config pixman-1 > /dev/null 2>&1; then
> +  if test "$want_tools" = "no" -a "$softmmu" = "no"; then
> +pixman="none"
> +  elif $pkg_config pixman-1 > /dev/null 2>&1; then
>  pixman="system"
>else
>  pixman="internal"
>fi
>  fi
> -if test "$pixman" = "system"; then
> +if test "$pixman" = "none"; then
> +  if test "$want_tools" != "no" -o "$softmmu" != "no"; then
> +echo "ERROR: pixman disabled but system emulation or tools build"
> +echo "   enabled.  You can turn off pixman only if you also"
> +echo "   disable all system emulation targets and the tools"
> +echo "   build with '--disable-tools --disable-system'."
> +exit 1
> +  fi
> +  pixman_cflags=
> +  pixman_libs=
> +elif test "$pixman" = "system"; then
>pixman_cflags=`$pkg_config --cflags pixman-1 2>/dev/null`
>pixman_libs=`$pkg_config --libs pixman-1 2>/dev/null`
>  else
> diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
> index a9e226b..3e0df33 100644
> --- a/target-unicore32/helper.c
> +++ b/target-unicore32/helper.c
> @@ -13,7 +13,9 @@
>  #include "gdbstub.h"
>  #include "helper.h"
>  #include "host-utils.h"
> +#ifndef CONFIG_USER_ONLY
>  #include "console.h"
> +#endif
>  
>  #undef DEBUG_UC32
>  
> -- 
> 1.7.10.4



Re: [Qemu-devel] [PATCH 1/1] tmp105: Create API for TMP105 temperature sensor.

2012-12-23 Thread Anthony Liguori
Alex Horn  writes:

> * Define enum for TMP105 registers
> * Move tmp105_set() from I2C to TMP105 header
> * Document units and range of temperature as preconditions
>
> Signed-off-by: Alex Horn 

Applied. Thanks.

Regards,

Anthony Liguori

> ---
>  hw/i2c.h|3 --
>  hw/tmp105.c |   17 ---
>  hw/tmp105.h |   67 
> +++
>  3 files changed, 76 insertions(+), 11 deletions(-)
>  create mode 100644 hw/tmp105.h
>
> diff --git a/hw/i2c.h b/hw/i2c.h
> index 0f5682b..883b5c5 100644
> --- a/hw/i2c.h
> +++ b/hw/i2c.h
> @@ -73,9 +73,6 @@ void *wm8750_dac_buffer(void *opaque, int samples);
>  void wm8750_dac_commit(void *opaque);
>  void wm8750_set_bclk_in(void *opaque, int new_hz);
>  
> -/* tmp105.c */
> -void tmp105_set(I2CSlave *i2c, int temp);
> -
>  /* lm832x.c */
>  void lm832x_key_event(DeviceState *dev, int key, int state);
>  
> diff --git a/hw/tmp105.c b/hw/tmp105.c
> index 8e8dbd9..9c67e64 100644
> --- a/hw/tmp105.c
> +++ b/hw/tmp105.c
> @@ -20,6 +20,7 @@
>  
>  #include "hw.h"
>  #include "i2c.h"
> +#include "tmp105.h"
>  
>  typedef struct {
>  I2CSlave i2c;
> @@ -92,22 +93,22 @@ static void tmp105_read(TMP105State *s)
>  }
>  
>  switch (s->pointer & 3) {
> -case 0:  /* Temperature */
> +case TMP105_REG_TEMPERATURE:
>  s->buf[s->len ++] = (((uint16_t) s->temperature) >> 8);
>  s->buf[s->len ++] = (((uint16_t) s->temperature) >> 0) &
>  (0xf0 << ((~s->config >> 5) & 3));   /* R */
>  break;
>  
> -case 1:  /* Configuration */
> +case TMP105_REG_CONFIG:
>  s->buf[s->len ++] = s->config;
>  break;
>  
> -case 2:  /* T_LOW */
> +case TMP105_REG_T_LOW:
>  s->buf[s->len ++] = ((uint16_t) s->limit[0]) >> 8;
>  s->buf[s->len ++] = ((uint16_t) s->limit[0]) >> 0;
>  break;
>  
> -case 3:  /* T_HIGH */
> +case TMP105_REG_T_HIGH:
>  s->buf[s->len ++] = ((uint16_t) s->limit[1]) >> 8;
>  s->buf[s->len ++] = ((uint16_t) s->limit[1]) >> 0;
>  break;
> @@ -117,10 +118,10 @@ static void tmp105_read(TMP105State *s)
>  static void tmp105_write(TMP105State *s)
>  {
>  switch (s->pointer & 3) {
> -case 0:  /* Temperature */
> +case TMP105_REG_TEMPERATURE:
>  break;
>  
> -case 1:  /* Configuration */
> +case TMP105_REG_CONFIG:
>  if (s->buf[0] & ~s->config & (1 << 0))   /* SD */
>  printf("%s: TMP105 shutdown\n", __FUNCTION__);
>  s->config = s->buf[0];
> @@ -128,8 +129,8 @@ static void tmp105_write(TMP105State *s)
>  tmp105_alarm_update(s);
>  break;
>  
> -case 2:  /* T_LOW */
> -case 3:  /* T_HIGH */
> +case TMP105_REG_T_LOW:
> +case TMP105_REG_T_HIGH:
>  if (s->len >= 3)
>  s->limit[s->pointer & 1] = (int16_t)
>  uint16_t) s->buf[0]) << 8) | s->buf[1]);
> diff --git a/hw/tmp105.h b/hw/tmp105.h
> new file mode 100644
> index 000..51eff4b
> --- /dev/null
> +++ b/hw/tmp105.h
> @@ -0,0 +1,67 @@
> +/*
> + * Texas Instruments TMP105 Temperature Sensor
> + *
> + * Browse the data sheet:
> + *
> + *http://www.ti.com/lit/gpn/tmp105
> + *
> + * Copyright (C) 2012 Alex Horn 
> + * Copyright (C) 2008-2012 Andrzej Zaborowski 
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or
> + * later. See the COPYING file in the top-level directory.
> + */
> +#ifndef QEMU_TMP105_H
> +#define QEMU_TMP105_H
> +
> +#include "i2c.h"
> +
> +/**
> + * TMP105Reg:
> + * @TMP105_REG_TEMPERATURE: Temperature register
> + * @TMP105_REG_CONFIG: Configuration register
> + * @TMP105_REG_T_LOW: Low temperature register (also known as T_hyst)
> + * @TMP105_REG_T_HIGH: High temperature register (also known as T_OS)
> + *
> + * The following temperature sensors are
> + * compatible with the TMP105 registers:
> + * - adt75
> + * - ds1775
> + * - ds75
> + * - lm75
> + * - lm75a
> + * - max6625
> + * - max6626
> + * - mcp980x
> + * - stds75
> + * - tcn75
> + * - tmp100
> + * - tmp101
> + * - tmp105
> + * - tmp175
> + * - tmp275
> + * - tmp75
> + **/
> +typedef enum TMP105Reg {
> +TMP105_REG_TEMPERATURE = 0,
> +TMP105_REG_CONFIG,
> +TMP105_REG_T_LOW,
> +TMP105_REG_T_HIGH,
> +} TMP105Reg;
> +
> +/**
> + * tmp105_set:
> + * @i2c: dispatcher to TMP105 hardware model
> + * @temp: temperature with 0.001 centigrades units in the range -40 C to 
> +125 C
> + *
> + * Sets the temperature of the TMP105 hardware model.
> + *
> + * Bits 5 and 6 (value 32 and 64) in the register indexed by 
> TMP105_REG_CONFIG
> + * determine the precision of the temperature. See Table 8 in the data sheet.
> + *
> + * @see_also: I2C_SLAVE macro
> + * @see_also: http://www.ti.com/lit/gpn/tmp105
> + */
> +void tmp105_set(I2CSlave *i2c, int temp);
> +
> +#endif
> -- 
> 1.7.6.5



Re: [Qemu-devel] [PATCH v2] build: Use separate makefile for "trace/"

2012-12-23 Thread Anthony Liguori
Lluís Vilanova  writes:

> Signed-off-by: Lluís Vilanova 
> --
> Changes in v2:
>
> * Do not depend on "qemu-timer-common.o".
> * Use "$(obj)" in rules to refer to the build sub-directory.
> * Remove dependencies against "$(GENERATED_HEADERS)".
>
> Cc: Paolo Bonzini 

Applied. Thanks.

Regards,

Anthony Liguori

> ---
>  .gitignore  |8 ++--
>  Makefile|   15 +---
>  Makefile.objs   |   64 ++--
>  scripts/tracetool/backend/dtrace.py |2 +
>  scripts/tracetool/format/h.py   |6 ++-
>  trace.h |6 +++
>  trace/Makefile.objs |   70 
> +++
>  7 files changed, 96 insertions(+), 75 deletions(-)
>  create mode 100644 trace.h
>  create mode 100644 trace/Makefile.objs
>
> diff --git a/.gitignore b/.gitignore
> index bd6ba1c..0b75915 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -2,10 +2,10 @@ config-devices.*
>  config-all-devices.*
>  config-host.*
>  config-target.*
> -trace.h
> -trace.c
> -trace-dtrace.h
> -trace-dtrace.dtrace
> +trace/generated-tracers.h
> +trace/generated-tracers.c
> +trace/generated-tracers-dtrace.h
> +trace/generated-tracers-dtrace.dtrace
>  *-timestamp
>  *-softmmu
>  *-darwin-user
> diff --git a/Makefile b/Makefile
> index e9d6848..21a7912 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -31,12 +31,15 @@ ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if 
> $(MAKECMDGOALS),,fail))
>  endif
>  endif
>  
> -GENERATED_HEADERS = config-host.h trace.h qemu-options.def
> +GENERATED_HEADERS = config-host.h qemu-options.def
> +GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
> +GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
> +
> +GENERATED_HEADERS += trace/generated-tracers.h
>  ifeq ($(TRACE_BACKEND),dtrace)
> -GENERATED_HEADERS += trace-dtrace.h
> +GENERATED_HEADERS += trace/generated-tracers-dtrace.h
>  endif
> -GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
> -GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c trace.c
> +GENERATED_SOURCES += trace/generated-tracers.c
>  
>  # Don't try to regenerate Makefile or configure
>  # We don't generate any of them
> @@ -252,9 +255,9 @@ clean:
>   rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
>   rm -Rf .libs
>   rm -f qemu-img-cmds.h
> - rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
>   @# May not be present in GENERATED_HEADERS
> - rm -f trace-dtrace.h trace-dtrace.h-timestamp
> + rm -f trace/generated-tracers-dtrace.dtrace*
> + rm -f trace/generated-tracers-dtrace.h*
>   rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp)
>   rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
>   rm -rf qapi-generated
> diff --git a/Makefile.objs b/Makefile.objs
> index 3c7abca..24832a2 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -147,66 +147,7 @@ libdis-$(CONFIG_LM32_DIS) += lm32-dis.o
>  ##
>  # trace
>  
> -ifeq ($(TRACE_BACKEND),dtrace)
> -TRACE_H_EXTRA_DEPS=trace-dtrace.h
> -endif
> -trace.h: trace.h-timestamp $(TRACE_H_EXTRA_DEPS)
> -trace.h-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
> - $(call quiet-command,$(TRACETOOL) \
> - --format=h \
> - --backend=$(TRACE_BACKEND) \
> - < $< > $@,"  GEN   trace.h")
> - @cmp -s $@ trace.h || cp $@ trace.h
> -
> -trace.c: trace.c-timestamp
> -trace.c-timestamp: $(SRC_PATH)/trace-events $(BUILD_DIR)/config-host.mak
> - $(call quiet-command,$(TRACETOOL) \
> - --format=c \
> - --backend=$(TRACE_BACKEND) \
> - < $< > $@,"  GEN   trace.c")
> - @cmp -s $@ trace.c || cp $@ trace.c
> -
> -trace.o: trace.c $(GENERATED_HEADERS)
> -
> -trace-dtrace.h: trace-dtrace.dtrace
> - $(call quiet-command,dtrace -o $@ -h -s $<, "  GEN   trace-dtrace.h")
> -
> -# Normal practice is to name DTrace probe file with a '.d' extension
> -# but that gets picked up by QEMU's Makefile as an external dependency
> -# rule file. So we use '.dtrace' instead
> -trace-dtrace.dtrace: trace-dtrace.dtrace-timestamp
> -trace-dtrace.dtrace-timestamp: $(SRC_PATH)/trace-events 
> $(BUILD_DIR)/config-host.mak
> - $(call quiet-command,$(TRACETOOL) \
> - --format=d \
> - --backend=$(TRACE_BACKEND) \
> - < $< > $@,"  GEN   trace-dtrace.dtrace")
> - @cmp -s $@ trace-dtrace.dtrace || cp $@ trace-dtrace.dtrace
> -
> -trace-dtrace.o: trace-dtrace.dtrace $(GENERATED_HEADERS)
> - $(call quiet-command,dtrace -o $@ -G -s $<, "  GEN   trace-dtrace.o")
> -
> -ifeq ($(LIBTOOL),)
> -trace-dtrace.lo: trace-dtrace.dtrace
> - @echo "missing libtool. please install and rerun configure."; exit 1
> -else
> -trace-dtrace.lo: trace-dtrace.dtrace
> - $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC d

Re: [Qemu-devel] [PATCH] target-i386: CPUID: return highest basic leaf if eax > cpuid_xlevel

2012-12-23 Thread Anthony Liguori
Eduardo Habkost  writes:

> This fixes a subtle bug. A bug that probably won't cause trouble for any
> existing OS, but a bug anyway:
>
> Intel SDM Volume 2, CPUID Instruction states:
>
>> Two types of information are returned: basic and extended function
>> information. If a value entered for CPUID.EAX is higher than the maximum
>> input value for basic or extended function for that processor then the
>> data for the highest basic information leaf is returned. For example,
>> using the Intel Core i7 processor, the following is true:
>>
>>   CPUID.EAX = 05H (* Returns MONITOR/MWAIT leaf. *)
>>   CPUID.EAX = 0AH (* Returns Architectural Performance Monitoring leaf. *)
>>   CPUID.EAX = 0BH (* Returns Extended Topology Enumeration leaf. *)
>>   CPUID.EAX = 0CH (* INVALID: Returns the same information as CPUID.EAX = 
>> 0BH. *)
>>   CPUID.EAX = 8008H (* Returns linear/physical address size data. *)
>>   CPUID.EAX = 800AH (* INVALID: Returns same information as CPUID.EAX = 
>> 0BH. *)
>
> AMD's CPUID Specification, on the other hand, is less specific:
>
>> The CPUID instruction supports two sets or ranges of functions,
>> standard and extended.
>>
>> • The smallest function number of the standard function range is
>>   Fn_. The largest function num- ber of the standard function
>>   range, for a particular implementation, is returned in CPUID
>>   Fn__EAX.
>>
>> • The smallest function number of the extended function range is
>>   Fn8000_. The largest function num- ber of the extended function
>>   range, for a particular implementation, is returned in CPUID
>>   Fn8000__EAX.
>>
>> Functions that are neither standard nor extended are undefined and
>> should not be relied upon.
>
> QEMU's behavior matched Intel's specification before, but this was
> changed by commit b3baa152aaef1905876670590275c2dd0bbb088c. This patch
> restores the behavior documented by Intel when cpuid_xlevel2 is 0.
>
> The existing behavior when cpuid_xlevel2 is set (falling back to
> level=cpuid_xlevel) is being kept, as I couldn't find any public
> documentation on the CPUID 0xC000 function range on Centaur CPUs.
>
> Signed-off-by: Eduardo Habkost 

Applied. Thanks.

Regards,

Anthony Liguori

> ---
> Cc: Markus Armbruster 
> Cc: brill...@viatech.com.cn 
> Cc: Marcelo Tosatti 
> ---
>  target-i386/cpu.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 1837f5a..3cd1cee 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -1648,7 +1648,11 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, 
> uint32_t count,
>  index = env->cpuid_xlevel;
>  }
>  } else {
> -index =  env->cpuid_xlevel;
> +/* Intel documentation states that invalid EAX input will
> + * return the same information as EAX=cpuid_level
> + * (Intel SDM Vol. 2A - Instruction Set Reference - CPUID)
> + */
> +index =  env->cpuid_level;
>  }
>  }
>  } else {
> -- 
> 1.7.11.7



Re: [Qemu-devel] [PATCH V2] qemu-char: Inherit ptys and improve output from -serial pty

2012-12-23 Thread Anthony Liguori
Lei Li  writes:

> Changes since V1:
>   - Avoid crashing since qemu_opts_id() may return null on some
> systems according to Markus's suggestion.
>
> When controlling a qemu instance from another program, it's
> hard to know which serial port or monitor device is redirected
> to which pty. With more than one device using "pty" a lot of
> guesswork is involved.
>
> $ ./x86_64-softmmu/qemu-system-x86_64 -serial pty -serial pty -monitor pty
> char device redirected to /dev/pts/5
> char device redirected to /dev/pts/6
> char device redirected to /dev/pts/7
>
> Although we can find out what everything else is connected to
> by the "info chardev" with "-monitor stdio" in the command line,
> It'd be very useful to be able to have qemu inherit pseudo-tty
> file descriptors so they could just be specified on the command
> line like:
>
> $ ./x86_64-softmmu/qemu-system-x86_64 -serial pty -serial pty -monitor pty
> char device compat_monitor0 redirected to /dev/pts/5
> char device serial0 redirected to /dev/pts/6
> char device serial1 redirected to /dev/pts/7
>
> Referred link: https://bugs.launchpad.net/qemu/+bug/938552
>
> Signed-off-by: Lei Li 

Applied. Thanks.

Regards,

Anthony Liguori

> ---
>  qemu-char.c |8 +++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/qemu-char.c b/qemu-char.c
> index 6113d0a..31388be 100644
> --- a/qemu-char.c
> +++ b/qemu-char.c
> @@ -980,6 +980,7 @@ static CharDriverState *qemu_chr_open_pty(QemuOpts *opts)
>  CharDriverState *chr;
>  PtyCharDriver *s;
>  struct termios tty;
> +const char *label;
>  int master_fd, slave_fd, len;
>  #if defined(__OpenBSD__) || defined(__DragonFly__)
>  char pty_name[PATH_MAX];
> @@ -1005,7 +1006,12 @@ static CharDriverState *qemu_chr_open_pty(QemuOpts 
> *opts)
>  chr->filename = g_malloc(len);
>  snprintf(chr->filename, len, "pty:%s", q_ptsname(master_fd));
>  qemu_opt_set(opts, "path", q_ptsname(master_fd));
> -fprintf(stderr, "char device redirected to %s\n", q_ptsname(master_fd));
> +
> +label = qemu_opts_id(opts);
> +fprintf(stderr, "char device%s%s redirected to %s\n",
> +label ? " " : "",
> +label ?: "",
> +q_ptsname(master_fd));
>  
>  s = g_malloc0(sizeof(PtyCharDriver));
>  chr->opaque = s;
> -- 
> 1.7.7.6



Re: [Qemu-devel] [PATCH] MAINTAINERS: Take over kvm maintenance

2012-12-23 Thread Anthony Liguori
Gleb Natapov  writes:

> Replace Avi with myself as kvm maintainer.
>
> Signed-off-by: Gleb Natapov 

Applied. Thanks.

Regards,

Anthony Liguori

> diff --git a/MAINTAINERS b/MAINTAINERS
> index 2ede20d..0e574f9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -132,7 +132,7 @@ Guest CPU Cores (KVM):
>  --
>  
>  Overall
> -M: Avi Kivity 
> +M: Gleb Natapov 
>  M: Marcelo Tosatti 
>  L: k...@vger.kernel.org
>  S: Supported
> @@ -150,7 +150,7 @@ S: Maintained
>  F: target-s390x/kvm.c
>  
>  X86
> -M: Avi Kivity 
> +M: Gleb Natapov 
>  M: Marcelo Tosatti 
>  L: k...@vger.kernel.org
>  S: Supported
> --
>   Gleb.



[Qemu-devel] [PATCH] spice-qemu-char: register interface on post load

2012-12-23 Thread Alon Levy
The target has not seen the guest_connected event via
spice_chr_guest_open or spice_chr_write, and so spice server wrongly
assumes there is no agent active, while the client continues to send
motion events only by the agent channel, which the server ignores. The
net effect is that the mouse is static in the guest.

By registering the interface on post load spice server will pass on the
agent messages fixing the mouse behavior after migration.

RHBZ #725965

Signed-off-by: Alon Levy 
---
 spice-qemu-char.c | 42 ++
 1 file changed, 42 insertions(+)

diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index a4d7de8..e6eb523 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -2,6 +2,7 @@
 #include "trace.h"
 #include "ui/qemu-spice.h"
 #include "char/char.h"
+#include "migration/vmstate.h"
 #include 
 #include 
 #include 
@@ -26,6 +27,10 @@ typedef struct SpiceCharDriver {
 ssize_t   bufsize, datalen;
 uint32_t  debug;
 QLIST_ENTRY(SpiceCharDriver) next;
+uint32_t  guest_open;
+struct {
+QEMUTimer*timer;
+} post_load;
 } SpiceCharDriver;
 
 static QLIST_HEAD(, SpiceCharDriver) spice_chars =
@@ -185,18 +190,23 @@ static void spice_chr_close(struct CharDriverState *chr)
 printf("%s\n", __func__);
 vmc_unregister_interface(s);
 QLIST_REMOVE(s, next);
+qemu_free_timer(s->post_load.timer);
 g_free(s);
 }
 
 static void spice_chr_guest_open(struct CharDriverState *chr)
 {
 SpiceCharDriver *s = chr->opaque;
+
+s->guest_open = 1;
 vmc_register_interface(s);
 }
 
 static void spice_chr_guest_close(struct CharDriverState *chr)
 {
 SpiceCharDriver *s = chr->opaque;
+
+s->guest_open = 0;
 vmc_unregister_interface(s);
 }
 
@@ -217,6 +227,34 @@ static void print_allowed_subtypes(void)
 fprintf(stderr, "\n");
 }
 
+static void spice_chr_post_load_cb(void *opaque)
+{
+SpiceCharDriver *s = opaque;
+
+spice_chr_guest_open(s->chr);
+}
+
+static int spice_chr_post_load(void *opaque, int version_id)
+{
+SpiceCharDriver *s = opaque;
+
+if (s && s->chr && s->guest_open) {
+qemu_mod_timer(s->post_load.timer, 1);
+}
+return 0;
+}
+
+static VMStateDescription spice_chr_vmstate = {
+.name   = "spice-chr",
+.version_id = 1,
+.minimum_version_id = 1,
+.post_load  = spice_chr_post_load,
+.fields = (VMStateField[]) {
+VMSTATE_UINT32(guest_open, SpiceCharDriver),
+VMSTATE_END_OF_LIST()
+},
+};
+
 static CharDriverState *chr_open(QemuOpts *opts, const char *subtype)
 {
 CharDriverState *chr;
@@ -229,12 +267,16 @@ static CharDriverState *chr_open(QemuOpts *opts, const 
char *subtype)
 s->debug = debug;
 s->active = false;
 s->sin.subtype = subtype;
+s->post_load.timer = qemu_new_timer_ns(vm_clock,
+   spice_chr_post_load_cb, s);
 chr->opaque = s;
 chr->chr_write = spice_chr_write;
 chr->chr_close = spice_chr_close;
 chr->chr_guest_open = spice_chr_guest_open;
 chr->chr_guest_close = spice_chr_guest_close;
 
+vmstate_register(NULL, -1, &spice_chr_vmstate, s);
+
 QLIST_INSERT_HEAD(&spice_chars, s, next);
 
 return chr;
-- 
1.8.0.1




[Qemu-devel] 64bit guest hangs while migrating

2012-12-23 Thread Stefan Priebe

Hello list,

i'm using qemu v1.3.0. Since upgrading from kvm qemu 1.2 my 64bit linux 
guests hang while online migrating.


Has anybody an idea / can help?

Things happing while this happens:
- kvm process uses 100%CPU
- human monitor does not work as the process does not respond at/on socket
- strace of kvm process look like this:
..
[pid 28351] futex(0x7ff8b8025388, FUTEX_WAKE_PRIVATE, 1) = 0
[pid 28351] futex(0x7ff8b8026024,
FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 11801, {1356016143,
843092000},  
[pid 28285] mremap(0x7ff77bfe4000, 160378880, 160411648, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160411648, 160448512, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160448512, 160481280, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160481280, 160514048, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160514048, 160546816, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160546816, 160583680, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160583680, 160616448, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160616448, 160649216, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160649216, 160681984, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160681984, 160718848, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160718848, 160751616, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160751616, 160784384, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160784384, 160817152, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160817152, 160854016, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160854016, 160886784, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160886784, 160919552, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160919552, 160952320, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160952320, 160989184, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 160989184, 161021952, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161021952, 161054720, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161054720, 161087488, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161087488, 161124352, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161124352, 161157120, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161157120, 161189888, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161189888, 161222656, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161222656, 161259520, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161259520, 161292288, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161292288, 161325056, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28351] <... futex resumed> ) = -1 ETIMEDOUT (Connection timed
out)
[pid 28351] futex(0x7ff8b8025388, FUTEX_WAKE_PRIVATE, 1) = 0
[pid 28351] futex(0x7ff8b8026024,
FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 11803, {1356016144,
843283000},  
[pid 28285] mremap(0x7ff77bfe4000, 161325056, 161357824, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161357824, 161394688, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161394688, 161427456, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161427456, 161460224, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28345] <... restart_syscall resumed> ) = -1 ETIMEDOUT (Connection
timed out)
[pid 28345] futex(0x7ff8caa2e274, FUTEX_CMP_REQUEUE_PRIVATE, 1,
2147483647, 0x7ff8caa2e1b0, 872) = 1
[pid 28347] <... futex resumed> ) = 0
[pid 28345] futex(0x7ff8caa241a8, FUTEX_WAKE_PRIVATE, 1 
[pid 28347] futex(0x7ff8caa2e1b0, FUTEX_WAKE_PRIVATE, 1 
[pid 28345] <... futex resumed> ) = 0
[pid 28347] <... futex resumed> ) = 0
[pid 28345] futex(0x7ff8caa2420c,
FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 799, {1356016153,
954319000},  
[pid 28347] sendmsg(19, {msg_name(0)=NULL, msg_iov(1)=[{"\t", 1}],
msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 1
[pid 28347] futex(0x7ff8caa2e274, FUTEX_WAIT_PRIVATE, 873, NULL

[pid 28285] mremap(0x7ff77bfe4000, 161460224, 161492992, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161492992, 161529856, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161529856, 161562624, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161562624, 161595392, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161595392, 161628160, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 161628160, 161665024, MREMAP_MAYMOVE)
= 0x7ff77bfe4000
[pid 28285] mremap(0x7ff77bfe4000, 16166

[Qemu-devel] [Bug 1093360] [NEW] files on microsoft iso images mounted to qemu VM get stripped from Version info. E.G. Microsoft UAG installation fails

2012-12-23 Thread CarstenSchnorr
Public bug reported:

QEMU 0.9.0-0.14.1
KVM 60-88-0.14.1
there is a reference for a root cause, why installation of Microsoft UAG fails.
http://blogs.technet.com/b/isablog/archive/2010/07/13/another-tmg-2010-installation-failure-with-error-0x80070643.aspx

when checking available information on the mounted UAG ISO in my qemu machine, 
I realized simliar reduced information.
this was found:
using AQEMU 0.8.2 of 2011.07.27

using QEMU 0.9.0-0.14.1 and KVM 60-88-0.14.1
in an KVM managed  machine

** Affects: qemu
 Importance: Undecided
 Status: New


** Tags: dvd iso

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1093360

Title:
  files on microsoft iso images mounted to qemu VM  get stripped  from
  Version info. E.G. Microsoft UAG installation fails

Status in QEMU:
  New

Bug description:
  QEMU 0.9.0-0.14.1
  KVM 60-88-0.14.1
  there is a reference for a root cause, why installation of Microsoft UAG 
fails.
  
http://blogs.technet.com/b/isablog/archive/2010/07/13/another-tmg-2010-installation-failure-with-error-0x80070643.aspx

  when checking available information on the mounted UAG ISO in my qemu 
machine, I realized simliar reduced information.
  this was found:
  using AQEMU 0.8.2 of 2011.07.27

  using QEMU 0.9.0-0.14.1 and KVM 60-88-0.14.1
  in an KVM managed  machine

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1093360/+subscriptions



Re: [Qemu-devel] [PATCH] spice-qemu-char: register interface on post load

2012-12-23 Thread Amit Shah
On (Sun) 23 Dec 2012 [23:35:29], Alon Levy wrote:
> The target has not seen the guest_connected event via
> spice_chr_guest_open or spice_chr_write, and so spice server wrongly
> assumes there is no agent active, while the client continues to send
> motion events only by the agent channel, which the server ignores. The
> net effect is that the mouse is static in the guest.
> 
> By registering the interface on post load spice server will pass on the
> agent messages fixing the mouse behavior after migration.
> 
> RHBZ #725965
> 
> Signed-off-by: Alon Levy 
> ---
>  spice-qemu-char.c | 42 ++
>  1 file changed, 42 insertions(+)

I suppose Gerd should pick this up in his tree?

I have a couple of questions below, but I ack this approach.

>  static QLIST_HEAD(, SpiceCharDriver) spice_chars =
> @@ -185,18 +190,23 @@ static void spice_chr_close(struct CharDriverState *chr)
>  printf("%s\n", __func__);
>  vmc_unregister_interface(s);
>  QLIST_REMOVE(s, next);
> +qemu_free_timer(s->post_load.timer);

Also vmstate_unregister()?

I'm wondering if there can be a case where this function is called
before the timer has had a chance to fire.  It can happen if the spice
port is hot-unplugged before the guest has had a chance to run on the
target.  In that case, qemu_del_timer() should be called as well, to
ensure the timer doesn't fire with invalid args later.

Amit