]> xenbits.xensource.com Git - qemu-xen-4.0-testing.git/log
qemu-xen-4.0-testing.git
15 years agoMove block dma helpers aiocb to store dma state (Avi Kivity)
Ian Jackson [Wed, 7 Oct 2009 14:44:55 +0000 (15:44 +0100)]
Move block dma helpers aiocb to store dma state (Avi Kivity)

Use the dedicated dma aiocb to store intermediate state for dma block
transactions.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6874 c046a42c-6fe2-441c-8c8c-71466251a162

[ Backported from 6bbff9a0b495918309074ac60375be5f9dc868b3
  by Stefano Stabellini. ]

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoUse vectored aiocb storage to store vector translation state (Avi Kivity)
aliguori [Fri, 20 Mar 2009 18:26:12 +0000 (18:26 +0000)]
Use vectored aiocb storage to store vector translation state (Avi Kivity)

Now that we have a dedicated acb pool for vector translation acbs, we can
store the vector translation state in the acbs instead of in an external
structure.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6873 c046a42c-6fe2-441c-8c8c-71466251a162
(cherry picked from commit 3fb94d56c6adc96ffc4a81b58c752cc4ccfae39c)

15 years agoImplement cancellation method for dma async I/O (Avi Kivity)
aliguori [Fri, 20 Mar 2009 18:26:07 +0000 (18:26 +0000)]
Implement cancellation method for dma async I/O (Avi Kivity)

Move the dma helpers to a private aio pool, and implement a cancellation
method for them.  Should prevent issues when cancelling I/O while dma is
in progress.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6872 c046a42c-6fe2-441c-8c8c-71466251a162
(cherry picked from commit 6512a2a7106480c19183d6466a6845bc9bdf6ec0)

15 years agoConvert vectored aio emulation to use a dedicated pool (Avi Kivity)
aliguori [Fri, 20 Mar 2009 18:26:03 +0000 (18:26 +0000)]
Convert vectored aio emulation to use a dedicated pool (Avi Kivity)

This allows us to remove a hack in the vectored aio cancellation code.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6871 c046a42c-6fe2-441c-8c8c-71466251a162
(cherry picked from commit c07a9008ac6985cd5a15909c2b9977d982defc12)

15 years agoRefactor aio callback allocation to use an aiocb pool (Avi Kivity)
Ian Jackson [Wed, 7 Oct 2009 14:36:19 +0000 (15:36 +0100)]
Refactor aio callback allocation to use an aiocb pool (Avi Kivity)

Move the AIOCB allocation code to use a dedicate structure, AIOPool.  AIOCB
specific information, such as the AIOCB size and cancellation routine, is
moved into the pool.

At present, there is exactly one pool per block format driver, maintaining
the status quo.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6870 c046a42c-6fe2-441c-8c8c-71466251a162

[ Backported from 6bbff9a0b495918309074ac60375be5f9dc868b3
  by Stefano Stabellini. ]

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agorevert "fix qemu memory leak in block interface"
Ian Jackson [Wed, 7 Oct 2009 14:34:26 +0000 (15:34 +0100)]
revert "fix qemu memory leak in block interface"

"fix qemu memory leak in block interface" is not going to be needed any
more thanks to the refactoring of the block layer.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoallow logdirty commands while paused (unbreaks 60dbe1+8f09f4)
Ian Jackson [Wed, 23 Sep 2009 14:07:47 +0000 (15:07 +0100)]
allow logdirty commands while paused (unbreaks 60dbe1+8f09f4)

60dbe1+8f09f4 breaks HVM live migration: 60dbe1 causes xc_save to
attempt to disable logdirty mode while qemu is paused. 8f09f4 disables
most commands, including logdirty, while the domain is paused. So
xc_save times out waiting for qemu to respond to the logdirty disable
command, and live migration fails. Logdirty commands issued while
paused should not affect the stability of ioemu.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
15 years agopassthrough: basic graphics passthrough support
Ian Jackson [Fri, 18 Sep 2009 15:41:42 +0000 (16:41 +0100)]
passthrough: basic graphics passthrough support

basic gfx passthrough support:
  - add a vga type for gfx passthrough
  - retrieve VGA bios from host 0xC0000, then load it to guest 0xC0000
  - register/unregister legacy VGA I/O ports and MMIOs for passthroughed gfx

Signed-off-by: Ben Lin <ben.y.lin@intel.com>
Signed-off-by: Weidong Han <weidong.han@intel.com>
Acked-by: Jean Guyader <jean.guyader@critix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agopxe: Don't look for PXE ROMs when running as a DM
Ian Jackson [Fri, 18 Sep 2009 15:32:58 +0000 (16:32 +0100)]
pxe: Don't look for PXE ROMs when running as a DM

Searching for PXE ROMs in attached NICs is unnecessary as the ROM
that is used is included in the hvmloader binary. In the case where
there are only pass-through NICs it will cause the boot to fail
as the NICs are not known to qemu-xen at the time that this check is made.
In other words, without this change PXE boot from a pass-through
device will fail.

This has likely been broken since I changed around the pass-through
code so that devices passed-through at boot-time are handled by hot-plug.

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agofix a compilation error if not defined MAPCACHE (eg ia64)
Ian Jackson [Fri, 18 Sep 2009 15:31:56 +0000 (16:31 +0100)]
fix a compilation error if not defined MAPCACHE (eg ia64)

60dbe1d43827cf9a57b619a8736da2319489d432 cannot be compiled on ia64:
  exec-dm.c: In function 'cpu_physical_memory_map':
  exec-dm.c:805: error: 'l' undeclared (first use in this function)
This patch fixes it.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoMerge branch 'latara'
Ian Jackson [Fri, 11 Sep 2009 17:34:25 +0000 (18:34 +0100)]
Merge branch 'latara'

15 years agoconsistently use TARGET_PAGE_SIZE in block-vbd.c
Ian Jackson [Fri, 11 Sep 2009 17:23:19 +0000 (18:23 +0100)]
consistently use TARGET_PAGE_SIZE in block-vbd.c

Attached patch makes ioemu's block-vbd.c use of TARGET_PAGE_SIZE.
Fixes build error on NetBSD when building stubdom.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agonon-passthrough acpi fix
Ian Jackson [Fri, 11 Sep 2009 17:20:53 +0000 (18:20 +0100)]
non-passthrough acpi fix

