xsm: flask: Remove unused function avc_sidcmp

Fix compilation with Clang 3.5:

avc.c:657:19: error: unused function 'avc_sidcmp' [-Werror,-Wunused-function]
static inline int avc_sidcmp(u32 x, u32 y)
                      ^

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xsm: flask: ss: remove unused function determine_oocontext

This function is not used neither exported.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xsm: flask: flask_disable is only used internally

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
common: sched_sedf: Remove unused functions

Clang 3.5 will fail to compile xen/common/sched_sedf.c because some function
are not used:

sched_sedf.c:141:20: error: unused function 'extraq_add_head' [-Werror,-Wunused-function]
static inline void extraq_add_head(struct vcpu *d, int i)
                       ^
sched_sedf.c:147:20: error: unused function 'extraq_add_tail' [-Werror,-Wunused-function]
static inline void extraq_add_tail(struct vcpu *d, int i)

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
credit2: Some functions are only used internally

The list of function above are only used internally in common/sched_credit2.c
    - migrate
    - update_max_weight

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
x86: identify which vcpu's CR4 is being badly modified

When the toolstack is setting vcpu state on behalf of a migrating guest, the
domain/vcpu reference from gdprintk() identifies the toolstack, not the
affected domain.

After this change, the error looks more like:

  (XEN) d0 attempted to change d6v0's CR4 flags 00002660 -> 01876000

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/xsm: Don't use multiboot by default to initialize XSM

Multiboot protocol is only used by x86. When XSM support for ARM will be
introduced, another way will be used to retrieve the policy blob.

Introduce CONFIG_MULTIBOOT to compile XSM specific multiboot code and
rename xsm_init into xsm_multiboot_init to avoid confusion.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Keir Fraser <keir@xen.org>
xen/xsm: Add xsm_core_init function

This function contains non-specific architecture code (mostly the tail of
xsm_multiboot_init). It will be used later to avoid code duplication.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
xen/xsm: Add support for device tree

This patch adds a new module "xen,xsm-policy" to allow the user to load the XSM
policy when Xen is booting.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arm: Add support for XSM

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
libxc: domain restore: fold redundant variables

"vcpuextstate_size" being non-zero fully expresses "vcpuextstate" being
true - drop the latter.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Avoid said the /dev/xvd* is already defined after

open a vhd file failed

For example:
[root@dom0_134_103 ~]# xm block-attach 0
tap2:tapdisk:vhd:/root/liyi***.vhd /dev/xvdz  w
Error: ('create', '-avhd:/root/liyi***.vhd') failed (512  )
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]
Create a new virtual block device.

[root@dom0_134_103 ~]# xm block-attach 0
tap2:tapdisk:vhd:/root/liyi.vhd /dev/xvdz  w
Error: The device "/dev/xvdz" is already defined
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode> [BackDomain]

Create a new virtual block device.

Signed-off-by: Yi Li <peteryili@tencent.com>
Acked-by: Matt Wilson <msw@amazon.com>
tools/xend: move assert to exception block

The two assert in restore trigger sometimes after hundreds of
migrations. If they trigger the destination host will not destroy the
newly created, yet empty guest. After a second migration attempt to this
host there will be two guets with the same name and uuid. This situation
is poorly handled by the xm tools.
With this change the empty guest will be destroyed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Matt Wilson <msw@amazon.com>
xend/pvscsi: recognize also SCSI CDROM devices

Attaching a CDROM device with 'xm scsi-attach domU /dev/sr0 0:0:0:0'
fails because for some reason the sr driver was not handled at all in
the match list. With the change the above command succeeds and the
device is attached.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Matt Wilson <msw@amazon.com>