1. We cannot rely on BSF/BSR leaving the destination register intact
if the source is zero (according to Intel manuals)
2. We race clear_bit() in find_first_bit(), which may occur after
SCAS but before BSF. So we must handle zero input to BSF.
Cache figlet output across builds, and provide src-tarball target
which creates figlet output and then deletes figlet itself (which is
not licensed under GPL).
x86/64 compat: Replace hypervisor BUG_ON() with a cleaner hypercall failure.
While trying to run a 32-bit PV domU on a 64-bit hypervisor, I
triggered an assert in the hypervisor. The assert dealt with the
maximum number of grants that a domU can have. I made the hypervisor
a bit more graceful by returning an error rather than asserting.
ioemu: Fix rtl8139 emulation so that reboot works correctly in 64-bit
Windows VMs. Return an error if the guest OS tries to transmit a
packet with the transmitter disabled, so that it doesn't spin forever
waiting for it to complete.
Signed-off-by: Steven Smith <Steven.Smith@eu.citrix.com>
xen-unstable changeset: 17420:40c0dda6eae68ec1bbd3bfd3e812d8b9e34051a0
xen-unstable date: Wed Apr 09 16:03:40 2008 +0100
Keir Fraser [Mon, 31 Mar 2008 17:09:19 +0000 (18:09 +0100)]
Constrain the checks for GCC/ANSI to just those header files that
require it. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 17327:da9bd2e81288225c8836e8083430ebcadf696f98
xen-unstable date: Mon Mar 31 18:05:18 2008 +0100
Keir Fraser [Mon, 31 Mar 2008 16:51:33 +0000 (17:51 +0100)]
Revert all usages of gcc's __extension__ keyword, and instead assert
that our headers are not built with __GNUC__ and __STRICT_ANSI__.
__extension__ had some weird (and buggy) behaviours when nested which
make it a risky proposition for general usage in our header
files. Better to disallow -ansi, -std=c99, and similar gcc options
when building against Xen headers.
Keir Fraser [Mon, 31 Mar 2008 15:48:37 +0000 (16:48 +0100)]
Avoid deadlock when unregistering a xenbus watch.
Watch handlers which run in a separate thread (XBWF_new_thread) should
run without the xenbus_mutex held since kthread_run can block waiting
for memory which causes a deadlock if further watches need to be
unregistered in order to activate the swap device on resume.
XBWF_new_thread cannot be safely unregistered anyway since the mutex
only protects thread startup.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
linux-2.6.18-xen changeset: 498:0637d22ed554eb0b9cecc7a74fa0a77a7c456497
linux-2.6.18-xen date: Fri Mar 28 09:49:22 2008 +0000
Keir Fraser [Mon, 31 Mar 2008 15:45:04 +0000 (16:45 +0100)]
xen: fix grant table bug
A PV OS has two grant table data structures: the grant table itself
and a free list. The free list is composed of an array of pages,
which grow dynamically as the guest OS requires more grants. While
the grant table contains 8-byte entries, the free list contains 4-byte
entries. So we have half as many pages in the free list than in the
grant table.
There was a bug in the free list allocation code. The free list was
indexed as if it was the same size as the grant table. But it's only
half as large. So memory got corrupted, and I was seeing crashes in
the slab allocator later on.
Signed-off-by: Michael Abd-El-Malek <mabdelmalek@cmu.edu>
linux-2.6.18-xen changeset: 502:4018c0da336008e5dfb1163bddbdfbc328c8f5c4
linux-2.6.18-xen date: Mon Mar 31 11:03:07 2008 +0100
On Xen kernels, BIOVEC_PHYS_MERGEABLE permits merging of disk IOs that
span multiple pages, provided that the pages are both
pseudophysically- AND machine-contiguous ---
However, this best-effort merging of adjacent pages can occur in
regions of dom0 memory which just happen, by virtue of having been
initially set up that way, to be machine-contiguous. Such pages
which occur outside of a range created by xen_create_contiguous_
region won't be seen as contiguous by range_straddles_page_boundary(),
so the pci-dma-xen.c code for dma_map_sg() will send these regions
to the swiotlb for bounce buffering.
This patch adds a new check, check_pages_physically_contiguous(),
to the test for pages stradding page boundaries both in
swiotlb_map_sg() and dma_map_sg(), to capture these ranges and map
them directly via virt_to_bus() mapping rather than through the
swiotlb.
Signed-off-by: Stephen Tweedie <sct@redhat.com>
linux-2.6.18-xen changeset: 501:5486a234923da1fbab13eef6165f25c54ab63bd9
linux-2.6.18-xen date: Mon Mar 31 10:32:25 2008 +0100
Keir Fraser [Thu, 20 Mar 2008 12:25:35 +0000 (12:25 +0000)]
svm: Reported SS.DPL must equal CPL, as this is assumed by generic HVM
code despite the fact that AMD processors do not always maintain this
invariant.
Based on a bug report and proposed patch by Ben Guthro and Robert
Phillips of Virtual Iron.
Keir Fraser [Thu, 20 Mar 2008 12:24:10 +0000 (12:24 +0000)]
domain_shutdown() needs to vcpu_pause_nosync() rather than directly
incrementing the pause_count field. The latter ensures that the VCPU
gets descheduled --- synchronously in the case of the
currently-running VCPU.
Based on a bug report and proposed patch by Ben Guthro and Robert
Phillips of Virtual Iron.
Keir Fraser [Thu, 20 Mar 2008 12:23:14 +0000 (12:23 +0000)]
SVM: handle page faults in emulated instruction fetches
Deal with failures in hvm_copy_from_guest_virt when fetching
instructions in the various SVM emulation paths. Since we know that
the instruction was fetchable by the hardware, we can usually just
return from the VMEXIT and try again; whatever caused us to fail will
cause the hardware to fail next time and we'll get the correct exit
code.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 17202:8325f200e19414d998b7625f2e3cf786a6d3d3a3
xen-unstable date: Mon Mar 17 11:39:50 2008 +0000
Keir Fraser [Wed, 5 Mar 2008 16:45:30 +0000 (16:45 +0000)]
x86_emulate: INS/OUTS need Mov attribute to force writeback (since
dst.orig_val is not initialised). Also, Mov attribute on cmpxchg is
not necessary -- when destination is memory (i.e., successful cmpxchg)
then dst.orig_val is already correctly filled in. In case that
dst.orig_val == dst.val then the instruction linearises at the point
we first read the destination (and initialised dst.orig_val). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset: 17174:c89f6ed5635179695c92810a9c9eec205e5d0d78
xen-unstable date: Mon Mar 03 11:47:40 2008 +0000
Keir Fraser [Wed, 5 Mar 2008 16:45:06 +0000 (16:45 +0000)]
Fix xm vcpu-pin for inactive managed domains
We cannot currently change cpu affinity definitions of inactive
managed domains by xm vcpu-pin command. This patch enables changing
cpu affinity definitions of inactive managed domains. However, we
cannot change cpu affinity definitions to each vcpu because we cannot
currently define cpu affinity definitions to each vcpu to domain
configuration definitions. Therefore, we need to specify 'all' to
VCPU argument of xm vcpu-pin command.
Keir Fraser [Wed, 5 Mar 2008 10:04:00 +0000 (10:04 +0000)]
x86: make show_page_walk() more robust. Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 16879:1a2f557448cf5de825d40e550140637961d2eb46
xen-unstable date: Thu Jan 24 18:11:44 2008 +0000
Keir Fraser [Mon, 3 Mar 2008 13:41:34 +0000 (13:41 +0000)]
Fix restore of saved image containing rtc_timeoffset
Saved images contain rtc_timeoffset as a string value, resulting in a
TypeError exception when calling xc.domain_set_time_offset() on
restore. Cast rtc_timeoffset to int before calling
xc.domain_set_time_offset().
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
xen-unstable changeset: 17113:9dd235d6174d1944caf53798a07ecf509678eead
xen-unstable date: Tue Feb 26 14:35:39 2008 +0000
Keir Fraser [Sat, 1 Mar 2008 09:29:28 +0000 (09:29 +0000)]
xen: Fix PV resume race against another back-to-back suspend request.
Previously the next suspend request was being dropped on the floor. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
linux-2.6.18-xen changeset: 451:49ffe9ef67d420bde98e7ead29c9b9bfc5b026ba
linux-2.6.18-xen date: Fri Feb 29 10:29:13 2008 +0000
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.