Commit Graph
20482 Commits
Author SHA1 Message Date
Keir Fraser 995380cd80 pygrub: expands tabs before displaying menus.
Otherwise the highlighting and line length trimming does not work as
expected and the display appears corrupted.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-11-23 07:17:32 +00:00
Keir Fraser 758a4a6431 pygrub: if default entry is "saved" then use first entry.
pygrub doesn't support the "savedefault" command and will error out if
menu.lst uses the "default saved" directive. We might as well start on
the first entry in this case instead of failing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-11-23 07:17:10 +00:00
Keir Fraser adaedafa56 xsm: Change format strings from signed to unsigned
...to reflect the variables being passed in.

Signed-off-by : Paul Nuzzi <pjnuzzi@tycho.ncsc.mil>
2009-11-23 07:16:23 +00:00
Keir Fraser 5c3c739758 pcifront: fix multiple initialization bug
Now that we have pcifront_watches to dynamically initialize pcifront
we don't need a call to init_pcifront in pcilib and pcifront_scan
anymore; we should just wait for the frontend to connect to the
backend instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-23 07:14:33 +00:00
Keir Fraser 41c532e4e5 libxc: Minor tools bzip2/lzma decompression fixes
The attached patch cleans up a few minor problems in the bzip2/lzma
decompression support, pointed out by Jiri in internal review.  In
particular, it fixes a possible memory leak on realloc() error, it
fixes a shifting typo, and it changes the xc_dom_printf()'s to be a
bit clearly about which compression routine is in-use.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
2009-11-23 07:13:59 +00:00
Keir Fraser 0f761fab23 xend: Add support for XCP Windows PV drivers
This patch adds support for XCP Windows paravirtual drivers to run on
Xen. The drivers are currently provided in binary-only format from
Citrix. At a minimum, this patch is useful for performance comparisons
vs GPLPV drivers.

Live migration and save/resume are functional but set the guest clock
to the 1970's. The clock must be manually adjusted for the guest's ntp
to resume accurate timekeeping.

Before rebooting windows at the end of driver installation create the
registry key
HKLM\System\CurrentControlSet\Services\xenevtchn\Parameters. Add to it
a DWORD called SetFlags with a value of 0x10000000.

