]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/log
qemu-xen-3.3-testing.git
16 years agoAvoid trusting client-controlled areas of xenstore.
Ian Jackson [Thu, 12 Feb 2009 11:05:55 +0000 (11:05 +0000)]
Avoid trusting client-controlled areas of xenstore.

Various parts of xenstore, specifically /local/GUEST/devices, are
writeable by the guest.  Information from these areas must be used
with care, to avoid the guest tricking qemu-dm into improperly using
its privileged access to dom0 resources.

To this end:
 * Variables and functions referring to client-controlled data have
   had `danger' added to their names.
 * There is a new sanitisation/checking arrangement for getting
   backend paths and information about the configuration of device
   backends, given the frontend information.  This is so that when
   qemu is providing a data path which is parallel to the PV
   frontend/backend arrangements, it only uses the configuration from
   a genuine backend which is really configured to serve qemu's own
   guest.
 * For information which should be read from or written to the `vm'
   tree, we obtain the guest's uuid from the hypervisor (the `label'
   as the hypercall interface calls it) rather than reading it from
   the guest-controlled areas of xenstore.
 * The `phantom vbd' feature is disabled.  It relies on
   guest-controlled xenstore areas indicating device paths on the
   guest.  We do not believe this feature is currently very relevant.
 * We _do_ allow the guest of a stubdom qemu to mess up the
   correspondence between pv backends and emulated devices, in the
   sense that we don't mind if the guest directs qemu to use a `wrong'
   frontend.

(cherry picked from commit 5d9302d372cf0a2951e3e0c61a5e08496de8aa2b)
Conflicts:
qemu-xen.h

16 years agohw/serial.c: Avoid integer multiply overflow in token generation calculation
Ian Jackson [Wed, 1 Oct 2008 12:54:16 +0000 (13:54 +0100)]
hw/serial.c: Avoid integer multiply overflow in token generation calculation

If calls to serial_get_token are too far apart then delta.tv_sec may
be too large to multiply by 1E9.  So we clamp delta to 2s.
(cherry picked from commit d2807803a5ba22003155ed50802f7c4e92c8ddd7)

16 years agokeymaps: Correct Japanese Windows keys
Ian Jackson [Fri, 19 Sep 2008 16:57:35 +0000 (17:57 +0100)]
keymaps: Correct Japanese Windows keys

According to
 http://lists.xensource.com/archives/html/xen-devel/2007-07/msg00028.html
the translations for Super_R and _L are wrong.

This change, which was cross-ported from xen-unstable
 15446:f85252ce203e5cc05d959641f141aa1d885d8cfb
fixes this.

Signed-off-by: Takanori Kasai <kasai.takanori@xxxxxxxxxxxxxx>
Signed-off-by: Junko Ichino <ichino.junko@xxxxxxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry picked from commit f12fcb4930d0b6ea045a637493d130c4a9d2a180)

16 years agoUse CTYPE for isalpha in block-vvfat.c.
Ian Jackson [Thu, 28 Aug 2008 14:32:50 +0000 (15:32 +0100)]
Use CTYPE for isalpha in block-vvfat.c.

This call was missing the fix from:

  commit 5ed6aa6153110050c29bcd600a1424014cfbf1d4
  Author: Ian Jackson <iwj@mariner.uk.xensource.com>
  Date:   Wed Feb 20 16:30:05 2008 +0000

      Use new CTYPE macro for <ctype.h>

      This avoids passing a negative int to isfoobar,
      which is not allowed

Thanks to Christoph Egger for pointing it out (although we do not use
his proposed fix).
(cherry picked from commit 053eb0b2d2235c5810c9fe2180d5d61d95036340)

16 years agoenable usb uhci save/restore
Ian Jackson [Thu, 16 Oct 2008 09:29:00 +0000 (10:29 +0100)]
enable usb uhci save/restore

enables the usb uhci save and restore functions that
for some reasons were commented out.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ These were commented out in 1e4146791b46f0a798589c58a09f18b2841a9212
  aka svn://svn.savannah.nongnu.org/qemu/trunk@3609
  c046a42c-6fe2-441c-8c8c-71466251a162
  apparently by mistake.  This commit reverts 1e414679
  -Ian Jackson ]
(cherry picked from commit 5f8914edc785ddbd3cae769aa8309c80609c3601)

16 years agostubdom: Fix live migration of HVM domain xen-3.3.1 xen-3.3.1-rc3 xen-3.3.1-rc4
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.

Derived from old xen internal tools/ioemu tree.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
(cherry picked from commit 7ed781aff412cff84a884405d99b0f1f7a629fc3)

16 years agoAlways treat floppy images as raw xen-3.3.1-rc2
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>
(cherry picked from commit f2ce5c35f60bb606bd3ddb55c361bb8a9aad5c5c)

16 years agocirrus_vga fix save/restore lfb_addr/lfb_end printfs xen-3.3.1-rc1
Ian Jackson [Thu, 27 Nov 2008 12:04:32 +0000 (12:04 +0000)]
cirrus_vga fix save/restore lfb_addr/lfb_end printfs