Attached patch fixes ACPI problems with GPE
when ioemu build w/o CONFIG_PASSTHROUGH.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agofix HVM log dirty issue
Ian Jackson [Fri, 4 Sep 2009 15:25:35 +0000 (16:25 +0100)]
fix HVM log dirty issue

These patches fix some issues for HVM log dirty in qemu:
* Add necessary logging dirty in qemu to avoid guest error with
intensive disk access when live migration
* Take place of shared memory between qemu and migration tools by new
added hypercall, which is clean and simple

Signed-Off-By: Zhai, Edwin <edwin.zhai@intel.com>
Also revert commit 32710fbdc75e055f73a63d246737ce615b9109e9.
  "[stubdom] fix the crash of HVM live migration with intensive disk access"
 as this is the proper fix.   -iwj

15 years agoFix to eject cdrom on HVM Domain
Ian Jackson [Fri, 4 Sep 2009 15:19:54 +0000 (16:19 +0100)]
Fix to eject cdrom on HVM Domain

We tried to eject cdrom(/dev/hdc) on HVM Domain.
But, cdrom media are not ejected from the cdrom device on HostOS.

The module to eject the cdrom device has already been implemented in
qemu-dm.
 But, all devices are opened as raw device for VBD.
Therefore, the module to eject the cdrom device is not work.

The cdrom device was corrected to open as a physical device on HostOS.
When eject is executed on HVM Domain, cdrom media are ejected from the
cdrom device on HostOS.

This patch corrected the problem.
Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
15 years agoignore xenstore events while paused
Ian Jackson [Fri, 4 Sep 2009 15:17:39 +0000 (16:17 +0100)]
ignore xenstore events while paused

when qemu is paused it shouldn't try to handle xenstore events,
especially because when xend removes nodes on xenstore some
spurious events could be generated causing qemu to exit unexpectedly.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agodisable log-throttling in xen_platform after boot
Ian Jackson [Fri, 4 Sep 2009 15:15:27 +0000 (16:15 +0100)]
disable log-throttling in xen_platform after boot

currently log throttling in xen_platform can be disabled only if a
particular key is present on xenstore at boot time.
Obviously this requirement makes it difficult to use.
This patch fixes the issue creating a watch on xenstore on the node

/local/domain/$DOMID/log-throttling

so whenever a developer wants to disable log throttling, he just has to
write 0 to /local/domain/$DOMID/log-throttling at any moment after boot.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoremove check on ram_size
Ian Jackson [Fri, 4 Sep 2009 15:13:52 +0000 (16:13 +0100)]
remove check on ram_size

the initial check on the ram_size in qemu is completely unnecessary and
it is even broken on systems where dom0 is 32 bits while xen is 64 bits.
This patch solves the problem removing the check.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agofix qemu memory leak in block interface
Ian Jackson [Fri, 4 Sep 2009 15:12:28 +0000 (16:12 +0100)]
fix qemu memory leak in block interface

the qemu block interface leaks memory every time a read or write request
is issued, this patch fixes it.
This is also the bug that is causing stubdomains to crash under high
disk IO.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years ago[stubdom] fix the crash of HVM live migration with intensive disk access
Ian Jackson [Fri, 4 Sep 2009 15:10:46 +0000 (16:10 +0100)]
[stubdom] fix the crash of HVM live migration with intensive disk access

Intensive disk access, e.g. sum of big file, during HVM live migration would
cause guest error even file system crash. Guest dmesg said
"attempt to access beyond end of device
hda1: rw=0, want=10232032112, limit=10474317"

Current map cache used by qemu dma doesn't mark the page dirty, so that these
pages(probably holding DMA data struct) are not transferred in the last
iteration during live migration.

This patch fixes it, and also merges the qemu's original dirty bitmap used by
other devices such as vga.

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
15 years agoDisable xenstore_dom_chmod in stubdom build.
Ian Jackson [Mon, 10 Aug 2009 17:02:56 +0000 (18:02 +0100)]
Disable xenstore_dom_chmod in stubdom build.

This change:

    commit ad202d4194eab87d3645f13e7726a4d609e42fe8
    Author: Ian Jackson <ian.jackson@eu.citrix.com>
    Date:   Tue Jul 21 15:29:43 2009 +0100

add per domain low level xenstore functions [PATCH 2/3]
add per domain low level xenstore functions (read/chmod/write/watch).

broke the stubdom build because minios's fork/version of libxenstore
does not have the xenstore chmod operation.  As xenstore_dom_chmod
is not currently used in stubdom, #if it out.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agofix vnc screen corruption bugs and viewer exits
Ian Jackson [Tue, 4 Aug 2009 14:35:46 +0000 (15:35 +0100)]
fix vnc screen corruption bugs and viewer exits

I have been having problems with display corruption using raw
encoding.

I have also been having issues with the vncviewer client exiting with
"rect too big".

These problems appear when there are rapid changes to the framebuffer
contents. [I've been using "find /" in my tests to generate a lot of text
output.]

The root cause of both problems appears to be the changing of
the underlying framebuffer data during the creation of the update.
[Hextile makes multiple passes over the data and gets badly
confused if the data changes..]

The attached patch pulls the pixel data from the "stable" old_data
buffer rather than directly from the (changing) display surface.

Submitted-by: Andrew Thomas <andrew.thomas@oracle.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agopassthrough: support the assignment of the VF of Intel 82599 10GbE Controller
Ian Jackson [Tue, 4 Aug 2009 14:28:14 +0000 (15:28 +0100)]
passthrough: support the assignment of the VF of Intel 82599 10GbE Controller

The datasheet is available at
http://download.intel.com/design/network/datashts/82599_datasheet.pdf

See 'Table 9.7. VF PCIe Configuration Space' of the datasheet, the PCI
Express Capability Structure of the VF of Intel 82599 10GbE Controller looks
trivial, e.g., the PCI Express Capabilities Register is 0, so the Capability
Version is 0 and pt_pcie_size_init() would fail.

We should not try to expose the PCIe cap of the device to guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
15 years agopassthrough: Use physical INTX for virtual PCI functions
Ian Jackson [Tue, 4 Aug 2009 14:25:30 +0000 (15:25 +0100)]
passthrough: Use physical INTX for virtual PCI functions

