Keir Fraser [Thu, 28 Feb 2008 10:55:18 +0000 (10:55 +0000)]
kexec: dont initialise regions in reserve_memory()
There is no need to initialise efi_memmap_res and boot_param_res in
reserve_memory() for the initial xen domain as it is done in
machine_kexec_setup_resources() using values from the kexec hypercall.
Keir Fraser [Thu, 28 Feb 2008 10:54:55 +0000 (10:54 +0000)]
kexec: read more iomem regions from hypervisor
This sets the location of the efi memmap and boot parameter
regions using information provided by the hypervisor,
overriding values derived by dom0 from the virtualised
efi memory regions.
It also creates a xen heap region and uses this as the parent
of per-cpu regions - they belong in hypervisor memory not
dom0 kernel memory.
The xen heap region is inserted into /proc/iomem_machine
* There is also a hypervisor portion of this patch.
* In order for the regions to show up after kexec patches
to kexec-tools are required. I have posted them
to the kexec mailing list and intend to merge them.
Keir Fraser [Thu, 28 Feb 2008 10:54:20 +0000 (10:54 +0000)]
kexec: add xen_machine_kexec_register_resources() and machine_kexec_register_resources()
Add xen_machine_kexec_register_resources() and
machine_kexec_register_resources() to allow architecture specific
handling of iomem resources.
At this time xen_machine_kexec_register_resources() does the
same parenting of per-cpu resources on all architectures.
And machine_kexec_register_resources does nothing on all
architectures.
Keir Fraser [Thu, 28 Feb 2008 10:53:42 +0000 (10:53 +0000)]
kexec: add parent to per-cpu regions at setup time.
This is slightly more efficient as xen_machine_kexec_setup_resorces()
is called once (before xen_machine_kexec_register_resources()). While
xen_machine_kexec_register_resources() is called once for each EFI
memory region seen by a domain.
More cosmetic than anything else, but it seems more logical to me.
Keir Fraser [Thu, 28 Feb 2008 10:52:47 +0000 (10:52 +0000)]
kexec: Use error path if crash region range can't be accessed
Although the error handling path in xen_machine_kexec_setup_resource()
is somewhat minmal, it ought to be used if HYPERVISOR_kexec_op() fails
whengetting the crash kernel region, as this indicates that an error
occured, not that the crash kernel region is empty.
There would seem to be a potential deadlock in the netfront accelerator
plugin support. When the configured accelerator changes in xenstore,
netfront tries to load the new plugin using request_module(). It does
this from a workqueue work item. request_module() will invoke
modprobe which in some circumstances (I'm not sure exactly what - I've
not managed to reproduce it myself) seems to try to flush the
workqueue, and so it deadlocks. This patch fixes the problem by
giving the accel watch work item its own workqueue, and so modprobe
can successfully flush the system-wide one.
Ian Campbell [Tue, 26 Feb 2008 17:59:18 +0000 (17:59 +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>
Keir Fraser [Thu, 21 Feb 2008 10:21:34 +0000 (10:21 +0000)]
Solarflare: adjust Kconfig additions
Clean up drivers/xen/Kconfig after the Solarflare additions:
- placement of new items should not disturb menu hierarchy
- dependencies of XEN_NETDEV_ACCEL_SFC_BACKEND were missing
- use tabs for indentation
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
Keir Fraser [Wed, 20 Feb 2008 18:05:47 +0000 (18:05 +0000)]
Solarflare: Various build fixes, and make SFC drivers dependent on x86
From: Kieran Mansley <kmansley@solarflare.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 15 Feb 2008 10:01:06 +0000 (10:01 +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>
Keir Fraser [Mon, 11 Feb 2008 11:05:27 +0000 (11:05 +0000)]
CVE-2008-0600: Fix exploitable hole in vmsplice() syscall.
Fix is Al Viro's suggested patch for RHEL5. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 11 Feb 2008 10:19:25 +0000 (10:19 +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>
Keir Fraser [Mon, 11 Feb 2008 10:08:57 +0000 (10:08 +0000)]
block: backport Jens Axboe's commit from
Tue, 16 Oct 2007 09:03:56 +0000 (11:03 +0200) bf2de6f5a4faf0197268f18d08969b003b87b6e8
Initial support for data-less (or empty) barrier support
blkback: permit and implement empty barrier. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Keir Fraser [Mon, 11 Feb 2008 09:55:25 +0000 (09:55 +0000)]
net accel: Fix double-probe of accelerator on suspend_cancel
Fixes a bug in the network acceleration stuff where an accelerator
could get probed with the same interface twice on a suspend-cancel -
once manually in the suspend_cancel handler, and once when the watch
on the accel configuration option fired after being reinstated.
Keir Fraser [Mon, 11 Feb 2008 09:52:49 +0000 (09:52 +0000)]
xen balloon: allocate and free cold pages
To reduce the performance side effects of ballooning, use and return
cold pages. To limit the impact scrubbing of these (and other) pages
has on the cache, also implement a dedicated scrubbing function on x86
which uses non-temporal stores (when available).
Keir Fraser [Mon, 11 Feb 2008 09:49:58 +0000 (09:49 +0000)]
xen/x86: fix and improve xen_limit_pages_to_max_mfn()
- don't do multicall when nr_mcl is zero (and specifically don't
access cr_mcl[nr_mcl - 1] in that case)
- fix CONFIG_XEN_COMPAT <=3D 0x030002 handling
- don't exchange pages already meeting the restriction (likely
avoiding exchanging anything at all)
- avoid calling kmap functions without CONFIG_XEN_SCRUB_PAGES
- eliminate a few local variables
Keir Fraser [Tue, 5 Feb 2008 10:05:19 +0000 (10:05 +0000)]
netback: Fix BUG_ON() on page-flip receive path which would always
trigger and crash the kernbel.
Tracked down by Joakim Dahlstedt <jda@bea.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 4 Feb 2008 14:29:03 +0000 (14:29 +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>
Keir Fraser [Fri, 1 Feb 2008 11:11:12 +0000 (11:11 +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>
Keir Fraser [Mon, 21 Jan 2008 11:43:31 +0000 (11:43 +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>
Keir Fraser [Fri, 18 Jan 2008 16:52:25 +0000 (16:52 +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 [Fri, 18 Jan 2008 16:35:24 +0000 (16:35 +0000)]
linux/x86: clean up hypercall headers
- don't define HYPERVISOR_hvm_op() for pv guests (requiring to not
include
include/xen/hvm.h in non-pv-driver builds)
- remove the custome __STR/STR macros
- remove stringification where not necessary
- reduce instruction size for pv-driver case on x86-64
Keir Fraser [Wed, 16 Jan 2008 13:27:22 +0000 (13:27 +0000)]
x86: Check for XENFEAT_mmu_pt_update_preserve_ad before attempting to
use new mmu_update() hypercall. Older Xen versions are noisy if the
unsupported hypercall is attempted. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 15 Jan 2008 14:35:41 +0000 (14:35 +0000)]
xen, x86: Allow mprotect() pte updates to be batched using new Xen
batched interface which preserves access/dirty pte flags. Signed-off-by: Bruce Rogers <brogers@novell.com>
Ian Campbell [Mon, 14 Jan 2008 15:52:23 +0000 (15:52 +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>
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>
Alex Williamson [Tue, 11 Dec 2007 16:00:53 +0000 (09:00 -0700)]
[IA64] Fix CONFIG_XEN=no for gate page
The important part of this is to refrain from building .tmp_gate.o unless
CONFIG_XEN. However it also seems correct to make xen_gate_section in
vmlinux.lds.S depend on CONFIG_XEN as well. Tested that both builds work now.
Ian Campbell [Mon, 10 Dec 2007 15:04:49 +0000 (15:04 +0000)]
Setup memory zones in the same way as native instead of putting all
low memory in ZONE_DMA. There is no real benefit from diverging from
native in this respect.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Keir Fraser [Thu, 6 Dec 2007 16:02:51 +0000 (16:02 +0000)]
linux/x86: Use cpu_relax() rather than barrier() in smp_call_function()
Short of getting an explanation for the odd difference to native, make
the code match native (and also, in the case of x86-64,
__smp_call_function_single()).
Keir Fraser [Thu, 6 Dec 2007 15:59:52 +0000 (15:59 +0000)]
linux/x86: fix initial GDT setup
cpu_gdt_init() can be static, can have its argument point to const,
and the number of descriptors should be calculated from one more than
the table's limit.