Commit Graph
20445 Commits
Author SHA1 Message Date
Keir Fraser 113d3d76a6 remus: Add missing unistd.h include from libcheckpoint.c
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 17:21:13 +00:00
Keir Fraser 74781fed8b remus: Fix makefiles for indentation
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 17:02:25 +00:00
Keir Fraser 0b6ade9b3a Merge 2009-11-13 15:46:58 +00:00
Keir Fraser 12af847917 vtd: Make vtd faults dmesg more readable
This simple patch makes the VTd faults dmesg more readable and
helpful for debugging.

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
2009-11-13 15:38:57 +00:00
Keir Fraser b1a4f45a56 Remus: support for network buffering
This currently relies on the third-party IMQ patch (linuximq.net)
being present in dom0. The plan is to replace this with a direct hook
into netback eventually.

This patch includes a pared-down and patched copy of ebtables to
install IMQ on a VIF.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:34:46 +00:00
Keir Fraser 25f52c4c74 Remus: add control script to activate remus on a VM
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:34:03 +00:00
Keir Fraser 1a38c03675 Remus: add python control extensions
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:33:37 +00:00
Keir Fraser 4da23c0c03 x86: Change the interface physdev_map_pirq to support new dom0.
It also keeps compatibility with old dom0.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2009-11-13 15:31:45 +00:00
Keir Fraser b0a1af6167 libxenlight: implement pci passthrough
This patch implements pci passthrough (hotplug and coldplug) in
libxenlight, it also adds three new commands to xl: pci-attach,
pci-detach and pci-list.
Currently flr on a device is done writing to
/sys/bus/pci/drivers/pciback/do_flr
pciback do_flr is present in both XCI and XCP 2.6.27 kernels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 15:31:16 +00:00
Keir Fraser 35c1498503 libxenlight: fix name to domid conversion
This patch makes sure that the domain name to domid conversion is
correct, cross referencing the information found on xenstore with the
list of running domains.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 15:30:24 +00:00
Keir Fraser 0ddbfec52a x86: Disable spinlock checks temporarily while bringing a CPU online.
This is safe, as described in a code comment. Also fix up another
comment in start_secondary() while we're there.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-12 15:34:37 +00:00
Keir Fraser 86a7522040 Don't assume vcpu_id's are contiguous in alloc_vcpu
When cpu hot-added, this assumption is broken because the hot-added
CPU may be brougt online by dom0 in arbitrary order. This patch avoids
making this assumption while still linking vcpus in ascending order of
identifier.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-12 13:15:40 +00:00
Keir Fraser 48fd672fee Revert 20045:db1890f07661 "Revert alloc_idle_vcpu()..."
The old implementation of alloc_idle_vcpu() is unnecessary since
arch-specific code ensures that a single idle domain supports NR_CPUS
vcpus, despite the usual limit of MAX_VIRT_CPUS for ordinary domains.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-12 13:02:27 +00:00
Keir Fraser daa70e9d6e x86: Remove non-CONFIG_HOTPLUG_CPU code, and general cleanup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-12 11:59:18 +00:00
Keir Fraser c1100c28ed Support physical CPU hot-add in xen hypervisor
This patch add CPU hot-add in system.
a) It mark all CPU as possible when booting, if CONFIG_HOTPLUG_CPU is
set. BTW, this will increase per_cpu area.

b) When a CPU is added through hypercall, the CPU will be marked as
present and offline, and the numa information is setup if numa is
supported. The CPU will be brought to online by dom0 online explicitly.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-11-12 11:43:21 +00:00
Keir Fraser f4cf0d5e88 Update pcpu_info hypercall interface
This patch change the XENPF_get_cpuinfo interface to pass only one
pcpu information each hypercall. Also, it replace
xenpf_resource_hotplug with XENPF_cpu_online/offline.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-11-12 11:42:36 +00:00
Keir Fraser f8a685ad57 A few trivial cleanups
Alphabetize object files and guest config options for better
readability. Also remove svm interrupt prototypes which do not
exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-11-12 11:42:02 +00:00
Keir Fraser a7cbf88f59 xend/xm: Add PSCSI_HBA class and DSCSI_HBA class to XenAPI
XenAPI (not xapi) has supported only LUN assignment mode for pvSCSI.
But at last, HOST assignment mode also is supported by these patches.
To support HOST assignment mode, these patches add PSCSI_HBA class
and DSCSI_HBA class to XenAPI.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-12 11:40:44 +00:00
Keir Fraser 2eba88c6af PoD: Handle operations properly when domain is dying
No populate-on-demand activities should happen when a domain is dying.
Especially, it is a bug for memory to be added to the PoD cache when
d->is_dying is non-zero, since if this happens after the cache has
been emptied, these pages will never be freed. This may cause "zombie
domains" to linger.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-11-12 11:39:51 +00:00
Keir Fraser 000e0c8420 blktap2: Remove gnu89-inline option from CFLAGS
Not supported by older versions of gcc.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-11 13:11:44 +00:00
Keir Fraser 24be6cfe21 Mark CPU present when it is detected
Currently a CPU is marked as present only after it has been kicked off
successfully, i.e. before the CPU is brought up, it is not
present. This patch try to mark CPU as present when it is detected
(either through MPS table or ACPI). If it can't be brought up
successfully, it will be marked as non-present again.  This change is
mainly for CPU hot-plug. As discussed, we'd take two step for physical
CPU hot-add. A CPU is firstly marked as present, and later will bring
as online.

