All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad@kernel.org>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org, Marcos.Matsunaga@oracle.com,
	ross.lagerwall@citrix.com
Subject: Re: [PATCH v2 6/9] ts-xen-build: Build the livepatch test-cases
Date: Thu, 18 May 2017 02:49:28 -0400	[thread overview]
Message-ID: <20170518064925.GA28013@osstest.dumpdata.com> (raw)
In-Reply-To: <22608.9877.805751.831868@mariner.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

> 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?

[-- Attachment #2: 0003-mfi-common-Add-an-livepatch-test-and-also-add-job_cr.patch --]
[-- Type: text/x-diff, Size: 2998 bytes --]

>From 1a303fe8acb3949eb556673744bc5bc89a842b54 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad@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 <konrad@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


[-- Attachment #3: 0004-ts-xen-build-Build-livepatches-test-cases.patch --]
[-- Type: text/x-diff, Size: 2446 bytes --]

>From e7d697d4812ea22171fc738435c640adb5df1363 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@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.wilk@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


[-- Attachment #4: Type: text/plain, Size: 127 bytes --]

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

  parent reply	other threads:[~2017-05-18  2:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13  6:39 [PATCH v2] OSSTest test-harness for livepatches Konrad Rzeszutek Wilk
2016-12-13  6:39 ` [PATCH v2 1/9] OssTest: Add target_cmd_root_status which returns return code Konrad Rzeszutek Wilk
2016-12-13 16:20   ` Ian Jackson
2016-12-13  6:39 ` [PATCH v2 2/9] Osstest: Add target_cmd_output_root_status Konrad Rzeszutek Wilk
2016-12-13 16:23   ` Ian Jackson
2016-12-13  6:39 ` [PATCH v2 3/9] OssTest: Add target_dir_exists Konrad Rzeszutek Wilk
2016-12-13 16:24   ` Ian Jackson
2017-05-17 20:59     ` Konrad Rzeszutek Wilk
2017-05-18 16:50       ` Ian Jackson
2016-12-13  6:39 ` [PATCH v2 4/9] ts-xen-build: Make {xen|}dist.tar.gz only if $builddir/install/{$xen|}install Konrad Rzeszutek Wilk
2016-12-13  6:39 ` [PATCH v2 5/9] ts-xen-build: Enable livepatch Konrad Rzeszutek Wilk
2016-12-13  6:39 ` [PATCH v2 6/9] ts-xen-build: Build the livepatch test-cases Konrad Rzeszutek Wilk
2016-12-13 16:49   ` Ian Jackson
2017-05-18  0:07     ` Konrad Rzeszutek Wilk
2017-05-17 20:30       ` Konrad Rzeszutek Wilk
2017-05-18 16:41         ` Ian Jackson
2017-05-18  6:49     ` Konrad Rzeszutek Wilk [this message]
2017-05-18 16:47       ` Ian Jackson
2017-05-18 19:57         ` Konrad Rzeszutek Wilk
2016-12-13  6:39 ` [PATCH v2 7/9] ts-livepatch-[install|run]: Install and initial test-cases Konrad Rzeszutek Wilk
2016-12-13 17:08   ` Ian Jackson
2016-12-13  6:39 ` [PATCH v2 8/9] sg-run-job: Add the test-livepatch Konrad Rzeszutek Wilk
2016-12-13 17:08   ` Ian Jackson
2016-12-13  6:39 ` [PATCH v2 9/9] make-flight/mfi-common: Add livepatch build/test target in the matrix Konrad Rzeszutek Wilk
2016-12-13 16:14   ` Wei Liu
2016-12-13 16:44     ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170518064925.GA28013@osstest.dumpdata.com \
    --to=konrad@kernel.org \
    --cc=Marcos.Matsunaga@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.