Allow virtual functions to use the legacy interrupt pin of the
corresponding physical device.  This is already half-implemented
by the code that uses pci_read_intx() in pass-through.c. This fills
in a missing piece.

An alternate solution is to reverse the previously applied pci_read_intx()
code and revert to always using INTA. However, that seems likely to lead to
excessive sharing of interrupt pins when multi-function pass-through is
used.

Tested-by: Tom Rotenberg <tom.rotenberg@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agodefault the videoram to 4MB when it is not set
Ian Jackson [Tue, 4 Aug 2009 14:24:56 +0000 (15:24 +0100)]
default the videoram to 4MB when it is not set

this patch sets the videoram size to 4MB in case the size is not set
explicitly by the user or the toolstack.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoadd two missing cirrus_update_memory_access
Ian Jackson [Tue, 4 Aug 2009 14:23:43 +0000 (15:23 +0100)]
add two missing cirrus_update_memory_access

the cirrus emulation code misses two calls to
cirrus_update_memory_access; this fact together with the condition on the
call to cirrus_update_memory_access in cirrus_bitblt_reset can cause
segfaults in qemu.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agouse XC_PAGE_SIZE in xenfbfront (fix stubdom build on NetBSD)
Ian Jackson [Tue, 21 Jul 2009 15:08:24 +0000 (16:08 +0100)]
use XC_PAGE_SIZE in xenfbfront (fix stubdom build on NetBSD)

Apropos of a report from Christoph Egger about misuse of PAGE_SIZE in
xenfbfront; change references to XC_PAGE_SIZE which is correct in our
context.  This fix suggested by Stefano Stabillini.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agopassthrough: Fix pci bar remapping when guest probes width with all-1 BAR
Ian Jackson [Tue, 21 Jul 2009 14:33:30 +0000 (15:33 +0100)]
passthrough: Fix pci bar remapping when guest probes width with all-1 BAR

When guest code tries to get the block size of mmio, it will write all "1"s
into pci bar register and then qemu will return all "0"s to the don't care
bits in the emulated bar register to indicate the block size to guest code.
In this case, we should not create p2m mapping in  pt_bar_reg_write() and
pt_exp_rom_bar_reg_write(). Attached patch fixes this issue, additional
comment can be found in the patch.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
15 years agoadd low level functions from the root (read/write). [PATCH 3/3]
Ian Jackson [Tue, 21 Jul 2009 14:30:18 +0000 (15:30 +0100)]
add low level functions from the root (read/write).  [PATCH 3/3]

This is a series of patch to complete the xenstore interface in qemu.

1: create a callback mecanism for xenstore watches.
2: add per domain low level xenstore functions (read/chmod/write/watch).
3: add low level functions from the root (read/write).

Signed-off-by: Jean Guyader <jean.guyader@citrix.com>
15 years agoadd per domain low level xenstore functions [PATCH 2/3]
Ian Jackson [Tue, 21 Jul 2009 14:29:43 +0000 (15:29 +0100)]
add per domain low level xenstore functions [PATCH 2/3]

add per domain low level xenstore functions (read/chmod/write/watch).

This is a series of patch to complete the xenstore interface in qemu.

1: create a callback mecanism for xenstore watches.
2: add per domain low level xenstore functions (read/chmod/write/watch).
3: add low level functions from the root (read/write).

Signed-off-by: Jean Guyader <jean.guyader@citrix.com>
15 years agocreate a callback mechanism for xenstore watches [PATCH 1/3]
Ian Jackson [Tue, 21 Jul 2009 14:27:00 +0000 (15:27 +0100)]
create a callback mechanism for xenstore watches [PATCH 1/3]

This is a series of patch to complete the xenstore interface in qemu.

1: create a callback mecanism for xenstore watches.
2: add per domain low level xenstore functions (read/chmod/write/watch).
3: add low level functions from the root (read/write).

Signed-off-by: Jean Guyader <jean.guyader@citrix.com>
15 years agopass-through: pt_reset_interrupt_and_io_mapping(): use hw INTX
Ian Jackson [Mon, 20 Jul 2009 11:26:39 +0000 (12:26 +0100)]
pass-through: pt_reset_interrupt_and_io_mapping(): use hw INTX

This fixes a few things that I missed in previous patches:

* Use the hw INTX rather than INTA in pt_reset_interrupt_and_io_mapping()
  This is consistent with other uses of pci_intx()
* Remove now inaccurate "/* fix virtual interrupt pin to INTA# */" comments
* Use PCI_SLOT()

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoDo not #include <pci/header.h> unless CONFIG_PASSTHROUGH
Ian Jackson [Mon, 20 Jul 2009 11:22:59 +0000 (12:22 +0100)]
Do not #include <pci/header.h> unless CONFIG_PASSTHROUGH

Attached patch fixes an ioemu build error on NetBSD where
CONFIG_PASSTHROUGH is not (yet) defined.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoportability fixes for qemu-ifup
Ian Jackson [Thu, 9 Jul 2009 14:33:48 +0000 (15:33 +0100)]
portability fixes for qemu-ifup

Attached patch applies portability fixes to ioemu's qemu-ifup script:
- rename qemu-ifup to qemu-ifup-Linux
- add qemu-ifup-NetBSD for NetBSD
- Build system picks the right one and installs just that under the
  conventional name.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoAlways treat floppy images as raw
Ian Jackson [Wed, 8 Jul 2009 14:52:31 +0000 (15:52 +0100)]
Always treat floppy images as raw

The fix for the image format guessing vulnerability breaks raw floppy
images.  In our environment it is difficult to apply the same
configuration change as envisaged upstream, so instead we arrange to
always treat a floppy image as raw.

Two-line patch supplied by James Harper <james.harper@bendigoit.com.au>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit f2ce5c35f60bb606bd3ddb55c361bb8a9aad5c5c)

[ Also originally committed as 342846c1eecc972fcfae84d9d1ae65a318101792
  Mistakenly dropped from qemu-xen-unstable.git and now reapplied.
  Thanks to report from James Harper.   -iwj ]

15 years agofix scsi dma buffer size
Ian Jackson [Wed, 8 Jul 2009 14:41:15 +0000 (15:41 +0100)]
fix scsi dma buffer size