Signed-off-by: Keith Coleman <keith@scaltro.com>
2009-11-23 07:12:06 +00:00
Keir Fraser 998479ef8f Remus: remove Py_RETURN_NONE for Python 2.3
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:10:56 +00:00
Keir Fraser fa249f4edc Remus: fix a warning
This patch fixes the following warning:
  xen/lowlevel/checkpoint/libcheckpoint.c: In function
  `delete_suspend_timer':
  xen/lowlevel/checkpoint/libcheckpoint.c:352: warning: assignment
  makes integer from pointer without a cast

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:07:08 +00:00
Keir Fraser 558a4ade15 libxenlight: fix compilation error for ia64
xc_cpuid_apply_policy() and HVM_PARAM_VIRIDIAN are defined on x86
only.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:06:39 +00:00
Keir Fraser 22af01be29 [IA64] Remus: ia64 counter part of 07f6d9047af4
This patch adds callbacks to xc_domain_save().

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:06:10 +00:00
Keir Fraser ec4e2ccc86 docs: descriptions of PSCSI_HBA and DSCSI_HBA
Add descriptions of PSCSI_HBA class and DSCSI_HBA class to XenAPI
document.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-23 07:05:34 +00:00
Keir Fraser cbc97d570c libxenlight: fix memory leaks
In particular:

- all the temporary flexarrays allocated in the create
  device functions must be freed;

- all the strings that don't need to be modified can be added as they
  are
  to these temporary flexarrays instead of duplicating them;

- any data returned to the user shouldn't be added to the global
  memory tracker so that the user can free it whenever he wishes.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-23 07:04:54 +00:00
Keir Fraser e0df60ddc1 VT-d: Call pci_enable_acs() in pci_add_device_ext()
Signed-off-by: Allen Kay allen.m.kay@intel.com
2009-11-23 07:03:01 +00:00
Keir Fraser 2a9c410269 libxenlight: check for early failures of qemu-dm
This patch makes xl create check whether qemu-dm has started
correctly, and causes it to fail immediately with appropriate errors
if not.  There are other bugfixes too.

More specifically:

 * libxl_create_device_model forks twice rather than once so that the
   process which calls libxl does not end up being the actual parent
   of qemu.  That avoids the need for the qemu-dm process to be reaped
   at some indefinite time in the future.

 * The first fork generates an intermediate process which is
   responsible for writing the qemu-dm pid to xenstore and then merely
   waits to collect and report on qemu-dm's exit status during
   startup.  New arguments to libxl_create_device_model allow the
   preservation of its pid so that a later call can check whether the
   startup is successful.

 * The core of this functionality (the double fork, waitpid, signal
   handling and so forth) is abstracted away into a new facility
   libxl_spawn_... in libxl_exec.c.

Consequential changes:

 * libxl_wait_for_device_model now takes a callback function parameter
   which is called repeatedly in the loop iteration and allows the
   caller to abort the wait.

 * libxl_exec no longer calls fork; there is a new libxl_fork.

 * There is a hook to override waitpid, which will be necessary for
   some callers.

Remaining problems and other issues I noticed or we found:

 * The error handling is rather inconsistent still and lacking in
   places.

 * destroy_device_model can kill random dom0 processes (!)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2009-11-23 07:01:51 +00:00
Keir Fraser af7af769b9 libxenlight: correct broken osdeps.[ch] and make #includes consistent
osdeps.[hc] previously mistakenly declared and defined [v]asprintf.
These functions are available in the libc on most platforms.  Also,
osdeps.h is used by xc.c but xc.c is not part of the library, so
osdeps.h is part of the public interface and should have a better
name.

So now, instead:

 * osdeps.h is libxl_osdeps.h.

 * _GNU_SOURCE is #defined in libxl_osdeps.h so that we get the system
   [v]asprintf (and various other functions)

 * libxl_osdeps.h is included first in every libxl*.c file (it needs
   to be before any system headers so that _GNU_SOURCE) takes effect.

 * osdeps.[hc] only provide their own reimplementation of [v]asprintf
   if NEED_OWN_ASPRINTF is defined.  Currently it is not ever defined
   but this is provided for any platform which needs it.

 * While I was editing the #includes in each .c file, I put them all
   into the same order: "libxl_osdeps.h", then system headers,
   then local headers.

 * xs.h is included in libxl.h.  This is needed for "bool"; it has to
   not be typedefed in libxl.h because otherwise we get a duplicate
   definition when including xs.h.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-11-23 07:00:08 +00:00
Keir Fraser c14ce8a125 libxenlight: Clean up logging arrangements
* Introduce new variants of the logging functions which include
  errno values (converted using strerror) in the messages passed to
  the
  application's logging callback.

* Use the new errno-including logging functions everywhere where
  appropriate.  In general, xc_... functions return errno values or 0;
  xs_... functions return 0 or -1 (or some such) setting errno.

* When libxl_xs_get_dompath fails, do not treat it as an allocation
  error.  It isn't: it usually means xenstored failed.

* Remove many spurious \n's from log messages.  (The applications log
  callback is expected to add a \n if it wants to do that, so libxl's
  logging functions should be passed strings without \n.)

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2009-11-23 06:59:06 +00:00
Keir Fraser 3cfaf63e09 x86: enable directed EOI
This patch enables directed EOI on latest processor. With this, the
broadcast of EOI would be suppressed upon LAPIC EOI, so VMM is
required to perform a directed EOI to the IOxAPIC generating the
interrupt by writting to its EOI register.(Pls. refer SDM 3A 10.5.5)

This is useful for ioapic_ack_old to avoid the spurious interrupt
storm, which is the reason why ioapic_ack_new is used.

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
2009-11-23 06:58:19 +00:00
Keir Fraser f38d55cb34 vt-d: enable PCI ACS P2P upstream forwarding
This patch enables P2P upstream forwarding in ACS capable PCIe
switches.  The enabling is conditioned on iommu_enabled variable.
This code solves two potential problems in virtualization environment
where a PCIe device is as signed to a guest domain using a HW iommu
such as VT-d:

1) Unintentional failure caused by guest physical address programmed
into the device's DMA that happens to match the memory address range
of other downstream ports in the same PCIe switch.  This causes the
PCI transaction to go to the matching downstream port instead of go to
the root complex to get translated by VT-d as it should be.

2) Malicious guest software intentionally attacks another downstream
PCIe device by programming the DMA address into the assigned device
that matches memory address range of the downstream PCIe port.

Corresponding ACS filtering code is already in upstream control panel
code that do not allow PCI device passthrough to guests if it is
behind a PCIe switch that does not have ACS capability or with ACS
capability but is not enabled.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2009-11-23 06:56:01 +00:00
Keir Fraser 93e6c4731d libxenlight: implement support for pv guests
This patch makes pv guest work correctly with libxenlight.  It also
implements support for vfb and vkbd, starting qemu in xenpv mode. Both
xenconsole and qemu are supported as console backends.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-23 06:54:03 +00:00
Keir Fraser 1e4968503b xend: Remove tab indents
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-23 06:52:35 +00:00
Keir Fraser 463016ab58 tmem: fix double-free bug
Tmem double-frees a high-level data structure causing memory
corruption under certain circumstances.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-23 06:48:14 +00:00
Keir Fraser f38a18594b rombios: don't busy-wait for keystrokes
Spinning waiting for the keyboard is a bit rude on a virtual
machine. Wait for an interrupt instead.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-11-23 06:47:29 +00:00
Keir Fraser 5449532321 tmem: printk too chatty when tmem enabled
Two gdprintk's that are rarely encountered with tmem disabled
are frequent but meaningless when tmem is enabled.  Printing
these tens-to-hundreds of times per second (in certain
circumstances even higher) slows down domain execution.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-23 06:46:58 +00:00
Keir Fraser 2193ba37a3 tmem: fix regression from c/s 19886 "Remove page-scrub lists and async scrubbing"
Fix incorrect page_list macro choice from page-scrub code cleanup.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-23 06:45:03 +00:00
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