Also, In smp_boot_cpus(), xen need only scan all present CPU, and no
need to loop from 0... NR_CPUS. With this change, the bios_cpu_apicid
is not needed anymore.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-11-10 13:04:45 +00:00
Keir Fraser fee63693e0 Hypercall to expose physical CPU information.
It also make some changes to current cpu online/offline logic:
1) Firstly, cpu online/offline will trigger a vIRQ to dom0 for status
changes notification.
2) It also add an interface to platform operation to online/offline
physical CPU. Currently the cpu online/offline interface is in sysctl,
which can't be triggered in kernel. With this change, it is possible
to trigger cpu online/offline in dom0 through sysfs interface.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-11-10 13:03:42 +00:00
Keir Fraser 66cc31ec35 tools: Make build again on netbsd
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-10 13:01:09 +00:00
Keir Fraser 88069bda2e libxl: Call to open() must specify mode with O_CREAT.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 22:41:23 +00:00
Keir Fraser 9c2eca8f17 unlzma: Remove 'inline' decl from non-static function.
Breaks the build with some versions of gcc.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 22:30:21 +00:00
Keir Fraser abe3377eb2 x86: Fix clip_to_limit().
There are issues in updating the e820 map in the middle of a loop that
iterates over it. For example, after memmove(&e820.map[i],
&e820.map[i+1], ...), the original e820.map[i+1] become current
e820.map[i] but the next loop count is i+1, so the original
e820.map[i+1] will be skipped.

Fix and clarify the code by making a double loop.

Original bug discovery and fix by Xiao Guangrong <ericxiao.gr@gmail.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 20:43:40 +00:00
Keir Fraser b6a5bfafee cmdline_parse_early: fix parse 'edd=' option
If 'edd='is default, it should decrease "opt_edd" not "opt_edid"

Signed-off-by: Xiao Guangrong <ericxiao.gr@gmail.com>
2009-11-09 20:06:48 +00:00
Keir Fraser 3f3b3ccbb3 e820: fix e820_change_range_type()
In below case, e820_change_range_type() will return success:
[s, e] is in the middle of [rs, re] and e820->nr_map+1 >=
ARRAY_SIZE(e820->map) actually, it's failed, so this patch fix it

Signed-off-by: Xiao Guangrong <ericxiao.gr@gmail.com>
2009-11-09 20:05:43 +00:00
Keir Fraser c5c301ac77 libxenlight: initial libxenlight implementation under tools/libxl
Signed-off-by: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-09 19:54:28 +00:00
Keir Fraser 85f5921bdf blktap2: add remus driver
Blktap2 port of remus disk driver. Backwards compatable with blktap1
implementation.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:45:06 +00:00
Keir Fraser 61e986758d Remus: Fixup for tap:tapdisk syntax in remus uname
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:41:16 +00:00
Keir Fraser ab8fdd95a1 blktap2: only open driver stack once
Currently blktap2 opens a driver stack, closes it, and re-opens
it. This causes problems with our remus driver: the primary may
connect to the backup in between the first and second open.

This is a temporary fix.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-11-09 19:40:48 +00:00
Keir Fraser 8b0f1cdb96 blktap2: configurable driver chains
Blktap2 allows block device drivers to be layered to create more
advanced virtual block devices. However, composing a layered driver is
not exposed to the user. This patch fixes this, and allows the user to
explicitly specify a driver chain when starting a tapdisk process,
using the pipe character ('|') to explicitly seperate layers in a
blktap2 configuration string.

for example, the command:
  ~$ tapdisk2 -n "log:|aio:/path/to/file.img"