Attached patch fixes calculation of scsi dma buffer size.
Found by build error on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agocpu_unregister_map_client: fix memory leak
Ian Jackson [Tue, 30 Jun 2009 14:22:14 +0000 (15:22 +0100)]
cpu_unregister_map_client: fix memory leak

fix memory leak in cpu_unregister_map_client() and cpu_notify_map_clients().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
[ Picked out of qemu-devel submission for exec.c, because we have a
  clone-and-hack of the cpu_*map* code :-( -iwj ]

15 years agoget rid of hardcoded paths
Ian Jackson [Tue, 30 Jun 2009 13:46:42 +0000 (14:46 +0100)]
get rid of hardcoded paths

Attached patches get rid of hardcoded pathes in ioemu
and in ioemu-stubdom.

You need xen changeset 19841 or newer to have
them working.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoMerge branch 'pt.multifn'
Ian Jackson [Thu, 25 Jun 2009 17:40:33 +0000 (18:40 +0100)]
Merge branch 'pt.multifn'

Conflicts:
hw/piix4acpi.c

15 years agopassthrough: multi-function PCI in ACPI: rename slot to devfn
Ian Jackson [Thu, 25 Jun 2009 17:33:09 +0000 (18:33 +0100)]
passthrough: multi-function PCI in ACPI: rename slot to devfn

This is a companion to the previous patch "qemu-xen: pass-through:
multi-function PCI in ACPI". It does not make any functional changes,
rather it just renames slot to devfn as appropriate.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[7/8; cross-compatibility issues with xen-unstable.hg]

15 years agopassthrough: multi-function PCI in ACPI
Ian Jackson [Thu, 25 Jun 2009 17:32:29 +0000 (18:32 +0100)]
passthrough: multi-function PCI in ACPI

This changes the interface beween qemu-xen and the ACPI portion
of hvmlader. As such it breaks compatibility with older
hvmloaders and a companion patch to hvmloader is needed.

There is a subsequent "noise" companion to this change
which changes slot to devfn as appropriate.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[6/8; cross-compatibility issues with xen-unstable.hg]

15 years agopassthrough: Add AUTO_PHP_DEVFN_MULTI
Ian Jackson [Thu, 25 Jun 2009 17:32:01 +0000 (18:32 +0100)]
passthrough: Add AUTO_PHP_DEVFN_MULTI

Up until now there has been a signle magic value that xend can pass to
qemu-xen to signify that qemu-xen should choose a devfn for a pass-through
function.

When supporting multi-function devices in guests, it is useful for xend to
be able to sepcify if a function is to appear in a guest as a
single-function deveice, or as part of a multi-function device.

By adding AUTO_PHP_DEVFN_MULTI to suplement the existing AUTO_PHP_DEVFN,
this patch achieves that goal.

This patch does not break compatibility with xend as the value chosen for
AUTO_PHP_DEVFN_MULTI could never validly be sent by xend up until now.
However, there is a companion change to xend in order to make use of this
feature.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[5/8; cross-compatibility issues with xen-unstable.hg]

15 years agopassthrough: rename slot to devfn
Ian Jackson [Thu, 25 Jun 2009 17:31:24 +0000 (18:31 +0100)]
passthrough: rename slot to devfn

This is the noisy companion to the previous patch "qemu-xen: pass-through:
use devfn instead of slots as the unit for pass-through". It just renames
slot to devfn in various places.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[4/8; cross-compatibility issues with xen-unstable.hg]

15 years agopassthrough: use devfn instead of slots as the unit for pass-through
Ian Jackson [Thu, 25 Jun 2009 17:30:25 +0000 (18:30 +0100)]
passthrough: use devfn instead of slots as the unit for pass-through

This is part of support for multi-function PCI devices in guests

Instead of reading a slot number from xend, read a devfn.
This and subsequent other changes will allow xend to ask
for more than one function to be inserted into a single slot -
by specifying which function of the slot should be used.

This is a minimal patch for this change. A subsequent
patch that has a lot of noise to rename slot to devfn follows.

This patch breaks compatibility with xend and corresponding
patches to xend are required.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[3/8; cross-compatibility issues with xen-unstable.hg]

15 years agopassthrough: Read the PCI type bit from hardware
Ian Jackson [Thu, 25 Jun 2009 17:24:23 +0000 (18:24 +0100)]
passthrough: Read the PCI type bit from hardware

Preparation for multi-fucntion devices in guests.

When scanning the PCI bus a guest* will only look for
functions 2-7 if the multifunction bit is set.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
[2/8; cross-compatibility issues with xen-unstable.hg]

15 years agopassthrough: Read the interrupt pin from hardware
Ian Jackson [Thu, 25 Jun 2009 17:26:00 +0000 (18:26 +0100)]
passthrough: Read the interrupt pin from hardware

Preparation for multi-fucntion devices in guests.

Up until now guests have only seen devices with one function,
so it is both safe and sensible to always use INTA. But if
if multiple functions appear, it makes sense to use
the interrupt pin specified by the hardware.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>
[1/8; cross-compatibility issues with xen-unstable.hg]

15 years agohw/piix4acpi.c: cleanup logging
Ian Jackson [Thu, 18 Jun 2009 14:23:53 +0000 (15:23 +0100)]
hw/piix4acpi.c: cleanup logging

this is a simple cleanup patch for logging in piix4acpi: it replaces all
the calls to fprintf with calls to a specific logging function that has
3 simple logging levels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoimplement qemu_chr_open_pty for stubdoms
Ian Jackson [Thu, 18 Jun 2009 14:22:16 +0000 (15:22 +0100)]
implement qemu_chr_open_pty for stubdoms

this is an updated version of the patch "implement qemu_chr_open_pty for
stubdoms": qemu_chr_open_pty is now based on posix_openpt instead of
openpty(void).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ This depends on the corresponding minios change, which is
  19790:01ad2654815a ]

15 years agoxs_rm xenstore command from xend after we read it
Ian Jackson [Thu, 18 Jun 2009 13:53:58 +0000 (14:53 +0100)]
xs_rm xenstore command from xend after we read it

in xenstore_process_dm_command_event(), xs_rm the
command node after we read it.

