xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
@ 2017-06-07 14:51 Ian Jackson
  2017-06-07 14:51 ` [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch Ian Jackson
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Ian Jackson @ 2017-06-07 14:51 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, Jan Beulich

I am trying to get the livepatches tested in osstest.  As discussed, I
would like the xen.git Makefiles to be able to ship the livepatch test
files, so that osstest does not need to have too much special
knowledge of the xen.git build system.

There are three preliminary patches which tidy up the xen/test
Makefiles etc. a bit, and a final patch which provides the top-level
targets.  These targets are not invoked by default.

I have tested these with a private osstest branch; I got a pass with
an amd64 toolstack.  I'm still getting my osstest branch to DTRT with
a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series
needs some work.  But given that I have had one pass, and verified
that things work with a 32-bit x86 build, I think the xen.git changes
can go in now.

I would ideally like this in 4.9 because I would like to establish the
interface; also eventually I expect we will want to backport these
Makefile changes to 4.8 so that we can test the 4.8 livepatching too.

Thanks,
Ian.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
@ 2017-06-07 14:51 ` Ian Jackson
  2017-06-07 15:04   ` Konrad Rzeszutek Wilk
  2017-06-07 14:51 ` [PATCH 2/4] xen/test/livepatch: Regularise Makefiles Ian Jackson
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 24+ messages in thread
From: Ian Jackson @ 2017-06-07 14:51 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, Jan Beulich, Ian Jackson

Dumping these patch files in /usr/lib/debug/xen-*.livepatch is a bit
ugly.

Also, refactor the Makefile to have a LIVEPATCHES variable, to reduce
repetition.

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 xen/test/livepatch/Makefile | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile
index 76a779a..76d65cf 100644
--- a/xen/test/livepatch/Makefile
+++ b/xen/test/livepatch/Makefile
@@ -20,18 +20,21 @@ LIVEPATCH_BYE := xen_bye_world.livepatch
 LIVEPATCH_REPLACE := xen_replace_world.livepatch
 LIVEPATCH_NOP := xen_nop.livepatch
 
+LIVEPATCHES += $(LIVEPATCH)
+LIVEPATCHES += $(LIVEPATCH_BYE)
+LIVEPATCHES += $(LIVEPATCH_REPLACE)
+LIVEPATCHES += $(LIVEPATCH_NOP)
+
+LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch
+
 default: livepatch
 
 install: livepatch