A couple of printf calls needed casts to (unsigned long) adding to
avoid compiler compliants, following commits
 97e3066c43477c79b56f4afeb08c330fc2c244b7
 ea324bf41565322b370b27253b1a7eaa3cc360b9

16 years agocirrus_vga fix save/restore endian incompatibility
Ian Jackson [Thu, 27 Nov 2008 11:31:06 +0000 (11:31 +0000)]
cirrus_vga fix save/restore endian incompatibility

This patch fixes the cirrus_vga save/restore functions to keep
compatibility with older ioemu statefiles.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit 97e3066c43477c79b56f4afeb08c330fc2c244b7)

Conflicts:
        hw/cirrus_vga.c

16 years agocirrus vga save/restore and lfb_addr/lfb_end
Ian Jackson [Thu, 27 Nov 2008 12:01:00 +0000 (12:01 +0000)]
cirrus vga save/restore and lfb_addr/lfb_end

Cirrus VGA save and restore functions cast lfb_addr into an uint64_t
pointer while lfb_addr is only an unsigned long.
Same thing happened to lfb_end, causing pci_dev to be partially
overwritten by mistake.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit ea324bf41565322b370b27253b1a7eaa3cc360b9)

Conflicts:

hw/cirrus_vga.c

16 years agocirrus rop bounds checks (CVE-2007-1320)
Ian Jackson [Wed, 26 Nov 2008 17:25:12 +0000 (17:25 +0000)]
cirrus rop bounds checks (CVE-2007-1320)

This patch adds bounds checks to the new cirrus rop functions,
completing the fix for CVE-2007-1320.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit 86862533a3e896b21d318af1521b8f99a2931266)