As Ian Jackson pointed out: "when we start processing a command we
should delete it from xenstore immediately, so that future watch
triggerings either don't see the command or actually see genuine new
invocations".

The patch is used to overcome a race condition that occurs after
changeset 19679: ec2bc4b9fa32 (xend: hot-plug PCI devices at
boot-time) and could break the device assignment of hvm guest:

ioemu's xs_watch() fires the 'command' for the 1st time and xend's
signalDeviceModel('pci-ins',...) fires it for the 2nd time -- without
the patch, the 2nd time watch handling would try to invoke
xenstore_process_dm_command_event() again and since the 'parameter'
node has been changed to hold vslot by ioemu, the second time would
fail and set 'parameter' to "no free hotplug slots" at the end of the
2nd handling; and, if xend runs slower, xend would treat the
'parameter' of the 2nd time as that of the 1st time and destroy the
guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
15 years agoqemu: implement support for secondary consoles in the console backend
Ian Jackson [Tue, 16 Jun 2009 17:14:30 +0000 (18:14 +0100)]
qemu: implement support for secondary consoles in the console backend

[PATCH 5 of 5] qemu: implement support for secondary
This patch adds support for secondary consoles in the console backend.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ Patches 1-3 are to xen-unstable but do not have compatibility
  implications, we believe.  Patch 4 is awaiting revision. -iwj ]

15 years agostdvga + videoram config option
Ian Jackson [Mon, 8 Jun 2009 16:45:42 +0000 (17:45 +0100)]
stdvga + videoram config option

Without this patch, guests cannot be created on ia64 because of
qemu-dm's error.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
15 years agoadd a few missing statics and consts
Ian Jackson [Wed, 3 Jun 2009 14:47:52 +0000 (15:47 +0100)]
add a few missing statics and consts

attached patch fixes a few gcc warnings in ioemu.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agopass-through: only parse single BDFs.
Ian Jackson [Wed, 3 Jun 2009 14:39:26 +0000 (15:39 +0100)]
pass-through: only parse single BDFs.

As of "qemu-xen: hot-plug PCI devices at boot-time", the BDF string
that is parsed always contains a single bdf, not multiple bdf's delimited
by a '-'.

Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agopass-through: non-idempotent __insert_to_pci_slot()
Ian Jackson [Wed, 3 Jun 2009 14:38:45 +0000 (15:38 +0100)]
pass-through: non-idempotent __insert_to_pci_slot()

As of "qemu-xen: hot-plug PCI devices at boot-time" register_real_dev()
no longer needs to call __insert_to_pci_slot() and thus there
is no need for __insert_to_pci_slot() to be idempotent.

This is because register_real_dev()'s now only has one caller,
power_on_php_slot(), which always  passes a valid e_slot to
register_real_dev().

Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agopass-through: Catch errors in do_pci_del()
Ian Jackson [Wed, 3 Jun 2009 14:38:09 +0000 (15:38 +0100)]
pass-through: Catch errors in do_pci_del()

(The strdup() is needed because the parsing of devname is destructive.)

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agopass-through: Make use of PCI_FUNC, PCI_SLOT and PCI_DEVFN macros
Ian Jackson [Wed, 3 Jun 2009 14:37:02 +0000 (15:37 +0100)]
pass-through: Make use of PCI_FUNC, PCI_SLOT and PCI_DEVFN macros

This is mostly cosmetic, but debug statements asside
I think that it does make things somewhat easier to work with.

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agopassthrough: hot-plug PCI devices at boot-time
Ian Jackson [Mon, 1 Jun 2009 09:45:42 +0000 (10:45 +0100)]
passthrough: hot-plug PCI devices at boot-time

Currently there are two interfaces to pass-through PCI devices:
1. A method driven through per-device xenstore entries that is used at boot-time
2. An event-based method used for hot-plug.

This seems somewhat redundant and makes extending the code cumbersome
and prone to error - often the change needs to be made twice, in
two different ways.

This patch removes support for the boot-time protocol from qemu-xen.

There is a companion patch for xend which uses the hot-plug protocol
at boot time.

Cc: Edwin Zhai <edwin.zhai@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agopassthrough: fix %lx compiler warning
Ian Jackson [Fri, 29 May 2009 14:42:23 +0000 (15:42 +0100)]
passthrough: fix %lx compiler warning

This patch removes the following warning for x86-32 by PRIx64.

pass-through.c: In function 'pt_iomul_ioport_write':
pass-through.c:1140: warning: format '%lx' expects type 'long unsigned int', but argument 9 has type 'uint64_t'
pass-through.c: In function 'pt_iomul_ioport_read':
pass-through.c:1166: warning: format '%lx' expects type 'long unsigned int', but argument 9 has type 'uint64_t'

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
15 years agoDisable another remnant of PCI IO space multiplex, for stubdom
Ian Jackson [Fri, 29 May 2009 14:03:17 +0000 (15:03 +0100)]
Disable another remnant of PCI IO space multiplex, for stubdom

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
15 years agoDisable PCI IO space multiplex for stubdom
Ian Jackson [Fri, 29 May 2009 11:14:23 +0000 (12:14 +0100)]
Disable PCI IO space multiplex for stubdom

Changeset c675fef021550faeafa60577abd18347a172f220 breaks the stubdom
build.  The ioctl machinery used is not available in stubdom, so let
us disable this feature in stubdom and return matters to the previous
state if CONFIG_STUBDOM.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agoioemu: passthrough: PCI IO space multiplex.
Ian Jackson [Thu, 28 May 2009 17:34:03 +0000 (18:34 +0100)]
ioemu: passthrough: PCI IO space multiplex.

use PCI IO space multiplexer driver and command register emulation twist

This depends on xen-unstable c/s
 19666:8bf58f09e45a2cb021df59ddfe518ebdc6334b78

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
15 years agoreplace stat("/etc/disable-guest-log-throttle") in xen_platform.c
Ian Jackson [Thu, 28 May 2009 17:24:49 +0000 (18:24 +0100)]
replace stat("/etc/disable-guest-log-throttle") in xen_platform.c