-	$(INSTALL_DATA) $(LIVEPATCH) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH)
-	$(INSTALL_DATA) $(LIVEPATCH_BYE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE)
-	$(INSTALL_DATA) $(LIVEPATCH_REPLACE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE)
-	$(INSTALL_DATA) $(LIVEPATCH_NOP) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP)
+	$(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
+	$(INSTALL_DATA) $(LIVEPATCHES) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
+
 uninstall:
-	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH)
-	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE)
-	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE)
-	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP)
+	cd $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) && rm -f $(LIVEPATCHES)
 
 .PHONY: clean
 clean::
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 2/4] xen/test/livepatch: Regularise Makefiles
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
  2017-06-07 14:51 ` [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch Ian Jackson
@ 2017-06-07 14:51 ` Ian Jackson
  2017-06-07 15:05   ` Konrad Rzeszutek Wilk
  2017-06-07 14:51 ` [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore Ian Jackson
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 24+ messages in thread
From: Ian Jackson @ 2017-06-07 14:51 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, Jan Beulich, Ian Jackson

In xen/test/livepatch/Makefile:

  Provide a `build' target, as most of the
  subdir-invoking Makefiles elsewhere expect.

In xen/test/Makefile:

  Replace the two open-coded targets with a generalised pattern rule
  which descends into each of SUBDIRS.  This allows `install' to work
  too (it is already supported by xen/test/livepatch/Makefile).

  Provide an explicit default target of `tests', and an `all' target
  (which is conventional).

  Suppress entry into the xen/test/livepatch subdir when we are
  building for i386, since the 32-bit hypervisor is not supported any
  more and we can't build livepatches for it either.

After this, the xen/test subdirectory is somewhere were make can be
invoked in the way which is conventional for xen.git/xen/ subdirs.

None of this is yet invoked from the top-level Makefile.

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 xen/test/Makefile           | 18 ++++++++++++------
 xen/test/livepatch/Makefile |  2 +-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/xen/test/Makefile b/xen/test/Makefile
index d91b319..aa1a23b 100644
--- a/xen/test/Makefile
+++ b/xen/test/Makefile
@@ -1,7 +1,13 @@
-.PHONY: tests
-tests:
-	$(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch livepatch
 
-.PHONY: clean
-clean::
-	$(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean
+tests all: build
+
+
+ifneq ($(XEN_TARGET_ARCH),x86_32)
+# Xen 32-bit x86 hypervisor no longer supported, so has no test livepatches
+SUBDIRS += livepatch
+endif
+
+%:
+	set -e; for s in $(SUBDIRS); do \
+		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
+	done
diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile
index 76d65cf..6831383d 100644
--- a/xen/test/livepatch/Makefile
+++ b/xen/test/livepatch/Makefile
@@ -27,7 +27,7 @@ LIVEPATCHES += $(LIVEPATCH_NOP)
 
 LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch
 
-default: livepatch
+build default: livepatch
 
 install: livepatch
 	$(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
  2017-06-07 14:51 ` [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch Ian Jackson
  2017-06-07 14:51 ` [PATCH 2/4] xen/test/livepatch: Regularise Makefiles Ian Jackson
@ 2017-06-07 14:51 ` Ian Jackson
  2017-06-07 15:06   ` Konrad Rzeszutek Wilk
  2017-06-07 15:20   ` Jan Beulich
  2017-06-07 14:51 ` [PATCH 4/4] Makefile: Provide way to ship livepatch test files Ian Jackson
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 24+ messages in thread
From: Ian Jackson @ 2017-06-07 14:51 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, Jan Beulich, Ian Jackson

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 74747cb..5cae740 100644
--- a/.gitignore
+++ b/.gitignore
@@ -300,6 +300,7 @@ xen/test/livepatch/config.h
 xen/test/livepatch/xen_bye_world.livepatch
 xen/test/livepatch/xen_hello_world.livepatch
 xen/test/livepatch/xen_replace_world.livepatch
+xen/test/livepatch/xen_nop.livepatch
 xen/tools/kconfig/.tmp_gtkcheck
 xen/tools/kconfig/.tmp_qtcheck
 xen/tools/symbols
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH 4/4] Makefile: Provide way to ship livepatch test files
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
                   ` (2 preceding siblings ...)
  2017-06-07 14:51 ` [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore Ian Jackson
@ 2017-06-07 14:51 ` Ian Jackson
  2017-06-07 15:07   ` Konrad Rzeszutek Wilk
  2017-06-07 15:58   ` Andrew Cooper
  2017-06-07 15:07 ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Konrad Rzeszutek Wilk
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 24+ messages in thread
From: Ian Jackson @ 2017-06-07 14:51 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, Jan Beulich, Ian Jackson

In the toplevel Makefile, provide build-tests and install-tests
targets which descend into xen/test.  (dist-tests is provided
automatically by the pattern rule, as is the convention here.)

We have to set BASEDIR ourselves, and use these curious runes, because
the convention in Makefiles under xen/ is to "make -f Rules.mk" with
BASEDIR set and to expect Rules.mk to reinvoke the per-directory
Makefile.  (This is really very strange.)  Normally this invocation
pattern is organised by the machinery in xen/Makefile (which sets
BASEDIR) and Rules.mk, but we need to invoke it from outside that
context.

In theory it would be nice to have a pattern rule %-tests.  But this
is not the style in the rest of the toplevel Makefile; and doing that
might interfere with the dist-% pattern rule.

None of this is invoked by default.  If install-tests or dist-tests is
requested, the livepatches (the only current output from xen/tests)
are shipped in DESTDIR/usr/lib/debug/xen-livepatch/.

This allows CI systems such as osstest which are trying to consume
this to arrange for the files to be built, and output, without them
having to have special knowledge of the details of Xen's build syste.

CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Makefile | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Makefile b/Makefile
index 2ff33df..0b5f57d 100644
--- a/Makefile
+++ b/Makefile
@@ -144,6 +144,17 @@ tools/firmware/ovmf-dir-force-update:
 install-docs:
 	$(MAKE) -C docs install
 
+# We only have build-tests install-tests, not uninstall-tests etc.
+.PHONY: build-tests
+build-tests: build-xen
+	export BASEDIR=$(XEN_ROOT)/xen; \
+	$(MAKE) -f $$BASEDIR/Rules.mk -C xen/test build
+
+.PHONY: install-tests
+install-tests: install-xen
+	export BASEDIR=$(XEN_ROOT)/xen; \
+	$(MAKE) -f $$BASEDIR/Rules.mk -C xen/test install
+
 # build xen and the tools and place them in the install
 # directory. 'make install' should then copy them to the normal system
 # directories
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch
  2017-06-07 14:51 ` [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch Ian Jackson
@ 2017-06-07 15:04   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-07 15:04 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Wed, Jun 07, 2017 at 03:51:29PM +0100, Ian Jackson wrote:
> Dumping these patch files in /usr/lib/debug/xen-*.livepatch is a bit
> ugly.

<shrugs> Not really tied in where they go.
> 
> Also, refactor the Makefile to have a LIVEPATCHES variable, to reduce
> repetition.
> 
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
>  xen/test/livepatch/Makefile | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile
> index 76a779a..76d65cf 100644
> --- a/xen/test/livepatch/Makefile
> +++ b/xen/test/livepatch/Makefile
> @@ -20,18 +20,21 @@ LIVEPATCH_BYE := xen_bye_world.livepatch
>  LIVEPATCH_REPLACE := xen_replace_world.livepatch
>  LIVEPATCH_NOP := xen_nop.livepatch
>  
> +LIVEPATCHES += $(LIVEPATCH)
> +LIVEPATCHES += $(LIVEPATCH_BYE)
> +LIVEPATCHES += $(LIVEPATCH_REPLACE)
> +LIVEPATCHES += $(LIVEPATCH_NOP)
> +
> +LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch
> +
>  default: livepatch
>  
>  install: livepatch
> -	$(INSTALL_DATA) $(LIVEPATCH) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH)
> -	$(INSTALL_DATA) $(LIVEPATCH_BYE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE)
> -	$(INSTALL_DATA) $(LIVEPATCH_REPLACE) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE)
> -	$(INSTALL_DATA) $(LIVEPATCH_NOP) $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP)
> +	$(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
> +	$(INSTALL_DATA) $(LIVEPATCHES) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
> +
>  uninstall:
> -	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH)
> -	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_BYE)
> -	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_REPLACE)
> -	rm -f $(DESTDIR)$(DEBUG_DIR)/$(LIVEPATCH_NOP)
> +	cd $(DESTDIR)$(LIVEPATCH_DEBUG_DIR) && rm -f $(LIVEPATCHES)
>  
>  .PHONY: clean
>  clean::
> -- 
> 2.1.4
> 

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 2/4] xen/test/livepatch: Regularise Makefiles
  2017-06-07 14:51 ` [PATCH 2/4] xen/test/livepatch: Regularise Makefiles Ian Jackson
@ 2017-06-07 15:05   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-07 15:05 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Wed, Jun 07, 2017 at 03:51:30PM +0100, Ian Jackson wrote:
> In xen/test/livepatch/Makefile:
> 
>   Provide a `build' target, as most of the
>   subdir-invoking Makefiles elsewhere expect.
> 
> In xen/test/Makefile:
> 
>   Replace the two open-coded targets with a generalised pattern rule
>   which descends into each of SUBDIRS.  This allows `install' to work
>   too (it is already supported by xen/test/livepatch/Makefile).
> 
>   Provide an explicit default target of `tests', and an `all' target
>   (which is conventional).
> 
>   Suppress entry into the xen/test/livepatch subdir when we are
>   building for i386, since the 32-bit hypervisor is not supported any
>   more and we can't build livepatches for it either.
> 
> After this, the xen/test subdirectory is somewhere were make can be
> invoked in the way which is conventional for xen.git/xen/ subdirs.
> 
> None of this is yet invoked from the top-level Makefile.
> 
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