will create a blktap2 device where read and write requests are passed
to the 'log' driver, then forwarded to the 'aio' driver.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-11-09 19:40:14 +00:00
Keir Fraser ad91d3c17b Remus: Make checkpoint buffering HVM-aware
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:19:27 +00:00
Keir Fraser 2cdf23dd60 Remus: Do bitmap scan word-by-word before bit-by-bit.
For sparse bitmaps and large domains this saves a lot of time.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:17:22 +00:00
Keir Fraser 69ebc5d595 Remus: Do not bother with to_skip/to_fix bitmaps after the first final round.
Signed-off-by: Geoffrey Lefebvre <geoffrey@cs.ubc.ca>
2009-11-09 19:16:48 +00:00
Keir Fraser ac0982a376 Remus: Buffer checkpoint data locally until domain has resumed execution.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:16:19 +00:00
Keir Fraser 57f44d8638 Remus: Initiate failover if a packet is not received every 500ms.
This breaks checkpoints at lower frequencies, and should be made
optional.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:15:34 +00:00
Keir Fraser 13ffaa7d3d Remus: Make xc_domain_restore loop until the fd is closed.
The tail containing the final PFN table, VCPU contexts and
shared_info_page is buffered, then the read loop is restarted.
After the first pass, incoming pages are buffered until the next tail
is read, completing a new consistent checkpoint. At this point, the
memory changes are applied and the loop begins again. When the fd read
fails, the tail buffer is processed.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:14:03 +00:00
Keir Fraser b6119955df Remus: Add callbacks for suspend, postcopy and preresume in xc_domain_save.
This makes it possible to perform repeated checkpoints.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:06:25 +00:00
Keir Fraser 4a6d50ad69 x86, hvm: Make host TscInvariant CPUID flag visible to guest by default.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 18:54:27 +00:00
Keir Fraser 2e6a2d4dba x86_32: Respect e820 map when populating Xen heap.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 08:19:55 +00:00
Keir Fraser cef4294cff x86, cpuid: mask TSC invariant bit for PV and HVM domains if migration
is not disabled and TSC is not emulated

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-09 08:03:30 +00:00
Keir Fraser ab77e81f65 x86/dom0: support bzip2 and lzma compressed bzImage payloads
This matches functionality in the tools already supporting the same
for DomU-s.

Code taken from Linux 2.6.32-rc and adjusted as little as possible to
be usable in Xen.

The question is whether, particularly for non-Linux Dom0-s, plain ELF
images compressed by bzip2 or lzma should also be supported.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-11-09 07:52:27 +00:00
Keir Fraser 14ec087884 xentop: Add two more VBD statistics
In addition to VBD read/write request#, add VBD read/write sector#
also. It makes VBD throughput observation easier. As the method to get
such info is OS dependent, just Linux version code is added.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
2009-11-05 12:00:58 +00:00
Keir Fraser 397ade9be3 xc_resume: fix modify_returncode when host width != guest width
Also improve checking in xc_domain_resume_any().

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-04 22:32:01 +00:00
Keir Fraser e71172174b Update QEMU_TAG to f72b6e0ffc3bb84d4442c5a7493bffbdce2a4468 2009-11-04 18:14:02 +00:00
Keir Fraser cecb47b785 xen passthrough: fix recent regressions
This patch fixes the recent regressions pointed out by Dexuan, keeping
pci passthrough working with stubdom too.  In particular calling
device_create when pci_state == 'Initialising' is a mistake because
the state is always Initialising when attaching a device while
device_create has too be called only when the pci backend is missing.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-03 12:41:54 +00:00
Keir Fraser b8a456caed x86: improve reporting through XENMEM_machine_memory_map
Since Dom0 derives machine address ranges usable for assigning PCI
device resources from the output of this sub-hypercall, Xen should
make
sure it properly reports all ranges not suitable for this (as either
reserved or unusable):
- RAM regions excluded via command line option
- memory regions used by Xen itself (LAPIC, IOAPICs)

While the latter should generally already be excluded by the BIOS
provided E820 table, this apparently isn't always the case at least
for IOAPICs, and with Linux having got changed to account for this it
seems to make sense to also do so in Xen.

Generally the HPET range should also be excluded here, but since it
isn't being reflected in Dom0's iomem_caps (and can't be, as it's a
sub-page range) I wasn't sure whether adding explicit code for doing
so would be reasonable.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-11-03 12:40:28 +00:00
Keir Fraser b95beb1858 x86: Clean up APIC local timer handling.
1. Writing TMICT=0 disables the timer. Use this fact to simplify and
improve reprogram_timer(). In particular, we always write TMICT, and
write zero when we do not need a timer interrupt.

2. In HPET broadcast timer handler, set TMICT=0 when we mask the APIC
local timer. May as well do this early, before entering deep sleep.

3. In HVM-guest APIC emulation, disable the emulated local timer when
the guest sets TMICT=0. Previously we would issue an immediate
one-shot interrupt.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-03 09:33:22 +00:00