Keir Fraser [Sat, 1 Mar 2008 09:27:10 +0000 (09:27 +0000)]
Avoid using a separate watch thread due to uninitialised watch->flags.
The xenbus_dev code isn't setup to handle the case where
XBWF_new_thread is set so there is a potetial crash if this flag is
erroneously set. Therefore initialise flags to zero by using kzalloc
rather than kmalloc.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
linux-2.6.18-xen changeset: 440:43de9d7c3c63adaac7e334621f763c94acbbc178
linux-2.6.18-xen date: Tue Feb 26 17:59:18 2008 +0000
Keir Fraser [Tue, 26 Feb 2008 15:06:42 +0000 (15:06 +0000)]
ioemu: IDE flush on O_DIRECT with drive caching off.
Long ago Xen added code to the device model to basically do an fsync()
after every data write if the user in the guest specified that IDE
write caching should be disabled. This works fine, except in the case
where you are doing O_DIRECT writes inside the guest (ala dd
if=/dev/zero of=/dev/hdb oflag=direct). This is because you can get
out of ide_write_dma_cb() in the middle of the loop without going
through the logic to sync. This simple patch makes sure that you
always check (and sync) inside the write callback.
Signed-off-by: Chris Lalancette <clalance@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Keir Fraser [Thu, 21 Feb 2008 15:15:02 +0000 (15:15 +0000)]
xm: Fix xm vcpu-pin to complain for CPU numbers out of range. Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
xen-unstable changeset: 17092:511ab2b89ced1e190c6c76139b60049b69be69ef
xen-unstable date: Wed Feb 20 17:42:12 2008 +0000
Keir Fraser [Mon, 18 Feb 2008 14:33:57 +0000 (14:33 +0000)]
Xen dom0 arbitrarily assigns APIC ID x to CPU ID x. Make dom0 also
assign the APIC ID to ACPI ID mapping in the same way. Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
linux-2.6.18-xen changeset: 419:0034d9389130969f9452b76370f76394e10238b8
linux-2.6.18-xen date: Fri Feb 15 10:01:06 2008 +0000
Keir Fraser [Mon, 18 Feb 2008 14:29:50 +0000 (14:29 +0000)]
fbfront: Clear ring contents on save/restore. Otherwise in some cases
a restored domain loses mouse and keyboard. Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
linux-2.6.18-xen changeset: 415:90fbf541d772e9df4e7a4be3ed667d9bac5412c0
linux-2.6.18-xen date: Mon Feb 11 10:19:25 2008 +0000
Keir Fraser [Mon, 18 Feb 2008 14:26:38 +0000 (14:26 +0000)]
x86: Fix mod_l3_entry() for PAE-on-64 guests. The adjustment of
_PAGE_RW and _PAGE_USER cannot happen before get_page_from_l3e().
Original patch by Manuel Bouyer <bouyer@netbsd.org>. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 17061:9d29141a5e527d13c10b592c5b7807af73750a19
xen-unstable date: Mon Feb 18 13:50:25 2008 +0000
Keir Fraser [Mon, 18 Feb 2008 14:24:54 +0000 (14:24 +0000)]
x86/64: Make BIOS call to declare our intention to enter long mode. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 17051:55ae3b66b1b6e9039f13d9eec0b98864ca87ba6f
xen-unstable date: Thu Feb 14 11:24:49 2008 +0000
Keir Fraser [Mon, 18 Feb 2008 14:19:42 +0000 (14:19 +0000)]
xm reboot: Fix wait option of xm reboot command
When I rebooted a domain by xm reboot command with wait option,
I saw the following message. But, rebooting the domain succeeded.
Domain vm1 destroyed for failed in rebooting
The cause why the message was shown is the domain is destroyed
temporarily by processing of xm reboot command. The domain
information is not gotten from Xend by server.xend.domains()
function till recreating the domain is completed.
This patch fixes processing of xm reboot command in Xm side.
It waits just a bit till recreating the domain is completed,
then it measures the success or failure of the reboot of the
domain.
Keir Fraser [Mon, 4 Feb 2008 14:32:26 +0000 (14:32 +0000)]
ebtables: don't compute gap until we know we have an ebt_entry
Original upstream Linux patch by Chuck Ebbert. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
linux-2.6.18-xen changeset: 405:369b676a32439c947a604323b5b3db6007ffedd2
linux-2.6.18-xen date: Mon Feb 04 14:29:03 2008 +0000
Keir Fraser [Mon, 4 Feb 2008 14:24:57 +0000 (14:24 +0000)]
Do not allocate vcpu_guest_context on the stack when initialising a
new VCPU. It is too big for 4kB stacks.
Original patch by Donald Dutile <ddutile@redhat.com> backported from
upstream pv_ops work. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
linux-2.6.18-xen changeset: 402:687ef5a4fcb7c6a0c8fe90ab25ce58a465c1cb4b
linux-2.6.18-xen date: Fri Feb 01 11:11:12 2008 +0000
Keir Fraser [Mon, 4 Feb 2008 14:22:33 +0000 (14:22 +0000)]
xend: Fix grow of the LEGACY_UNSUPPORTED_BY_XENAPI_CFG list each time
we instantiate a new XendConfig. Signed-off-by: Pascal Bouchareine <pascal@gandi.net>
xen-unstable changeset: 16965:b1b93caa7d8e2414af06f06c3a9734675f715bad
xen-unstable date: Sat Feb 02 10:53:24 2008 +0000
Keir Fraser [Mon, 4 Feb 2008 14:22:17 +0000 (14:22 +0000)]
Fix save/restore failure cleanup
The save failure cleanup introduced in 13543:207523704fb1 is
incorrect: if we didn't get as far as actually suspending the domain,
then the guest domain will not be expecting the devices to be removed
(seen on both Linux and Solaris, which don't expect a 'Closing' state
when they hold the device open). Only re-jig devices if we definitely
shut the domain down.
Signed-off-by: John Levon <john.levon@sun.com>
xen-unstable changeset: 16964:5d84464dc1fc013110c25dc0ff1f99585e699fa3
xen-unstable date: Sat Feb 02 10:51:54 2008 +0000
Keir Fraser [Mon, 4 Feb 2008 14:20:07 +0000 (14:20 +0000)]
libxc: Fix the third argument of bitmap_64_to_byte in
xc_tbuf_set_cpu_mask Signed-off-by: Eric Liu <eric.e.liu@intel.com>
xen-unstable changeset: 16951:475f4323b86a9c15e81e31ba9a25d19c5fa51eb5
xen-unstable date: Thu Jan 31 09:39:44 2008 +0000
Keir Fraser [Mon, 28 Jan 2008 10:37:48 +0000 (10:37 +0000)]
Fix losetup -r flag when we specify 'w!' for the disk mode.
From: Zhigang Wang <zhigang.x.wang@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16880:78a29cf8476b6e6720edbfb4c89c3809be227ffe
xen-unstable date: Fri Jan 25 13:22:52 2008 +0000
Keir Fraser [Thu, 24 Jan 2008 14:58:25 +0000 (14:58 +0000)]
tools/examples/block better use of losetup -r
Use losetup -r when the vbd is specified to be readonly, but only if
-r is supported (rather than always creating a writeable losetup
mapping if possible).
This was inspired by (but not derived from) a diff from the Fedora 8
patchset which uses -r iff the vbd is specified as readonly. We need
to be cleverer upstream because not all systems have losetup -r.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 16642:643ab64d12d5ce57e5f1e08f85ab4bb7fbc136ae
xen-unstable date: Wed Dec 19 15:05:15 2007 +0000
Keir Fraser [Thu, 24 Jan 2008 14:57:57 +0000 (14:57 +0000)]
Enable loopback disk image files on readonly nfs filesystem.
When we losetup a file on readonly nfs filesystem, it fails with:
# losetup /dev/loop7 /data/vm/xen_el5_i386_para/system.raw
/data/vm/xen_el5_i386_para/system.raw: Permission denied
New version of losetup has add a "-r" option for readonly loop, which
Linux kernel has supported for a long time. Some distribution (EL5
update, Fedora 8, etc.) have shipped it. This patch benefit this
option while doesn't break the old versions of losetup.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
xen-unstable changeset: 16330:fbe7ed173314723f80f105e7e60fddd0bed77e5b
xen-unstable date: Wed Nov 07 09:22:31 2007 +0000
Keir Fraser [Tue, 22 Jan 2008 11:33:40 +0000 (11:33 +0000)]
blkback/blktap: Check for kthread_should_stop() in inner loop,
mdelaay() should be msleep(), and these changes belong in blktap as
well as blkback.
Based on comments and patches from Jan Beulich and Steven Smith. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
linux-2.6.18-xen changeset: 392:7070d34f251c3e0c411022a5d365aea9804114a7
linux-2.6.18-xen date: Mon Jan 21 11:43:31 2008 +0000
blkback: Request-processing loop is unbounded and hence requires a
yield point. Also, bad request type is a good cause to sleep for a
short while as the frontend has probably gone mad.
Patch by Steven Smith <steven.smith@eu.citrix.com>
Keir Fraser [Tue, 22 Jan 2008 11:32:23 +0000 (11:32 +0000)]
Avoid allocations causing swap activity on the resume path by allowing
such allocations to access the emergency pools otherwise a
save/restore/migration of a guest which is low on memory can
deadlock.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
linux-2.6.18-xen changeset: 377:e8b49cfbdac0c5ee680cd9ec3d693ed0e2d42432
linux-2.6.18-xen date: Mon Jan 14 15:52:23 2008 +0000
Keir Fraser [Tue, 22 Jan 2008 11:27:43 +0000 (11:27 +0000)]
xend: On block-attach, remove device information when VmError occurs.
I tested xm block-attach command with a wrong
parameter(file:). Naturally a command error occurred. Then I retested
xm block-attach command with a correct parameter(phy:). But a command
error occurred again. The second command error occurred because Xend
did not remove device information from self.info when the first
command error occurred.
Keir Fraser [Tue, 22 Jan 2008 11:27:18 +0000 (11:27 +0000)]
hvm, ioemu: Fix the ide/cdrom emulation error on FC7 guest.
The new libata-eh in the Linux kernel is throwing a fit over the QEMU
cdrom device for two reasons:
1) DRQ can be set with ERR_STAT set. This is a violation of the ATAPI
state machine.
2) After a TEST_UNIT_READY ATAPI command is sent ERR_STAT is getting
set
which is correct. But, when the OS issues another ATAPI command
ERR_STAT is still set. Which is bad since the next expected command
from the OS is REQUEST_SENSE to find out why ERR_STAT is set.
bug this fixes: https://bugzilla.novell.com/show_bug.cgi?id=3D291775
Signed-off-by: Brandon Philips <bphilips@suse.de>
Porting this qemu fix to xen.
Keir Fraser [Fri, 18 Jan 2008 13:54:11 +0000 (13:54 +0000)]
hvm: Allocate an unmapped guard page to separate ordinary low RAM
from special pages (ioreq, xenstore, etc). This will stop some probe
functions (e.g., embedded in memtest) from stomping on the special
pages. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16728:be960a84e492c1baa0a2dfa76b1a770d0df5e433
xen-unstable date: Thu Jan 17 12:59:10 2008 +0000
Keir Fraser [Fri, 18 Jan 2008 13:53:38 +0000 (13:53 +0000)]
libxen: Fix function prototype. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 16721:b953c358d0adc75f77cfa1991b5fc15da2b5b0a2
xen-unstable date: Tue Jan 15 18:48:32 2008 +0000
Keir Fraser [Thu, 17 Jan 2008 14:00:54 +0000 (14:00 +0000)]
x86: Remove broken and unnecessary numa code from smpboot.c.
This was trampling on random memory when node==NUMA_NO_NODE. Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset: 15246:4eb223694d0aa8dc6266621ead1eb590f1aa29cc
xen-unstable date: Sun Jun 10 18:07:58 2007 +0100
Keir Fraser [Tue, 15 Jan 2008 11:19:14 +0000 (11:19 +0000)]
Cleanup xenstore after console device teardown
After the changes in 13616:b111908dd70b, DevController was leaking
xenstore entries every time we took down a console device, as there
was no equivalent to 'xenstore-rm -t' used in the hotplug scripts for
"real" devices. Implement the moral equivalent whenever removal is
forced.
Keir Fraser [Fri, 11 Jan 2008 11:06:22 +0000 (11:06 +0000)]
x86 hvm: hvm_maybe_deassert_evtchn_irq() needs to be called early in
vmexit handling, before IO-APIC can be EOIed or unmasked and resample
the fake INTx line. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16705:e4fd457a3dd5eebf059b49340bb7f3aea1239d8f
xen-unstable date: Fri Jan 11 10:53:44 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 22:58:05 +0000 (22:58 +0000)]
x86_emulate: Certain opcodes are only valid with a memory operand. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16703:c86025f569cb
xen-unstable date: Thu Jan 10 22:52:40 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:54:59 +0000 (11:54 +0000)]
x86 hvm: Tolerate failure to complete INTACK cycle on an
interrupt. Failure can occur because we do not hold locks between
detecting a pending interrupt and acknowledging it. Satte can change
between these two points. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Previously the evtchn_upcall_pending flag would only ever be sampled
on VCPU0, possibly leading to long delays in deasserting the
fake-pci-device INTx line if the interrupt is actually delivered to
other than VCPU0.
Diagnosed by Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Thu, 10 Jan 2008 11:43:21 +0000 (11:43 +0000)]
x86_emulate: Correct RIP-relative addressing offset for SHLD/SHRD with
immediate byte third operand. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16696:b5b3e27f1af3f709a7795d407b567a7b4db533f0
xen-unstable date: Wed Jan 09 10:11:31 2008 +0000
x86_emulate: Fix handling of RIP-relative addressing.
The handling of SHLD/SHRD introduced in 16696:b5b3e27f1af3f7 was
incorrect; thanks to Gary Grebus @ Virtual Iron for spotting it. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16699:7e400607cdd8aa810b96a832eaf8989f48dd6646
xen-unstable date: Wed Jan 09 22:21:28 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:40:11 +0000 (11:40 +0000)]
hvm: hpet: Clamp period to sane values to prevent excessive looping in
hpet_timer_fn(), or excessive numbers of set_timer() callbacks. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16697:1b2be7cf0b7b4b639b7d6f027545930021ebe1e0
xen-unstable date: Wed Jan 09 10:32:13 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:39:23 +0000 (11:39 +0000)]
hvm: hpet: Fix overflow when converting to nanoseconds.
Currently in hpet_tick_to_ns, the approach is multiplying first, which
easily causes overflow when tick is quite large. The patch cannot
handle arbitratry large ticks duo to the precision requirement and
64bit's value range. But by optimize the equation, a larger ticks than
current code can be supported. Also an overflow check is added before
the calculation.
Keir Fraser [Thu, 10 Jan 2008 11:38:10 +0000 (11:38 +0000)]
hvm: time: Fixes to 'SYNC' (no_missed_ticks_pending) timer handling.
Based on a patch by Dave Winchell <dwinchell@virtualiron.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16690:01adaec882d4ea62aede17926716d122b084dd94
xen-unstable date: Tue Jan 08 14:31:23 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:37:32 +0000 (11:37 +0000)]
hvm: hpet: Fix per-timer enable/disable.
The enable/disable per timer interrupt bit is wrongly used as per
timer enable/disable. According to spec, comparator value should
constantly increasing when HPET is globally enabled, no matter
whether the timer interrupt is enabled or not.
Keir Fraser [Thu, 10 Jan 2008 11:35:34 +0000 (11:35 +0000)]
Handle netdev secondary addresses and labels
Fix the network-bridge logic to correctly transfer secondary IP
address from $netdev to $bridge.
e.g. if you add an secondary address/label/alias with:
$> ip addr add 172.31.0.200/24 dev eth0 label eth0:00
then, "ip addr show dev eth0" gives e.g.:
inet 172.31.0.10/24 brd 172.31.0.255 scope global eth0
inet 172.31.0.200/24 scope global secondary eth0:00
and transfer_addrs() tries to execute:
ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev
tmpbridge
ip addr add 172.31.0.200/24 scope global secondary dev tmpbridge:00
which causes the sript to fail because:
1) The device tmpbridge:00 doesn't exist
2) The "secondary" flag isn't valid
This patch fixes the sed commands to instead give:
ip addr add 172.31.0.10/24 brd 172.31.0.255 scope global dev
tmpbridge label tmpbridge
ip addr add 172.31.0.200/24 scope global dev tmpbridge label
tmpbridge:00
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
xen-unstable changeset: 16680:7b7700a30e5280d57ecb9a284ee943aa80ae37f0
xen-unstable date: Tue Jan 08 09:43:44 2008 +0000
Keir Fraser [Thu, 10 Jan 2008 11:34:38 +0000 (11:34 +0000)]
HVM vif without bridge.
When using xen without a bridge but NAT or routing, HVM domains can't
boot, and qemu-dm-n.log contains:
config qemu network with xen bridge for tap0 xenbr0
bridge xenbr0 does not exist!
That's because the qemu-ifup script always tries to add the vif to
a default-named xenbr0 bridge. On the contrary, PV domains just work
fine with the same configuration file except HVM parameters.
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
xen-unstable changeset: 16679:60440a7e7a40c0cfe94f7abcbde82ea2c6e123fe
xen-unstable date: Tue Jan 08 09:40:33 2008 +0000
We need TIF_RESTORE_SIGMASK in order to support ppoll() and pselect()
system calls. This patch originally came from Andi, and was based
heavily on David Howells' implementation of same on i386. I fixed a
typo which was causing do_signal() to use the wrong signal mask.
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Andi Kleen <ak@suse.de>
linux-2.6.18-xen changeset: 375:748cd890ea7f56752311e519e80eece9d850c01a
linux-2.6.18-xen date: Wed Jan 09 22:12:04 2008 +0000
Keir Fraser [Fri, 28 Dec 2007 15:47:10 +0000 (15:47 +0000)]
In C99 (7.19.6.2.10), the behavior of scanf("stuff... %n", ..., &n) is
said to be undefined if the value to be put is n can't fit. I guess
we can safely consider that the same applies to printf.
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
xen-unstable changeset: 16671:19f549449cb5
xen-unstable date: Fri Dec 28 15:23:28 2007 +0000
Keir Fraser [Thu, 27 Dec 2007 22:34:26 +0000 (22:34 +0000)]
Fix pygrub handling of many kernels
If there are a large number of kernel images configured in grub.conf
there will be too many to fit in the limited size pygrub display. This
patch fixes this so that the list of kernels scrolls as needed.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
xen-unstable changeset: 16668:50bd5d2c15cf
xen-unstable date: Thu Dec 27 12:56:32 2007 +0000
Keir Fraser [Thu, 27 Dec 2007 22:33:47 +0000 (22:33 +0000)]
Fix xend xenstore handling.
xend can get into a situation where two processes are attempting to
interact with the xenstore socket, with disastrous results. Fix the
two bad users of xstransact, add a big warning, and fix the destructor
so future mistakes will be detected earlier.
Signed-off-by: John Levon <john.levon@sun.com>
xen-unstable changeset: 16664:9fe92a88912b
xen-unstable date: Thu Dec 27 12:27:34 2007 +0000
Keir Fraser [Thu, 27 Dec 2007 22:32:24 +0000 (22:32 +0000)]
hvm: For functions which translate virtual addresses to machine
addresses, page faults should only be raised when the gva->gfn
translation fails. These should be distinguished from gfn->mfn
translation failures.
The main effect of this is to change the behaviour of functions
derived from __hvm_copy(), which now returns a three-way enumeration,
and also can automatically inject #PF when the gva->gfn translation
fails.
Keir Fraser [Thu, 27 Dec 2007 21:55:38 +0000 (21:55 +0000)]
hvm: Register fields CS,DS,ES,FS,GS,SS,etc. are all undefined during
HVM execution as they are not saved/restore on vmexit/vmentry. To
prevent accidental usage of these fields, poison them with 16-bit
value 0xbeef (debug builds only). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 16660:2324110ef2c6
xen-unstable date: Thu Dec 27 10:39:04 2007 +0000