]> xenbits.xensource.com Git - xen.git/log
xen.git
10 years agoUse C xenstored with --disable-ocamltools
Olaf Hering [Fri, 10 Oct 2014 08:32:24 +0000 (10:32 +0200)]
Use C xenstored with --disable-ocamltools

When xen is configured with --disable-ocamltools then oxenstored will
still be the default if all required ocaml devel packages are installed.
The reason is that xenstored.m4 is included before the ocamltools check.
And xenstored.m4 does not use the result of --disable-ocamltools.

Rearrange the code to check first for the presence of ocaml, then check
--disable-ocamltools and finally decide what sort of xenstored should be
the default.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- ran autogen.sh as requested]

10 years agoAdjust helptext in m4/systemd.m4
Olaf Hering [Fri, 10 Oct 2014 07:19:48 +0000 (09:19 +0200)]
Adjust helptext in m4/systemd.m4

Use AS_HELP_STRING for proper formating, mention both options take a
directory, mention the default value, quote the arguments in brackets.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ijc -- ran autogen.sh as requested]
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoFix typo in m4/xenstored.m4
Olaf Hering [Thu, 9 Oct 2014 16:44:43 +0000 (18:44 +0200)]
Fix typo in m4/xenstored.m4

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ijc -- ran autogen.sh as requested]

10 years agostubdom: provide install-c target
Olaf Hering [Wed, 8 Oct 2014 13:57:42 +0000 (15:57 +0200)]
stubdom: provide install-c target

configure --enable-c-stubdom fails to build with 'make rpmball' because
no install target exists for it. Just provide it to fix build.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agoxen/arm: Use PSCI-0.2 for machine_halt/restart by default
Suravee Suthikulpanit [Fri, 3 Oct 2014 14:31:11 +0000 (09:31 -0500)]
xen/arm: Use PSCI-0.2 for machine_halt/restart by default

"machine_halt()" and "machine_restart()" are modified to use PSCI interface
by default if PSCI-0.2 is supported. The "raw_machine_reset()" is also removed
since this is unnecessary.

Also, machine_halt() is modified to add 10ms delay to make sure all auxiliary CPUs
are offlined before calling the shutdown.

For non-PSCI, platform_poweroff() and platform_reset() are used instead.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm: Initial support for PSCI-0.2
Suravee Suthikulpanit [Fri, 3 Oct 2014 14:31:10 +0000 (09:31 -0500)]
xen/arm: Initial support for PSCI-0.2

This patch adds SMC calls to suport a subset of PSCI-0.2 functions
(PSCI_VERSION, CPU_ON, SYSTEM_OFF, SYSTEM_RESET).

By default, the psci_init() will use PSCI-0.2. Otherwise, it will
use PSCI-0.1 if PSCI-0.2 fails or un-supported.

To add support for PSCI_VERSION, this patch replaces the "bool_t psci_available"
variable with "int psci_ver", which contains the PSCI_VERSION as described in the
PSCI-0.2 spec.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen: arm: Do not enable EFI in dom0 since it is not yet supported.
Suravee Suthikulpanit [Mon, 13 Oct 2014 16:17:10 +0000 (11:17 -0500)]
xen: arm: Do not enable EFI in dom0 since it is not yet supported.

Since EFI is not yet supported in dom0, we need to remove the following
properties from the chosen node:

  * linux,uefi-mmap-start
  * linux,uefi-mmap-size
  * linux,uefi-mmap-desc-size
  * linux,uefi-mmap-desc-ver

These are added by "arch/arm/efi/efi-boot.h: fdt_add_uefi_nodes()",
and used by dom0 kernel to enable EFI.

Cc: Julien Grall <julien.grall@linaro.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Roy Franz <roy.franz@linaro.org>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Roy Franz <roy.franz@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoRemove stray blexit()
Roy Franz [Mon, 13 Oct 2014 19:56:29 +0000 (12:56 -0700)]
Remove stray blexit()

A stray call to blexit() was in the normal processing path for handling
FDTs specified in the config file, causing the EFI boot code to
unconditionally exit.  Remove the blexit() call as it should never
have been here.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Tested-by: Vijaya Kumar K<Vijaya.Kumar@caviumnetworks.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agotools/hotplug: Removing of "all" dependency from "install" rule.
Anthony PERARD [Mon, 13 Oct 2014 14:31:36 +0000 (15:31 +0100)]
tools/hotplug: Removing of "all" dependency from "install" rule.

The "install" rules depends on both "all" and "subdirs-install" and
"all" depends on "subdirs-all". This leads the "install" rules to call
both "subdirs-all" and "subdirs-install" which create a race with two
concurrent `make` within the same directory (systemd) trying to make the
same things (xen.conf) and failing.

Ultimatly, "install" should only depend on the things it needs to
install, and not on "all".

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Tested-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoRevert "tools/hotplug: fix race during xen.conf creation"
Ian Campbell [Fri, 10 Oct 2014 08:35:34 +0000 (09:35 +0100)]
Revert "tools/hotplug: fix race during xen.conf creation"

This reverts commit eac3f5122fd4769b2885d8ad78bcbcf5df2472c1.

The "all" target should never depend on "install", it is supposed to only build
not install.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxenstore: extend the xenstore ring with a 'closing' signal
David Scott [Thu, 25 Sep 2014 14:58:41 +0000 (15:58 +0100)]
xenstore: extend the xenstore ring with a 'closing' signal

Hvmloader uses the xenstore ring and then tries to reset it back
to its initial state before booting the guest. Occasionally xenstored
will read the ring while it is being zeroed and conclude it has
been corrupted. This prevents PV drivers from loading in the guest.

This patch updates the xenstore ring protocol definition, enabling
a server to advertise additional features to the guest. One such feature
is defined: the ability to cleanly reset the ring including the
higher-level protocol, like an enhanced RESET_WATCHES for rings.

This patch implements the ring reconnection features in oxenstored
and hvmloader, fixing the bug.

This patch also defines an 'invalid' xenstore packet type and uses this
to poison the ring over a reconnect. This will make diagnosing this
bug much easier in future.

