Commit Graph
12705 Commits
Author SHA1 Message Date
Jan Beulich b45a4f1ed6 x86emul: support MOVBE and CRC32
The former in an attempt to at least gradually support all simple data
movement instructions. The latter just because it shares the opcode
with the former.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-06-23 17:48:45 +02:00
Daniel De Graaf 559f439bfa flask: remove xen_flask_userlist operation
This operation has no known users, and is primarily useful when an MLS
policy is in use (which has never been shipped with Xen).  In addition,
the information it provides does not actually depend on hypervisor
state (only on the XSM policy), so an application that needs it could
compute the results without needing to involve the hypervisor.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:55:30 +01:00
Daniel De Graaf 53c300ab1c flask: unify {get, set}vcpucontext permissions
These permissions were initially split because they were in separate
domctls, but this split is very unlikely to actually provide security
benefits: it would require a carefully contrived situation for a domain
to both need access to one type of CPU register and also need to be
prohibited from accessing another type.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-06-21 15:54:27 +01:00
Daniel De Graaf b49839ef4e flask/policy: remove unused example
The access vectors defined here have never been used by xenstore.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:29:18 +01:00
Daniel De Graaf 2511f89d9a flask/policy: xenstore stubdom policy
This adds the xenstore_t type to the example policy for use by a
xenstore stub domain; see the init-xenstore-domain tool for how this
type needs to be used.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:29:17 +01:00
Daniel De Graaf e2aba42bff flask/policy: remove unused support for binary modules
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:29:17 +01:00
Daniel De Graaf d72fd26d5f flask/policy: move user definitions and constraints into modules
This also renames the example users created by vm_role.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:29:17 +01:00
Daniel De Graaf a2c8399a91 flask/policy: split out rules for system_r
When the all_system_role module is enabled, any domain type can be
created using the system_r role, which was the default.  When it is
disabled, domains not using the default types (dom0_t and domU_t) must
use another role such as vm_r.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:29:17 +01:00
Daniel De Graaf 31689dcb0f flask/policy: split into modules
This makes it easier to enable or disable parts of the XSM policy.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2016-06-21 15:29:17 +01:00
Razvan Cojocaru 490a39a1db vm_event: allow subscribing to write events for specific MSR-s
Previously, subscribing to MSR write events was an all-or-none
approach, with special cases for introspection MSR-s. This patch
allows the vm_event consumer to specify exactly what MSR-s it is
interested in, and as a side-effect gets rid of the
vmx_introspection_force_enabled_msrs[] special case.
The patch also introduces arch_monitor_init_domain() and
arch_monitor_cleanup_domain(), to do monitor-specific work
(as opposed to the previous way of doing all the setup in
vm_event_init_domain() / vm_event_cleanup_domain()).
This replaces the previously posted "xen: Filter out MSR write
events" patch.

Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>
2016-06-21 11:59:37 +02:00
Wei Liu 0630892faf libxl: fix an error path that uses uninitialised rc in libxl_set_memory_target
ecdc6fd8 ("libxl: Fix libxl_set_memory_target return value") failed to
initialised rc in one failure path. Fix it in this patch.

Also fixed an indentation issue while I was there.

CID: 1362695

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-20 14:47:02 +01:00
Jan Beulich 0875433389 hvmloader: limit CPUs exposed to guests
Various Linux versions allocate (partial) per-CPU data for all of them,
as there is no indication in MADT whether they're hotpluggable. That's
a little wasteful in terms of resource consumption especially for
- guests with not overly much memory assigned,
- 32-bit guests not having overly much address space available.
Therefore limit what we put into MADT to the "maxvcpus" value, and make
sure AML doesn't touch memory addresses corresponding to CPUs beyond
that value (we can't reasonably make the respective processor objects
disappear).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2016-06-17 16:51:22 +02:00
Shannon Zhao 2f7b56c1a7 libxl/arm: Fix the function name in error log
It should be xc_dom_devicetree_mem instead of xc_dom_devicetree_file.

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-17 11:46:21 +01:00
Dongli Zhang 87beb45e0b tools/livepatch: initialise j to 0 to fix compilation error in gcc 4.5
Initialise j to 0 to make some versions of gcc (e.g., gcc4.5/4.3) happy to
avoid compilation error by commit beba3693f7.