currently xen_platform reads /etc/disable-guest-log-throttle at boot to
decide whether is going to throttle guest logging or not.
When using stubdom this is the only code in qemu that rely on
fs-backend, apart from saving and loading the statefile for migration.
This patch removes the read from /etc and adds a read from xenstore
instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agofix cdrom eject, media change, stubdom fallback case
Ian Jackson [Thu, 21 May 2009 17:45:39 +0000 (18:45 +0100)]
fix cdrom eject, media change, stubdom fallback case

this patch fixes few cdrom handling issues:

- when a cdrom medium event occurs and the new filename is NULL,
  we should eject the emulated cdrom instead of just ignoring the event;

- when a cdrom medium event occurs and we are in a stubdom, we have to
  pass the xenstore path of the frontend to bdrv_open instead of the
  filename;

- when we try and fail to open a cdrom (or disk) in a stubdom we should
  not fall back to the usual "non-stubdom" code path because is useless
  and wrong.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoblock-vbd: bounce misaligned read/write requests
Ian Jackson [Thu, 21 May 2009 17:09:17 +0000 (18:09 +0100)]
block-vbd: bounce misaligned read/write requests

Bounce any read or write request with a buffer not aligned, a sector
number not aligned or an offset not aligned according to the sector size
reported by blkfront.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agofix stdvga + videoram config option
Ian Jackson [Thu, 21 May 2009 17:08:19 +0000 (18:08 +0100)]
fix stdvga + videoram config option

[There is an unfortunate] initial configuration check done by qemu that is
actually meaningless for us (at least on x86).

This patch should fix the problem.  I kept the check in place only in
case it might be of some use for the ia64 people.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agopass-through: porvide leading zero for vdevfn
Ian Jackson [Thu, 21 May 2009 16:57:38 +0000 (17:57 +0100)]
pass-through: porvide leading zero for vdevfn

This is consistent with the format used elsewhere.

At this time this inconsistency manifests in the output of pci-list
for functions that have been hot-plugged.

While the pci-list output could be unified inside xm or xend by,
for example parsing the string as an integer and then formating it
as a string, there seems to be no disadvantage in making the
string representation used consistent.

Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoqemu xen upstream synch (Gerd): [PATCH 7/7] xen_backend logging: add include
Ian Jackson [Tue, 19 May 2009 14:42:20 +0000 (15:42 +0100)]
qemu xen upstream synch (Gerd): [PATCH 7/7] xen_backend logging: add include

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15 years agoqemu xen upstream synch (Gerd): [PATCH 6/7] xenfb: kill unused variables
Ian Jackson [Tue, 19 May 2009 14:41:34 +0000 (15:41 +0100)]
qemu xen upstream synch (Gerd): [PATCH 6/7] xenfb: kill unused variables

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15 years agoqemu xen upstream synch (Gerd): [PATCH 5/7] logging fixups.
Ian Jackson [Tue, 19 May 2009 14:41:04 +0000 (15:41 +0100)]
qemu xen upstream synch (Gerd): [PATCH 5/7] logging fixups.

Use new logging API.
Kill a few fprintf(stderr, "...") calls.

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15 years agoqemu xen upstream synch (Gerd): [PATCH 4/7]: no malloc failure checks.
Ian Jackson [Tue, 19 May 2009 14:40:06 +0000 (15:40 +0100)]
qemu xen upstream synch (Gerd): [PATCH 4/7]: no malloc failure checks.

qemu_malloc() will never return errors.  It will abort instead.
Thus no checks for failure are needed.

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15 years agoqemu xen upstream synch (Gerd): [PATCH 3/7]: fix fsf address & compare style
Ian Jackson [Tue, 19 May 2009 14:38:44 +0000 (15:38 +0100)]
qemu xen upstream synch (Gerd): [PATCH 3/7]: fix fsf address & compare style

changes coming from upstream merge review (style only, no code changes).
 - Update FSF address.
 - Fix strage compare style.

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15 years agoqemu xen upstream synch (Gerd): [PATCH 2/7] merge review: delete comment
Ian Jackson [Tue, 19 May 2009 14:37:47 +0000 (15:37 +0100)]
qemu xen upstream synch (Gerd): [PATCH 2/7] merge review: delete comment

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
15 years agoqemu xen upstream synch (Gerd): [PATCH 1/7] xenfb update.
Ian Jackson [Tue, 19 May 2009 14:36:46 +0000 (15:36 +0100)]
qemu xen upstream synch (Gerd): [PATCH 1/7] xenfb update.

[This is] a series of patches for qemu-xen, making the code identical
to the xen support patches being submitted to upstream qemu.  The review
process on qemu-devel resulted in a number of fixes and cleanups in the
backend code, this is where most of the changes come from.

There are also some xenfb changes due to displaystate reorganization and
xenfb being merged in steps due to that.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
16 years agoFix DMA emualtion for ia64.
Ian Jackson [Fri, 8 May 2009 16:26:01 +0000 (17:26 +0100)]
Fix DMA emualtion for ia64.

For DMA in native system, operating system depends on platform
flushes icache of memory touched by DMA operations.
But as to virtual DMA of virtual machine, dma emulation code has to
use explicit instructions to flush icahce,otherwise,
guest may use old icache and leads to guest's crash.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Yang Zhang <yang.zhang@intel.com>
16 years agopassthrough: pt_bar_mapping: use a better way to get the CMD value
Ian Jackson [Fri, 8 May 2009 16:15:39 +0000 (17:15 +0100)]
passthrough: pt_bar_mapping: use a better way to get the CMD value

The pt_pci_read_config(&ptdev->dev, PCI_COMMAND, 2) in
5d767b7b3fac52336f59e5b40d8befa6b1909937 is not proper as Yuji Shimada
points out: "pt_pci_read_config emulates access to read the registers
from guest software. Many functions which are not relevant are
executed in pt_pci_read_config. So side effects may occur"; instead,
we can "remove emu_mask from writable_mask in pt_cmd_reg_write and
then we can get the proper value from reg_entry->data".  Thanks for
Yuji's review and Simon Horman's test.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Tested-by: Simon Horman <horms@verge.net.au>
Reviewed-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agopassthrough: pt_bar_mapping etc.: use correct CMD for PCI BAR mapping etc.
Ian Jackson [Tue, 5 May 2009 14:22:17 +0000 (15:22 +0100)]
passthrough: pt_bar_mapping etc.: use correct CMD for PCI BAR mapping etc.

