Ian Jackson [Fri, 18 Jul 2008 13:33:07 +0000 (14:33 +0100)]
ide: enable single word DMA
Windows XP doesn't enable DMA by default on dvd-rom devices emulated by QEMU.
Furthermore if I try to manually enable DMA using Device Manager, the
DMA mode chosen by Windows is inexplicably one of the few modes
unsupported by QEMU: single word mode 2.
Since on virtual hardware single word DMA is not really slower than
multi word DMA, it makes sense for QEMU to support single word dma as
well.
This patch does exactly this. We also make sure that mdma is
deactivated when sdma is active and vice versa.
Ian Jackson [Wed, 2 Jul 2008 17:38:07 +0000 (18:38 +0100)]
qemu-xen: Fix extendable images
bdrv_file_open should specify raw image format instead of
guessing. This fixes a segfault when bdrv_open2 wants to access
drv->flags. bdrv_file_open is used at least by qcow2.
Additionally, move the extensible flag from bdrv_host_device to
bdrv_raw. qcow2 wants to open the image file as an extensible file.
Ian Jackson [Fri, 23 May 2008 17:43:27 +0000 (18:43 +0100)]
Fix COW extendability for vulnerability fix.
(Thanks to report from Daniel Berrange.
Corresponds to my email to xen-devel of 2008-02-27
Subject: Re: [Xen-devel] [PATCH] ioemu block device extent checks.)
Ian Jackson [Mon, 19 May 2008 15:21:52 +0000 (16:21 +0100)]
Send unit_attention on cd-rom not_ready to ready transition
Patch sends a UNIT_ATTENTION(6), MEDIUM_MAY_HAVE_CHANGED(0x28) sense
when cdrom transitions from not ready to ready.
I used the following documentation:
ATA Packet interface for CD-ROMS, SFF8020i.pdf. See state diagram Figure
12, page 82 and Table 44 -recommended Sense Key, ASC
With patch in place HVM win2008 server guest sees the CD/DVD contents
have changed when the media is switched.
Ian Jackson [Fri, 16 May 2008 16:04:57 +0000 (17:04 +0100)]
pci.c: restore bus-level pci interrupt state via pci_set_irq
This change abolishes pcibus_save. Instead we use an invariant - that
device interrupts are supposed to be reflected in the bus interrupt
state - to restore the bus interrupt state.
This makes the code smaller and removes one way in which a savefile
could be corrupted (eg, if it had been generated by a buggy emulator).
It also means that systems which do some of their own PCI bus
emulation and thus reflect PCI bus state elsewhere (eg CPU acclerators
such as Xen) get notified of the PCI bus interrupt level, via
pci_set_irq's call to bus->set_irq.
Ian Jackson [Fri, 16 May 2008 16:01:12 +0000 (17:01 +0100)]
register_savevm etc.: make save function optional
This allows a device to provide only a loading function, not a saving
function.
This is useful if a later version of an emulation restores its state
in some other way (eg by having a different device name, or by
exploiting invariants in the state); when this happens it is still
necessary to load or skip the information when it is found in old
savefiles.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
edgar_igl [Tue, 13 May 2008 10:59:14 +0000 (10:59 +0000)]
CRIS: Improve TLB management and handle delayslots at page boundaries.
* Dont flush the entire qemu tlb when the $pid changes. Instead we go through
the guests TLB and choose entries that need to be flushed.
* Add env->dslot and handle delayslots at pageboundaries.
* Remove some unused code.
Ian Jackson [Fri, 28 Mar 2008 16:54:09 +0000 (16:54 +0000)]
Perform emulated IDE flushes asynchronously.
We arrange for the WIN_FLUSH_CACHE and WIN_FLUSH_CACHE_EXT
commands to use a new bdrv_aio_flush facility.
If there is an error, the ATA-7 spec says that we are supposed to know
which is the first block whose flush failed and leave that in the
block offset registers. However since we are using f(data)sync that's
not possible for us. There is sadly no way for us to report the error
which won't encourage the guest to try to understand what went wrong
and then do the flush again expecting the remaining blocks to be
written (as specified by ATA-7).
So if the asynchronous flush fails, we kill the disk by detaching
->bs. This makes it vanish: we don't generate any more interrupts,
leave status set to busy, and ignore future commands (and discard any
in-flight IO). Alan Cox reports that this will probably induce the
best available behaviour in guests (retry for a while and then give
up). Fine-grained error reporting is available if the guest turns off
the write cache.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Modified-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Ian Jackson [Thu, 27 Mar 2008 17:58:45 +0000 (17:58 +0000)]
make write cacheing controllable by guest
This patch implements the ATA write cache feature. This enables a
guest to control, in the standard way, whether disk writes are
immediately committed to disk before the IDE command completes, or may
be buffered in the host.
In this patch, by default buffering is off, which provides better
reliability but may have a performance impact. It would be
straightforward to change the default, or perhaps offer a command-line
option, if that would be preferred.
This patch is derived from one which was originally submitted to the
Xen tree by Rik van Riel <riel@redhat.com> and includes code to save
the write_cache setting from Samuel Thibault.
From: Rik van Riel <riel@redhat.com> Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com> Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Wed, 13 Feb 2008 16:24:30 +0000 (16:24 +0000)]
check return value from read() and write() properly
The system calls read and write may return less than the whole amount
requested for a number of reasons. So the idioms
if (read(fd, &object, sizeof(object)) != sizeof(object)) goto fail;
and even worse
if (read(fd, &object, sizeof(object)) < 0) goto fail;
are wrong. Additionally, read and write may sometimes return EINTR on
some systems so interruption is not desired or expected a loop is
needed.
Ian Jackson [Wed, 13 Feb 2008 16:20:09 +0000 (16:20 +0000)]
Remove clone-and-hack qemu_malloc et al.
qemu-img.c has copies of qemu_malloc et al, which are already provided
in osdep.c. The attached patch removes these from qemu-img.c and
adds osdep.o to BLOCK_OBJS.
Ian Jackson [Wed, 13 Feb 2008 16:18:49 +0000 (16:18 +0000)]
Make it possible to disable AF_UNIX (unix-domain) sockets
The patch below makes it possible to disable AF_UNIX (unix-domain)
sockets in host environments which do not define _WIN32, by adding
-DNO_UNIX_SOCKETS to the compiler flags. This is useful in the
effectively-embedded qemu host which are going to be using for device
emulation in Xen.
Ian Jackson [Wed, 13 Feb 2008 16:17:54 +0000 (16:17 +0000)]
qemu's audio subdirectory contains a copy of BSD's sys-queue.h, which
defines a bunch of LIST_ macros. This makes it difficult to build a
program made partly out of qemu and partly out of the Linux kernel,
since Linux has a different set of LIST_ macros. It might also cause
trouble when mixing with BSD-derived code.
Under the circumstances it's probably best to rename the versions in
qemu. The attached patch does this.
edgar_igl [Sun, 11 May 2008 14:28:14 +0000 (14:28 +0000)]
CRIS: Add support for the pseudo randomized set that the mmu provides with TLB refill faults. This makes linux guests use the four way TLB set associativty.
edgar_igl [Thu, 8 May 2008 21:02:43 +0000 (21:02 +0000)]
CFI-0002 linux MTD compatibility.
* Add an extended table area.
* Clear buffer write timeouts to indicate that we dont support it.
* Correct device size.