Failure manifests with gcc 4.5 as:

[  153s] cc1: warnings being treated as errors
[  153s] xen-livepatch.c: In function 'main':
[  153s] xen-livepatch.c:415:12: error: 'j' may be used uninitialized in this function
[  153s] make[3]: *** [xen-livepatch.o] Error 1

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-17 11:27:21 +01:00
Juergen Gross c256d2afc1 xl: correct xl cpupool-numa-split with vcpu limited dom0
When trying to use xl cpupool-numa-split and dom0 is limited to less
vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Reported-by: Glenn Enright <glenn@rimuhosting.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu 67a5ab831d oxenstored: honour XEN_RUN_STORED in systemd C stub
Generate a _paths.h for that and add proper dependency.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 44e6ba4b33 oxenstored: honour XEN_RUN_STORED and XEN_CONFIG_DIR
Only contain changes to ocaml source code. C stub files will be handled
separately.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 0e3e738605 ocaml/libxs: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 33bcbdb330 ocaml/libxs: generate a paths.ml
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-17 11:27:21 +01:00
Wei Liu 5994480f20 hotplug/FreeBSD: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu 153db2f820 libxenstore: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu ba53cec7cd hotplug/Linux: honour XEN_RUN_STORED
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu 7d82f09765 build: introduce XEN_RUN_STORED
It defaults to /var/run/xenstored. It will be used later to remove some
hard-coded paths in tree. There should be no visible change to default
configuration.

Install and remove it in respective Makefile targets.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-17 11:27:21 +01:00
Wei Liu d337764d9b tools: bump some library version numbers to 4.8
It is a pretty safe thing to do and would avoid accidentally overwrite
the old libraries when doing development.

Bump all version numbers that are currently 4.7 to 4.8. That includes
libxc, libxlu, libxl and libvchan.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 18:32:10 +01:00
Wei Liu 9b394b7eff xl: remus/colo: only initialise ha variable when necessary
The original code is wrong because the common case is no HA enabled.  It
should have been set to NULL first.

Instead of setting ha to NULL, move it to the scope where it is used.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 16:22:15 +01:00
Wei Liu fcf3f57eee tools: remove hard-coded /var/lib/xen in Makefile
Now all conversations are done, remove the hard-coded paths.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 938b2b4033 libxl: honour XEN_LIB_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
;wq
2016-06-14 14:31:27 +01:00
Wei Liu 540cecf0cf hotplug/Linux: honour XEN_LIB_DIR
Use configure to generate sysconfig.xendomains file.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 102ddb11f2 tools: install and remove XEN_LIB_DIR in Makefile
The intention of using wild card in uninstall target is to remove both
xen and xenstored directories. Change that to two runes that explicitly
remove each of those directories.

Note that the runes that use hard-coded paths are kept for now to keep
the tree bisectable as I replace hard-coded paths component by
component.  Those runes will be removed eventually.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 15f1a11d66 build: introduce and export XEN_LIB_DIR
This variable defaults to /var/lib/xen. It will be used to substitute
various hard-coded paths in tools.

The new variable points to $localstatedir/lib/xen, which defaults to
/var/lib/xen, so there is no change in default configuration.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu a4fa83e568 oxenstored: honour XEN_LOG_DIR defined by configure
We generate a corresponding constant (in lower case) in paths.ml. Use
that in source code to get rid of hard-coded path.

