Ian Campbell [Tue, 25 Oct 2011 16:04:41 +0000 (17:04 +0100)]
libxl: add missing "break;" to do_pci_remove
Otherwise we erroneously fall through the LIBXL_DOMAIN_TYPE_PV case into the
"default: abort()".
(I'm sure we fixed this once already...)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Tested-by: Dario Faggioli <dario.faggioli@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Yang Zhang [Tue, 25 Oct 2011 15:46:47 +0000 (16:46 +0100)]
x86 pm: provide CC7/PC2 residency
Sandy bridge introduces new MSR to get cc7/pc2 residency (core C-state
7/package C-state 2). Print the cc7/pc2 residency when on sandy bridge
platform.
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com> Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Mon, 24 Oct 2011 17:01:07 +0000 (18:01 +0100)]
x86/hpet: fix cpumask allocation after 23990:1c8789852eaf
hpet_fsb_cap_lookup(), if it doesn't find any FSB capable timer,
leaves hpet_events allocated, while hpet_events->cpumask may not have
been, As we're pretty generous with these one-time allocations already
(in that hpet_events doesn't get freed when no usable counters were
found, even if in that case only the first array entry [or none at
all] may get used), simply make the cpumask allocation in the legacy
case independent of whether hpet_events was NULL before.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Mon, 24 Oct 2011 17:00:20 +0000 (18:00 +0100)]
x86/ucode-amd: fix regression from c/s 23871:503ee256fecf
microcode_fits() must return distinct values for the success and
no-fit-but-no-error cases, so the caller can react accordingly. Make
it return 1 in the success case, and adjust its single caller.
Also remove an impossible code path - install_equiv_cpu_table(), which
gets called prior to microcode_fits(), never leaves equiv_cpu_table
being NULL without also returning an error.
Note that this is still awaiting testing on a system where the
regression was actually observed (which also requires a new enough
microcode_ctl package). Note also that this will need to be
backported to 4.0 and 4.1 (or the broken c/s that got backported
there reverted).
Signed-off-by: Jan Beulich <jbeulich@novell.com> Committed-by: Keir Fraser <keir@xen.org>
Tim Deegan [Mon, 24 Oct 2011 10:29:08 +0000 (11:29 +0100)]
nestedhvm: handle l2 guest MMIO access
Hyper-V starts a root domain which effectively an l2 guest.
Hyper-V passes its devices through to the root domain and
let it do the MMIO accesses. The emulation is done by
Xen (host) and Hyper-V forwards the interrupts to the l2 guest.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Jan Beulich [Fri, 21 Oct 2011 07:45:24 +0000 (09:45 +0200)]
cpumask <=> xenctl_cpumap: allocate CPU masks and byte maps dynamically
Generally there was a NR_CPUS-bits wide array in these functions and
another (through a cpumask_t) on their callers' stacks, which may get
a little large for big NR_CPUS. As the functions can fail anyway, do
the allocation in there.
For the x86/MCA case this require a little code restructuring: By using
different CPU mask accessors it was possible to avoid allocating a mask
in the broadcast case. Also, this was the only user that failed to
check the return value of the conversion function (which could have led
to undefined behvior).
Also constify the input parameters of the two functions.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Fri, 21 Oct 2011 07:21:09 +0000 (09:21 +0200)]
eliminate direct assignments of CPU masks
Use cpumask_copy() instead of direct variable assignments for copying
CPU masks. While direct assignments are not a problem when both sides
are variables actually defined as cpumask_t (except for possibly
copying *much* more than would actually need to be copied), they must
not happen when the original variable is of type cpumask_var_t (which
may have lass space allocated to it than a full cpumask_t). Eliminate
as many of such assignments as possible (in several cases it's even
possible to collapse two operations [copy then clear one bit] into one
[cpumask_andnot()]), and thus set the way for reducing the allocation
size in alloc_cpumask_var().
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Fri, 21 Oct 2011 07:17:42 +0000 (09:17 +0200)]
introduce and use nr_cpu_ids and nr_cpumask_bits
The former is the runtime equivalent of NR_CPUS (and users of NR_CPUS,
where necessary, get adjusted accordingly), while the latter is for the
sole use of determining the allocation size when dynamically allocating
CPU masks (done later in this series).
Adjust accessors to use either of the two to bound their bitmap
operations - which one gets used depends on whether accessing the bits
in the gap between nr_cpu_ids and nr_cpumask_bits is benign but more
efficient.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 19 Oct 2011 10:50:54 +0000 (12:50 +0200)]
fold struct irq_cfg into struct irq_desc
struct irq_cfg really has become an architecture extension to struct
irq_desc, and hence it should be treated as such (rather than as IRQ
chip specific data, which it was meant to be originally).
For a first step, only convert a subset of the uses; subsequent
patches (partly to be sent later) will aim at fully eliminating the
use of the old structure type.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Ian Campbell [Thu, 13 Oct 2011 09:44:27 +0000 (10:44 +0100)]
libxl: remove QMP warning when no pty style serial device is configured
If the serial device is not "pty" then there is nothing to do but this is not
an error. Removes a spurious warning if e.g. serial="file:/tmp/serial.log" is used:
libxl: error: libxl_qmp.c:137:register_serials_chardev_callback: Failed to store serial port information in xenstore: No such file or directory
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 13 Oct 2011 09:32:09 +0000 (10:32 +0100)]
libxc: osdep: report missing backends in common code
Backends were inconsistent about reporting and it's a pain to edit them all
when adding a new class of osdep.
Signed-off-by: Ian Campbell <Ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
Requires Daniel De Graaf's "libxc: add xc_gntshr_* functions"
Ian Campbell [Thu, 13 Oct 2011 09:32:09 +0000 (10:32 +0100)]
libxl: libxl__e820_alloc must take a libxl__gc.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Thu, 13 Oct 2011 08:37:06 +0000 (09:37 +0100)]
libxl: correctly propagate errors from libxl_domain_resume
currently it return success no matter what.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Signed-off-by: Ian Cmpabell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 13 Oct 2011 09:31:00 +0000 (10:31 +0100)]
libxl: probe disk backend type in libxl_device_disk_add
Without this "xl block-attach" does not work. On create do_domain_create already
catches this.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 7 Oct 2011 10:27:02 +0000 (11:27 +0100)]
libxl: add a test case for correct parsing of disk "backendtype" field
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 7 Oct 2011 10:06:41 +0000 (11:06 +0100)]
xl: use libxl_device_disk_to_json to pretty print disk configuration
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 7 Oct 2011 10:05:47 +0000 (11:05 +0100)]
xl: allow check-xl-disk-parse to run against installed xl as well as build dir
I can't run from the current directory since my build box isn't running Xen so
if ./xl doesn't exist use the installed version on the assumption that I've
copied the script to a test host.
I think running from the build dir needs the blktap2 libraries, so update
LD_LIBRARY_PATH as appropriate.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Ian Campbell [Fri, 7 Oct 2011 10:05:45 +0000 (11:05 +0100)]
libxl: IDL: autogenerate functions to produce JSON from libxl data structures.
Two functions are provided. TYPE_gen_json exposes an interface which is
compatible with the YAGL generator infrastructure. TYPE_to_string uses this to
produce a pretty printed string.
The TYPE_gen_json functions are defined in a new header libxl_json.h which is
not exposed via libxl.h due to the use of YAGL datatypes to avoid poluting the
namespace us libxl users which don't use the library themselves. If a libxl
user is interested in integrating at the YAGL level then it should #include
this file itself.
Also update testidl to generate a random version of each IDL datastructure and
convert it to JSON. Unfortunately this requires a libxl_ctx and therefore the
test must be run on a Xen system now.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
Andrew Cooper [Fri, 14 Oct 2011 17:11:25 +0000 (18:11 +0100)]
hvmloader: Add the WAET since Microsoft are demanding it for Windows 8
Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Keir Fraser [Fri, 14 Oct 2011 17:08:04 +0000 (18:08 +0100)]
Return -EINVAL when trying to kick/kill a nonexistent domain watchdog
... to be more in-line with the NR_DOMAIN_WATCHDOG_TIMERS check at the
top of domain_watchdog(), and also to follow the
timer_(delete|settime)
POSIX API's EINVAL return value.
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Also, replace EEXIST with ENOSPC when failing to allocate a new
domain watchdog.
Jan Beulich [Fri, 14 Oct 2011 12:34:15 +0000 (14:34 +0200)]
x86/MSI: drop local cpumask_t variable from msi_compose_msg()
The function gets called only during initialization/resume (when no
other CPUs are running) or with the IRQ descriptor lock held, so
there's no way for the CPU mask to change under its feet.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Fri, 14 Oct 2011 10:26:20 +0000 (12:26 +0200)]
x86: clean up physid_mask_t handling
This eliminates passing and returning by value of this type (making it
unnecessary for the compiler to create temporary variables for doing so
on the stack), thus dramatically reducing the stack frame sizes of a
couple of functions (was in one case over 12k for a 4095-CPU build).
In one case a local variable gets converted to a static one, possible
because the function gets called at most once (during early boot).
Some accessors get eliminated altogether as being unused or as being
equally well open coded at the place of use.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Fri, 14 Oct 2011 08:15:54 +0000 (10:15 +0200)]
cpufreq: error path fixes
This fixes an actual bug (failure to exit from a function after an
allocation failure), an inconsistency (not removing the cpufreq_dom
list member upon failure), and a latent bug (not clearing the current
governor upon governor initialization failure when there was no old
one; latent because the only current code path leading to this
situation frees the policy upon failure and hence the governor not
getting cleared is benign).
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Keir Fraser [Thu, 13 Oct 2011 14:59:22 +0000 (15:59 +0100)]
x86: Simplify smpboot_alloc by merging x86-{32,64} code as far as
possible.
We still need one ifdef, as x86-32 does not have a compat_gdt_table.
On x86-32 there is 1/2-page wastage due to allocating a whole page for
the per-CPU IDT, however we expect very few users of the x86-32
hypervisor. Those that cannot move to the 64-bit hypervisor are likely
using old single-processor systems or new single-procesor netbooks. On
UP and small MP systems, the wastage is insignificant.
Christoph Egger [Thu, 13 Oct 2011 11:21:10 +0000 (12:21 +0100)]
nestedsvm: fix checks of guest writes to HSAVE_PA MSR
Accessing HSAVE_PA MSR does not require SVM to be enabled nor any
special guest paging mode.
But accessing HSAVE_PA MSR requires the address to be 4k aligned.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Olaf Hering [Thu, 13 Oct 2011 11:21:10 +0000 (12:21 +0100)]
xenpaging: handle evict failures
Evict of a nominated gfn must fail if some other process mapped the
page without checking the p2mt of that gfn first.
Add a check to cancel eviction if the page usage count is not 1.
Handle the possible eviction failure in the page-in paths.
After nominate and before evict, something may check the p2mt and call
populate. Handle this case and let the gfn enter the page-in path. The
gfn may still be connected to a mfn, so there is no need to allocate a
new page in prep.
Adjust do_mmu_update to return -ENOENT only if the gfn has entered the
page-in path and if it is not yet connected to a mfn. Otherwise
linux_privcmd_map_foreign_bulk() may loop forever.
Add MEM_EVENT_FLAG_EVICT_FAIL to inform pager that a page-in request for
a possible not-evicted page was sent. xenpaging does currently not need
that flag because failure to evict a gfn will be caught.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Jan Beulich [Thu, 13 Oct 2011 08:09:28 +0000 (10:09 +0200)]
VMX: extend last branch MSR info to cover newer CPU models
There are still a couple of family 6 models missing here: 37, 44, 46,
and 47 (according to SDM doc changes May 2011); presumably they would
all go into the Nehalem/Sandy Bridge group. Intel?
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Haitao Shan <maillists.shan@gmail.com>
Jan Beulich [Thu, 13 Oct 2011 08:03:43 +0000 (10:03 +0200)]
xmalloc: return unused full pages on multi-page allocations
Certain (boot time) allocations are relatively large (particularly when
building with high NR_CPUS), but can also happen to be pretty far away
from a power-of-two size. Utilize the page allocator's (other than
Linux'es) capability of allowing to return space from higher-order
allocations in smaller pieces to return the unused parts immediately.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Thu, 13 Oct 2011 08:02:34 +0000 (10:02 +0200)]
x86-64: don't use xmalloc_array() for allocation of the (per-CPU) IDTs
The IDTs being exactly a page in size, using xmalloc() here is rather
inefficient, as this requires double the amount to be allocated (with
almost an entire page wasted). For hot plugged CPUs, this at once
eliminates one more non-order-zero runtime allocation.
For x86-32, however, the IDT is exactly half a page, so allocating a
full page seems wasteful here, so it continues to use xmalloc() as
before.
With most of the affected functions' bodies now being inside #ifdef-s,
it might be reasonable to split those parts out into subarch-specific
code...
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Thu, 13 Oct 2011 08:00:13 +0000 (10:00 +0200)]
constify vcpu_set_affinity()'s second parameter
None of the callers actually make use of the function's returning of
the old affinity through its second parameter, and eliminating this
capability allows some callers to no longer use a local variable here,
reducing their stack footprint significantly when building with large
NR_CPUS.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Ian Campbell [Wed, 12 Oct 2011 15:21:32 +0000 (16:21 +0100)]
libxl: fixup incorrect indentation
Several places which were previsously indented using hard tabs are now
incorrectly indented. Fix them up.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 11 Oct 2011 13:34:07 +0000 (14:34 +0100)]
libxl: fixup incorrect indentation
Several places which were previsously indented using hard tabs are now
incorrectly indented. Fix them up.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 11 Oct 2011 13:26:00 +0000 (14:26 +0100)]
libxl: expand hard tab stops
I ran the following and committed the result. ^I is an actual hard tab
for i in $(grep -l --exclude=*_[ly].\[ch\] '^I' tools/libxl/*.[ch]) ; do
cat $i | expand | sponge $i
done
There are some actually wrong indentations too, I'll fix those up
manually.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Guido Gunther [Tue, 11 Oct 2011 11:02:58 +0000 (12:02 +0100)]
pygrub: add debug flag
Debugging config file errors is tedious so help a bit by not silently
dropping parsing exceptions when --debug is given. Also intialize the
logging API at debug level in this case.
Signed-off-by: Guido Gunther <agx@sigxcpu.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Olaf Hering [Tue, 11 Oct 2011 09:46:28 +0000 (10:46 +0100)]
xenpaging: clear page content after evict
If the guest happens to read from the gfn while xenpaging is in the process of
evicting the page, the guest may read zeros instead of actual data.
Also if eviction fails the page content will be corrupted and xenpaging wont
attempt to restore the page.
Remove page scrubbing from pager and do it after successful eviction.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Ian Campbell [Mon, 10 Oct 2011 15:49:48 +0000 (16:49 +0100)]
tools/check: check for yajl (needed by libxl)
We need precisely version 1 so check for .so.1. In the future we should handle
yajl v2 as well.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jon Ludlam [Mon, 10 Oct 2011 15:41:16 +0000 (16:41 +0100)]
tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one
The bit bugs are in ocaml vcpu affinity calls, and the off-by-one
error is in the ocaml console ring code
Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Jon Ludlam [Mon, 10 Oct 2011 15:41:16 +0000 (16:41 +0100)]
tools/ocaml: Remove log library from tools/ocaml/libs
The only user was oxenstored, which has had the relevant bits
merged in.
Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Jon Ludlam [Mon, 10 Oct 2011 15:41:16 +0000 (16:41 +0100)]
tools/ocaml: Remove the uuid library
The library was only minimally used, and was really rather redundant.
Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Jon Ludlam [Mon, 10 Oct 2011 15:37:07 +0000 (16:37 +0100)]
tools/ocaml: Rename the ocaml libraries
ocamlfind does not support namespaces, so to avoid
name clashes the module names have become longer.
Additionally, the xenstore and xenbus subdirs, which
contain several modules each, have been packed into
toplevel Xenstore and Xenbus modules.
[ Patch modified from that submitted, to update the .hgignore, and to
cope with intervening changes to mmap_stubs.c -iwj ]
Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Daniel De Graaf [Mon, 10 Oct 2011 10:21:51 +0000 (11:21 +0100)]
libxl: correctly parse disk "backendtype" field
The expression for backendtype was missing a comma.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Boris Ostrovsky [Mon, 10 Oct 2011 08:09:17 +0000 (10:09 +0200)]
x86/AMD: Remove AMD_ERRATUM_400 definition
AMD_ERRATUM_400 was used to determine whether the processor supports
Always Running APIC Counter (ARAT) feature in init_amd(). Now that
ARAT support is based solely on family number this macro is no longer
needed.
Keep it in comments section as an example in case we ever need to use
it for somethnig else.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Jan Beulich <jbeulich@suse.com>
Jan Beulich [Mon, 10 Oct 2011 07:21:32 +0000 (09:21 +0200)]
passthrough: update bus2bridge mapping as PCI devices get added/removed
This deals with two limitations at once: On device removal, the
mapping did not get updated so far at all, and hotplugged devices as
well as such not discoverable by Xen's initial bus scan (including the
case where a non-zero PCI segment wasn't accessible during Xen boot,
but became accessible after Dom0 validated access information against
ACPI data) wouldn't cause updates to the mapping either.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Kay, Allen M" <allen.m.kay@intel.com>
Jan Beulich [Fri, 7 Oct 2011 15:50:50 +0000 (17:50 +0200)]
VT-d: don't reject possibly valid DRHD or RMRR
If a non-zero PCI segment isn't accessible during Xen boot (because
firmware decided to not enter the necessary MMIO space into the E820
table), devices referred to on those segments through DRHD or RMRR
structures should not be rejected just because the devices can't be
found.
This is in line with what is being done in at least one other case
already: Systems with more than one PCI segment (usually high end
ones) are assumed to have valid firmware provided data, while systems
with just segment 0 continue to have their firmware tables validated.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Kay, Allen M" <allen.m.kay@intel.com>
Boris Ostrovsky [Fri, 7 Oct 2011 08:32:15 +0000 (10:32 +0200)]
x86/AMD: Do not enable ARAT feature on AMD processors below family 0x12
Determining whether an AMD processor is affected by erratum 400 may
have some corner cases and handling these cases is somewhat complicated.
In the interest of simplicity we won't claim ARAT support on processor
families below 0x12.
Daniel De Graaf [Thu, 6 Oct 2011 18:44:40 +0000 (19:44 +0100)]
libvchan: interdomain communications library
This library implements a bidirectional communication interface between
applications in different domains, similar to unix sockets. Data can be
sent using the byte-oriented libvchan_read/libvchan_write or the
packet-oriented libvchan_recv/libvchan_send.
Channel setup is done using a client-server model; domain IDs and a port
number must be negotiated prior to initialization. The server allocates
memory for the shared pages and determines the sizes of the
communication rings (which may span multiple pages, although the default
places rings and control within a single page).
With properly sized rings, testing has shown that this interface
provides speed comparable to pipes within a single Linux domain; it is
significantly faster than network-based communication.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Daniel De Graaf [Thu, 6 Oct 2011 18:38:01 +0000 (19:38 +0100)]
libxc: add xc_gntshr_* functions
These functions and the xc_gntshr device (/dev/xen/gntalloc on linux)
allow applications to create pages shared with other domains.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Daniel De Graaf [Thu, 6 Oct 2011 18:28:53 +0000 (19:28 +0100)]
libxc: add xc_gnttab_map_grant_ref_notify
Normally, when a userspace process mapping a grant crashes, the domain
providing the reference receives no indication that its peer has
crashed, possibly leading to unexpected freezes or timeouts. This
function provides a notification of the unmap by signalling an event
channel and/or clearing a specific byte in the page.
This also unifies the 3 very similar grant-mapping osdep interfaces into
a single function instead of introducing yet another minor variation.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Roger Pau Monne [Thu, 6 Oct 2011 18:11:51 +0000 (19:11 +0100)]
tools build: link to specific library version (libxs, libxl, xenstore, xenstat)
To avoid linking to unexpected copies (eg wrong versions) of xen
libraries, explicitly pass the linker the library file to link to.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 6 Oct 2011 17:50:22 +0000 (18:50 +0100)]
libxl: fix libxl_mac_to_device_nic
I think I broke this back in 22041:4c9ef5ec9146, using i as both the inner and
outer loop iterator.
I've added libxl__compare_macs which helps keep things clean.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 6 Oct 2011 17:49:41 +0000 (18:49 +0100)]
libxl: add and use parse_mac helper function
rather than open coding a bunch it a bunch of times.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Zheng Li [Thu, 6 Oct 2011 16:45:43 +0000 (17:45 +0100)]
tools: ocaml: Fix invalid memory access in OCaml mmap library
Fix invalid memory access in OCaml mmap library (to play nicely with the GC)
This was a bug reported by Roberto Di Cosmo. When he tried to reuse
the mmap library for his own project, Mmap.read occasionally got
different result when reading from the same map. This turned out to be
a bug in the binding, where a C pointer was created pointing to a
OCaml value, and the OCaml value was subsequently moved around by the
GC after memory allocation and hence invalidated the C pointer. This
patch removes the indirection of C pointer and uses OCaml macro to
access values directly.
Only Mmap.read function had this problem. The other functions, despite
having the same code style, didn't have memory allocation involved
hence wouldn't intrigue such an error. I've changed all of them to the
safer style for future proof. Directly casting OCaml value's *data
block* (rather than the value itself) as a C pointer is not a common
practice either, but I'll leave it as it is.
The bug hadn't occured on XenServer because XenServer didn't make use
of the Mmap.read function (except in one place for debugging). In
XenServer, most mmap operations were going through another pair of
separately implemented functions (Xs_ring.read/write).
Signed-off-by: Zheng Li <dev@zheng.li> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne [Thu, 6 Oct 2011 16:26:18 +0000 (17:26 +0100)]
libxl: create pci backend only when there are pci devices.
Creating empty pci entries made Linux DomUs under NetBSD Dom0 wait a very long time for devices to initialize during kernel boot.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne [Thu, 6 Oct 2011 16:24:36 +0000 (17:24 +0100)]
xenbackendd: fix incorrect usage of pidfile
Fix xenbackendd ignoring the pidfile passed through the command line.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 6 Oct 2011 16:18:38 +0000 (17:18 +0100)]
xl: wrap help output if command name is too long
Without this in the "xl help" line for pci-list-assignable-devices the command
name merges with the first word of the help. Since the bash completion support
parses "xl help" this leads to "pci-list-assignable-devicesList" being
presented as an option instead of the correct command name.
We also need to filter out lines which start with more than one space in the
bash completion support to stop "List" appearing as a possible command name
after the change to wrap it.
Doesn't address the fact that some help text overflows 80 columns.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 6 Oct 2011 15:19:46 +0000 (16:19 +0100)]
libxl: probe disk backend type in libxl_device_disk_add
Without this "xl block-attach" does not work. On create do_domain_create already
catches this.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 6 Oct 2011 15:19:03 +0000 (16:19 +0100)]
libxlu: correctly parse disk "backendtype" field
Currently it tries to parse the value from the full "backendtype=FOO" string
but really it needs to parse from the equals.
Before:
# xl -N block-attach d32-1 backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b
command line: config parsing error in disk specification: unknown value for backendtype: near `backendtype=phy' in `backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b'
After [in new syntax, not yet in this tree -iwj]:
# xl -N block-attach d32-1 backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b
disk: {
"backend_domid": 0,
"pdev_path": "/dev/VG/debian-x86_32-1b",
"vdev": "xvdb",
"backend": "phy",
"format": "raw",
"script": null,
"removable": 0,
"readwrite": 1,
"is_cdrom": 0
}
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 6 Oct 2011 15:15:33 +0000 (16:15 +0100)]
libxl: undo 23728:548b2826293e whitespace cleanup to autogenerated file
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Olaf Hering [Thu, 6 Oct 2011 11:33:17 +0000 (12:33 +0100)]
xenpaging: remove confusing comment from p2m_mem_paging_populate
Currently there is no way to avoid the double check of the p2mt
because p2m_mem_paging_populate() is called from many places without
the p2m_lock held. Upcoming changes will move the function into
gfn_to_mfn(), so its interface could be changed and the extra
p2m_lock/get_entry can be removed.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Olaf Hering [Thu, 6 Oct 2011 11:33:17 +0000 (12:33 +0100)]
xenpaging: use p2m->get_entry() in p2m_mem_paging functions
Use p2m->get_entry() in the p2m_mem_paging functions. This preserves the
p2m_access type when gfn is updated with set_p2m_entry().
Its also a preparation for locking fixes in a subsequent patch.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Currently the build produces lots of
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
This is due to the "grep -- $(2)" in cc-options. It seems that the
default of reading stdin is disabled when using "--". I don't know if
this is a bug in grep or how it is supposed to be but we can work
around it by explicitly passing in "-"
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Keir Fraser <keir@xen.org>