Signed-off-by: David Scott <dave.scott@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Jon Ludlam <jonathan.ludlam@citrix.com>
10 years agooxenstored: reduce syslog call overhead
Zheng Li [Thu, 25 Sep 2014 17:35:02 +0000 (18:35 +0100)]
oxenstored: reduce syslog call overhead

We noticed that, if configured to use syslog as the logging backend, every
single line of access logging (via the syslog C binding) will call stat on
/etc/localtime for 3 times. The rational behind this is probably to detect any
timezone changes over time.

This is a considerable cost we'd like to avoid, given the intensiveness of our
access logging --- we log almost every xenstore status change (for good
reason). Also a running Xen host is rarely a mobile environment, so the little
benefit can hardly justify the cost.

Setting up the TZ environment varialbe can avoid stat calls.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: add a safe net mechanism for existing ill-behaved clients
Zheng Li [Thu, 25 Sep 2014 17:35:01 +0000 (18:35 +0100)]
oxenstored: add a safe net mechanism for existing ill-behaved clients

In previous commit, we moved from exhaustively scanning all domain connections
to only processing those have correctly notified us by events. The benefits are
not only efficiency but also correctness, because it could potentially block an
ill-behaved client and have it waiting on its own mistake. If someone makes a
mistake on this when developing a piece of code, he/she would immediately
notice the problem (as the process being blocked), so that he/she could fix it
rightaway before anything else. Note that the chances of making such mistakes
are rare in reality, because most client code would use the libxenstore library
(which has all the notification logic built in correctly) instead of having to
implement raw accessing from scratch.

On the other hand, we did notice that there were some legacy code that didn't do
the notification correctly. As some code might be still running in wild, it
would be bad if they break by this change (e.g. after an upgrade). This patch
introduces a safe net mechanism to ensure ill-behaved clients continue to work,
but still retain most of the performance benefits here.

  * We add a checker to still scan all the rings periodically, so that we can
    still pick up these messages at an acceptable frequency.

  * Internally, we introduce an io_credit concept for domain connections. It
    represents the rounds of ring scan we are going to perform on a domain
    connection. For well-behaved connections, this value is changing between 0
    and 1; but for connections detected as ill-behaved, we'll bump its credit
    to a high value so that we'll unconditionally scan its ring for the next
    $n$ rounds. This way, the client won't hiccupped by the interval between
    checker's running (especially during periods when it continously interacts
    with oxenstored); and oxenstored doesn't have to keep scanning these
    rings indefinitely (with the credit running out), as they are usually quite
    most of the time.

  * We log an message when a domain connection is suspected as ill-behaved.
    Enable [info] level logging if you want/need to see it in action. Note that
    this information won't be accurate, as false positives are possible due to
    time window (e.g. we detect a client has written to the ring and we get no
    notificiation from it for the time being, but still the notification could
    potentially arrive at some time later). It's no harm to give a domain
    connection extra credit though.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: only process domain connections that notify us by events
Zheng Li [Thu, 25 Sep 2014 17:35:00 +0000 (18:35 +0100)]
oxenstored: only process domain connections that notify us by events

Currently, upon receiving an event, oxenstored will always scan/process all
the domain connections (xs rings), disregarding which domain sent that event.
This is rather costy and inefficient. It also shadows and indulges client
for not correctly communicating with us on message/space availability.

With this patch, oxenstore will only scan/process the domain connections
that have correctly notified us by events or have IO actions leftover from
previous communication.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: enable domain connection indexing based on eventchn port
Zheng Li [Thu, 25 Sep 2014 17:34:59 +0000 (18:34 +0100)]
oxenstored: enable domain connection indexing based on eventchn port

Currently in xenstore connection database,  we use a hash table of
(domid -> connection) to store domain connections. This allows fast indexing
based on dom ids.

This patch adds another dimention of fast indexing that is based on eventchn
port number. This is useful when doing selective connection processing
based on the port numbers of incoming events.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: use hash table to store socket connections
Zheng Li [Thu, 25 Sep 2014 17:34:58 +0000 (18:34 +0100)]
oxenstored: use hash table to store socket connections

Currently we use list to store socket connections. This is fine for smaller
number of connections. But when we scale up, traveling through a list of
hundreds or thousands of connections just to find a single one of them is very
low efficient.

This patch replaces the list with a (Unix.file_descr -> Connection.t) hash table.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: catch the error when a connection is already deleted
Zheng Li [Thu, 25 Sep 2014 17:34:57 +0000 (18:34 +0100)]
oxenstored: catch the error when a connection is already deleted

The function process_fdset_with is called on the read set connections first.
During the process, it might destroy a connection and remove it from the
connections database if some errors occur. However, a reference to the same
connection might still exist in the write set, which is awaiting to be
processed next. In this case, a Not_found error will be raised and the process
is aborted.

This patch changes the logic to ignore connections just missing from the
connection database and continue the rest part of the work.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: add a --use-select command line flag
Zheng Li [Thu, 25 Sep 2014 17:34:56 +0000 (18:34 +0100)]
oxenstored: add a --use-select command line flag

This allows to fall back to the original Unix.select if preferred. It could be
useful for debugging purposes too.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: add facilities to raise the max open fds uplimit
Zheng Li [Thu, 25 Sep 2014 17:34:55 +0000 (18:34 +0100)]
oxenstored: add facilities to raise the max open fds uplimit

To go beyond 1024 fds, we also need to raise the process limitation on max
open fds (usually defaults to 1024).

We need to know the system level max open fds so that we won't go above that.
Simply setting the limit to RLIM_INFINITY doesn't work on Linux 3.x (EPERM), a
patch on this went into the 2.x branch but not 3.x for some reason.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agooxenstored: add a poll-based select mechanism
Zheng Li [Thu, 25 Sep 2014 17:34:54 +0000 (18:34 +0100)]
oxenstored: add a poll-based select mechanism

Currently, oxenstored uses Unix.select underneath, so it doesn't work properly
if given a FD number >= 1024. This is a scalability bottleneck for hosts
running large number of VMs.

To remove this limitation, we implemented a poll-based mechanism but with the
same type signature as the Unix.select currently in use. So these two functions
can be interchangeable at any stage.