Note that with this patch the default location for xenstored*.log is
changed from /var/log to /var/log/xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-14 14:31:27 +01:00
Wei Liu 6b007a6df1 oxenstored: generate a paths module
That file includes all paths generated by configure. It will be used to
get rid of hard-coded paths in code.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: David Scott <dave@recoil.org>
2016-06-14 14:31:27 +01:00
Wei Liu c84a1fa2e6 oxenstored: honour XEN_{LOG,RUN}_DIR in oxenstored.conf
Generate oxenstored.conf with configure. This involves modifying
tools/configure.ac and rerun autogen.sh.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 10055f661e libxl: log file name in failure in libxl__create_qemu_logfile
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 3148bebbf0 libxl: rename a field in libxl__domain_create_state
The libxl__stub_dm_spawn_state field in libxl__domain_create_state was
named dmss. That was inconsistent with how things were named (usually
acronym) and there was already libxl__dm_spawn_state named dmss in other
places.

Change dmss to sdss and fix up all sites that reference this field.  No
functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:27 +01:00
Wei Liu 5e6e8546cf libxl: linux hotplug: clean up get_hotplug_env
That get_hotplug_env function is called for both block and nic. Move
some nic specific code out of common code to appropriate place.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:26 +01:00
Wei Liu 1cf3fa32da libxl: add emacs block to libxl_linux.c
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-14 14:31:26 +01:00
Dongli Zhang beba3693f7 tools/livepatch: cleanup unnecessary "j = ARRAY_SIZE(action_options);"
Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)"
is true. Thus, it is not necessary to update "j" when "i ==
ARRAY_SIZE(main_options)" is false.

Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2016-06-10 11:08:42 +01:00
Wei Liu 3bf5fdf8d8 libxl: honour XEN_LOG_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:52:37 +01:00
Wei Liu 32b7c63889 hotplug/NetBSD: honour XEN_{LOG,RUN}_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-06-10 10:52:20 +01:00
Wei Liu a666e1ce86 hotplug/Linux: honour XEN_LOG_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-06-10 10:52:16 +01:00
Wei Liu 7c64c92a4f hotplug/FreeBSD: honour XEN_{LOG,RUN}_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
2016-06-10 10:51:51 +01:00
Wei Liu de2807b957 libxc: honour XEN_LOG_DIR in xc_dom_core.c
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:51:38 +01:00
Wei Liu 6c5f6f8a62 xenbackendd: honour XEN_{RUN,LOG}_DIR
Also added a gitignore entry for xenbackendd binary while I was there.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:51:31 +01:00
Wei Liu 15574254d2 xenconsoled: honour XEN_LOG_DIR and remove hard-coded path
Make a _paths.h for xenconsoled as well and use that to generate a
default path for log file directory.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:51:11 +01:00
Wei Liu 8a80688a23 tools: install XEN_{LOG,RUN}_DIR
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-10 10:50:27 +01:00
Wei Liu e2532e9207 Run autogen.sh
In 936a7a54 ("Open Xen 4.8-unstable), output of autogen.sh was not
included. The configure scripts still referred to 4.7.

Run autogen.sh and commit the result.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2016-06-09 16:31:56 +01:00
Paulina Szubarczyk 9554c36ff3 libxl: libxl_tmem functions improving coding style
In accordance with CODING_SYTLE:
 - Use 'r' for return values to functions whose return values are a
   different error space (like xc_tmem_control, xc_tmem_auth)

libxc functions are supposed to, on failure, set errno and always
return -1  which is the value stored in 'r', therfore use LOGE()
instead LOGEV() with the 'r' value.

Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-09 16:31:56 +01:00
Paulina Szubarczyk e3ccca40cd libxl: style cleanups in libxl_device_pci_assignable_list()
Various coding style compliance cleanups, such as, arranging for
using only one path out of the function, whitespaces in loops ad if-s
and r instead of rc for storing non-libxl error codes.

Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-09 16:31:56 +01:00
Paulina Szubarczyk 630cfdddad libxl: improve return codes for some pci related functions
*libxl__device_from_pcidev(), pcidev_struct_fill() initialize
 the values of libxl_device and libxl_device_pci structs
 and can be void.

*libxl__create_pci_backend(), libxl__device_pci_destroy_all()
 should propagate the success/error, rather than always returning 0.

Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
2016-06-09 16:31:56 +01:00