+Anthony PERARD
+
+
+From 20c7f36f3485d84ba2dd8c6c37b92f325794c29f Mon Sep 17 00:00:00 2001
+From: Julien Grall <julien.grall@linaro.org>
+Date: Sun, 27 Apr 2014 20:53:20 +0100
+Subject: [PATCH] WORKAROUND: arm64: Fixup PSR
+
+---
+ xen/include/public/arch-arm.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
+index e711606..72d641f 100644
+--- a/xen/include/public/arch-arm.h
++++ b/xen/include/public/arch-arm.h
+@@ -341,6 +341,15 @@ typedef uint64_t xen_callback_t;
+ #define PSR_MODE_SYS 0x1f
+
+ /* 64 bit modes */
++#undef PSR_MODE_BIT
++#undef PSR_MODE_EL3h
++#undef PSR_MODE_EL3t
++#undef PSR_MODE_EL2h
++#undef PSR_MODE_EL2t
++#undef PSR_MODE_EL1h
++#undef PSR_MODE_EL1t
++#undef PSR_MODE_EL0t
++
+ #define PSR_MODE_BIT 0x10 /* Set iff AArch32 */
+ #define PSR_MODE_EL3h 0x0d
+ #define PSR_MODE_EL3t 0x0c
+--
+Anthony PERARD
+
+From 40438b3e343e28738a51cd9075783fae0c42ba75 Mon Sep 17 00:00:00 2001
+From: Anthony PERARD <anthony.perard@citrix.com>
+Date: Tue, 11 Aug 2015 11:06:20 +0000
+Subject: [PATCH] fix with --disable-blktap2
+
+---
+ tools/libxl/libxl_noblktap2.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tools/libxl/libxl_noblktap2.c b/tools/libxl/libxl_noblktap2.c
+index 5a86ed1..da55ab1 100644
+--- a/tools/libxl/libxl_noblktap2.c
++++ b/tools/libxl/libxl_noblktap2.c
+@@ -23,7 +23,8 @@ int libxl__blktap_enabled(libxl__gc *gc)
+
+ char *libxl__blktap_devpath(libxl__gc *gc,
+ const char *disk,
+- libxl_disk_format format)
++ libxl_disk_format format,
++ int readwrite)
+ {
+ return NULL;
+ }
+--
+Anthony PERARD
+
+From stefano.stabellini@eu.citrix.com Wed Aug 12 16:01:30 2015
+Date: Wed, 12 Aug 2015 16:00:00 +0100
+From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+Subject: updated backport patch for centos
+
+xen/arm: support compressed kernels
+
+Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
+---
+ xen/arch/arm/kernel.c | 156 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 156 insertions(+)
+
+diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
+index f641b12..35692e1 100644
+--- a/xen/arch/arm/kernel.c
++++ b/xen/arch/arm/kernel.c
+@@ -13,6 +13,7 @@
+ #include <asm/byteorder.h>
+ #include <asm/setup.h>
+ #include <xen/libfdt/libfdt.h>
++#include <xen/vmap.h>
+
+ #include "kernel.h"
+
+@@ -258,6 +259,122 @@ static int kernel_uimage_probe(struct kernel_info *info,
+ }
+
+ #ifdef CONFIG_ARM_64
++
++#define HEAPORDER 3
++
++static unsigned char *__initdata window;
++#define memptr long
++static memptr __initdata free_mem_ptr;
++static memptr __initdata free_mem_end_ptr;
++
++#define WSIZE 0x80000000
++
++static unsigned char *__initdata inbuf;
++static unsigned __initdata insize;
++
++/* Index of next byte to be processed in inbuf: */
++static unsigned __initdata inptr;
++
++/* Bytes in output buffer: */
++static unsigned __initdata outcnt;
++
++#define OF(args) args
++#define STATIC static
++
++#define memzero(s, n) memset((s), 0, (n))
++
++typedef unsigned char uch;
++typedef unsigned short ush;
++typedef unsigned long ulg;
++
++#define INIT __init
++#define INITDATA __initdata
++
++#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf())
++
++#ifdef DEBUG
++# define Assert(cond, msg) do { if (!(cond)) error(msg); } while (0)
++# define Trace(x) do { fprintf x; } while (0)
++# define Tracev(x) do { if (verbose) fprintf x ; } while (0)
++# define Tracevv(x) do { if (verbose > 1) fprintf x ; } while (0)
++# define Tracec(c, x) do { if (verbose && (c)) fprintf x ; } while (0)
++# define Tracecv(c, x) do { if (verbose > 1 && (c)) fprintf x ; } while (0)
++#else
++# define Assert(cond, msg)
++# define Trace(x)
++# define Tracev(x)
++# define Tracevv(x)
++# define Tracec(c, x)
++# define Tracecv(c, x)
++#endif
++
++static long __initdata bytes_out;
++static void flush_window(void);
++
++static __init void error(char *x)
++{
++ panic("%s", x);
++}
++
++static __init int fill_inbuf(void)
++{
++ error("ran out of input data");
++ return 0;
++}
++
++#include "../../common/inflate.c"
++
++static __init void flush_window(void)
++{
++ /*
++ * The window is equal to the output buffer therefore only need to
++ * compute the crc.
++ */
++ unsigned long c = crc;
++ unsigned n;
++ unsigned char *in, ch;
++
++ in = window;
++ for ( n = 0; n < outcnt; n++ )
++ {
++ ch = *in++;
++ c = crc_32_tab[((int)c ^ ch) & 0xff] ^ (c >> 8);
++ }
++ crc = c;
++
++ bytes_out += (unsigned long)outcnt;
++ outcnt = 0;
++}
++
++static __init int perform_gunzip(char *output, char *image, unsigned long image_len)
++{
++ int rc;
++
++ window = (unsigned char *)output;
++
++ free_mem_ptr = (unsigned long)alloc_xenheap_pages(HEAPORDER, 0);
++ free_mem_end_ptr = free_mem_ptr + (PAGE_SIZE << HEAPORDER);
++
++ inbuf = (unsigned char *)image;
++ insize = image_len;
++ inptr = 0;
++
++ makecrc();
++
++ if ( gunzip() < 0 )
++ {
++ rc = -EINVAL;
++ }
++ else
++ {
++ rc = 0;
++ }
++
++ free_xenheap_pages((void *)free_mem_ptr, HEAPORDER);
++
++ return rc;
++}
++
+ /*
+ * Check if the image is a 64-bit Image.
+ */
+@@ -310,6 +427,43 @@ static int kernel_zimage64_probe(struct kernel_info *info,
+
+ return 0;
+ }
++
++static unsigned long output_length(char *image, unsigned long image_len)
++{
++ return *(uint32_t *)&image[image_len - 4];
++}
++
++static int kernel_zimage64_compressed_probe(struct kernel_info *info,
++ paddr_t addr, paddr_t size)
++{
++ char *output, *input;
++ unsigned char magic[2];
++ int rc;
++ unsigned kernel_order_in;
++ unsigned kernel_order_out;
++ paddr_t output_size;
++
++ copy_from_paddr(magic, addr, sizeof(magic));
++
++ if (!((magic[0] == 0x1f) && ((magic[1] == 0x8b) || (magic[1] == 0x9e))))
++ return -EINVAL;
++
++ kernel_order_in = get_order_from_bytes(size);
++ input = (char *)ioremap_cache(addr, size);
++
++ output_size = output_length(input, size);
++ kernel_order_out = get_order_from_bytes(output_size);
++ output = (char *)alloc_xenheap_pages(kernel_order_out, 0);
++
++ rc = perform_gunzip(output, input, size);
++ clean_dcache_va_range(output, output_size);
++ iounmap(input);
++
++ if (rc != 0)
++ return rc;
++
++ return kernel_zimage64_probe(info, virt_to_maddr(output), output_size);
++}
+ #endif
+
+ /*
+@@ -466,6 +620,8 @@ int kernel_probe(struct kernel_info *info)
+ #ifdef CONFIG_ARM_64
+ rc = kernel_zimage64_probe(info, start, size);
+ if (rc < 0)
++ rc = kernel_zimage64_compressed_probe(info, start, size);
++ if (rc < 0)
+ #endif
+ rc = kernel_uimage_probe(info, start, size);
+ if (rc < 0)
+--
+1.7.10.4
+
+
+From f64a891386fc89a8c1642dba02b2f9a13d2500af Mon Sep 17 00:00:00 2001
+From: Anthony PERARD <anthony.perard@citrix.com>
+Date: Wed, 12 Aug 2015 16:43:52 +0000
+Subject: [PATCH] context of var-lib-xenstored.
+
+---
+ tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
+index 11a7d50..ed8f4d0 100644
+--- a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
++++ b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
+@@ -9,4 +9,4 @@ RefuseManualStop=true
+ What=xenstore
+ Where=@XEN_LIB_STORED@
+ Type=tmpfs
+-Options=mode=755
++Options=mode=755,context="system_u:object_r:xenstored_var_lib_t:s0"
+--
+Anthony PERARD
+
+From ad91ab02e9809395d743dc5a1175be1426ff2c99 Mon Sep 17 00:00:00 2001
+From: Anthony PERARD <anthony.perard@citrix.com>
+Date: Thu, 13 Aug 2015 18:11:56 +0000
+Subject: [PATCH] fix xenstore launch.
+
+the sh -c exec xenstore does not appear to works with centos systemd 208 + socket + selinux.
+---
+ tools/hotplug/Linux/systemd/xenstored.service.in | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
+index a5f836b..1d43487 100644
+--- a/tools/hotplug/Linux/systemd/xenstored.service.in
++++ b/tools/hotplug/Linux/systemd/xenstored.service.in
+@@ -10,12 +10,11 @@ ConditionPathExists=/proc/xen/capabilities
+ Type=notify
+ KillMode=none
+ Environment=XENSTORED_ARGS=
+-Environment=XENSTORED=@XENSTORED@
+ EnvironmentFile=-@CONFIG_DIR@/@CONFIG_LEAF_DIR@/xencommons
+ ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
+ ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
+-ExecStart=/bin/sh -c "exec $XENSTORED --no-fork $XENSTORED_ARGS"
++ExecStart=@XENSTORED@ --no-fork $XENSTORED_ARGS"
+
+ [Install]
+ WantedBy=multi-user.target
+--
+Anthony PERARD