16 years agoContain MSI errors in msi emulation code
Ian Jackson [Wed, 26 Nov 2008 17:18:19 +0000 (17:18 +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.

Submitted-By: Haitao Shan
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years ago[ia64] Fix memory size calculation on VT-i over 3GB memory
Ian Jackson [Thu, 9 Oct 2008 13:46:16 +0000 (14:46 +0100)]
[ia64] Fix memory size calculation on VT-i over 3GB memory

VT-i domains have two memory holes: VGA I/O (under 1MB) and MMIO
(3GB-4GB). This patch calculates the correct memory size with them.

This is based on xen-unstable 10936:a0b3cf802d99.

Original patch by Zhang xiantao <xiantao.zhang@intel.com>
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
(cherry picked from commit 6bb40e81b938beb53eb4102cdfae03dd79edbf13)

16 years agovnc and xenfb integer overflow and division by zero vuln fixes
Ian Jackson [Wed, 26 Nov 2008 14:14:06 +0000 (14:14 +0000)]
vnc and xenfb integer overflow and division by zero vuln fixes

 row_stride_div0.patch: a malicious frontend can send row_stride==0 and force
 qemu-dm to perform division by 0
 vnc_resize_doublecheck.patch: there is an unchecked multiplication when
 calculating framebuffer size. Cs 17630 sanitizes framebuffer dimensions
 passed by the frontend, so most probably no integer overflow can happen, but
 there should be a check for overflow close to the actual computation (to
 make code review easier and to cope with other codepaths in the future).

 (Patches submitted by Rafal Wojtczuk <rafal@invisiblethingslab.com>
 against xen-3.2 ioemu; adapted for xen-unstable by Ian Jackson and also
 edited to actually compile and do be correct.)

Contributed-by: Rafal Wojtczuk <rafal@invisiblethingslab.com>
Modified-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cherry picked from xen-unsstable a83c1174b942d0f0f0e05927eb5b69fe8489b7ab

PLUS

 vnc integer overflow check fix overzealous zero checking

 In a83c1174b942d0f0f0e05927eb5b69fe8489b7ab, we arranged to avoid
 integer overflow and calls to realloc(nonzero,0).  However
 vs->depth==0 is legitimate on entry to vnc_dpy_resize_shared.

 We need to move the check for vs->depth until after vnc_colourdepth.

Cherry picked from xen-unstable 81b31c9f37ac4e3584bdfe8e7b04bedcb8940b88

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years ago[passthrough] make upper field of 64 bit bar writable
Ian Jackson [Thu, 28 Aug 2008 14:41:23 +0000 (15:41 +0100)]
[passthrough] make upper field of 64 bit bar writable

This patch makes upper field of 64 bit base address register writable.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
(cherry picked from commit e13a9aa9ea1712d949771043bc2a51db64817244)

16 years agosupport PCI Express Capability Structure version 1
Ian Jackson [Wed, 3 Sep 2008 10:26:06 +0000 (11:26 +0100)]
support PCI Express Capability Structure version 1

Suppport PCI Express Capability Structure version 1.  The format of
PCI Express Capability Structure is different between version 1 and
version 2.  Current code supports only version 2.  This might cause
conflict with other capability structure if device implement
version 1.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoFix broken audio support.
Ian Jackson [Thu, 25 Sep 2008 10:12:03 +0000 (11:12 +0100)]
Fix broken audio support.

-DHAS_AUDIO_CHOICE was omitted from CPPFLAGS.

This change was committed as one hunk of

    commit ae6c754836d244cdb3fe461853e774f1e7c5a33c
    Author: Ian Jackson <ian.jackson@eu.citrix.com>
    Date:   Thu Aug 28 15:11:55 2008 +0100

Drop duplication opengl configuration flags

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
although this was probably a mistake; it should have been committed
separately.  In any case we cherry pick that half of the change now.

16 years agoFix map cache low/high/low bug
Ian Jackson [Tue, 9 Sep 2008 13:02:03 +0000 (14:02 +0100)]
Fix map cache low/high/low bug

This small patch fixes an issue leading to a crash (segfault, although
with earlier changesets I was seeing sigbus - not sure what changed)
in qemu-dm when the following conditions occur:

1. A valid mapping for a bucket on a low address exists

2. Immediately after accessing memory mapped in this bucket, an access
occurs to a high (beyond assigned ram) address beyond the 1GB limit
for 32bit map cache wrapping around to the previous bucket's entry
number.

3. The next call to map cache again accesses the low address.

In this scenario, the guest mem for the low bucket has been unmapped
by the remap_bucket caused by 2., but because the valid_mapping
bit-test fails, map_cache returns before last_address_index has been
updated. The subsequent call to map_cache therefore never remaps the
low, valid bucket and instead returns a vaddr pointing to memory that
has failed to get mapped.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
(cherry picked from commit 77304a4b670e068e555385b7ed8a04ed0b8e9bac)

16 years agofix offset of MSI-X memory mapped table.
Ian Jackson [Fri, 5 Sep 2008 09:32:49 +0000 (10:32 +0100)]
fix offset of MSI-X memory mapped table.

This patch fixes offset of MSI-X memory mapped table.

Current code does not set dev->msix->table_off variable.
The offset of MSI-X memory mapped table is treated as 0.
The wrong region is unmapped from guest physical memory space.
As a result, guest device driver can't access memory mapped resource.

The patch fixes this issue. My MegaRAID SAS assigned to guest domain
becomes working with the patch.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
(cherry picked from commit 5c3b16ef00b18d0c43574060ef124b4c52b2e998)

16 years agofix multiple pci-attach/pci-detach by removing meaningless irq_index
Ian Jackson [Mon, 1 Sep 2008 09:34:37 +0000 (10:34 +0100)]
fix multiple pci-attach/pci-detach by removing meaningless irq_index

For HVM guest, we can't do pci-attach/pci-detach for >64 times due to
the meaningless checking in pci_register_device(). This patches
removes it.

With the patches, I [Dexuan] made a test of 300 times of attach/detach
and everything works well.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
(cherry picked from commit 990348aa4d6b55d2d2d1aa60b33385cb77c78052)

16 years agoFix unmapping issue on hot-removing pass-thru device xen-3.3.0 xen-3.3.0-rc6
Keir Fraser [Wed, 20 Aug 2008 08:09:28 +0000 (09:09 +0100)]
Fix unmapping issue on hot-removing pass-thru device

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoMerge latara:/usr/groups/xencore/HG/qemu-xen-unstable xen-3.3.0-rc5
Ian Jackson [Fri, 15 Aug 2008 12:41:49 +0000 (13:41 +0100)]
Merge latara:/usr/groups/xencore/HG/qemu-xen-unstable

16 years agoFix new USB HID queueing.
Ian Jackson [Fri, 15 Aug 2008 12:40:58 +0000 (13:40 +0100)]
Fix new USB HID queueing.

This commit:

    commit 28b7599603cc2165cd68961be034979657759f40
    Author: Ian Jackson <iwj@mariner.uk.xensource.com>
    Date:   Fri May 9 15:50:33 2008 +0100

Queue some mouse events.

was full of bugs.

16 years agoTry to fix USB HID and make the HID reports readable.
Ian Jackson [Fri, 15 Aug 2008 10:38:06 +0000 (11:38 +0100)]
Try to fix USB HID and make the HID reports readable.

Decode HID report Items in the comments.
Invert mouse wheel direction as per Alexander Graf's report and as we already do in the tablet.
Clamp the Relative values to -127:127 as we claimed in the HID descriptors.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4482 c046a42c-6fe2-441c-8c8c-71466251a162

(Cherry picked from qemu upstream branch, git commit
  976f8eef23eb571b6707d7bdec488f6c6ae4231b)

16 years agoMSI-X: enhancement
Keir Fraser [Wed, 13 Aug 2008 13:12:59 +0000 (14:12 +0100)]
MSI-X: enhancement

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
16 years agodrop QEMU_ prefix from QEMU_LIST_* xen-3.3.0-rc4
Keir Fraser [Fri, 8 Aug 2008 09:51:17 +0000 (10:51 +0100)]
drop QEMU_ prefix from QEMU_LIST_*

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
16 years agofix typo in serial emulation
Keir Fraser [Fri, 8 Aug 2008 09:47:10 +0000 (10:47 +0100)]
fix typo in serial emulation

There is a small bug on the serial emulation code that prevents kgdb
from working correctly over the serial.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agopass-through: Fix I/O BAR mapping problem xen-3.3.0-rc3
Keir Fraser [Wed, 6 Aug 2008 09:55:38 +0000 (10:55 +0100)]
pass-through: Fix I/O BAR mapping problem

Check BAR type indicator to avoid I/O BAR being mistaken as 64-bit =
memory BAR.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
16 years agofix a bug in serial_load
Keir Fraser [Wed, 6 Aug 2008 08:45:02 +0000 (09:45 +0100)]
fix a bug in serial_load

Currently we are trying to read the same value twice in the serial_load
function, this patch fixes that.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoxend does not pass us -m option, so direct HVM Linux loading
Keir Fraser [Tue, 5 Aug 2008 12:24:47 +0000 (13:24 +0100)]
xend does not pass us -m option, so direct HVM Linux loading
approximates end of low memory via a different method.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
16 years agostubdom: fix read-only disks access
Keir Fraser [Mon, 4 Aug 2008 10:08:09 +0000 (11:08 +0100)]
stubdom: fix read-only disks access

There is no need for a flush on read-only disks.  It would actually even
error out and disturb the guest.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
16 years agoMerge branch 'qemu'
Ian Jackson [Fri, 1 Aug 2008 16:16:58 +0000 (17:16 +0100)]
Merge branch 'qemu'

16 years agoFix medium change device lookup.
Ian Jackson [Fri, 1 Aug 2008 16:15:24 +0000 (17:15 +0100)]
Fix medium change device lookup.

Previously, medium change notifications would be handled with respect
to the wrong emulated disk drive.  This would make many configurations
(particularly ones with CDs and many hard disks) break.  (A medium
change notification occurs at the start for every removeable device.)

Thanks to Haicheng Li at Intel for the report,
 http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1314

16 years ago[ide] Check that asynchronous (DMA) submission succeeds qemu
Ian Jackson [Fri, 1 Aug 2008 15:56:13 +0000 (16:56 +0100)]
[ide] Check that asynchronous (DMA) submission succeeds

If it does not, abort the command immediately rather than dropping
it on the floor.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agopassthrough: fix flag for expansion rom base address register.
Keir Fraser [Fri, 1 Aug 2008 09:06:13 +0000 (10:06 +0100)]
passthrough: fix flag for expansion rom base address register.

pt_bar_reg_parse() is called for expansion rom base address register.
Currently it returns PT_BAR_FLAG_MEM if bit 0 is 0. It returns
PT_BAR_FLAG_IO if bit 0 is 1.

But bit 0 in expansion rom base address register is enable bit. If bit
0 is 1 for some reason, it returns PT_BAR_FLAG_IO. Expansion rom is
mapped to memory space. It should return PT_BAR_FLAG_MEM.

After applying this patch, it returns PT_BAR_FLAG_MEM regardless
of bit 0, when it is called for expansion rom base address register.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agopassthrough: fix corrupting register value in pt_pci_write_config().
Keir Fraser [Fri, 1 Aug 2008 09:05:36 +0000 (10:05 +0100)]
passthrough: fix corrupting register value in pt_pci_write_config().

I forgot to shift value read from real device. If the emulated register offset
is not aligned with 4 byte, the write emulation will not be handled well
because of corrupting register value read from real device.
The patch fixes this issue.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agopassthru: fix libpci error handling.
Keir Fraser [Fri, 1 Aug 2008 09:04:39 +0000 (10:04 +0100)]
passthru: fix libpci error handling.

libpci returns ALL F when error occurs. Currently, if libpci returns ALL
F, emulation stops. But it is possible that the field of real register
which is read by guest software is ALL F.

After applying this patch, if libpci returns ALL F, ioemu will log
warning message and continue the emulation.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agopassthrough: fix writing handlers for base address registers.
Keir Fraser [Fri, 1 Aug 2008 09:01:05 +0000 (10:01 +0100)]
passthrough: fix writing handlers for base address registers.

- Current implementation can not work fine when base address registers
  are accessed via 1 byte write access and 2 byte write access. This
  patch enables them.

- Currently guest software can set address which is not aligned
  with resource size and page size. The patch does not allow guest
  software to set unaligned address.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agopassthrough: fix log messages and comments
Keir Fraser [Fri, 1 Aug 2008 09:00:14 +0000 (10:00 +0100)]
passthrough: fix log messages and comments

- fix log messages to make analysis easier when issue occurs.

- remove verbose message.

- add comments in the source code.

- fix wrong comments in the source code.

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agocross-build fix re -msse2 flag and cc-option
Ian Jackson [Thu, 31 Jul 2008 15:17:41 +0000 (16:17 +0100)]
cross-build fix re -msse2 flag and cc-option

- The ioemu version of cc-option doesn't take $(CC) as the first
  argument, so all builds were getting -msse2 regardless of
  architecture.

Signed-off-by: Aron Griffis <aron@hp.com>
16 years agoFix warnings
Ian Jackson [Wed, 30 Jul 2008 16:13:46 +0000 (17:13 +0100)]
Fix warnings

[This] patch fixes two warnings when compiling.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Manually cherry-picked from c9dba66abe8f4c4df28f3b32befe49da1b749a48

16 years agofix SDL mouse events processing xen-3.3.0-rc2
Ian Jackson [Wed, 30 Jul 2008 15:46:30 +0000 (16:46 +0100)]
fix SDL mouse events processing

This fixes SDL mouse events processing:
- GetRelativeMouseState() always returns the last position, so when the
  polling loop gets several mouse events in one go, we would send
  useless 'no move' events, let's avoid that.
- So as to make sure we don't miss any mouse click / double click, we
  should not use GetRelativeMouseState() to get the button state, but
  rather keep records of the button state ourselves (I've requested SDL
  developers to provide it directly in the event in SDL 1.3).
- bev->state doesn't contain the button state but whether the event is a press
  or a release. Use bev->button instead.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoFix typo in error message re pciutils-dev
Ian Jackson [Wed, 30 Jul 2008 15:27:03 +0000 (16:27 +0100)]
Fix typo in error message re pciutils-dev

Thanks to report from Stefano Stabellini

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoFix warnings
Ian Jackson [Wed, 30 Jul 2008 15:24:54 +0000 (16:24 +0100)]
Fix warnings

[This] patch fixes two warnings when compiling.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
16 years agoMerge latara:/usr/groups/xencore/HG/qemu-xen-unstable
Ian Jackson [Wed, 30 Jul 2008 11:08:53 +0000 (12:08 +0100)]
Merge latara:/usr/groups/xencore/HG/qemu-xen-unstable

16 years agoMerge branch 'qemu'
Ian Jackson [Wed, 30 Jul 2008 11:07:35 +0000 (12:07 +0100)]
Merge branch 'qemu'

16 years agoUse fd signal trick to break us out of select; do not sigwait
Ian Jackson [Wed, 30 Jul 2008 11:06:29 +0000 (12:06 +0100)]
Use fd signal trick to break us out of select; do not sigwait

* The sigwait approach to detecting aio does not work because some
  versions of glibc forget to block signals on the private aio thread.
  This means that blocking SIGUSR2 is ineffective; the signals can be
  lost and the program can block in sigwait (!)

* Use of SIGUSR2 to interrupt select() does not work because signals
  which arrive just before entry to select() do not interrupt it.

So instead we use the time-honoured self-pipe trick: in the signal
handler we write to a pipe, which we select on when we want to wait
for the signal, and which we read from (to empty out) just before
actually doing the `top half' processing which deals with the condition
to which the signal relates.

16 years agoAdd missing #include "qemu-xen.h"
Ian Jackson [Wed, 30 Jul 2008 10:52:48 +0000 (11:52 +0100)]
Add missing #include "qemu-xen.h"

16 years agoRegister block drivers before reading xenstore.
Ian Jackson [Wed, 30 Jul 2008 10:52:03 +0000 (11:52 +0100)]
Register block drivers before reading xenstore.

Without this, cow images do not work.  Part of the fix to
 http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1304.

Thanks to report from Intel.

16 years agohw/serial: substitute gettimeofday with clock_gettime
Keir Fraser [Wed, 30 Jul 2008 10:07:43 +0000 (11:07 +0100)]
hw/serial: substitute gettimeofday with clock_gettime

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoremove type parameter from xc_physdev_map_pirq{,_msi}() xen-3.3.0-rc1
Ian Jackson [Thu, 24 Jul 2008 13:40:59 +0000 (14:40 +0100)]
remove type parameter from xc_physdev_map_pirq{,_msi}()

tools: remove type parameter from xc_physdev_map_pirq{,_msi}()
... as it's implied by the function name.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cross-ported from xen-unstable changeset
18128:0c320ae06d79d319f9fd419428e1539bc1b4818d

16 years agofix spurious track_dirty_vram warning
Ian Jackson [Thu, 24 Jul 2008 13:32:06 +0000 (14:32 +0100)]
fix spurious track_dirty_vram warning

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
16 years agopass-through.h: Sprinkle some #ifdefs to cope with pciutils-dev versions
Ian Jackson [Thu, 24 Jul 2008 12:57:10 +0000 (13:57 +0100)]
pass-through.h: Sprinkle some #ifdefs to cope with pciutils-dev versions

Some versions of pciutils-dev contain #defines which others are lacking.
To avoid spurious compiler warnings we add some #ifdefs.  *sigh*

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agoRevert "ACPI S3 state wake up - change to write flag behaviour"
Ian Jackson [Thu, 24 Jul 2008 12:47:46 +0000 (13:47 +0100)]
Revert "ACPI S3 state wake up - change to write flag behaviour"

This reverts commit 7fc722da73707a0965f8b43a67f2ef5fd9a9c143.

Following discussion on xen-devel and elsewhere, we have concluded
that the real problem here was that the S3 resume flag was in the ROM
memory region rather than the EBDA.  This has been fixed in
xen-unstable 18120.

We can therefore keep the whole of the ROM/BIOS area readonly.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoACPI S3 state wake up - change to write flag behaviour
Ian Jackson [Wed, 23 Jul 2008 18:01:00 +0000 (19:01 +0100)]
ACPI S3 state wake up - change to write flag behaviour

ioemu-remote: The device model needs to write in the ACPI tables when it
wakes up from S3 state.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
16 years agoSave 3MB ioport table memory (Samuel Thibault)
aliguori [Wed, 23 Jul 2008 15:19:59 +0000 (15:19 +0000)]
Save 3MB ioport table memory (Samuel Thibault)

Save 1.5MB (32bit) or 3MB (64bit) memory by keeping ioport tables
sparse and use a test against NULL instead.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4927 c046a42c-6fe2-441c-8c8c-71466251a162
(cherry picked from commit 477e3edf8be5f0b998d19766198b6cf6b847557f)

16 years agoPrint a message announcing success when xen-setup finishes.
Ian Jackson [Wed, 23 Jul 2008 14:37:04 +0000 (15:37 +0100)]
Print a message announcing success when xen-setup finishes.

This will help mitigate confusion which might be caused by earlier
output from configure (eg the report of errors from the SDL test).

16 years agoWrite vnc port to xenstore.
Ian Jackson [Tue, 22 Jul 2008 16:04:35 +0000 (17:04 +0100)]
Write vnc port to xenstore.

(Reinstate accidentally dropped feature from xen-unstable.)

16 years agoCheck vnc_display_port, not vnc_display, for failure.
Ian Jackson [Tue, 22 Jul 2008 16:03:51 +0000 (17:03 +0100)]
Check vnc_display_port, not vnc_display, for failure.

This fixes a bug introduced in
  7e90700420eddad9298774fc4d12ed112f0d70f2
  Add vncunused option.
  [etc.]

16 years agoMerge latara:/usr/groups/xencore/HG/qemu-xen-unstable
Ian Jackson [Tue, 22 Jul 2008 15:35:11 +0000 (16:35 +0100)]
Merge latara:/usr/groups/xencore/HG/qemu-xen-unstable

16 years agoDo not unconditionally set CONFIG_SDL.
Ian Jackson [Tue, 22 Jul 2008 15:33:55 +0000 (16:33 +0100)]
Do not unconditionally set CONFIG_SDL.

CONFIG_SDL was erroneously hardwired in i386-dm/config.h and is no longer.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoDo not pass syntax errors to test if opengl is false.
Ian Jackson [Tue, 22 Jul 2008 15:28:57 +0000 (16:28 +0100)]
Do not pass syntax errors to test if opengl is false.

Put the quotes around $opengl in   test "$opengl" = "yes"

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoNicer fix for spurious messages from configure when GCC3 is missing.
Ian Jackson [Tue, 22 Jul 2008 15:28:06 +0000 (16:28 +0100)]
Nicer fix for spurious messages from configure when GCC3 is missing.

This reverts b5123e05cce4be4c6c8c822fad0f0df4c053da06 and replaces it
with a nice simple change, namely to change  test ... -a ...  with
test ... && test ... .  That provides shortcut evaluation.

Thanks to Andre Przywara who provided this one-line change as an
update to the previous commit.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoPass --disable-gfx-check to allow VNC-only builds.
Ian Jackson [Tue, 22 Jul 2008 15:23:47 +0000 (16:23 +0100)]
Pass --disable-gfx-check to allow VNC-only builds.

Qemu upstream inexplicably falls over during configuration if you will
be forced to use VNC for graphics, as if that were somehow an
unreasonable thing to do.  So hit that check on the head.

Thanks to Christoph Egger for the report.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoioemu: fix vram tracking when !s->lfb_addr
Keir Fraser [Tue, 22 Jul 2008 14:58:20 +0000 (15:58 +0100)]
ioemu: fix vram tracking when !s->lfb_addr

When we don't have an LFB (standard VGA), we can not and do not need
vram tracking at all since we always get explicit dirtying.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
16 years agoFix HVM direct kernel booting.
Ian Jackson [Tue, 22 Jul 2008 14:49:52 +0000 (15:49 +0100)]
Fix HVM direct kernel booting.

This was broken during the merge with qemu upstream.

Fixes:
 * Properly update kernel loading address so that qemu actually
   loads the kernel where we want it.
 * Use 0x200000 not 0x20000 as the updated kernel loading address.
 * Use stl_phys(real_addr+0x214,) rather than stl_p(header+0x214,),
   as the header has already been copied into target memory so we
   need to update it there.

16 years agoAdd missing cast for printf of maddr
Ian Jackson [Tue, 22 Jul 2008 10:55:18 +0000 (11:55 +0100)]
Add missing cast for printf of maddr

16 years agopci passthrough changes ported across from xen-unstable by Yuji Shimada
Ian Jackson [Tue, 22 Jul 2008 10:52:24 +0000 (11:52 +0100)]
pci passthrough changes ported across from xen-unstable by Yuji Shimada

The patch contains following patches which have been applied to Xen
Unstable Changeset 17959-18076.

pci_config_passthrough_with_msi_msix.patch

    [Xen-devel] [PATCH] Support more Capability Structures (including
    MSI/MSI-X) and Device Specific Registers for pt device.
    Yuji Shimada <shimada-yxb@necst.nec.co.jp>
    Fri, 04 Jul 2008 15:26:52 +0900

fix_pt_iomap.patch

    Re: [Xen-devel] [PATCH] Support more Capability Structures
    (including MSI/MSI-X) and Device Specific Registers for pt device.
    NISHIGUCHI Naoki <nisiguti@jp.fujitsu.com>
    Tue, 08 Jul 2008 14:14:55 +0900

fix_pt_bar_mapping.patch

    [Xen-devel] [PATCH] ioemu: pass-through: pt_bar_mapping fix
    NISHIGUCHI Naoki <nisiguti@jp.fujitsu.com>
    Wed, 09 Jul 2008 15:46:15 +0900

fix_hot-remove.patch

    [Xen-devel] [PATCH] Fix issues when passthrough device is
    hot-removed from HVM domain
    Yuji Shimada <shimada-yxb@necst.nec.co.jp>
    Wed, 16 Jul 2008 09:20:11 +0900

chk_bar_overlap_bugfix.patch

    [Xen-devel] [PATCH] ioemu: alternative patch fixing pt_chk_bar_overlap
    Yuji Shimada <shimada-yxb@necst.nec.co.jp>
    Thu, 17 Jul 2008 16:05:11 +0900

Thanks

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
16 years agohw/pass-through.c: pt_unregister_regions returns void
Ian Jackson [Fri, 18 Jul 2008 15:02:23 +0000 (16:02 +0100)]
hw/pass-through.c: pt_unregister_regions returns void

It only ever falls off the end, and its return value is not used
by its one caller.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoAdd missing #include "qemu-xen.h" to hw/pass-through.c
Ian Jackson [Fri, 18 Jul 2008 15:00:02 +0000 (16:00 +0100)]
Add missing #include "qemu-xen.h" to hw/pass-through.c

16 years agoAdd missing #include "qemu-xen.h" to piix4acpi.c
Ian Jackson [Fri, 18 Jul 2008 14:58:54 +0000 (15:58 +0100)]
Add missing #include "qemu-xen.h" to piix4acpi.c

16 years agoMerge branch 'qemu'
Ian Jackson [Fri, 18 Jul 2008 14:56:27 +0000 (15:56 +0100)]
Merge branch 'qemu'

16 years agousb-linux.c: #define __user to work around broken Linux headers
Ian Jackson [Fri, 18 Jul 2008 14:51:19 +0000 (15:51 +0100)]
usb-linux.c: #define __user to work around broken Linux headers

Really we would like to #include <linux/compiler.h> but according
to changelogs in xen-unstable, at least FC6R3 doesn't have it.

This change is identical to xen-unstable
11601:ba7487569374378b398a1b134ea108a6a8209b4b.

16 years agoioemu-remote: use xenstore direct_pci
Ian Jackson [Fri, 18 Jul 2008 14:37:42 +0000 (15:37 +0100)]
ioemu-remote: use xenstore direct_pci

ioemu-remote: Use xenstore's direct_pci instead of the one from the
command line if there is some pass-through devices.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
16 years agoioemu-remote: pt_init must take a const direct_pci.
Ian Jackson [Fri, 18 Jul 2008 14:34:32 +0000 (15:34 +0100)]
ioemu-remote: pt_init must take a const direct_pci.

[ Also copes with direct_pci==0 on entry, which was the
  remaining portion of b7eec990223bb8c4b145597af37592103c412542 -iwj ]

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
16 years agoRevert "ioemu-remote: Fix the pass-through compilation."
Ian Jackson [Fri, 18 Jul 2008 14:32:36 +0000 (15:32 +0100)]
Revert "ioemu-remote: Fix the pass-through compilation."

This reverts commit b7eec990223bb8c4b145597af37592103c412542.

Jean Guyader has provided a more comprehensive fix for the direct_pci
change later and the PT_LOG change to use stdout

16 years agoioemu-remote: Fix the pass-through compilation.
Ian Jackson [Fri, 18 Jul 2008 14:28:23 +0000 (15:28 +0100)]
ioemu-remote: Fix the pass-through compilation.

(For 32bit.)

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
16 years agoDo not disturb old fd flags (eg O_APPEND) when setting nonblock.
Ian Jackson [Fri, 18 Jul 2008 13:28:52 +0000 (14:28 +0100)]
Do not disturb old fd flags (eg O_APPEND) when setting nonblock.

socket_set_nonblock should not unconditionally call
fcntl(,F_SETFL,O_NONBLOCK) because that would clear other flags which
might be intentionally set on the fd.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoAlways use nonblocking mode for qemu_chr_open_fd.
Ian Jackson [Fri, 18 Jul 2008 13:24:17 +0000 (14:24 +0100)]
Always use nonblocking mode for qemu_chr_open_fd.

The rest of qemu assumes that IO operations on a CharDriverState do
not block.  Currently there are a couple of cases where such a driver
was set up but the calls to set nonblocking mode were missing:
 * qemu_chr_open_pty
 * qemu_chr_open_pipe
 * qemu_chr_open_stdio

This is fixed by adding two calls to socket_set_nonblock to
qemu_chr_open_fd.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoDo not call fcntl(, O_NONBLOCK) pointlessly.
Ian Jackson [Fri, 18 Jul 2008 13:15:01 +0000 (14:15 +0100)]
Do not call fcntl(, O_NONBLOCK) pointlessly.

It is silly to call fcntl(fd,F_SETFL,O_NONBLOCK) immediately after
opening the fd in nonblocking mode.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoide: enable single word DMA
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.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoReintegrate media insert functionality
Ian Jackson [Wed, 16 Jul 2008 13:01:41 +0000 (14:01 +0100)]
Reintegrate media insert functionality

With patch applied I am able to switch ISO images by writing new
image name to /local/domain/0/backend/vbd/<domid>/<diskid>/params

Signed-off-by: Pat Campbell <plc@novell.com>
16 years agoEnable PCI passthrough by default.
Ian Jackson [Tue, 15 Jul 2008 17:55:44 +0000 (18:55 +0100)]
Enable PCI passthrough by default.

Patch from Jean Guyader / Samuel Thibault.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoInclude <exec-all.h>
Ian Jackson [Tue, 15 Jul 2008 17:50:59 +0000 (18:50 +0100)]
Include <exec-all.h>

16 years agoMerge branch 'master' of ../qemu-iwj
Ian Jackson [Tue, 15 Jul 2008 17:47:44 +0000 (18:47 +0100)]
Merge branch 'master' of ../qemu-iwj

16 years agoMerge branch 'qemu'
Ian Jackson [Tue, 15 Jul 2008 17:46:25 +0000 (18:46 +0100)]
Merge branch 'qemu'

16 years agoCorrected fixes for passthrough compilation.
Ian Jackson [Tue, 15 Jul 2008 17:45:12 +0000 (18:45 +0100)]
Corrected fixes for passthrough compilation.

16 years agoSaner calculation of stubdom IDE_DMA_BUF_SECTORS.
Ian Jackson [Tue, 15 Jul 2008 17:40:04 +0000 (18:40 +0100)]
Saner calculation of stubdom IDE_DMA_BUF_SECTORS.

Thanks to Samuel Thibault.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoHonour -DNO_AIO.
Ian Jackson [Tue, 15 Jul 2008 17:36:40 +0000 (18:36 +0100)]
Honour -DNO_AIO.

Based on a patch by Samuel Thibault.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoNew --disable-audio configure option.
Ian Jackson [Tue, 15 Jul 2008 17:19:28 +0000 (18:19 +0100)]
New --disable-audio configure option.

This disables all audio support including drivers and -DHAS_AUDIO.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoDo not set -DHAS_AUDIO without CONFIG_AUDIO
Ian Jackson [Tue, 15 Jul 2008 17:18:42 +0000 (18:18 +0100)]
Do not set -DHAS_AUDIO without CONFIG_AUDIO

16 years agoDo not build dyngen
Ian Jackson [Tue, 15 Jul 2008 17:03:32 +0000 (18:03 +0100)]
Do not build dyngen

16 years agoioemu-remote: Fix the pass-through compilation.
Ian Jackson [Tue, 15 Jul 2008 16:45:26 +0000 (17:45 +0100)]
ioemu-remote: Fix the pass-through compilation.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
16 years agoMerge branch 'qemu'
Ian Jackson [Tue, 15 Jul 2008 16:36:58 +0000 (17:36 +0100)]
Merge branch 'qemu'

16 years agoDo not try to use -net user as a default when slirp disabled.
Ian Jackson [Tue, 15 Jul 2008 16:35:57 +0000 (17:35 +0100)]
Do not try to use -net user as a default when slirp disabled.

Patch from Jeremy Fitzhardinge <jeremy@goop.org> (who is a Citrix
staff member).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoDisable gcc version check.
Ian Jackson [Tue, 15 Jul 2008 16:32:55 +0000 (17:32 +0100)]
Disable gcc version check.

This is not relevant for qemu-dm as we do not use the
qemu cpu emulations.

16 years agoMerge branch 'qemu'
Ian Jackson [Tue, 15 Jul 2008 16:15:22 +0000 (17:15 +0100)]
Merge branch 'qemu'

16 years agoWith --disable-gcc-check, do not produce spurious errors if no GCC3 at all.
Ian Jackson [Tue, 15 Jul 2008 16:15:12 +0000 (17:15 +0100)]
With --disable-gcc-check, do not produce spurious errors if no GCC3 at all.

Small patch thanks to Prashanth.Mundkur@citrix.com.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
16 years agoqemu ioemu rendering fixes for palette handling (another dropped patch)
Ian Jackson [Mon, 14 Jul 2008 12:46:28 +0000 (13:46 +0100)]
qemu ioemu rendering fixes for palette handling (another dropped patch)

Stefano reports that this part of xen-unstable 17334:baff5b3aaf13
was accidentally dropped.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
16 years agoRevert "ioemu: drop unused 4MB video memory"
Ian Jackson [Mon, 14 Jul 2008 12:13:26 +0000 (13:13 +0100)]
Revert "ioemu: drop unused 4MB video memory"

This reverts commit 2b7a55d6133cae388c0b506ba6f0110bbf9a9318.

This has various compatibility problems, including breaking
restoration of old images.  It is also likely that we will want to
increase this amount in the future.