Andrew Cooper [Tue, 21 Oct 2014 15:34:20 +0000 (17:34 +0200)]
x86/hvm: further restrict access to x2apic MSRs
The x2apic specification reserves the entire MSR range 0x800-0xbff, while only
the first 0x3f MSRs have defined purposes. All reserved MSRs in this region
are architecturally required to raise #GP faults upon access.
Xen used to pass this entire range to hvm_x2apic_msr_{read,write}(), but the
range was restricted somewhat by XSA-108 (c/s 61fdda7ac) to prevent guests
being able to read pages adjacent to the domheap page backing the vlapic->regs
array.
While removing the vulnerability, a side effect of XSA-108 was that the MSR
range 0x900-0xbff fell through the switch statement and ends up reading the
hosts x2apic range. This behaviour is a problem in general, but specifically
it turns out that MSRs 0xa00-0xa02 are implemented (but undocumented) on
certain SandyBridge and IvyBridge systems.
Experimentally, no operating system in XenServer's test suite (including all
versions of Windows currently supported by Microsoft) ever peek at these MSRs,
even on hosts where some of them are implemented.
This patch undoes the fix for XSA-108 (c/s 61fdda7ac), returning the primary
bounds check to the entire specified range. hvm_x2apic_msr_write() was always
safe, as it is whitelist based. hvm_x2apic_msr_read() changes to a whitelist
approach, which avoids the vulnerability, and provides a more architecturally
accurate emulation of the reserved MSRs (which would previously read as 0
rather than fault).
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Paul Durrant [Tue, 21 Oct 2014 15:31:31 +0000 (17:31 +0200)]
x86/viridian: freeze time reference counter when domain is paused
In XenServer system test it has become apparent that versions of Windows
that make use of the time reference counter enlightenment cannot cope with
large jumps forward in the value read from the MSR. Specifically,
suspending a very large domain took approx. 45 minutes to complete and
when the domain was resumed it was discovered that the WMI (Windows
Management Instrumentation) service had hung.
The reason a large jump forward is seen by the guest is that, when a guest
is suspended, the guest stops running when the SCHEDOP_suspend hypercall is
made, however the MSR value essentially keeps incrementing until the
tool-stack issues DOMCTL_gethvmcontext.
This patch adds code to freeze the value of the time reference counter
on domain pause and 'thaw' it on domain unpause, but only thaw it if the
domain is not shutting down. The absolute value of the counter is then
saved in the viridian domain context record. This prevents the guest OS
from experiencing large jumps in the value of the MSR and has been shown
to reliably fix the problem with WMI.
Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm64: Use __flush_dcache_area instead of __flush_dcache_all
When booting with EFI, __flush_dcache_all does not correctly flush data.
According to Mark Rutland, __flush_dcache_all is not guaranteed to push
data to the PoC if there is a system-level cache as it uses Set/Way
operations. Therefore, this patch switchs to use the "__flush_dcache_area"
mechanism, which is coppied from Linux.
Add flushing of FDT in addition to Xen text/data.
Remove now unused __flush_dcache_all and related helper functions.
Invalidate the instruction tlb before turning on paging
later on when starting Xen in EL2.
Signed-off-by: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> Signed-off-by: Roy Franz <roy.franz@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Fri, 29 Aug 2014 20:14:30 +0000 (21:14 +0100)]
docs: Introduce specification for x86 pv bootloader chainloading paths/formats.
In order to support pvgrub (or other bootloader) from dom0 chainloading a
pvgrub (or other) from within the domU filesystem we need a standard for where
the stage 1 bootloader should look and what it should expect to find there.
Add a document along those lines.
This is currently x86-specific since it is expected that other new architecures
(including ARM) will either not need to implement this due to the existence of
more generic specifications for that arch (e.g. the ARM VM spec) or will update
this document in due course.
Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Cc: Colin Watson <cjwatson@debian.org> Cc: 759018@bugs.debian.org
Andrew Cooper [Wed, 15 Oct 2014 17:33:56 +0000 (18:33 +0100)]
tools/misc: Delete more obsolete utilities
* nsplitd has been orphaned from the build since its introduction in c/s dc44ed4764 (in 2004), and never been developed since. While it does appear
to compile, it is full of pointer width mismatch, pointer sign mismatch, and
uninitialised variable warnings, which makes it unlikely to function
correctly when compiled for a 64bit environment.
* xen-python-path was declared obsolete in c/s 11e1149fe (in 2009) and can't
actually be used correctly by out-of-tree components. 5 years is long enough
for out-of-tree callers to catch up.
There are no subdirectories any more, so drop the notion from the Makefile.
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> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Andrew Cooper [Wed, 15 Oct 2014 17:33:55 +0000 (18:33 +0100)]
tools/build: Fix root build target
The root Makefile 'build' rule recurses into the tools directory and invokes
the 'build' rule. However, the tools Makefile doesn't contain a 'build' rule,
resulting in failure.
Introduce a 'build' rule identical to the existing 'all' rule.
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> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-mceinj is another utility which incorrectly makes use of xg_private.h Fix
up its include path.
While fixing this Makefile, remove some trailing whitespace.
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> CC: Stefano Stabellini <stefano.stabellini@citrix.com> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
where 'name' is a label to identify the channel to the frontend.
If 'connection = pty' then the channel is connected to a pty in the
backend domain
If 'connection = socket' then the channel is connected to a Unix domain
socket given by 'path = ...' in the backend domain.
This patch also adds the command:
xl channel-list <domain>
which allows the state of channels to be queried. In particular if
'connection=pty' this will show the path of the pty slave device.
Signed-off-by: David Scott <dave.scott@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
David Scott [Thu, 9 Oct 2014 09:17:27 +0000 (10:17 +0100)]
libxl: add support for 'channels'
A 'channel':
- is a low-bandwidth private communication channel that resembles
a physical serial port.
- is implemented as a PV console with a well-known string name
which is used to hook the channel to the appropriate software
in the guest (i.e. some kind of guest agent).
- has a backend 'connection' which describes what should happen
to the data.
The following 'connection' types are defined:
* PTY: the I/O surfaces as a pty in the backend domain
* SOCKET: a listening Unix domain socket accepts a connection in
the backend domain and proxies
Channels may be listed but don't currently support hotplug/unplug.
Signed-off-by: David Scott <dave.scott@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Olaf Hering [Thu, 16 Oct 2014 12:48:00 +0000 (14:48 +0200)]
README: remove references to unneeded python helpers
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>
Ian Jackson [Thu, 16 Oct 2014 17:44:13 +0000 (18:44 +0100)]
libxl: Avoid fd leak of qemu state fd during migration
In a long-running process (such as virt-manager) this might eventually
run the process out of fds.
That qemu argument construction might generate an fd that needs to be
fed to qemu is a bit odd, but we just run with it and provide a
parameter to the qemu argument construction code for this purpose.
There is no need to use the carefd machinery, because leaking the odd
copy of this descriptor into a child unexpectedly forked out of
another thread, is fine. We just don't want to leak it back to the
main process.
Reported-by: ustermann.max@web.de Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Ian Jackson [Thu, 16 Oct 2014 17:44:12 +0000 (18:44 +0100)]
libxl: Fix a couple of log messages to print correct errnos
xc_domain_create and xc_cpupool_movedomain do not return errno values;
they return -1 and set errno. Fix the logging accordingly.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Reviewed-by: Don Slutz <dslutz@verizon.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Julien Grall [Fri, 17 Oct 2014 16:14:44 +0000 (17:14 +0100)]
xen/arm: flush_tlb_domain: Disable IRQ when flushing TLB of another domain
When Xen is flushing the TLB for another domain than current, it has to
switch temporarily to the P2M of this domain. If IRQs are enabled, it may
be possible to receive an interrupt that requires the use the P2M of the current
domain, or even temporarily switch to another P2M.
For the former case, the translation would be wrong. For the latter one,
as the handler would restore the current P2M, Xen would flush the wrong domain
TLB.
Thankfully we don't have such interrupt handler, but it may be necessary
in the future to do that during when the user asks to dump domain stack via
a keystroke.
Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- spelling in the commit log ]
Julien Grall [Sat, 18 Oct 2014 19:25:21 +0000 (20:25 +0100)]
xen/arm: p2m: Fix crash when p2m_lookup is used with an invalid IPA
Since the commit 58f0fd8 "xen: arm: handle variable p2m levels in p2m_lookup",
Xen checks that the root_table offset is valid. If not, its unlock the p2m
spinlock before returning an error. But, at this time, the lock has not been
taken.
On Xen built with debug=y, we can get the following stack trace if the guest
use an invalid IPA in hypercall or mess-up the grant-table:
Julien Grall [Sat, 18 Oct 2014 20:22:01 +0000 (21:22 +0100)]
docs/man: xl.pod.1: Fix build issue after commit 7471879
The commit 7471879 "tools: CMDs and APIs for Cache Monitoring Technology"
has introduced a new section but forgot to add '=back'. This will result
a build issue with newer podman:
man/xl.pod.1 around line 1443: You forgot a '=back' before '=head1'
or creating a section "POD ERRORS" with older one.
At the same time, capitalize the title of the section to match the coding
style used within the files.
Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Wei Liu <wei.liu2@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Wei Liu [Sun, 19 Oct 2014 17:48:30 +0000 (18:48 +0100)]
README: point to correct location of README.remus
The said file was moved in 20857ac ("remus: move remus README to docs
directory").
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Yang Hongyang <yanghy@cn.fujitsu.com> Cc: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Julien Grall [Thu, 16 Oct 2014 12:34:18 +0000 (13:34 +0100)]
xen: arm: introduce assembly helper to call smc
Commit 063188f4b3 "xen: arm: Add support for the Exynos secure firmware"
introduced code assuming that exynos_smc() would get called with arguments in
certain registers. While the "noinline" attribute guarantees the function to
not get inlined, it does not guarantee that all arguments arrive in the assumed
registers: gcc's interprocedural analysis can result in clone functions to be
created where some of the incoming arguments (commonly when they have constant
values) get replaced by putting in place the respective values inside the
clone.
Xen contains in multiple place of this SMC function: consolidate the function
in a single place and write it in assembly.
Reported-by: Jan Beulich <jbeulich@suse.com> Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- reworded commit message as discussed ]
Jan Beulich [Thu, 16 Oct 2014 08:08:39 +0000 (10:08 +0200)]
move XENMEM_get_vnumainfo out of tools-only section of public/memory.h
After all this interface specifically exists for guest kernels to learn
about their (virtual) topology. I'm sure I made a comment to this
effect during review, but apparently I then didn't notice that this
never got carried out.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Ian Campbell [Fri, 10 Oct 2014 14:43:14 +0000 (15:43 +0100)]
xen: arm64: Handle memory banks which are not 1GB aligned
The code in the arm64 version of setup_xenheap_mappings was making
some very confused attempts to handle this but was bogus.
As well as adjusting the mapping to start on a 1GB boundary we also
need to account for the offset between the start of the mapping and
the actual start of the heap when converting between page pointers,
virtual addresses and machine addresses.
I preferred to do this by explicitly accounting for the offset rather
than adding an offset to the frametable because that approach could
potentially waste a large amount of frametable (up to just less than
1GB worth) but also because of issues with converting mfns from
outside the regions considered for pdx initialisation (which are not
1GB aligned) back and forth.
We already have an idea of the distinction between the start of the
direct map and the start of the xenheap in the difference between
DIRECTMAP_VIRT_START and XENHEAP_VIRT_START. Until now these were the
same thing, but now we change XENHEAP_VIRT_START to point to the
actual start of heap not the mapping. Surprisingly there was only one
place which was using the conceptually wrong value.
Also change xenheap_virt_end to a vaddr_t for consistency.
We've been lucky so far that most hardware happens to locate memory
on a 1GB boundary (we did have reports of a system with memory at a
half gig boundary which exhibited failures which I didn't manage to
follow up on successfully). The EFI support has exposed this
shortcoming by the way it handles reserved memory, which has a
similar effect to having memory non-1GB aligned.
arm32 does things differently here due to using a small Xen heap and
a demand mapped domain heap, so isn't affected.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Suravee Suthikulanit <suravee.suthikulpanit@amd.com> Cc: Roy Franz <roy.franz@linaro.org> Cc: Vijay Kilari <vijay.kilari@gmail.com> Reviewed-by: Julien Grall <julien.grall@linaro.org> Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Roy Franz <roy.franz@linaro.org>
Olaf Hering [Fri, 10 Oct 2014 15:32:42 +0000 (17:32 +0200)]
Fix configure --with-systemd-modules-load=DIR
Currently --with-systemd=DIR1 --with-systemd-modules-load=DIR2 will set
both XEN_SYSTEMD_DIR and XEN_SYSTEMD_MODULES_LOAD to DIR1. The reason is
that both AC_ARG_WITH() use 'systemd' as the name for the internal
variable. As a result the value of the first option is also use as the
value for the second option. Fix this by using another variable name.
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 Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ijc -- ran autogen.sh as requested]
Roger Pau Monne [Fri, 10 Oct 2014 14:34:37 +0000 (16:34 +0200)]
libxl: include sys/ioctl.h
This is a requirement for the code in libxl_remus_disk_drbd.c that uses the
ioctl syscall. Fixes the following error when building on FreeBSD:
libxl_remus_disk_drbd.c: In function 'drbd_postsuspend':
libxl_remus_disk_drbd.c:197:9: error: implicit declaration of function 'ioctl' [-Werror=implicit-function-declaration]
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>
Olaf Hering [Fri, 10 Oct 2014 09:23:25 +0000 (11:23 +0200)]
Remove dead qemu variables from toplevel Makefile
The variables should have been removed already in 7ed06911dc596d23f21dee209b7f2db294e34b56 ("Remove dead qemu code from
toplevel Makefile"), but I did not spot it at this time.
Now it looks like the intention initially was to let the install-tools
depend on tools/qemu-xen-traditional-dir. But that did not work because
there was the typo in the variables (TGT vs. TARGET), and
CONFIG_QEMU_TRAD was not defined anyway.
So remove QEMU_TRAD_DIR_TARGET and QEMU_XEN_DIR_TARGET because they are
not defined at all.
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>
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]
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>
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]
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>
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>
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>
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>
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>
Jan Beulich [Fri, 10 Oct 2014 08:54:21 +0000 (10:54 +0200)]
VT-d: fix RMRR related error handling
- reassign_device_ownership() now tears down RMRR mappings (for other
than Dom0)
- to facilitate that, rmrr_identity_mapping() now deals with both
establishing and tearing down of these mappings (the open coded
equivalent in intel_iommu_remove_device() is being replaced at once)
- intel_iommu_assign_device() now unrolls the assignment upon RMRR
mapping errors
- intel_iommu_add_device() now returns consistent values upon RMRR
mapping failures (was: failure when last iteration ran into a
problem, success otherwise)
- intel_iommu_remove_device() no longer special cases Dom0 (it only
ever gets called for devices removed from the _system_, not a domain)
- rmrr_identity_mapping() now returns a proper error indicator instead
of -1 when intel_iommu_map_page() failed
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Kevin Tian <kevin.tian@intel.com>
Jan Beulich [Fri, 10 Oct 2014 08:53:01 +0000 (10:53 +0200)]
x86/vlapic: don't silently accept bad vectors
Vectors 0-15 are reserved, and a physical LAPIC - upon sending or
receiving one - would generate an APIC error instead of doing the
requested action. Make our emulation behave similarly.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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: 1240237, 1240235. 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>
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>
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 ]
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 ]
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>
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>
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 ]
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 ]
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>
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 ]
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 ]
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 ]
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>
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 ]
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>
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>
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>
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 ]
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>
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 ]
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 ]
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.
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 ]
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 ]
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>
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 ]
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>