> or something ?

I ended up doing two patches - one to create an enable_livepatch
(in mfi-common) to seed the jobs.

And then another to piggyback on that.

I am attaching them here (as attachment), and I think it makes
it simpler?
>From 1a303fe8acb3949eb556673744bc5bc89a842b54 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <kon...@kernel.org>
Date: Wed, 17 May 2017 20:54:07 -0400
Subject: [PATCH v3 3/7] mfi-common: Add an livepatch test and also add
 job_create_build var.

The enable_livepatch=[true|false] is added to the jobs.

It should only be enabled for certain Xen versions (4.9)
and higher.

Signed-off-by: Konrad Rzeszutek Wilk <kon...@kernel.org>
---
v3: New patch
---
 mfi-common | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/mfi-common b/mfi-common
index ec31e2e..8cc9e5f 100644
--- a/mfi-common
+++ b/mfi-common
@@ -76,6 +76,24 @@ branch_wants_xtf_tests () {
   esac
 }
 
+branch_wants_livepatch () {
+  echo $branch
+  case "$branch" in
+    osstest*)   return 0;;
+    xen-3.*)    return 0;;
+    xen-4.0*)   return 0;;
+    xen-4.1*)   return 0;;
+    xen-4.2*)   return 0;;
+    xen-4.3*)   return 0;;
+    xen-4.4*)   return 0;;
+    xen-4.5*)   return 0;;
+    xen-4.6*)   return 0;;
+    xen-4.7*)   return 0;;
+    livepatch*) return 0;;
+    *)        return 1;;
+  esac
+}
+
 job_create_build () {
   job_create_build_filter_callback "$@" || return 0
 
@@ -104,6 +122,7 @@ create_build_jobs () {
   local want_xend build_defxend build_extraxend
   local enable_ovmf
   local build_hostflags
+  local enable_livepatch
 
   if [ "x$BUILD_LVEXTEND_MAX" != x ]; then
      BUILD_RUNVARS+=" build_lvextend_max=$BUILD_LVEXTEND_MAX "
@@ -196,7 +215,10 @@ create_build_jobs () {
             want_prevxen=y
         fi
     fi
-
+    enable_livepatch=false
+    if ! branch_wants_livepatch; then
+       enable_livepatch=true
+    fi
     eval "
         arch_runvars=\"\$ARCH_RUNVARS_$arch\"
     "
@@ -211,7 +233,7 @@ create_build_jobs () {
       fi
       job_create_build build-$arch$xsm_suffix build                          \
                 arch=$arch enable_xend=$build_defxend enable_ovmf=$enable_ovmf\
-                enable_xsm=$enable_xsm                                       \
+                enable_xsm=$enable_xsm enable_livepatch=$enable_livepatch    \
         tree_qemu=$TREE_QEMU                                                 \
         tree_qemuu=$TREE_QEMU_UPSTREAM                                       \
         tree_xen=$TREE_XEN                                                   \
@@ -239,7 +261,7 @@ create_build_jobs () {
         # $REVISION_PREVXEN.
         job_create_build build-$arch-prev build                       \
                     arch=$arch enable_xend=false enable_ovmf=$enable_prevovmf\
-                    enable_xsm=false                                         \
+                    enable_xsm=false enable_livepatch=$enable_livepatch      \
             tree_xen=$TREE_XEN                                               \
                     $RUNVARS $BUILD_RUNVARS $BUILD_XEN_RUNVARS $arch_runvars \
                     $hostos_runvars                                          \
-- 
2.1.4

>From e7d697d4812ea22171fc738435c640adb5df1363 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Date: Mon, 21 Nov 2016 17:11:13 -0500
Subject: [PATCH v3 4/7] ts-xen-build: Build livepatches test-cases

Livepatch compiles and works on x86/ARM{32|64} so we can
enable it. It only gets built and put in xentlpdist.tar.gz
if enable_livepatch is set to true.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
---
v1: New posting
v2: Put the livepatch test-cases in xentlpdist.tar.gz file
v3: Use enable_livepatch to gate the build and tarring the test-cases.
---
 ts-xen-build | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/ts-xen-build b/ts-xen-build
index 31acb9d..92f467b 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -51,6 +51,7 @@ $dashdashdash //= -1;
 builddirsprops();
 
 my $enable_xsm = ($r{enable_xsm}//'false') =~ m/true/ ? 1 : 0;
+my $enable_livepatch = ($r{enable_livepatch}//'false') =~ m/true/ ? 1 : 0;
 
 $buildcmd_global_prefix= <<END;
     export XEN_CONFIG_EXPERT=y
@@ -95,6 +96,12 @@ sub checkout () {
 	echo >>.config LIBLEAFDIR_x86_64=lib
 	echo >>.config KERNELS=''
 END
+               (${enable_livepatch} ? <<END : '').
+	if test -f xen/Kconfig; then
+		echo >>xen/.config CONFIG_LIVEPATCH=y
+		echo >>xen/.config CONFIG_FAST_SYMBOL_LOOKUP=y
+    fi
+END
                (nonempty($r{enable_xsm}) ? <<END : '').
 	if test -f xen/Kconfig; then
 		echo >>xen/.config CONFIG_XSM='${build_xsm}'
@@ -164,6 +171,18 @@ END
 END
 	store_runvar("flaskpolicy", "xenpolicy-" . $xen_version);
     }
+
+    if ($enable_livepatch) {
+        buildcmd_stamped_logged(600, 'xen', 'xenlpt', <<END,<<END,'')
+            export XEN_ROOT=$builddir/xen
+            export DESTDIR=$builddir/xen/dist/xenlpt
+            export BASEDIR=$builddir/xen/xen
+            mkdir -p \${DESTDIR}/usr/lib/debug
+END
+            $make_prefix make -C xen/test -f $builddir/xen/xen/Rules.mk install
+END
+
+    }
 }
 
 sub divide () {
@@ -209,6 +228,7 @@ sub stash () {
                     "xen/dist/${part}install",
                     "${part}dist");
     }
+    built_stash($ho, $builddir, "xen/dist/xenlpt", "xenlptdist") if $enable_livepatch;
     built_stash_file($ho, $builddir, "xen-syms", "xen/xen/xen-syms", 1);
     built_stash_file($ho, $builddir, "xen-config", "xen/.config", 1);
     built_stash_file($ho, $builddir, "xen-hv-config", "xen/xen/.config", 1);
-- 
2.1.4

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to