Commit Graph
20458 Commits
Author SHA1 Message Date
Keir Fraser e2d760b373 x86 shadow: Relax assertion in VRAM tracking code
The original assertion is too strict, as it includes the A/D bits of
the PTE, which (by design) can change under our feet.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-11-23 06:43:50 +00:00
Keir Fraser f1fa336b59 blktap2: fix libgcrypt detection
If we want to check the functionality of libgcrypt, we shouldn't test
a function only exported by openssl, but instead the one actually used
in the code.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-11-23 06:42:12 +00:00
Keir Fraser 61fff729d6 Revert 20437:64599a2d310d
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-17 13:07:16 +00:00
Keir Fraser d3c3f9f893 blktap2: Remove uninitialised variable rc from tdremus_close().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-17 08:05:52 +00:00
Keir Fraser 6ae7243885 tmem: fix domain shutdown problem/race
Tmem fails to put_domain so a dying domain never gets
properly shut down.  Also, fix race condition when
domain is dying by not allowing any new ops to succeed.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-14 10:32:59 +00:00
Keir Fraser f60cd0f902 xend: Remove extraneous logging from pyxc_physinfo().
Also fixes 32-bit build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-14 10:25:19 +00:00
Keir Fraser f481a3f9c3 xend: Balloon down memory to achive enough DMA32 memory for PV guests
with PCI pass-through to succesfully launch.

If the user hasn't used dom0_mem=3D bootup parameter, the privileged
domain usurps all of the memory. During launch of PV guests with PCI
pass-through we ratchet down the memory for the privileged domain to
the required memory for the PV guest. However, for PV guests with PCI
pass-through we do not take into account that the PV guest is going to
swap its SWIOTLB memory for DMA32 memory - in fact, swap 64MB of
it. This patch balloon's down the privileged domain so that there are
64MB of DMA32 memory available.

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-14 08:09:50 +00:00
Keir Fraser 38d6eb319c stubdom: Fix up pciutils.patch
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 22:13:59 +00:00
Keir Fraser 3695303ba1 xsm: Dynamic update to device ocontexts
Added the ability to add and delete ocontexts dynamically on a running
system.  Two new commands have been added to the xsm hypercall, add
and delete ocontext.  Twelve new library functions have been
implemented that use the hypercall commands to label and unlabel
pirqs, PCI devices, I/O ports and memory.  The base policy has been
updated so dom0 has the ability to use the hypercall commands by
default.  Items added to the list will not be present next time the
system reloads.  They will need to be added to the static policy.

Signed-off-by : George Coker <gscoker@alpha.ncsc.mil>
Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
2009-11-13 22:00:19 +00:00
Keir Fraser 4def0d9ca1 xen: allow stubdom to call unmap_domain_pirq
there is one missing IS_PRIV/IS_PRIV_FOR change in xen to make
xc_physdev_unmap_pirq work with stubdoms.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 21:59:20 +00:00
Keir Fraser f8b6fcaf8f pcifront: implement dynamic connections and disconnections
this patch implements dynamic connections and disconnections in
pcifront.
This feature is required to properly support pci hotplug, because when
no pci devices are assigned to a guest, xend will remove the pci
backend altogether.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 21:58:30 +00:00
Keir Fraser 42b2352e01 xend: call xc_assign_device for all the devices to hotplug
this patch fixes a couple of issues with pci passthrough in xend,
previously reported by Cui Dexuan.
The main problem is that xc_assign_device is called only for the first
device hotplugged into the guest and not the followings.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 21:54:44 +00:00
Keir Fraser 04d6becec1 remus: Add missing python __init__.py file
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 21:09:33 +00:00
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