dbb8aafa702b8b4f5568e08641d98471fd04e0f8 has a bug:
The virtual CMD value we get from reg_entry->data is not the proper
value because reg_entry->data only holds the emulated bits and the
PCI_COMMAND_IO/PCI_COMMAND_MEMORY bits are not in it.  Instead, we can
use pt_pci_read_config(&ptdev->dev, PCI_COMMAND, 2) to get the proper
value.

We should only update the mapping of the related BAR, NOT the mappings
of ALL BARs.

In pt_exp_rom_bar_reg_write(), we should also update the mapping. And
for PCI_ROM_SLOT, when the PCI_ROM_ADDRESS_ENABLE bit is 0, we should
not have the mapping.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
16 years agoqemu-img-xen: Fix cow creation with raw image backing files
Ian Jackson [Tue, 5 May 2009 14:20:50 +0000 (15:20 +0100)]
qemu-img-xen: Fix cow creation with raw image backing files

Previously
  dd if=/dev/zero of=raw_image count=100
  ./qemu-img-xen create -b raw_image -f qcow2 cow_image
would fail because it would attempt to autodetect the format of
base_image.  With this change, it works.  However,
  ./qemu-img-xen create -b cow_image -f qcow2 cow_image_2
will now fail because we now always expect the backing file to be raw.

Thanks to Xin Li and Dongxiao Xu for the bug report.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agopassthrough: don't call xc_deassign_device() xen-3.4.0-rc3
Ian Jackson [Wed, 29 Apr 2009 15:28:37 +0000 (16:28 +0100)]
passthrough: don't call xc_deassign_device()

This series of patches modify the order of resetting/deassigning
device.

I modify the order of resetting/deassigning device like below.

  When guest OS shutdowns or a device is hotremoved.
   1. Xend resets devices.
   2. Xend deassigns devices.

Because if devices are deassigned before the reset, dom0 memory may be
broken by DMA

This patch modifies ioemu not to call xc_deassign_device()

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agodrop lwip network support in stubdoms
Ian Jackson [Thu, 23 Apr 2009 15:35:09 +0000 (16:35 +0100)]
drop lwip network support in stubdoms

in order to simplify network support in ioemu stubdoms, I am dropping
lwip based networking.
Network support is still provided the same way: using the tap
interface, created in qemu using netfront.
The lwip stack is still available to avoid additional compilation
issues.
However the stubdom is not going to have its own vif anymore,
this means that the only vnc server supported is the one in dom0.
You can still enable the vnc server in a stubdom at compile time, if
you want so.

Probably the most important change caused by this patch to xen users is
that you don't have to specify two vif in the stubdom config file
anymore, but just one:

-vif = [ '', 'ip=10.0.1.1,mac=aa:00:00:12:23:34']
+vif = ['ip=10.0.1.1,mac=aa:00:00:12:23:34']

this is the qemu part of the patch: we do not need to hard code 1 as the
starting vif for the tap interface anymore.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agopassthrough: Fix older kernel assigned device resume failure problem
Ian Jackson [Wed, 22 Apr 2009 15:16:40 +0000 (16:16 +0100)]
passthrough: Fix older kernel assigned device resume failure problem

We found when do S3 resume, some older kernel(such as rh5.1)
cmd register might be restored before BAR registers, Since
pt_bar_mapping is done when writing cmd register, it will cause
mapping incorrect address.
It's the root_cause of when doing RH5.1 HVM S3, assigned e1000e
network card fails to resume back. (set pci_power_mgmt=1 in guest
config file, let PM support device enter D3 hot state during guest S3)

we should call pt_bar_mapping in pt_bar_reg_write to avoid this problem
for supporting older kernels.

Signed-off-by: Liping Ke <Liping.Ke@intel.com>
Signed-off-by: Yu Zhao<yu.zhao@intel.com>
Acked-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoFix hvm guest cirrus_vga hvm s3 resume failure
Ian Jackson [Tue, 21 Apr 2009 14:45:18 +0000 (15:45 +0100)]
Fix hvm guest cirrus_vga hvm s3 resume failure

This patch is for fixing hvm guest cirrus_vga hvm s3 resume failure.
 We found latest Qemu (after Mar 3.10) will cause HVM guest vga fails
to resume back from S3.  It's because vga_bios_init is not only needed
during init, but also needed after cirrus_vga reset (hvm s3 will do
qemu_reset).

Also, we found the outdated s->vram_ptr reset will cause s3 resume
screen black, so we remove it. (win2000 boot up does not need it now)

We verified the fix with the latest cs/qemu.

[ Patch modified slightly by Ian Jackson to reduce code motion. ]

Signed-off-by: Liping Ke<liping.ke@intel.com>
Signed-off-by: Ke Yu<ke.yu@intel.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agofix qcow2 backing file open
Ian Jackson [Mon, 20 Apr 2009 16:55:20 +0000 (17:55 +0100)]
fix qcow2 backing file open

