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).
aliguori [Thu, 15 Jan 2009 21:57:30 +0000 (21:57 +0000)]
report issues causing the kvm probe to fail (Christian Ehrhardt)
The patch applies to upstream qemu as well as kvm-userspace, but since it is
the qemu configure script I think it should go to upstream qemu (Anthony)
first and with the next merge to kvm-userspace. On the other hand it is the kvm
probe so an ack from Avi in case v3 is ok would be reasonable.
*updates*
v2 - it also reports other errors than just #error preprocessor statements
(requested by Avi)
v3 - In case awk or grep is not installed it now gracfully (silently)
fails still disabling kvm (requested by Anthony)
This patch is about reporting more details of the issue if configuring kvm
fails. Therefore this patch keeps the qemu style configure output which is a
list of "$Feature $Status", but extend the "no" result like "KVM Support no"
with some more information.
There might be a lot of things going wrong with that probe and I don't want
to handle all of them, but if it is one of the known checks e.g. for
KVM_API_VERSION then we could grep/awk that out and report it. The patch
reports in case of a known case in the style
"KVM support no - (Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS)"
In case more than one #error is triggered it creates a comma separated list in
those brackets and in case it is something else than an #error it just reports
plain old "no".
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6334 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Thu, 15 Jan 2009 21:52:11 +0000 (21:52 +0000)]
Define macros that will become the new logging API (Eduardo Habkost)
These macros are NOT a proposal for a definitive new logging API. They
are just a step for it: a way to mark all usage patterns of the
logfile/loglevel variables on a single place.
aliguori [Thu, 15 Jan 2009 21:48:06 +0000 (21:48 +0000)]
Clean up debugging code #ifdefs (Eduardo Habkost)
Use macros to avoid #ifdefs on debugging code.
This patch doesn't try to merge logging macros from different files,
but just unify the debugging code #ifdefs onto a macro on each file. A
further cleanup can unify the debugging macros on a common header, later
aliguori [Thu, 15 Jan 2009 21:42:12 +0000 (21:42 +0000)]
qemu-img: Fix type of getopt return value (Kevin Wolf)
getopt doesn't return a char but an int.
Signed-off-by: Kevin Wolf <kwolf@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6331 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Thu, 15 Jan 2009 21:39:41 +0000 (21:39 +0000)]
Fix Windows build (Hervé Poussineau)
r6303 broke Windows build, where "noreturn" is a keyword used with __declspec.
Attached patch fixes Windows build, by moving windows.h header inclusion before Qemu noreturn define.
aliguori [Thu, 15 Jan 2009 20:47:45 +0000 (20:47 +0000)]
Handle SDL grabs failing (Mark McLoughlin)
If a X window is not viewable, XGrabPointer() fails and
returns GrabNotViewable. SDL's X backend currently handles
this by retrying the grab until the window becomes viewable
again.
This means e.g. if you Ctrl-Alt-RightArrow to switch
workspaces, QEMU tries to grab, SDL blocks because the
window isn't viewable and your guest stops executing until
you switch back to that workspace again.
See this Fedora bug for the gory details:
https://bugzilla.redhat.com/480065
Some SDL backends will return SDL_GRAB_OFF from
SDL_WM_GrabInput(), so the fix is to make the X backend do
this if the grab fails.
The only side-effect in QEMU is that if SDL_WM_GrabInput()
fails we still change the window title to indicate that it's
grabbed, when in fact it's not. This patch fixes that minor
issue.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6325 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Thu, 15 Jan 2009 20:37:28 +0000 (20:37 +0000)]
add a -vga none cli option (Stefano Stabellini)
currently there is no way to fully disable any graphic card device for
the PC architecture.
You can have no graphical output, thanks to -nographic, but you would
have the VGA device connected to your PCI bus anyway.
There is already a convenient -vga option to choose between std, cirrus
and vmware; this patch add the new option "none" to select no graphic
card at all.
aliguori [Thu, 15 Jan 2009 20:11:34 +0000 (20:11 +0000)]
Add -rtc-td-hack option to fix time drift with RTC on Windows (Gleb Natapov)
After my last patch to fix interrupt coalescing was rejected
on the basis that it is too intrusive we decided to make the
fix much more localized and only fix the problem for RTC time
source. Unfortunately it is impossible to fix the problem entirely
inside RTC code like Andrzej proposed since Windows reads RTC
register C more then once on each time interrupt so it is impossible
to count reliably how many interrupt windows actually handled.
Proposed solution is localized to I386 target and is disabled by
default. To enable it "-rtc-td-hack" flag should be used.
This patch adds the typical qemu console command line switch to the virtio
console. using -virtioconsole ARG it can now be specified what output a guest
hvc should be redirected to.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6317 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Thu, 15 Jan 2009 20:05:25 +0000 (20:05 +0000)]
add virtio-console support (Christian Ehrhardt)
This patch adds the virtio console to qemu. This console can be found after the
serial and parallel outputs as another virtual console. In the -nographic case
it is redirected to the null output by default.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6315 c046a42c-6fe2-441c-8c8c-71466251a162
aurel32 [Wed, 14 Jan 2009 21:09:07 +0000 (21:09 +0000)]
Fix day of week in mc146818
According to mc146818 specification, Day of Week register (#6) is between 1
and 7, 1 representing Sunday. According C specification, tm_wday field in
struct tm is between 0 and 6, 0 representing Sunday.
Bit 2 of register B (#11) is named DM (data mode) and specifies if RTC
stores values in BCD or in binary form.
blueswir1 [Wed, 14 Jan 2009 19:00:36 +0000 (19:00 +0000)]
Add noreturn function attribute
Introduce noreturn attribute and attach it to cpu_loop_exit as well as
interrupt/exception helpers for i386. This avoids a bunch of gcc4
warnings.
[ Note that this patch comes with a workaround to include qemu-common.h
even in cases where is currently causes conflicts with dyngen-exec.h.
I've been told that these conflicts will get resolved in the future
(/me will try to have a look as well - as time permits). ]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6303 c046a42c-6fe2-441c-8c8c-71466251a162
malc [Wed, 14 Jan 2009 18:39:49 +0000 (18:39 +0000)]
Remove all traces of __powerpc__
According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is the
ubiquitous define which should be used to test whether gcc targets
PowerPC, on 64bit platforms _ARCH_PPC64 will be also defined.
aurel32 [Wed, 14 Jan 2009 14:47:56 +0000 (14:47 +0000)]
escc: allow one IRQ per serial channel
The Z85C30 on the PowerMAC machines have one interrupt per serial
channel, while the Sparc machines have only one for both. Allow the
emulated device to use one IRQ per channel.
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)
aliguori [Tue, 13 Jan 2009 19:39:36 +0000 (19:39 +0000)]
Check NIC model in some NIC init functions (Mark McLoughlin)
Some NIC init functions are only called when that model is
the only valid model. In that case, it makes sense to use
qemu_check_nic_model() from the NIC init function itself.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6286 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Tue, 13 Jan 2009 19:15:55 +0000 (19:15 +0000)]
Fix tap downscript argument (Mark McLoughlin)
Kill off the hack that parses info_str for the tap interface
name to pass as the argument to the downscript and, instead,
just explicitly keep a copy of the string for later.
Reported-by: John Wong <johnw@wonghome.net> Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6285 c046a42c-6fe2-441c-8c8c-71466251a162
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.)
aliguori [Tue, 13 Jan 2009 15:20:14 +0000 (15:20 +0000)]
RTL8139: Latch C+ mode state instead of inferring it from C+ Command register (Avi Kivity)
It was observed that Windows 2003 x64 hangs when shutting down if an
RTL8139 NIC and a USB device tablet are both present. What seems to be
happening is:
- the guest shuts down the transmitter and receiver
- time passes
- the guest requests a tally counter dump
As it happens, the tally counter command register overlaps the transmit
status register in C mode. Qemu determines whether the chip is in C or C+
mode by looking at the C+ transmit enable bit; as this is now unset, the
dump tally counter command is interpreted as a C mode transmit command. The
guest doesn't think so, however, and continues to poll for completion of the
tally counter dump command. This never occurs, so the guest hangs.
Fix by redefining C+ mode as "a write to the C+ command register has occurred
since the last reset". The data sheet is silent on the matter.
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@6279 c046a42c-6fe2-441c-8c8c-71466251a162
aliguori [Tue, 13 Jan 2009 15:13:53 +0000 (15:13 +0000)]
Fix race in POSIX AIO emulation (Jan Kiszka)
When we cancel an AIO request that is already being processed by
aio_thread, qemu_paio_cancel should return QEMU_PAIO_NOTCANCELED as long
as aio_thread isn't done with this request. But as the latter currently
updates aiocb->ret after every block of the request, we may report
QEMU_PAIO_ALLDONE too early.
Futhermore, in case some zero-length request should have been queued,
aiocb->ret is never set to != -EINPROGRESS and callers like
raw_aio_cancel could get stuck in an endless loop.
Fix those issues by updating aiocb->ret _after_ the request has been
fully processed. This also simplifies the locking.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6278 c046a42c-6fe2-441c-8c8c-71466251a162
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.
aliguori [Fri, 9 Jan 2009 20:05:10 +0000 (20:05 +0000)]
fix configuring kvm probe when using --kerneldir (Christian Ehrhardt)
There is already a variable kvm_cflags which gets the path of the kernel
includes when using --kerneldir. But eventually with newer kernels we all will
need arch/$arch/include too (my case was a incldue of asm/kvm.h which was not
found anymore). Headers in a full kernel source are not flattened to
one arch like they are if e.g. installed kernel headers are used.
To fix that, the includes added to cflags depending on --kerneldir should also
contian the arch includes. The patch adds a special check for x86 because its
source layout recently changed, all others directly use arch/$cpu/include if
existent.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6263 c046a42c-6fe2-441c-8c8c-71466251a162