Ian Jackson [Fri, 6 Feb 2009 16:16:06 +0000 (16:16 +0000)]
hw/pass-through.c: workaround for old libpci
Old versions of libpci (including the ones on the automatic tests
which control Xen staging propagation) do not define
PCI_LIB_VERSION or the PCI_ERR_{UNCOR_MASK,...} constants.
This means that change 8c771eb6294afc5b3754a9e3de51568d4e5986c2 breaks
the build. In this changeset I apply what is intended to be a
workaround for this problem but it may not be completely correct; this
is therefore perhaps an interim fix.
The potential problem is that the save/restore of some PCI passthrough
error handling registers (across suspend/resume) may not work properly
with old versions of libpci. However non-passthrough and non-suspect
use cases should now be fine.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 5 Feb 2009 15:54:13 +0000 (15:54 +0000)]
Enable guest OS to program D0-D3hot states of an assigned device
This patch enables guest OS to program D0-D3hot states of assigned
device.
This patch is revised version based on the review comments.
- Use LIST_FOREACH(). Don't use lh_first, le_next directly.
- Use pci_{read, write}_block instead of "switch(len) case [124]
pci_{read, write}_{byte, word, long}():".
Ian Jackson [Thu, 5 Feb 2009 14:45:25 +0000 (14:45 +0000)]
fix raw_aio_read/write error handling
Currently when qemu_paio_read or qemu_paio_write return an error we call
qemu_aio_release without removing the request from the list.
I know that in the current implementation qemu_paio_write/read don't return
any error, but still the behavior is wrong, especially considering
that the implementation of these two functions is likely to change in is
the future.
This patch fixes the problem adding a raw_aio_remove function that
removes the callback from the queue and also calls qemu_aio_release.
raw_aio_remove is called by raw_aio_read, raw_aio_write and
raw_aio_cancel.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Backported-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Jan 2009 12:06:19 +0000 (12:06 +0000)]
Restore xenfb.h and atkbd_ translation tables for xenfbfront
Commit ef21d5fda2be46163d9bc3f65d64a6bfd97dd06e removed xenfb.h but
this broke the stubdom build. Necessary changes to get the build
working again:
* un-#if-0 atkbd_set2_keycode and atkbd_unxlate_table in xenfb.c
* make those two tables not `static'
* restore xenfb.h, with their declarations
* adjust the comment in the new xenfb.c
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 27 Jan 2009 11:39:10 +0000 (11:39 +0000)]
Get guest uuid from xenstore
xenstore_get_guess_uuid() retrieves the guest uuid by using a sysctl
hypercall through libxc now, but when we use the ioemu-stubdom, the
hcall is not allowed to be invoked.
This patch makes ioemu get the guest uuid from xenstore, instead of
using libxc.
Ian Jackson [Mon, 26 Jan 2009 15:07:08 +0000 (15:07 +0000)]
Replacement PV xenfb backend (Gerd Hoffman)
Description from Gerd's message:
This patch adds a framebuffer (and kbd+mouse) backend driver. It
it based on current xen-unstable code. It has been changed to make
use of the common backend driver code. It also has been changed to
compile with xen headers older than unstable (aka soon-to-be 3.3).
Ian Jackson [Mon, 26 Jan 2009 12:08:54 +0000 (12:08 +0000)]
add libpci fixup to handle recent change in PCIUtils
The following commit of PCIUtils changes what 'base_addr' contains.
Add a fixup to make sure the pass-through works when building against
different versions of PCIUtils.
The base address flags are ignored when using sysfs method, while
the proc and generic methods combined the flags into 'base_addr'.
This inconsistency may fail some applications using libpci.
Ian Jackson [Fri, 16 Jan 2009 16:02:18 +0000 (16:02 +0000)]
Replacement PV console backend (Gerd Hoffman)
Description from Gerd's message:
xen: add console backend driver.
This patch adds a xenconsole backend driver. It it based on current
xen-unstable code. It has been changed to make use of the common
backend driver code.
Note that this driver is not used at all in the default configurations
of upstream Xen.
Ian Jackson [Fri, 16 Jan 2009 15:52:44 +0000 (15:52 +0000)]
Provide alternative Xen backend infrastructure (Gerd Hoffman)
Description from Gerd's message:
Subject: [PATCH] xen: backend driver core
This patch adds infrastructure for xen backend drivers living in qemu,
so drivers don't need to implement common stuff on their own. It's
mostly xenbus management stuff: some functions to access xentore,
setting up xenstore watches, callbacks on device discovery and state
changes, handle event channel, ...
In this patch, this is just additional machinery, which will be used
in the forthcoming change(s).
Ian Jackson [Wed, 14 Jan 2009 11:04:04 +0000 (11:04 +0000)]
stdvga improvements - new videoram allocation system
This patch is the "stdvga improvements" patch to qemu-xen-unstable with
the due changes for the new videoram allocation system.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(This is Stefano's [PATCH 4 of 4] ioemu;
1 and 2 are already applied and 3 is in xen-unstable. -iwj)
Ian Jackson [Tue, 13 Jan 2009 15:41:01 +0000 (15:41 +0000)]
populate guest videoram
This patch applies to qemu-xen-unstable and implements the new way of
populating the videoram in the guest and mapping it in qemu. Initially
the videoram is populated at the address 0xff000000 in the guest memory
address space.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(This is Stefano's [PATCH 2 of 4] ioemu;
1 is in xen-unstable and 3 and 4 will go in shortly -iwj.)
Ian Jackson [Tue, 13 Jan 2009 11:28:04 +0000 (11:28 +0000)]
Contain MSI errors in msi emulation code
If msi=0 is specified and guest want to enable msi, qemu finds it can
not enable it and quits. (This problem is not appicable for xen
unstable since the "msi=x" switch is removed.) This patch let these
cases be handled inside msi emulation code. If qemu can not enable
msi, guest will not receive MSI. But Qemu can still go on. But if
guest driver does not test MSI's functionality, guest device will stop
to function.
Cherry pick requested by Dexuan Cui:
In the latest Xen-unstable, MSI in xen was disabled temporarily and
many guests with MSI-capable NIC assigned fail to bootup. Could you
please pull the following commit of qemu-xen-3.3-testing.git into
qemu-xen-unstable.git?
Ian Jackson [Mon, 12 Jan 2009 14:28:45 +0000 (14:28 +0000)]
passthrough: MSI-INTx interrupt translation support
This patch enables Xen to use MSI for MSI-capable devices as the
underlying interrupt source even if the guest does not explicitly
use it. The guest will still see an IO-APIC based INTx interrupt
translated by Xen from the MSI irq.
If the guest enables MSI or MSI-X for the passthrough device, this
translation is automatically turned off. It can also be disabled in
the config file at domain startup time.
Ian Jackson [Thu, 8 Jan 2009 19:07:45 +0000 (19:07 +0000)]
send arp like packets for hvm live migration
When two servers connect different switch/hub and do live migration
between them, network connect will no reponse about 30 seconds,
it caused by migration finished, target server do not broadcast
guest os's network info.
In pvm, when backend changed, netfront driver will send fake arp
to network, so, hvm also need this.
Uri Lublin [wrote] the patch for it:
http://www.mail-archive.com/qemu-devel@nongnu.org/msg09306.html
I [Joe] add send arp like packets at tap_receive(), and it looked like
work fine.
Signed-off-by: Joe Jin <joe.jin@oracle.com> Tested-by: Deepak Patel <deepak.patel@oracle.com> CC: Keir Fraser <keir.fraser@eu.citrix.com> CC: Kurt C. Hackel <kurt.hackel@oracle.com>
Ian Jackson [Wed, 7 Jan 2009 15:16:04 +0000 (15:16 +0000)]
fix usb-hid emulation SET_IDLE
there is a bug in the current usb-hid emulation code that affects the
way the idle flag is handled: the spec clearly states that when SET_IDLE
is called with a value == 0 means "do not send any event unless there is
an actual change". However we are currently assuming the opposite
meaning of the flag.
This patch fixes it and it also fixes a possible initialization issue
that is uncovered by using the default idle flag set to 0.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[supplied patch also trivially changed by Ian Jackson]
Ian Jackson [Tue, 6 Jan 2009 16:07:04 +0000 (16:07 +0000)]
xen-hooks.mak: Do not print `***' when compiling unless we fall over
make prints `***' when it stops due to an error. With make -j, and/or
with automated build systems, this error marker can be in the middle
of a large logfile. It is useful to be able to search for it.
Therefore change occurrences of `*' to `#' for information and warning
messages. `***' is reserved for cases where the build stops.
A corresponding change is being submitted to xen-unstable.hg.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Allocate product code 0xffff == 65535 for experimental pre-release
drivers. This will help by giving developers something to use which
doesn't tread on anyone's toes.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 31 Dec 2008 16:12:51 +0000 (16:12 +0000)]
magic ioport 0x10 protocol - clean up document
Clean up the README and product number registry comment:
- removing mail headers
- specifying that the magic number will be reversed
if the drivers are blacklisted
- clarifying that logging is permitted if drivers are
blacklisted
- specifying clearly when people should allocate new numbers
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 31 Dec 2008 16:00:20 +0000 (16:00 +0000)]
disable qemu PCI devices in HVM domains
Magic ioport (0x10) protocol for negotating with guest PV drivers
during startup, and allowing PV drivers to disable hardware emulations
thus preventing guest from seeing the same device through two paths.
Protocol and implementation from the Citrix Xenserver product line.
Documentation (protocol spec) will follow in a moment.
Contributed-By: Steven Smith <steven.smith@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Tue, 30 Dec 2008 16:49:29 +0000 (16:49 +0000)]
Do not install signal handlers in qemu-dm
Instead, if we get a terminating signal, just die. This means that
xend can kill us. Unlike upstream qemu, we are not at risk from being
sent random console signals as an attempt to cleanly terminate the
domain.
Thanks to report from Dexuan Cui <dexuan.cui@intel.com>. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 17 Dec 2008 11:39:21 +0000 (11:39 +0000)]
stubdom: Fix live migration of HVM domain
Live-migration fails because stubdom-dm doesn't respond to the request
from xc_save for the logdirty bitmap segment. The attached patch
simply generated from old ioemu tree will fix the issue, then.
Ian Jackson [Tue, 16 Dec 2008 16:03:12 +0000 (16:03 +0000)]
posix_aio_init: Explicitly unblock SIGUSR2 not USR1
In 1f4f23ae9fc220eec55aa742f67f5bb47716bcc6 I arranged to explicitly
unblock the wrong signal - the occurrence of SIGUSR1 was a leftover
from my various debugging trees.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 11 Dec 2008 18:04:47 +0000 (18:04 +0000)]
usb-hid.c: fix usb mouse wheel
This patch fixes the usb mouse wheel of usb devices.
[ Previously, tablets would fail to subtract dz from e->dz thus
producing an infinite stream of reports; also the wheel direction
inversions had been multipled by merge damage resulting in the wrong
number of inversions for mice. -iwj ]
Ian Jackson [Thu, 11 Dec 2008 17:38:28 +0000 (17:38 +0000)]
posix_aio_init: Explicitly unblock SIGUSR1
On Centos 4.3 as invoked by xend it seems that SIGUSR1 can be blocked.
This is almost certainly a libc bug; I checked by using sigprocmask to
obtain what was allegedly the current signal mask and printing it out
and SIGUSR1 wasn't listed, although my strace showed rt_sigprocmask
calls which clearly implied it was blocked - and indeed it wasn't
delivered.
Explicitly enabling it is an easy workaround.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 10 Dec 2008 15:30:49 +0000 (15:30 +0000)]
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>
aliguori [Thu, 13 Nov 2008 19:23:17 +0000 (19:23 +0000)]
block: make raw aio signaling non-blocking (Gerd Hoffman)
This patch switches the read handle of the signaling pipe into
non-blocking mode. This avoids unwanted blocking reads and also
allows to read all bytes out of the signaling pipe in case we got
signaled more that once before the handler ran.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5716 c046a42c-6fe2-441c-8c8c-71466251a162
(cherry picked from commit e20e830bbdc502986d6fd30c26b06c37a5ee0611)
Ian Jackson [Tue, 28 Oct 2008 10:25:11 +0000 (10:25 +0000)]
usb-linux.c: provide our own copy of <linux/usbdevice_fs.h>
The version on the Xensource build machines is too old. And since
this is a stable ABI it is permitted to copy the headers from Linux
into applications.
Original-Author: Thomas Sailer <sailer@ife.ee.ethz.ch> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Previously, during the merge, I resolved the changeset 2cfc40201be5562a942615452fc2c4ee45d1165c
usb-uhci: correctly deal with interrupt in asynchronous completion
which came from xen-unstable
changeset: 12775:60bbcf799384d779c2a561b9d9ba30f28e31d970
date: Thu Dec 07 11:52:26 2006 +0000
files: tools/ioemu/hw/usb-hid.c tools/ioemu/hw/usb-uhci.c
description:
[HVM] qemu mouse: Adds support for USB mouse/tablet status check and
...
And UHC should leave a TD active when receiving NAK and execute this
incompleted TD in a subseqent frame. UHC only generates an interrupt
on complete after the TD with ICO bit is completed.
... Signed-off-by: Xinmei Huang <xinmei.huang@intel.com>
with the new uhci controller in upstream qemu.
However, in the context of the new uhci controller this is a broken
change; it causes the polling of the usb tablet (for example) to cease
after the first two polls.
Ian Jackson [Fri, 24 Oct 2008 18:09:49 +0000 (19:09 +0100)]
vga.c: Call dpy_update when stealing vram
When we steal the vram, we copy the old data into it. It may be the
case that the display output is already running - eg a VNC client
already connected. In this case it is necessary to call dpy_update to
ensure that the data is sent to the client.
Without this change the initial screen clearing (done by the BIOS
before vram is stole) may be missed if the vnc client is fast at VM
startup, resulting in a white vnc screen with bits of black-backed
text painted over (which can be rectified by asking for a screen
refresh).
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Fri, 24 Oct 2008 18:07:32 +0000 (19:07 +0100)]
vnc.c: fix visible_[xywh] computations for multiple-update-requesters
The spec is unclear about the semantics of several update requests
with various different regions. Some clients (eg tightvnc 1.3.9-4 as
in etch) send a number of small nonincremental requests for areas they
have lost, followed by a large incremental one.
Our code will throw away the `modified' bits for areas outside our
idea of the client's visible area, and redraw them if that idea grows
again. So any client which sends many sequential requests in this way
will end up with some pointless retransmissions.
So what we do here is a bit of a workaround: we avoid shrinking the
visible window on a nonincremental update. We assume that a client's
incremental update specifies a new visible area (possibly shrinking)
but a nonincremental one may only grow it. Hopefully the client which
has really had its visible area reduced will shortly send us an
incremental update request.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 23 Oct 2008 09:21:41 +0000 (10:21 +0100)]
Battery management - compilation fixes
* xenstore_refresh_battery_status declaration and definition
was missing void (interpreted in C as K&R syntax)
* a couple of functions returning int returned NULL on failure
pbrook [Wed, 22 Oct 2008 15:11:31 +0000 (15:11 +0000)]
* Use function pointers for symbol lookup (currently for elf32 and elf64,
could be expanded). This also fixes the bug with mips elf64 symbols
in current Qemu trunk.
* Use quicksort and binary search for symbol lookup.
* Remove unneeded entries from symbol table. This reduced a typical table
size (linux mips kernel) from 1764487 to 11656 entries.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5510 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Tue, 21 Oct 2008 16:27:28 +0000 (16:27 +0000)]
Fix broken USB support for Linux host (Bjorn Danielsson)
Make "host:" usb devices work again on systems that have the
file /proc/bus/usb/devices. This was broken in r5441 due to
incorrect logic for the USB_FS_SYS case in usb_host_scan().