Signed-off-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
10 years agotools/ocaml: Gate building tests on CONFIG_TESTS
Andrew Cooper [Tue, 7 Oct 2014 11:02:10 +0000 (12:02 +0100)]
tools/ocaml: Gate building tests on CONFIG_TESTS

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: David Scott <dave.scott@eu.citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
10 years agotools/xenstore: Only create SBINDIR if it is to be used
Andrew Cooper [Tue, 7 Oct 2014 11:02:09 +0000 (12:02 +0100)]
tools/xenstore: Only create SBINDIR if it is to be used

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agotools/xenstore: Introduce clients-install target
Andrew Cooper [Tue, 7 Oct 2014 11:02:08 +0000 (12:02 +0100)]
tools/xenstore: Introduce clients-install target

...to match the existing 'clients' built target.  This is particularly useful
when rebuilding the xenstore clients separately for a non-dom0 environment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agogitignore: Cleanup
Andrew Cooper [Tue, 7 Oct 2014 11:02:07 +0000 (12:02 +0100)]
gitignore: Cleanup

This is a rough pruning based mainly on directories which no longer exist.
Some of this was code deleted in 2007.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Keir Fraser <keir@xen.org>
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoRemove dead qemu code from toplevel Makefile
Olaf Hering [Wed, 8 Oct 2014 07:41:27 +0000 (09:41 +0200)]
Remove dead qemu code from toplevel Makefile