I am not a Makefile expert but I can give you an 
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
>  xen/test/Makefile           | 18 ++++++++++++------
>  xen/test/livepatch/Makefile |  2 +-
>  2 files changed, 13 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/test/Makefile b/xen/test/Makefile
> index d91b319..aa1a23b 100644
> --- a/xen/test/Makefile
> +++ b/xen/test/Makefile
> @@ -1,7 +1,13 @@
> -.PHONY: tests
> -tests:
> -	$(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch livepatch
>  
> -.PHONY: clean
> -clean::
> -	$(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean
> +tests all: build
> +
> +
> +ifneq ($(XEN_TARGET_ARCH),x86_32)
> +# Xen 32-bit x86 hypervisor no longer supported, so has no test livepatches
> +SUBDIRS += livepatch
> +endif
> +
> +%:
> +	set -e; for s in $(SUBDIRS); do \
> +		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
> +	done
> diff --git a/xen/test/livepatch/Makefile b/xen/test/livepatch/Makefile
> index 76d65cf..6831383d 100644
> --- a/xen/test/livepatch/Makefile
> +++ b/xen/test/livepatch/Makefile
> @@ -27,7 +27,7 @@ LIVEPATCHES += $(LIVEPATCH_NOP)
>  
>  LIVEPATCH_DEBUG_DIR ?= $(DEBUG_DIR)/xen-livepatch
>  
> -default: livepatch
> +build default: livepatch
>  
>  install: livepatch
>  	$(INSTALL_DIR) $(DESTDIR)$(LIVEPATCH_DEBUG_DIR)
> -- 
> 2.1.4
> 

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore
  2017-06-07 14:51 ` [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore Ian Jackson
@ 2017-06-07 15:06   ` Konrad Rzeszutek Wilk
  2017-06-07 15:20   ` Jan Beulich
  1 sibling, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-07 15:06 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Wed, Jun 07, 2017 at 03:51:31PM +0100, Ian Jackson wrote:
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Oh yes!

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  .gitignore | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/.gitignore b/.gitignore
> index 74747cb..5cae740 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -300,6 +300,7 @@ xen/test/livepatch/config.h
>  xen/test/livepatch/xen_bye_world.livepatch
>  xen/test/livepatch/xen_hello_world.livepatch
>  xen/test/livepatch/xen_replace_world.livepatch
> +xen/test/livepatch/xen_nop.livepatch
>  xen/tools/kconfig/.tmp_gtkcheck
>  xen/tools/kconfig/.tmp_qtcheck
>  xen/tools/symbols
> -- 
> 2.1.4
> 

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/4] Makefile: Provide way to ship livepatch test files
  2017-06-07 14:51 ` [PATCH 4/4] Makefile: Provide way to ship livepatch test files Ian Jackson
@ 2017-06-07 15:07   ` Konrad Rzeszutek Wilk
  2017-06-07 15:58   ` Andrew Cooper
  1 sibling, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-07 15:07 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Wed, Jun 07, 2017 at 03:51:32PM +0100, Ian Jackson wrote:
> In the toplevel Makefile, provide build-tests and install-tests
> targets which descend into xen/test.  (dist-tests is provided
> automatically by the pattern rule, as is the convention here.)
> 
> We have to set BASEDIR ourselves, and use these curious runes, because
> the convention in Makefiles under xen/ is to "make -f Rules.mk" with
> BASEDIR set and to expect Rules.mk to reinvoke the per-directory
> Makefile.  (This is really very strange.)  Normally this invocation
> pattern is organised by the machinery in xen/Makefile (which sets
> BASEDIR) and Rules.mk, but we need to invoke it from outside that
> context.
> 
> In theory it would be nice to have a pattern rule %-tests.  But this
> is not the style in the rest of the toplevel Makefile; and doing that
> might interfere with the dist-% pattern rule.
> 
> None of this is invoked by default.  If install-tests or dist-tests is
> requested, the livepatches (the only current output from xen/tests)
> are shipped in DESTDIR/usr/lib/debug/xen-livepatch/.
> 
> This allows CI systems such as osstest which are trying to consume
> this to arrange for the files to be built, and output, without them
> having to have special knowledge of the details of Xen's build syste.
> 
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
>  Makefile | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Makefile b/Makefile
> index 2ff33df..0b5f57d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -144,6 +144,17 @@ tools/firmware/ovmf-dir-force-update:
>  install-docs:
>  	$(MAKE) -C docs install
>  
> +# We only have build-tests install-tests, not uninstall-tests etc.
> +.PHONY: build-tests
> +build-tests: build-xen
> +	export BASEDIR=$(XEN_ROOT)/xen; \
> +	$(MAKE) -f $$BASEDIR/Rules.mk -C xen/test build
> +
> +.PHONY: install-tests
> +install-tests: install-xen
> +	export BASEDIR=$(XEN_ROOT)/xen; \
> +	$(MAKE) -f $$BASEDIR/Rules.mk -C xen/test install
> +
>  # build xen and the tools and place them in the install
>  # directory. 'make install' should then copy them to the normal system
>  # directories
> -- 
> 2.1.4
> 

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
                   ` (3 preceding siblings ...)
  2017-06-07 14:51 ` [PATCH 4/4] Makefile: Provide way to ship livepatch test files Ian Jackson
@ 2017-06-07 15:07 ` Konrad Rzeszutek Wilk
  2017-06-07 15:22 ` Jan Beulich
  2017-06-07 15:31 ` Wei Liu
  6 siblings, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-07 15:07 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Wed, Jun 07, 2017 at 03:51:28PM +0100, Ian Jackson wrote:
> I am trying to get the livepatches tested in osstest.  As discussed, I
> would like the xen.git Makefiles to be able to ship the livepatch test
> files, so that osstest does not need to have too much special
> knowledge of the xen.git build system.
> 
> There are three preliminary patches which tidy up the xen/test
> Makefiles etc. a bit, and a final patch which provides the top-level
> targets.  These targets are not invoked by default.
> 
> I have tested these with a private osstest branch; I got a pass with
> an amd64 toolstack.  I'm still getting my osstest branch to DTRT with
> a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series
> needs some work.  But given that I have had one pass, and verified
> that things work with a 32-bit x86 build, I think the xen.git changes
> can go in now.

Thank you for taking these up!

> 
> I would ideally like this in 4.9 because I would like to establish the
> interface; also eventually I expect we will want to backport these
> Makefile changes to 4.8 so that we can test the 4.8 livepatching too.
> 
> Thanks,
> Ian.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore
  2017-06-07 14:51 ` [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore Ian Jackson
  2017-06-07 15:06   ` Konrad Rzeszutek Wilk
@ 2017-06-07 15:20   ` Jan Beulich
  1 sibling, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-06-07 15:20 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, xen-devel

>>> On 07.06.17 at 16:51, <ian.jackson@eu.citrix.com> wrote:
> --- a/.gitignore
> +++ b/.gitignore
> @@ -300,6 +300,7 @@ xen/test/livepatch/config.h
>  xen/test/livepatch/xen_bye_world.livepatch
>  xen/test/livepatch/xen_hello_world.livepatch
>  xen/test/livepatch/xen_replace_world.livepatch
> +xen/test/livepatch/xen_nop.livepatch

Please move your addition one line up to respect alphabetical
ordering.

Jan


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
                   ` (4 preceding siblings ...)
  2017-06-07 15:07 ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Konrad Rzeszutek Wilk
@ 2017-06-07 15:22 ` Jan Beulich
  2017-06-07 15:31 ` Wei Liu
  6 siblings, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-06-07 15:22 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, xen-devel

>>> On 07.06.17 at 16:51, <ian.jackson@eu.citrix.com> wrote:
> I am trying to get the livepatches tested in osstest.  As discussed, I
> would like the xen.git Makefiles to be able to ship the livepatch test
> files, so that osstest does not need to have too much special
> knowledge of the xen.git build system.
> 
> There are three preliminary patches which tidy up the xen/test
> Makefiles etc. a bit, and a final patch which provides the top-level
> targets.  These targets are not invoked by default.
> 
> I have tested these with a private osstest branch; I got a pass with
> an amd64 toolstack.  I'm still getting my osstest branch to DTRT with
> a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series
> needs some work.  But given that I have had one pass, and verified
> that things work with a 32-bit x86 build, I think the xen.git changes
> can go in now.
> 
> I would ideally like this in 4.9 because I would like to establish the
> interface; also eventually I expect we will want to backport these
> Makefile changes to 4.8 so that we can test the 4.8 livepatching too.

With the one minor remark on patch 3 addressed
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
                   ` (5 preceding siblings ...)
  2017-06-07 15:22 ` Jan Beulich
@ 2017-06-07 15:31 ` Wei Liu
  2017-06-07 15:53   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests [and 1 more messages] Ian Jackson
  2017-06-09 12:41   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Julien Grall
  6 siblings, 2 replies; 24+ messages in thread
From: Wei Liu @ 2017-06-07 15:31 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Wed, Jun 07, 2017 at 03:51:28PM +0100, Ian Jackson wrote:
> I am trying to get the livepatches tested in osstest.  As discussed, I
> would like the xen.git Makefiles to be able to ship the livepatch test
> files, so that osstest does not need to have too much special
> knowledge of the xen.git build system.
> 
> There are three preliminary patches which tidy up the xen/test
> Makefiles etc. a bit, and a final patch which provides the top-level
> targets.  These targets are not invoked by default.
> 
> I have tested these with a private osstest branch; I got a pass with
> an amd64 toolstack.  I'm still getting my osstest branch to DTRT with
> a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series
> needs some work.  But given that I have had one pass, and verified
> that things work with a 32-bit x86 build, I think the xen.git changes
> can go in now.
> 
> I would ideally like this in 4.9 because I would like to establish the
> interface; also eventually I expect we will want to backport these
> Makefile changes to 4.8 so that we can test the 4.8 livepatching too.
> 

Acked-by: Wei Liu <wei.liu2@citrix.com>

+1 for this to go into 4.9 and be backported to 4.8.

> Thanks,
> Ian.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests [and 1 more messages]
  2017-06-07 15:31 ` Wei Liu
@ 2017-06-07 15:53   ` Ian Jackson
  2017-06-09 12:41   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Julien Grall
  1 sibling, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2017-06-07 15:53 UTC (permalink / raw)
  To: Jan Beulich, Wei Liu
  Cc: xen-devel, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, xen-devel

Wei Liu writes ("Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
> Acked-by: Wei Liu <wei.liu2@citrix.com>

Thanks to everyone for the review and acks.

> +1 for this to go into 4.9 and be backported to 4.8.

Thanks.

Jan Beulich writes ("Re: [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore"):
> On 07.06.17 at 16:51, <ian.jackson@eu.citrix.com> wrote:
> > +xen/test/livepatch/xen_nop.livepatch
> 
> Please move your addition one line up to respect alphabetical
> ordering.

Of course.  Done.

Thanks,
Ian.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH 4/4] Makefile: Provide way to ship livepatch test files
  2017-06-07 14:51 ` [PATCH 4/4] Makefile: Provide way to ship livepatch test files Ian Jackson
  2017-06-07 15:07   ` Konrad Rzeszutek Wilk
@ 2017-06-07 15:58   ` Andrew Cooper
  1 sibling, 0 replies; 24+ messages in thread
From: Andrew Cooper @ 2017-06-07 15:58 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Tim Deegan, Julien Grall,
	Stefano Stabellini, Jan Beulich

On 07/06/17 15:51, Ian Jackson wrote:
> This allows CI systems such as osstest which are trying to consume
> this to arrange for the files to be built, and output, without them
> having to have special knowledge of the details of Xen's build syste.

system.

~Andrew

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-07 15:31 ` Wei Liu
  2017-06-07 15:53   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests [and 1 more messages] Ian Jackson
@ 2017-06-09 12:41   ` Julien Grall
  2017-06-09 14:31     ` Ian Jackson
  1 sibling, 1 reply; 24+ messages in thread
From: Julien Grall @ 2017-06-09 12:41 UTC (permalink / raw)
  To: Wei Liu, Ian Jackson
  Cc: xen-devel, George Dunlap, Andrew Cooper, Tim Deegan,
	Stefano Stabellini, Jan Beulich

Hi,

On 07/06/17 16:31, Wei Liu wrote:
> On Wed, Jun 07, 2017 at 03:51:28PM +0100, Ian Jackson wrote:
>> I am trying to get the livepatches tested in osstest.  As discussed, I
>> would like the xen.git Makefiles to be able to ship the livepatch test
>> files, so that osstest does not need to have too much special
>> knowledge of the xen.git build system.
>>
>> There are three preliminary patches which tidy up the xen/test
>> Makefiles etc. a bit, and a final patch which provides the top-level
>> targets.  These targets are not invoked by default.
>>
>> I have tested these with a private osstest branch; I got a pass with
>> an amd64 toolstack.  I'm still getting my osstest branch to DTRT with
>> a 32-bit toolstack but 64-bit hypervisor, and the osstest patch series
>> needs some work.  But given that I have had one pass, and verified
>> that things work with a 32-bit x86 build, I think the xen.git changes
>> can go in now.
>>
>> I would ideally like this in 4.9 because I would like to establish the
>> interface; also eventually I expect we will want to backport these
>> Makefile changes to 4.8 so that we can test the 4.8 livepatching too.
>>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
>
> +1 for this to go into 4.9 and be backported to 4.8.

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-09 12:41   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Julien Grall
@ 2017-06-09 14:31     ` Ian Jackson
  2017-06-14 10:28       ` Julien Grall
  0 siblings, 1 reply; 24+ messages in thread
From: Ian Jackson @ 2017-06-09 14:31 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Stefano Stabellini, Jan Beulich

Julien Grall writes ("Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
> Release-acked-by: Julien Grall <julien.grall@arm.com>

Thanks.  I have pushed this to staging and will wait for an osstest
test report to check I didn't break the build, before applying the
same commits to staging-4.9.

Ian.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-09 14:31     ` Ian Jackson
@ 2017-06-14 10:28       ` Julien Grall
  2017-06-19 12:59         ` Ian Jackson
  0 siblings, 1 reply; 24+ messages in thread
From: Julien Grall @ 2017-06-14 10:28 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Stefano Stabellini, Jan Beulich

Hi Ian,

On 06/09/2017 03:31 PM, Ian Jackson wrote:
> Julien Grall writes ("Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
>> Release-acked-by: Julien Grall <julien.grall@arm.com>
> 
> Thanks.  I have pushed this to staging and will wait for an osstest
> test report to check I didn't break the build, before applying the
> same commits to staging-4.9.

I don't see the patches in staging. Do you still plan to have those 
patches in Xen 4.9?

Cheers,

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-14 10:28       ` Julien Grall
@ 2017-06-19 12:59         ` Ian Jackson
  2017-06-19 13:03           ` Andrew Cooper
  0 siblings, 1 reply; 24+ messages in thread
From: Ian Jackson @ 2017-06-19 12:59 UTC (permalink / raw)
  To: Julien Grall
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Stefano Stabellini, Jan Beulich

Julien Grall writes ("Re: [Xen-devel] [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
> I don't see the patches in staging. Do you still plan to have those 
> patches in Xen 4.9?

As you'll have seen, they went to staging last week and are now in
xen.git#master.  I have just applied them to staging-4.9 (and
staging-4.8).

Thanks,
Ian.

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests
  2017-06-19 12:59         ` Ian Jackson
@ 2017-06-19 13:03           ` Andrew Cooper
  2017-06-19 14:23             ` [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule Ian Jackson
  0 siblings, 1 reply; 24+ messages in thread
From: Andrew Cooper @ 2017-06-19 13:03 UTC (permalink / raw)
  To: Ian Jackson, Julien Grall
  Cc: xen-devel, Wei Liu, George Dunlap, Tim Deegan,
	Stefano Stabellini, Jan Beulich

On 19/06/17 13:59, Ian Jackson wrote:
> Julien Grall writes ("Re: [Xen-devel] [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests"):
>> I don't see the patches in staging. Do you still plan to have those 
>> patches in Xen 4.9?
> As you'll have seen, they went to staging last week and are now in
> xen.git#master.  I have just applied them to staging-4.9 (and
> staging-4.8).

Unfortunately, the `make -C xen clean` target is now broken.

make -f /local/xen.git/xen/Rules.mk -C test clean
make[2]: Entering directory '/local/xen.git/xen/test'
set -e; for s in livepatch; do \
    make -f /local/xen.git/xen/Rules.mk -C $s .*.d; \
done
make[3]: Entering directory '/local/xen.git/xen/test/livepatch'
make[3]: *** No rule to make target '.*.d'.  Stop.
make[3]: Leaving directory '/local/xen.git/xen/test/livepatch'

I think the %: rule is too general, and needs restricting to the primary
commands.

~Andrew

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
  2017-06-19 13:03           ` Andrew Cooper
@ 2017-06-19 14:23             ` Ian Jackson
  2017-06-19 14:55               ` Konrad Rzeszutek Wilk
  2017-06-19 20:14               ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 24+ messages in thread
From: Ian Jackson @ 2017-06-19 14:23 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, Julien Grall, Jan Beulich, Ian Jackson

In "xen/test/livepatch: Regularise Makefiles" we reworked
xen/test/Makefile to use a pattern rule.  However, there are two
problems with this.  Both are related to the way that xen/Rules.mk is
implicitly part of this Makefile because of the way that Makefiles
under xen/ are invoked by their parent directory Makefiles.

Firstly, the Rules.mk `clean' target overrides the pattern rule in
xen/test/Makefile.  The result is that `make -C xen clean' does not
actually run the livepatch clean target.

The Rules.mk clean target does have provision for recursing into
subdirectories, but that feature is tangled up with complex object
file iteration machinery which is not desirable here.  However, we can
extend the Rules.mk clean target since it is a double-colon rules.

Sadly this involves duplicating the SUBDIR iteration boilerplate.  (A
make function could be used but the cure would be worse than the
disease.)

Secondly, Rules.mk has a number of -include directives.  make likes to
try to (re)build files mentioned in includes.  With the % pattern
rule, this applies to those files too.

As a result, make -C xen clean would try to build `.*.d' (for example)
in xen/test.  This would fail with an error message.  The error would
be ignored because of the `-', but it's annoying and ugly.

Solve this by limiting the % pattern rule to the targets we expect it
to handle.  These are those listed in the top-level Makefile, apart
from: those which are subdir- or component-qualified; clean targets
(which are handled specially, even distclean); and dist,
src-tarball-*, etc. (which are converted to install by an earlier
Makefile).

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 xen/test/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/test/Makefile b/xen/test/Makefile
index aa1a23b..aaa4996 100644
--- a/xen/test/Makefile
+++ b/xen/test/Makefile
@@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32)
 SUBDIRS += livepatch
 endif
 
-%:
+install build subtree-force-update uninstall: %:
 	set -e; for s in $(SUBDIRS); do \
 		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
 	done
+
+clean::
+	set -e; for s in $(SUBDIRS); do \
+		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \
+	done
-- 
2.1.4


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

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
  2017-06-19 14:23             ` [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule Ian Jackson
@ 2017-06-19 14:55               ` Konrad Rzeszutek Wilk
  2017-06-19 20:14               ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-19 14:55 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Mon, Jun 19, 2017 at 03:23:26PM +0100, Ian Jackson wrote:
> In "xen/test/livepatch: Regularise Makefiles" we reworked
> xen/test/Makefile to use a pattern rule.  However, there are two
> problems with this.  Both are related to the way that xen/Rules.mk is
> implicitly part of this Makefile because of the way that Makefiles
> under xen/ are invoked by their parent directory Makefiles.
> 
> Firstly, the Rules.mk `clean' target overrides the pattern rule in
> xen/test/Makefile.  The result is that `make -C xen clean' does not
> actually run the livepatch clean target.
> 
> The Rules.mk clean target does have provision for recursing into
> subdirectories, but that feature is tangled up with complex object
> file iteration machinery which is not desirable here.  However, we can
> extend the Rules.mk clean target since it is a double-colon rules.
> 
> Sadly this involves duplicating the SUBDIR iteration boilerplate.  (A
> make function could be used but the cure would be worse than the
> disease.)
> 
> Secondly, Rules.mk has a number of -include directives.  make likes to
> try to (re)build files mentioned in includes.  With the % pattern
> rule, this applies to those files too.
> 
> As a result, make -C xen clean would try to build `.*.d' (for example)
> in xen/test.  This would fail with an error message.  The error would
> be ignored because of the `-', but it's annoying and ugly.

Aaah.
> 
> Solve this by limiting the % pattern rule to the targets we expect it
> to handle.  These are those listed in the top-level Makefile, apart
> from: those which are subdir- or component-qualified; clean targets
> (which are handled specially, even distclean); and dist,
> src-tarball-*, etc. (which are converted to install by an earlier
> Makefile).
> 
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>


> ---
>  xen/test/Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/test/Makefile b/xen/test/Makefile
> index aa1a23b..aaa4996 100644
> --- a/xen/test/Makefile
> +++ b/xen/test/Makefile
> @@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32)
>  SUBDIRS += livepatch
>  endif
>  
> -%:
> +install build subtree-force-update uninstall: %:
>  	set -e; for s in $(SUBDIRS); do \
>  		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
>  	done
> +
> +clean::
> +	set -e; for s in $(SUBDIRS); do \
> +		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \
> +	done
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
  2017-06-19 14:23             ` [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule Ian Jackson
  2017-06-19 14:55               ` Konrad Rzeszutek Wilk
@ 2017-06-19 20:14               ` Konrad Rzeszutek Wilk
  2017-06-20 10:37                 ` Julien Grall
  1 sibling, 1 reply; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-06-19 20:14 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Julien Grall, Stefano Stabellini, Jan Beulich

On Mon, Jun 19, 2017 at 03:23:26PM +0100, Ian Jackson wrote:
> In "xen/test/livepatch: Regularise Makefiles" we reworked
> xen/test/Makefile to use a pattern rule.  However, there are two
> problems with this.  Both are related to the way that xen/Rules.mk is
> implicitly part of this Makefile because of the way that Makefiles
> under xen/ are invoked by their parent directory Makefiles.
> 
> Firstly, the Rules.mk `clean' target overrides the pattern rule in
> xen/test/Makefile.  The result is that `make -C xen clean' does not
> actually run the livepatch clean target.
> 
> The Rules.mk clean target does have provision for recursing into
> subdirectories, but that feature is tangled up with complex object
> file iteration machinery which is not desirable here.  However, we can
> extend the Rules.mk clean target since it is a double-colon rules.
> 
> Sadly this involves duplicating the SUBDIR iteration boilerplate.  (A
> make function could be used but the cure would be worse than the
> disease.)
> 
> Secondly, Rules.mk has a number of -include directives.  make likes to
> try to (re)build files mentioned in includes.  With the % pattern
> rule, this applies to those files too.
> 
> As a result, make -C xen clean would try to build `.*.d' (for example)
> in xen/test.  This would fail with an error message.  The error would
> be ignored because of the `-', but it's annoying and ugly.
> 
> Solve this by limiting the % pattern rule to the targets we expect it
> to handle.  These are those listed in the top-level Makefile, apart
> from: those which are subdir- or component-qualified; clean targets
> (which are handled specially, even distclean); and dist,
> src-tarball-*, etc. (which are converted to install by an earlier
> Makefile).
> 
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>

And
Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> ---
>  xen/test/Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/test/Makefile b/xen/test/Makefile
> index aa1a23b..aaa4996 100644
> --- a/xen/test/Makefile
> +++ b/xen/test/Makefile
> @@ -7,7 +7,12 @@ ifneq ($(XEN_TARGET_ARCH),x86_32)
>  SUBDIRS += livepatch
>  endif
>  
> -%:
> +install build subtree-force-update uninstall: %:
>  	set -e; for s in $(SUBDIRS); do \
>  		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $*; \
>  	done
> +
> +clean::
> +	set -e; for s in $(SUBDIRS); do \
> +		$(MAKE) -f $(BASEDIR)/Rules.mk -C $$s $@; \
> +	done
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule
  2017-06-19 20:14               ` Konrad Rzeszutek Wilk
@ 2017-06-20 10:37                 ` Julien Grall
  0 siblings, 0 replies; 24+ messages in thread
From: Julien Grall @ 2017-06-20 10:37 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk, Ian Jackson
  Cc: xen-devel, Wei Liu, George Dunlap, Andrew Cooper, Tim Deegan,
	Stefano Stabellini, Jan Beulich

Hi,

On 06/19/2017 09:14 PM, Konrad Rzeszutek Wilk wrote:
> On Mon, Jun 19, 2017 at 03:23:26PM +0100, Ian Jackson wrote:
>> In "xen/test/livepatch: Regularise Makefiles" we reworked
>> xen/test/Makefile to use a pattern rule.  However, there are two
>> problems with this.  Both are related to the way that xen/Rules.mk is
>> implicitly part of this Makefile because of the way that Makefiles
>> under xen/ are invoked by their parent directory Makefiles.
>>
>> Firstly, the Rules.mk `clean' target overrides the pattern rule in
>> xen/test/Makefile.  The result is that `make -C xen clean' does not
>> actually run the livepatch clean target.
>>
>> The Rules.mk clean target does have provision for recursing into
>> subdirectories, but that feature is tangled up with complex object
>> file iteration machinery which is not desirable here.  However, we can
>> extend the Rules.mk clean target since it is a double-colon rules.
>>
>> Sadly this involves duplicating the SUBDIR iteration boilerplate.  (A
>> make function could be used but the cure would be worse than the
>> disease.)
>>
>> Secondly, Rules.mk has a number of -include directives.  make likes to
>> try to (re)build files mentioned in includes.  With the % pattern
>> rule, this applies to those files too.
>>
>> As a result, make -C xen clean would try to build `.*.d' (for example)
>> in xen/test.  This would fail with an error message.  The error would
>> be ignored because of the `-', but it's annoying and ugly.
>>
>> Solve this by limiting the % pattern rule to the targets we expect it
>> to handle.  These are those listed in the top-level Makefile, apart
>> from: those which are subdir- or component-qualified; clean targets
>> (which are handled specially, even distclean); and dist,
>> src-tarball-*, etc. (which are converted to install by an earlier
>> Makefile).
>>
>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> 
> And
> Tested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-06-20 10:37 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-07 14:51 [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Ian Jackson
2017-06-07 14:51 ` [PATCH 1/4] xen/test/livepatch/Makefile: Install in DESTDIR/usr/lib/debug/xen-livepatch Ian Jackson
2017-06-07 15:04   ` Konrad Rzeszutek Wilk
2017-06-07 14:51 ` [PATCH 2/4] xen/test/livepatch: Regularise Makefiles Ian Jackson
2017-06-07 15:05   ` Konrad Rzeszutek Wilk
2017-06-07 14:51 ` [PATCH 3/4] xen/test/livepatch: Add xen_nop.livepatch to .gitignore Ian Jackson
2017-06-07 15:06   ` Konrad Rzeszutek Wilk
2017-06-07 15:20   ` Jan Beulich
2017-06-07 14:51 ` [PATCH 4/4] Makefile: Provide way to ship livepatch test files Ian Jackson
2017-06-07 15:07   ` Konrad Rzeszutek Wilk
2017-06-07 15:58   ` Andrew Cooper
2017-06-07 15:07 ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Konrad Rzeszutek Wilk
2017-06-07 15:22 ` Jan Beulich
2017-06-07 15:31 ` Wei Liu
2017-06-07 15:53   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests [and 1 more messages] Ian Jackson
2017-06-09 12:41   ` [PATCH for-4.9 0/4] Makefiles: Provide way to ship livepatch tests Julien Grall
2017-06-09 14:31     ` Ian Jackson
2017-06-14 10:28       ` Julien Grall
2017-06-19 12:59         ` Ian Jackson
2017-06-19 13:03           ` Andrew Cooper
2017-06-19 14:23             ` [PATCH for-4.9] xen/test/Makefile: Fix clean target, broken by pattern rule Ian Jackson
2017-06-19 14:55               ` Konrad Rzeszutek Wilk
2017-06-19 20:14               ` Konrad Rzeszutek Wilk
2017-06-20 10:37                 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).