Make `:'-less BDRV_O_FILE bdrv_open2 work again.
qcow2 opens its backing file this way.  Thanks to Yang Zhang for the patch.

Signed-off-by: Yang Zhang <yang.zhang@intel.com>
16 years agostubdom: fix network
Ian Jackson [Fri, 17 Apr 2009 16:41:32 +0000 (17:41 +0100)]
stubdom: fix network
Date: Fri, 17 Apr 2009 16:14:50 GMT

this patch fixes network support in ioemu stubdoms.
At the moment in order to provide a working network interface to the
guest you still need to specify a vif in both the guest and stubdom
config files.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agofix sdl mode
Ian Jackson [Fri, 17 Apr 2009 16:40:32 +0000 (17:40 +0100)]
fix sdl mode

When I use "sdl=1 vnc=0" in hvm guest config file, qemu-dm would exit
due to a de-reference to a NULL pointer. The regression is introduced
by 3793d85f111a0dfe055ca8ac17a9d1881af43240.  The attached patch fixes
the issue.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agopassthrough: guest MSI config on disable xen-3.4.0-rc2
Ian Jackson [Thu, 16 Apr 2009 10:47:04 +0000 (11:47 +0100)]
passthrough: guest MSI config on disable

It's possible for a guest to change the MSI vector or flags
when MSI is disabled, after it's first initialized. This patch
handles the address and data update when it's disabled.

Signed-off-by: Qing He <qing.he@intel.com>
16 years agoMerge branch 'stable_0_10'
Ian Jackson [Tue, 14 Apr 2009 16:35:05 +0000 (17:35 +0100)]
Merge branch 'stable_0_10'

Conflicts:

block.c
hw/cirrus_vga.c
hw/vga.c

16 years agofix std-vga cli option
Ian Jackson [Tue, 14 Apr 2009 12:31:27 +0000 (13:31 +0100)]
fix std-vga cli option

currently the std-vga qemu command line option does not work anymore,
this patch fixes the issue.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agomapcache fixes (Stefano)
Ian Jackson [Tue, 14 Apr 2009 11:03:01 +0000 (12:03 +0100)]
mapcache fixes (Stefano)

this patch makes the new mapcache code cleaner and fixes few problems
introduced by the recent mapcache improvements.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoRecognise evdev(xx)_aliases(yy) and xfree86(xx)_aliases(yy) as keymap names.
aliguori [Mon, 13 Apr 2009 13:29:40 +0000 (13:29 +0000)]
Recognise evdev(xx)_aliases(yy) and xfree86(xx)_aliases(yy) as keymap names.

Newer Xorg use these with non-default kemaps (such as the ThinkPad keymap).

aliguori: this is from r7097 in trunk by balrog

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7098 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoMake PCI config status register read-only
aliguori [Fri, 10 Apr 2009 20:49:44 +0000 (20:49 +0000)]
Make PCI config status register read-only

From the documentation I can find, this register is supposed to be read-only.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7071 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoFix crash on resolution change -> screen dump -> vga redraw (Avi Kivity)
aliguori [Fri, 10 Apr 2009 18:36:38 +0000 (18:36 +0000)]
Fix crash on resolution change -> screen dump -> vga redraw (Avi Kivity)

The vga screen dump function updates last_width and last_height,
but does not change the DisplaySurface that these variables describe.
A consequent vga_draw_graphic() will therefore fail to resize the
surface and crash.

Fix by invalidating the display state after a screen dump, forcing
vga_draw_graphic() to reallocate the DisplaySurface.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7069 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agopassthrough: Fix error handling when interrupt hypercall fails.
Ian Jackson [Wed, 8 Apr 2009 16:54:45 +0000 (17:54 +0100)]
passthrough: Fix error handling when interrupt hypercall fails.

This patch fixes error handling when interrupt hypercall fails.
This patch makes Interrupt Disable bit emulate type.

The policy of this patch is [ in a comment at the top of pass-through.c ]

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoFix ia64 HVM boot failure. Remove mmap bounce buffer in ia64.
Ian Jackson [Wed, 8 Apr 2009 16:39:00 +0000 (17:39 +0100)]
Fix ia64 HVM boot failure.  Remove mmap bounce buffer in ia64.

For Non-MAPCACHE case, to get the virtual address corresponding to
guest physical address, only an offset value is added to guest
physical address.  With this patch, ia64 HVM boot failure bug can be
fixed.

[ This reverts part of 2ed2ee1704a4ef956ecc61848c84d12aaa4419d5,
  once again removing the bounce buffer in the non-MAPCACHE
  version of cpu_physical_memory_map. -iwj ]

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
16 years agosync DisplayAllocator interface
Ian Jackson [Wed, 8 Apr 2009 16:32:57 +0000 (17:32 +0100)]
sync DisplayAllocator interface

this simple patch sync's the DisplayAllocator interface with upstream
qemu. The only non trivial change, is the new ability for sdl to support
the DisplayAllocator interface, hence improving performances (avoid a
memcpy) when the guest is in text mode or uses a color depth of 8bpp or
24bpp (no DisplayState surface sharing allowed).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoUpdate version for release
aliguori [Tue, 7 Apr 2009 01:57:17 +0000 (01:57 +0000)]
Update version for release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7012 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agoFix find_device_type() to correctly identify floppy disk devices; (Luca Tettamanti)
aliguori [Tue, 7 Apr 2009 01:46:18 +0000 (01:46 +0000)]
Fix find_device_type() to correctly identify floppy disk devices; (Luca Tettamanti)
they are reported as DRIVE_REMOVABLE by win32.

Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7011 c046a42c-6fe2-441c-8c8c-71466251a162

16 years ago Fix savevm after BDRV_FILE size enforcement
aliguori [Sun, 5 Apr 2009 21:07:26 +0000 (21:07 +0000)]
 Fix savevm after BDRV_FILE size enforcement

 We now enforce that you cannot write beyond the end of a non-growable file.
 qcow2 files are not growable but we rely on them being growable to do
 savevm/loadvm.  Temporarily allow them to be growable by introducing a new
 API specifically for savevm read/write operations.

Reported-by: malc
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7005 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agostop dirty tracking just at the end of migration (Glauber Costa)
aliguori [Sun, 5 Apr 2009 19:33:41 +0000 (19:33 +0000)]
stop dirty tracking just at the end of migration (Glauber Costa)

If there is still work to do, it is not safe to assume we
can end the dirty tracking. Specifically, kvm can update the dirty
tracking log inside ram_save_block(), leaving pages still out of sync
if we go with the current code.

Based on a patch by Yaniv Kamay

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7002 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agocreate qemu_file_set_error (Glauber Costa)
aliguori [Sun, 5 Apr 2009 19:33:37 +0000 (19:33 +0000)]
create qemu_file_set_error (Glauber Costa)

This is mainly for consistency, since we don't want
anything outside of savevm setting it explicitly. There
are current no users of that in qemu tree, but there
are potential candidates on kvm-userspace. And avi
is a nice guy, let's be nice with him.

Based on a patch by Yaniv Kamay

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7001 c046a42c-6fe2-441c-8c8c-71466251a162

16 years agopropagate error on failed completion (Glauber Costa)
aliguori [Sun, 5 Apr 2009 19:33:33 +0000 (19:33 +0000)]
propagate error on failed completion (Glauber Costa)

migrate_fd_put_ready() calls qemu_savevm_state_complete(),
but the later can fail.

If it happens, re-start the vm and propagate the error up

Based on a patch by Yaniv Kamay

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@7000 c046a42c-6fe2-441c-8c8c-71466251a162