After commit b0f69ec5c71de1248d915c193b57c43e786857dd ("tools: Make
qemu-xen-traditional build optional.") the existing make targets are
wrapped in ifeq ($(CONF),y), but CONF is never set because
config/Tools.mk is not included.

Drop the dead code. The same effect can be achieved by calling the make
commands directly, after calling configure.

A better approach would be a simple, single 'make $something' which
should be a wrapper around a targets in tools/Makefile that clones,
updates and cleans the subprojects. That has to be worked out in a
different patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agostubdom: another for fix for lwip compile
Olaf Hering [Tue, 7 Oct 2014 14:15:46 +0000 (16:15 +0200)]
stubdom: another for fix for lwip compile

stubdom/lwip-x86_64/src/core/dhcp.c: In function 'dhcp_create_request':
stubdom/lwip-x86_64/src/core/dhcp.c:1361:64: error: array subscript is above array bounds

The previous attempt to fix the failure above worked fine in SLE11,
openSUSE 13.1 and newer. But gcc-4.5 as included in openSUSE 11.4 still
failed to compile. To fix compilation also with this version of gcc move
the range check right into the code instead of assigning it to a
temporary variable.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agotools/ocaml: use APPEND_CFLAGS and APPEND_LDFLAGS
Olaf Hering [Mon, 6 Oct 2014 13:22:40 +0000 (15:22 +0200)]
tools/ocaml: use APPEND_CFLAGS and APPEND_LDFLAGS

While implementing the --enable-rpath change I noticed that a ocaml
build does not use APPEND_LDFLAGS. Make use of APPEND_CFLAGS and
APPEND_LDFLAGS as it is done already in other places.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: David Scott <dave.scott@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave.scott@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoconfig: remove unused MSGFMT and MSGMERGE
Olaf Hering [Tue, 7 Oct 2014 14:04:06 +0000 (16:04 +0200)]
config: remove unused MSGFMT and MSGMERGE

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoFix comment typo in m4/paths.m4
Olaf Hering [Tue, 7 Oct 2014 08:51:31 +0000 (10:51 +0200)]
Fix comment typo in m4/paths.m4

Please rerun autogen.sh after applying this patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agostubdom: remove references to xend from README
Olaf Hering [Mon, 6 Oct 2014 13:42:53 +0000 (15:42 +0200)]
stubdom: remove references to xend from README

.. the xl part of the config is right above the removed lines.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agotools: remove references to xend-config.sxp
Olaf Hering [Mon, 6 Oct 2014 13:37:49 +0000 (15:37 +0200)]
tools: remove references to xend-config.sxp

xend is gone. Remove references to its config file.
Also remove python script sxp-pretty which relies on removed code.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agotools/tests: remove code using xend
Olaf Hering [Mon, 6 Oct 2014 14:25:28 +0000 (16:25 +0200)]
tools/tests: remove code using xend

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agotools/hotplug: update rc.d dependency for NetBSD
Olaf Hering [Mon, 6 Oct 2014 13:55:26 +0000 (15:55 +0200)]
tools/hotplug: update rc.d dependency for NetBSD

While searching remaining xend strings I noticed that xen-domains wants
xencommons as dependency now.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agolibxl: Fix error handling in libxl_userdata_unlink
Ian Jackson [Wed, 24 Sep 2014 14:22:08 +0000 (15:22 +0100)]
libxl: Fix error handling in libxl_userdata_unlink

Previously:
  * rc would not be set before leaving the function, with the
    result that an uninitialised value would be returned
  * failures of libxl__userdata_path would result in a NULL dereference
  * failures of unlink() would not be usefully logged

This appears to be due to an attempt to avoid having to repeat the
call to libxl__unlock_domain_userdata by informally sharing parts of
the success and failure paths.

Change to use the canonical error-handling style:
  * Initialise lock to 0.
  * Do the unlock in the `out' section - always attempt to unlock
    lock if it is non-0.
  * Explicitly set rc and `goto out' on all error paths, even
    those right at the end of the function.
  * Add an error check for filename = libxl__userdata_path(...);

Coverity-ID: 12402371240235.
CC: Wei Liu <wei.liu2@citrix.com>
CC: coverity@xenproject.org
Reviewed-by: Andrew Cooper<andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
10 years agomove vtpmmgr helpers from tools to stubdom
Olaf Hering [Wed, 1 Oct 2014 16:41:29 +0000 (18:41 +0200)]
move vtpmmgr helpers from tools to stubdom

Tools.mk contains a dead CONFIG_VTPM, @vtpm@ is never expanded because
@vtpm@ is only known by stubdom/configure.ac. Move the two perl scripts
to stubdom/vtpmmgr and install them as executeable. This was introduced
by the recent commit ffa11862aa431494e809c6e99f7358c12cb67e44 ("vtpmmgr:
add example control tools")
Also remove vtpm= from config/Stubdom.mk because vtpm= is (appearently)
not used by make itself.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agotools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen
Olaf Hering [Wed, 1 Oct 2014 16:41:28 +0000 (18:41 +0200)]
tools/hotplug: Use XEN_RUN_DIR instead of /var/run/xen

Also remove duplicate XEN_RUN_DIR from m4/paths.m4.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agotools: use XEN_LIB_STORED instead of /var/lib/xenstored
Olaf Hering [Wed, 1 Oct 2014 16:41:27 +0000 (18:41 +0200)]
tools: use XEN_LIB_STORED instead of /var/lib/xenstored

Remove hardcoded /var/lib/xenstored instead of using the existing
XEN_LIB_STORED variable.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoUse Paths.mk for docs, stubdom and tools build
Olaf Hering [Wed, 1 Oct 2014 16:41:26 +0000 (18:41 +0200)]
Use Paths.mk for docs, stubdom and tools build

Paths.mk contains just directories set by configure.
Source this file first when building docs,stubdom or tools.
Remove unused path variables from $subsystem.mk.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agotools: remove private copies of includedir and libdir from libxenstat
Olaf Hering [Wed, 1 Oct 2014 16:41:25 +0000 (18:41 +0200)]
tools: remove private copies of includedir and libdir from libxenstat

They are wrong and unused.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoMake XENFIRMWAREDIR a subdir of libexecdir
Olaf Hering [Wed, 1 Oct 2014 16:41:24 +0000 (18:41 +0200)]
Make XENFIRMWAREDIR a subdir of libexecdir

Put the firmware files below libexecdir. This is essentially just a new
name for the existing path. It has the benefit that it can be configured
via --libexecdir= if required.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoAdd configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR
Olaf Hering [Wed, 1 Oct 2014 16:41:23 +0000 (18:41 +0200)]
Add configure --with-sysconfig-leaf-dir=SUBDIR to set CONFIG_LEAF_DIR

Set CONFIG_LEAF_DIR with configure to give control if needed. The
check for the correct value if the option is not specified is tricky.
Since other packages (such as grub2) started to populate also
/etc/default/ a given system may have both directories.
Use "default" only if /etc/sysconfig does not exist. "sysconfig"
remains the default.

Move the variable from StdGNU.mk to Linux.mk because thats the only
place where it is used.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoMove variable to set bash_completion.d to Paths.mk
Olaf Hering [Wed, 1 Oct 2014 16:41:22 +0000 (18:41 +0200)]
Move variable to set bash_completion.d to Paths.mk

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoAdd configure --with-linux-backend-modules="mod1 mod2"
Olaf Hering [Wed, 1 Oct 2014 16:41:21 +0000 (18:41 +0200)]
Add configure --with-linux-backend-modules="mod1 mod2"

This replaces config/Linux.modules with a configure option. As a result
of this change only a single xencomons.in is required, instead of a
xencomons.in.in and sed hackery.

After this change blktap2 and blktap will be loaded at the same time.
This is already done in out-of-tree xencommons scripts, and systemd will
load both modules as well. No harm is expected by loading both modules.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoAdd configure --enable-rpath
Olaf Hering [Wed, 1 Oct 2014 16:41:20 +0000 (18:41 +0200)]
Add configure --enable-rpath

This fixes the tools when xen is configured with --prefix=/odd/path

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoUse configure --localstatedir=BASEDIR to set path to /var
Olaf Hering [Wed, 1 Oct 2014 16:41:19 +0000 (18:41 +0200)]
Use configure --localstatedir=BASEDIR to set path to /var

This is helpful to test make uninstall with --prefix=/private/dir as
unprivileged user. No change in behaviour is expected by this change.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoUse configure --prefix=DIR to set PREFIX
Olaf Hering [Wed, 1 Oct 2014 16:41:18 +0000 (18:41 +0200)]
Use configure --prefix=DIR to set PREFIX

PREFIX is set by configure --prefix=DIR, nothing outside
tools,docs,stubdom is using this variable.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoUse configure --libexecdir=BASEDIR to set LIBEXEC
Olaf Hering [Wed, 1 Oct 2014 16:41:17 +0000 (18:41 +0200)]
Use configure --libexecdir=BASEDIR to set LIBEXEC

The current usage of LIBEXEC is bogus. It describes the directory for
private xen executables. Other places create their own, similar
libexecdir path as $prefix/lib/xen/*.

Additional two other variables are used to describe similar paths:
PRIVATE_BINDIR and PRIVATE_PREFIX

The autoconf documentation refers to libexec as a directory for
executables and stuff which is called by other programs, not by the
user.

Adjust all places that want libexecdir as a target path. LIBEXEC refers
now to the base directory. Three convenience variables are used to refer
to paths to private binaries, libs and include files.

In the systemd files LIBEXEC_BIN is substituted, so this variable has to
be present in autoconf. All other variables are expanded in Paths.mk
because they are only used in Makefiles.

Most users of LIBEXEC are updated to use LIBEXEC_BIN because that is
what they want.

Users of PRIVATE_BINDIR are updated to use LIBEXEC_BIN because that is
what they want. PRIVATE_BINDIR and PRIVATE_PREFIX usage is removed by
this patch, in favour of LIBXEC_BIN and LIBEXEC

An internal libxl function was removed. A single helper to retrieve
LIBEXEC_BIN remains.

As suggested by the autoconf documentation, configure appends the
package name to LIBEXEC to make sure the provided directory really
refers to xen. This makes sure "make uninstall" preserves the real
libexecdir.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested, updated QEMU_TRADITIONAL_REVISION to
         pickup version which uses LIBEXEC_BIN ]

10 years agoUse configure --includedir=DIR to set INCLUDEDIR
Olaf Hering [Wed, 1 Oct 2014 16:41:16 +0000 (18:41 +0200)]
Use configure --includedir=DIR to set INCLUDEDIR

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoUse configure --docdir=DIR to set DOCDIR
Olaf Hering [Wed, 1 Oct 2014 16:41:15 +0000 (18:41 +0200)]
Use configure --docdir=DIR to set DOCDIR

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoUse configure --mandir=DIR to set MANDIR
Olaf Hering [Wed, 1 Oct 2014 16:41:14 +0000 (18:41 +0200)]
Use configure --mandir=DIR to set MANDIR

Also move common MAN8DIR and MAN1DIR to Paths.mk.in

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agotools: substitute bindir instead of BINDIR
Olaf Hering [Wed, 1 Oct 2014 16:41:13 +0000 (18:41 +0200)]
tools: substitute bindir instead of BINDIR

... and same for sbindir and libdir.
Expand usage of exec_prefix so that it does not appear in substituted
variables in systemd files.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Akced-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoSubstitue configure variables in Paths.mk.in
Olaf Hering [Wed, 1 Oct 2014 16:41:12 +0000 (18:41 +0200)]
Substitue configure variables in Paths.mk.in

This patch lays the groundwork to convert variables used in Makefiles
to the common automake style, i.e. PREFIX becomes prefix, MANDIR becomes
mandir and so on.

The reason is that configure variables such as mandir expand to
${datarootdir}/man, and datarootdir expands to ${prefix}/share. This
requires extra expansion in configure.ac before assigning to MANDIR.

Special care must be taken when variable substition is done in other
files, such as xencommons.in. All @VARIABLES@ used in these files have
to be the expanded version, or all other variables must be available at
runtime.

This patch by itself changes nothing, but upcoming changes will make use
of the lowercase variables.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoremove duplicate variables from config
Olaf Hering [Wed, 1 Oct 2014 16:41:11 +0000 (18:41 +0200)]
remove duplicate variables from config

... because they are already in Paths.mk:
BINDIR, LIBEXEC, PRIVATE_BINDIR, PRIVATE_PREFIX, SBINDIR, SHAREDIR,
XEN_CONFIG_DIR, XENFIRMWAREDIR, XEN_LOCK_DIR, XEN_PAGING_DIR,
XEN_RUN_DIR. Remove unused PKG_XEN_PREFIX, which was also incorrectly
assigned to PRIVATE_PREFIX.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agotools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD
Olaf Hering [Wed, 1 Oct 2014 16:41:10 +0000 (18:41 +0200)]
tools/hotplug: substitute XEN_SCRIPT_DIR on FreeBSD

Also remove DESTDIR from the path, this was most likely not intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agotools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d
Olaf Hering [Wed, 1 Oct 2014 16:41:09 +0000 (18:41 +0200)]
tools/hotplug: use INITD_DIR instead of CONFIG_DIR/init.d|rc.d

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agotools/configure.ac: sort AC_CONFIG_FILES
Olaf Hering [Wed, 1 Oct 2014 16:41:08 +0000 (18:41 +0200)]
tools/configure.ac: sort AC_CONFIG_FILES

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agotools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path
Olaf Hering [Wed, 1 Oct 2014 16:41:07 +0000 (18:41 +0200)]
tools/hotplug: use XEN_SCRIPT_DIR instead of hardcoded path

Helper scripts get installed into XEN_SCRIPT_DIR, but initscripts,
helper scripts and udev rules still refer to the hardcoded location
/etc/xen/scripts/. Update scripts, rules and Makefile to refer to
@XEN_SCRIPT_DIR@ instead.

Update configure.ac to substitute the path in files using
XEN_SCRIPT_DIR. Remove XEN_SCRIPT_DIR from StdGNU.mk and SunOS.mk, its
already in Paths.mk.

Note: In SunOS.mk it refered to PRIVATE_PREFIX, which was introduced by
9f6d07bac9f14aaa8bafe38b4a217e61a3a57842 ("tools: get rid of hardcoded
config dirs").

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agoAdd configure --with-initddir=DIR
Olaf Hering [Wed, 1 Oct 2014 16:41:06 +0000 (18:41 +0200)]
Add configure --with-initddir=DIR

Preserve existing behaviour: Fedora gets rc.d/init.d, BSD gets rc.d,
everyone else gets init.d.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- ran autogen.sh as requested ]

10 years agotools/python: use also LDFLAGS for build
Olaf Hering [Wed, 1 Oct 2014 16:41:05 +0000 (18:41 +0200)]
tools/python: use also LDFLAGS for build

An upcoming change will pass -Wl,-rpath to xc.so. Make sure such LDFLAGS
will be used for python libs.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agotools/hotplug: fix race during xen.conf creation
Olaf Hering [Wed, 1 Oct 2014 16:41:04 +0000 (18:41 +0200)]
tools/hotplug: fix race during xen.conf creation

A make -j8 will call the xen.conf rule twice. The move-if-changed
macro may fail if the tmp file was already removed by the other make
process. Fix this by let the all target depend on install.
Also remove the generated file with make clean.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
[ ijc -- fixed s/of/if/ typo in commit message ]

10 years agotools: fix make uninstall
Olaf Hering [Wed, 1 Oct 2014 16:41:03 +0000 (18:41 +0200)]
tools: fix make uninstall

The uninstall target does not know about the paths it removes because
the toplevel Makefile does not include the required files.

Move the commands to tools/Makefile because all files come from subdirs
in tools/ anyway. Drop the removal of $(XEN_RUN_DIR) because it gets
created at runtime. Drop the removal of systemd related files because
the wildcard matches everything.

The proper fix is to remove the files and directories in the Makefiles
which install them. But this version is the least intrusive change at
this point.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
10 years agoautoconf: autogen.sh after 622e837570f4 "autoconf: add libnl3 dependency ..."
Ian Campbell [Mon, 6 Oct 2014 14:47:17 +0000 (15:47 +0100)]
autoconf: autogen.sh after 622e837570f4 "autoconf: add libnl3 dependency ..."

It appears this was forgotten.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoMerge branch 'staging' of xenbits.xen.org:/home/xen/git/xen into staging
Jan Beulich [Mon, 6 Oct 2014 13:47:12 +0000 (15:47 +0200)]
Merge branch 'staging' of xenbits.xen.org:/home/xen/git/xen into staging

10 years agoRevert "x86/vlapic: don't silently accept bad vectors" - it
Jan Beulich [Mon, 6 Oct 2014 13:45:51 +0000 (15:45 +0200)]
Revert "x86/vlapic: don't silently accept bad vectors" - it
appears to cause reboot issues for Win7 guests.

This reverts commit 0a43c50cb0c55d2f770b69d9452c994d9f2cdd84.

10 years agoxen/arm: check on domain type against hardware support
Vijaya Kumar K [Fri, 26 Sep 2014 05:58:47 +0000 (11:28 +0530)]
xen/arm: check on domain type against hardware support

Some arm64 platforms implement only aarch64 mode. So allow
domains that are only 64-bit

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- s/cpu_has_a32/cpu_has_arm/ as discussed on list ]

10 years agolibxl.c:return val of libxl_wait_for_memory_target
Ayush Ruia [Mon, 6 Oct 2014 08:12:26 +0000 (03:12 -0500)]
libxl.c:return val of libxl_wait_for_memory_target

Fixed the return value of the function libxl_wait_for_memory_target. It was always returning 0 even inthe case of an error.

Signed-off-by: Ayush Ruia <ayushruia@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
10 years agoxen/arm: Deliver interrupts to vcpu specified in IROUTER
Stefano Stabellini [Fri, 26 Sep 2014 15:53:15 +0000 (16:53 +0100)]
xen/arm: Deliver interrupts to vcpu specified in IROUTER

In GICv3 use IROUTER register contents to deliver irq to
specified vcpu.

vgic irouter[irq] is used to represent vcpu number for which
irq affinity is assigned. Bit[31] is used to store IROUTER
bit[31] value to represent irq mode.

This patch is similar to Stefano's commit
5b3a817ea33b891caf7d7d788da9ce6deffa82a1 for GICv2

Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
10 years agoxen/arm: Add p2m_set_permission and p2m_shatter_page helpers.
Tamas K Lengyel [Mon, 29 Sep 2014 15:55:13 +0000 (17:55 +0200)]
xen/arm: Add p2m_set_permission and p2m_shatter_page helpers.

Signed-off-by: Tamas K Lengyel <tklengyel@sec.in.tum.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
10 years agoxsm: add CMT related xsm policies
Dongxiao Xu [Mon, 6 Oct 2014 10:45:09 +0000 (12:45 +0200)]
xsm: add CMT related xsm policies

Add xsm policies for CMT related hypercalls.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86: add CMT related MSRs in allowed list
Dongxiao Xu [Mon, 6 Oct 2014 10:44:23 +0000 (12:44 +0200)]
x86: add CMT related MSRs in allowed list

Tool stack will try to access the two MSRs to perform CMT
related operations, thus added them in the allowed list.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86: enable CMT for each domain RMID
Dongxiao Xu [Mon, 6 Oct 2014 10:43:20 +0000 (12:43 +0200)]
x86: enable CMT for each domain RMID

If the CMT service is attached to a domain, its related RMID
will be set to hardware for monitoring when the domain's vcpu is
scheduled in. When the domain's vcpu is scheduled out, RMID 0
(system reserved) will be set for monitoring.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86: collect global CMT information
Dongxiao Xu [Mon, 6 Oct 2014 10:42:32 +0000 (12:42 +0200)]
x86: collect global CMT information

This implementation tries to put all policies into user space, thus some
global CMT information needs to be exposed, such as the total RMID count,
L3 upscaling factor, etc.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86: dynamically attach/detach CMT service for a guest
Dongxiao Xu [Mon, 6 Oct 2014 10:39:11 +0000 (12:39 +0200)]
x86: dynamically attach/detach CMT service for a guest

Add hypervisor side support for dynamically attach and detach
Cache Monitoring Technology(CMT) services for a certain guest.

When attach CMT service for a guest, system will allocate an
RMID for it. When detach or guest is shutdown, the RMID will be
recycled for future use.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86: detect and initialize Cache Monitoring Technology feature
Dongxiao Xu [Mon, 6 Oct 2014 10:36:51 +0000 (12:36 +0200)]
x86: detect and initialize Cache Monitoring Technology feature

Detect Cache Monitoring Technology(CMT) feature and enumerate the
resource types, one of which is to monitor the L3 cache occupancy.

Also introduce a Xen command line parameter to control the Platform
Shared Resource such as CMT.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agolibxc: provide interface for generic resource access
Dongxiao Xu [Mon, 6 Oct 2014 10:35:55 +0000 (12:35 +0200)]
libxc: provide interface for generic resource access

Xen added a new platform_op hypercall for generic MSR access, and this
is the the tool side change to wrapper the hypercall into xc APIs.

For non-preemptible batch resource operations, group them in entries of
xc_resource_op structure. For preemptible ones, use multiple
xc_resource_op structure instead.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agoxsm: add resource operation related xsm policy
Dongxiao Xu [Mon, 6 Oct 2014 10:29:16 +0000 (12:29 +0200)]
xsm: add resource operation related xsm policy

Add xsm policies for resource access related hypercall, such as MSR
access, port I/O read/write, and other related resource operations.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86: add generic resource (e.g. MSR) access hypercall
Dongxiao Xu [Mon, 6 Oct 2014 10:28:09 +0000 (12:28 +0200)]
x86: add generic resource (e.g. MSR) access hypercall

Add a generic resource access hypercall for tool stack or other
components, e.g., accessing MSR, port I/O, etc.

The resource is abstracted as a resource address/value pair.
The resource access can be any type of XEN_RESOURCE_OP_*(current
only support MSR and it's white-listed). The resource operations
are always runs on cpu that caller specified. If caller does not
care this, it should use current cpu to eliminate the IPI overhead.

Batch resource operations in one call are also supported but the
max number currently is limited to 2. The operations in a batch are
non-preemptible and execute in their original order. If preemptible
batch is desirable, then multicall mechanism can be used.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agox86/paging: make log-dirty operations preemptible
Jan Beulich [Mon, 6 Oct 2014 09:22:04 +0000 (11:22 +0200)]
x86/paging: make log-dirty operations preemptible

Both the freeing and the inspection of the bitmap get done in (nested)
loops which - besides having a rather high iteration count in general,
albeit that would be covered by XSA-77 - have the number of non-trivial
iterations they need to perform (indirectly) controllable by both the
guest they are for and any domain controlling the guest (including the
one running qemu for it).

Note that the tying of the continuations to the invoking domain (which
previously [wrongly] used the invoking vCPU instead) implies that the
tools requesting such operations have to make sure they don't issue
multiple similar operations in parallel.

Note further that this breaks supervisor-mode kernel assumptions in
hypercall_create_continuation() (where regs->eip gets rewound to the
current hypercall stub beginning), but otoh
hypercall_cancel_continuation() doesn't work in that mode either.
Perhaps time to rip out all the remains of that feature?

This is part of CVE-2014-5146 / XSA-97.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
10 years agodocs, amd_ucode: add AMD container file format notes
Aravind Gopalakrishnan [Mon, 6 Oct 2014 09:21:15 +0000 (11:21 +0200)]
docs, amd_ucode: add AMD container file format notes

This patch introduces documentation notes about AMD container
file formats and where to obtain latest container files from.

Also, We provide a how-to for updating patch level by
concatenating container files along with initrd images.
Misc notes about how Xen handles two containers of same
kind (if/when) they are concatenated together are also included.

Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
10 years agoAMD/guest_iommu: properly disable guest iommu support
Andrew Cooper [Mon, 6 Oct 2014 09:20:12 +0000 (11:20 +0200)]
AMD/guest_iommu: properly disable guest iommu support

AMD Guest IOMMU support was added to allow correct use of PASID and PRI
hardware support with an ATS-aware guest driver.

However, support cannot possibly function as guest_iommu_set_base() has no
callers.  This means that its MMIO region's P2M pages are not set to
p2m_mmio_dm, preventing any invocation of the MMIO read/write handlers.

c/s fd186384 "x86/HVM: extend LAPIC shortcuts around P2M lookups" introduces a
path (via hvm_mmio_internal()) where iommu_mmio_handler claims its MMIO range,
and causes __hvm_copy() to fail with HVMCOPY_bad_gfn_to_mfn.

iommu->mmio_base defaults to 0, with a range of 8 pages, and is unilaterally
enabled in any HVM guests when the host IOMMU(s) supports any extended
features.

Unfortunately, HVMLoader's AP boot trampoline executes an `lmsw` instruction
at linear address 0x100c which unconditionally requires emulation.  The
instruction fetch in turn fails as __hvm_copy() fails with
HVMCOPY_bad_gfn_to_mfn.

The result is that multi-vcpu HVM guests do not work on newer AMD hardware, if
IOMMU support is enabled in the BIOS.

Change the default mmio_base address to ~0ULL.  This prevents
guest_iommu_mmio_range() from actually claiming any physical range
whatsoever, which allows the emulation of `lmsw` to succeed.

Reported-by: Roberto Luongo <rluongo@ready.it>
Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Roberto Luongo <rluongo@ready.it>
Acked-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
10 years agox86: favor function parameter over global in construct_dom0()
Jan Beulich [Mon, 6 Oct 2014 09:15:37 +0000 (11:15 +0200)]
x86: favor function parameter over global in construct_dom0()

There's no reason to use the "hardware_domain" variable anywhere here,
making the code more cumbersome to read.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
10 years agodon't allow Dom0 access to IOMMUs' MMIO pages
Jan Beulich [Mon, 6 Oct 2014 09:15:01 +0000 (11:15 +0200)]
don't allow Dom0 access to IOMMUs' MMIO pages

Just like for LAPIC, IO-APIC, MSI, and HT we shouldn't be granting Dom0
access to these. This implicitly results in these pages also getting
marked reserved in the machine memory map Dom0 uses to determine the
ranges where PCI devices can have their MMIO ranges placed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
10 years agox86: restore reserving of IO-APIC pages in XENMEM_machine_memory_map output
Jan Beulich [Mon, 6 Oct 2014 09:13:19 +0000 (11:13 +0200)]
x86: restore reserving of IO-APIC pages in XENMEM_machine_memory_map output

Commit d1222afda4 ("x86: allow Dom0 read-only access to IO-APICs") had
an unintended side effect: By no longer adding IO-APIC pages to Dom0's
iomem_caps these also no longer get reported as reserved in the machine
memory map presented to it (which got added there intentionally by
commit b8a456caed ["x86: improve reporting through
XENMEM_machine_memory_map"] because many BIOSes fail to add these).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
10 years agox86/MSI: fix MSI-X case of freeing IRQ
Jan Beulich [Mon, 6 Oct 2014 09:11:28 +0000 (11:11 +0200)]
x86/MSI: fix MSI-X case of freeing IRQ

Commit d1b6d0a024 ("x86: enable multi-vector MSI") went a little too
far with moving things around in msi_free_irqs() in order to streamline
the code: We shouldn't drop the MSI-X control page reference before
calling destroy_irq(), as the latter will call us back via
desc->handler->shutdown() (effectively invoking to msi_set_mask_bit()).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
10 years agoamd/seattle: Initial revision of AMD Seattle support
Suravee Suthikulpanit [Fri, 3 Oct 2014 14:16:08 +0000 (09:16 -0500)]
amd/seattle: Initial revision of AMD Seattle support

This patch add initial (minimal) platform support for AMD Seattle,
which mainly just define the matching ID, and specify system_off,
and system_reset mechanism.

Initially, the firmware only support a subset of PSCI-0.2 functions,
system-off and system-reset. The mechanism for bring up auxiliary processors
is still using spin-table.

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm: Fix crash if last memory section is bigger than 1gb
Frediano Ziglio [Thu, 2 Oct 2014 15:16:37 +0000 (16:16 +0100)]
xen/arm: Fix crash if last memory section is bigger than 1gb

On arm32 the xenheap has a maximum size of 1GB. On systems with more than 8GB
(so 1/8 total RAM is greater than 1GB) there is no point in searching for a
region with 1/8 of the total RAM when only 1GB will be used. Therefore limit
the maximum size to 1GB before searching.

Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- updated commit message as discussed ]

10 years agoamd/seattle: Add early printk message for the platform
Suravee Suthikulpanit [Thu, 2 Oct 2014 21:25:34 +0000 (16:25 -0500)]
amd/seattle: Add early printk message for the platform

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agogicv2: Add compatibility id for gic-400
Suravee Suthikulpanit [Thu, 2 Oct 2014 21:25:33 +0000 (16:25 -0500)]
gicv2: Add compatibility id for gic-400

Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm: add support for early printk for HiSilicon D01 platform
Frediano Ziglio [Thu, 2 Oct 2014 15:48:53 +0000 (16:48 +0100)]
xen/arm: add support for early printk for HiSilicon D01 platform

This platform use a standard 8250 device on port 0xe4007000.

Signed-off-by: Frediano Ziglio <frediano.ziglio@huawei.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm/docs: Document Broadcom 7445D0 early printk support
Jon Fraser [Thu, 2 Oct 2014 22:16:54 +0000 (18:16 -0400)]
xen/arm/docs: Document Broadcom 7445D0 early printk support

Use CONFIG_EARLY_PRINTK=brcm for Broadcom 7445D0 based boards.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm: Add support for Broadcom 7445D0 A15 platform.
Jon Fraser [Thu, 2 Oct 2014 22:16:53 +0000 (18:16 -0400)]
xen/arm: Add support for Broadcom 7445D0 A15 platform.

This code supports the Broadcom 7445D0 32-bit A15 based platform.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm: Update early print console UART address for Broadcom 7445D0.
Jon Fraser [Thu, 2 Oct 2014 22:16:52 +0000 (18:16 -0400)]
xen/arm: Update early print console UART address for Broadcom 7445D0.

The console UART address changed between chip versions C0 and D0.
Broadcom 7445[ABC]0 versions were not released and are not supported.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
10 years agoxen/arm: Broadcom 7445D0 ARM cpu support.
Jon Fraser [Thu, 2 Oct 2014 22:16:51 +0000 (18:16 -0400)]
xen/arm: Broadcom 7445D0 ARM cpu support.

Relax cpu id mask to cover minor cpu revisions in the SoC versions.

Signed-off-by: Jon Fraser <jfraser@broadcom.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
10 years agox86/APIC: don't make wrong implications on constants
Jan Beulich [Thu, 2 Oct 2014 15:03:04 +0000 (17:03 +0200)]
x86/APIC: don't make wrong implications on constants

For the physical APIC, oprofile code was abusing APIC_DM_NMI as a mask.

For the virtual APIC, a wrong assumption was made that LVTPC could be
programmed to only fixed or NMI delivery modes. While other modes are
invalid here, we still shouldn't inject an NMI into the guest in such
a case. Instead just do nothing.

In the course of adjusting this it became obvious that what value
vpmu_do_interrupt() returns on its various return paths was pretty
arbitrary. With its only caller ignoring the return value, simply make
the function's return type "void".

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
10 years agoarm64: create xen.efi binary for arm64
Roy Franz [Thu, 2 Oct 2014 15:02:23 +0000 (17:02 +0200)]
arm64: create xen.efi binary for arm64

The 'xen' binary for arm64 is both an Image file and a PE/COFF executable,
copy it to xen.efi so that the 'make install' processing is shared with
x86. Prior to this 'make install' was broken on arm64.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoEFI: update documentation for arm64
Roy Franz [Thu, 2 Oct 2014 15:02:04 +0000 (17:02 +0200)]
EFI: update documentation for arm64

The arm64 EFI boot support added a new 'dtb' value to the configuration file.
Update the documentation to describe this and how the coniguration file is not
used when GRUB loads the modules. Updates 'ucode' description to indicate that
it is x86 only.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agolibxc: fix mmap leak in xc_unmap_domain_meminfo/xc_map_domain_meminfo
Vitaly Kuznetsov [Wed, 1 Oct 2014 13:35:36 +0000 (15:35 +0200)]
libxc: fix mmap leak in xc_unmap_domain_meminfo/xc_map_domain_meminfo

xc_unmap_domain_meminfo uses P2M_FLL_ENTRIES macro instead of P2M_FL_ENTRIES.
Moreover, P2M_FL_ENTRIES macro uses (dinfo->p2m_size) which is always 0 here
as we don't initialize it. The result is that we always unmap just 1 frame.

xc_map_domain_meminfo uses P2M_FLL_ENTRIES macro instead of P2M_FL_ENTRIES
on failure path.

The issue went unnoticed mostly because we use unmap_domain_meminfo and
xc_map_domain_meminfo in one-shot xen-mfndump and xen-hptool (through
xc_exchange_page()) tools. When used is long-running apps (e.g. in xl)
domains become zombies after their death.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoxen/arm: p2m: Correctly initialize cur_offset
Julien Grall [Wed, 1 Oct 2014 15:13:41 +0000 (16:13 +0100)]
xen/arm: p2m: Correctly initialize cur_offset

{~0,} only initializes the first cell of the array to ~0. The other cells
are initialized to 0.

Explicitly initialize every cells of the array and, at the same time, do the
same for the mappings.

This is fixing boot after 82985d7 "xen: arm: handle variable p2m levels
in apply_p2m_changes" on platform where the root-level doesn't have
concatenate table (such as the Foundation Model).

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agox86/HVM: properly bound x2APIC MSR range
Jan Beulich [Wed, 1 Oct 2014 12:54:47 +0000 (14:54 +0200)]
x86/HVM: properly bound x2APIC MSR range

While the write path change appears to be purely cosmetic (but still
gets done here for consistency), the read side mistake permitted
accesses beyond the virtual APIC page.

Note that while this isn't fully in line with the specification
(digesting MSRs 0x800-0xBFF for the x2APIC), this is the minimal
possible fix addressing the security issue and getting x2APIC related
code into a consistent shape (elsewhere a 256 rather than 1024 wide
window is being used too). This will be dealt with subsequently.

This is CVE-2014-7188 / XSA-108.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
10 years agoxl: use nic global default values in network-attach
Roger Pau Monne [Wed, 1 Oct 2014 10:42:07 +0000 (12:42 +0200)]
xl: use nic global default values in network-attach

Introduce a new static function that will be used to set the initial nic
config based on the global defaults. This fixes a bug caused by
network-attach not using the default values set in xl.conf(5).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>