shim: don't let build modify shim.config
PATCH 1/1 shim: don't let build modify shim.config
Currently building the shim will modify shim.config in case some config option was added or modified in the hypervisor.
Avoid that by copying shim.config to an intermediate file instead.
---
Not sure whether its worth to take that for 4.11.
In case the maintainers think it should be part of 4.11 then LGTM. A followup patch should reduce the config options specified in shim.config.
--- .gitignore | 1 + tools/firmware/xen-dir/Makefile | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-)
.gitignore +1 -0
@@ -161,6 +161,7 @@ tools/firmware/xen-dir/linkfarm.stamp* tools/firmware/xen-dir/xen-root tools/firmware/xen-dir/xen-shim tools/firmware/xen-dir/xen-shim-syms +tools/firmware/xen-dir/xen-shim.config tools/flask/utils/flask-getenforce tools/flask/utils/flask-get-bool tools/flask/utils/flask-loadpolicy
tools/firmware/xen-dir/Makefile +7 -6
@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \ +xen-shim.config: shim.config + cp $< $@ + $(MAKE) -C $(D)/xen olddefconfig \ XEN_CONFIG_EXPERT=y \ - KCONFIG_CONFIG=$(CURDIR)/shim.config + KCONFIG_CONFIG=$(CURDIR)/xen-shim.config -xen-shim: $(D) shim-olddefconfig +xen-shim: $(D) xen-shim.config $(MAKE) -C $(D)/xen build \ XEN_CONFIG_EXPERT=y \ - KCONFIG_CONFIG=$(CURDIR)/shim.config + KCONFIG_CONFIG=$(CURDIR)/xen-shim.config ln -sf $(D)/xen/xen $@ ln -sf $(D)/xen/xen-syms $@-syms .PHONY: distclean clean distclean clean: rm -f xen-shim xen-shim-syms *.old + rm -f xen-shim.config rm -rf $(D) rm -f linkfarm.stamp*
Signature · 7 lines
2.13.6 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \
I think there was a reason for the % and $*.
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 45
Quoted 2 lines
tools/firmware/xen-dir/Makefile +2
-0+xen-shim.config: shim.config + cp $< $@
Why not copy it to where it actually belong - xen/.config?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-0@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean
Quoted 5 lines
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 3 lines
tools/firmware/xen-dir/Makefile +0
-3-.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Quoted 4 lines
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 45
Quoted 2 lines
tools/firmware/xen-dir/Makefile +2
-0+xen-shim.config: shim.config + cp $< $@Why not copy it to where it actually belong - xen/.config?
Hmm, true. In case nobody objects I'll do that.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 14 lines · Juergen Gross
Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-0@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distcleanQuoted 5 lines
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 3 lines
tools/firmware/xen-dir/Makefile +0
-3-.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
Quoted 6 lines
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Not likely I think.
Quoted 9 lines
Quoted 5 lines
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 45
Quoted 3 lines
tools/firmware/xen-dir/Makefile +2
-0+xen-shim.config: shim.config + cp $< $@Why not copy it to where it actually belong - xen/.config?
Hmm, true. In case nobody objects I'll do that.
No objection.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
Quoted 7 lines
Quoted 6 lines
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Not likely I think.
Using make shim-menuconfig was a specific usecase for my original version, but with this difference in representation, the usecase has mostly gone away.
With this change in place, what is the expected workflow for making an update to the configuration?
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 20 lines · Andrew Cooper
Quoted 19 lines · Wei Liu
Quoted 18 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Quoted 9 lines
Quoted 1 line
Not likely I think.
Using
make shim-menuconfigwas a specific usecase for my original version, but with this difference in representation, the usecase has mostly gone away.With this change in place, what is the expected workflow for making an update to the configuration?
Just commit the must-have's to the tracked file and let Xen's build system handle the rest?
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 27 lines · Wei Liu
Quoted 26 lines · Andrew Cooper
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
Quoted 7 lines
Quoted 6 lines
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Not likely I think.
Using
make shim-menuconfigwas a specific usecase for my original version, but with this difference in representation, the usecase has mostly gone away.
Quoted 6 lines
Quoted 3 lines
With this change in place, what is the expected workflow for making an update to the configuration?
Just commit the must-have's to the tracked file and let Xen's build system handle the rest?
+1. As a bare minimum:
CONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=yCONFIG_PV_SHIM_EXCLUSIVE=y
But I expect some more might be needed.
Having a full config will always be a PITA because it will get out of synch.
Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 32 lines · Roger Pau Monné
Quoted 26 lines · Wei Liu
Quoted 25 lines · Andrew Cooper
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
Quoted 7 lines
Quoted 6 lines
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Not likely I think.
Using
make shim-menuconfigwas a specific usecase for my original version, but with this difference in representation, the usecase has mostly gone away.Quoted 5 lines
Quoted 3 lines
With this change in place, what is the expected workflow for making an update to the configuration?
Just commit the must-have's to the tracked file and let Xen's build system handle the rest?
Quoted 8 lines
+1. As a bare minimum:
CONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=yCONFIG_PV_SHIM_EXCLUSIVE=yBut I expect some more might be needed.
CONFIG_SHADOW_PAGING=nCONFIG_NR_CPUS=32CONFIG_VIDEO=nCONFIG_HVM_FEP=nCONFIG_TBOOT=nCONFIG_KEXEC=nCONFIG_TMEM=nCONFIG_XENOPROF=n
Remember that shim also wants to be as much of a slimline build as possible
Quoted 2 lines
Having a full config will always be a PITA because it will get out of synch.
However we store it, it will get out of sync. I don't see a solution to this problem.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 51 lines · Andrew Cooper
Quoted 32 lines · Roger Pau Monné
Quoted 26 lines · Wei Liu
Quoted 25 lines · Andrew Cooper
Quoted 13 lines · Wei Liu
Quoted 12 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
Quoted 7 lines
Quoted 6 lines
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Not likely I think.
Using
make shim-menuconfigwas a specific usecase for my original version, but with this difference in representation, the usecase has mostly gone away.Quoted 5 lines
Quoted 3 lines
With this change in place, what is the expected workflow for making an update to the configuration?
Just commit the must-have's to the tracked file and let Xen's build system handle the rest?
Quoted 8 lines
+1. As a bare minimum:
CONFIG_XEN_GUEST=yCONFIG_PVH_GUEST=yCONFIG_PV_SHIM=yCONFIG_PV_SHIM_EXCLUSIVE=yBut I expect some more might be needed.
CONFIG_SHADOW_PAGING=nCONFIG_NR_CPUS=32CONFIG_VIDEO=nCONFIG_HVM_FEP=nCONFIG_TBOOT=nCONFIG_KEXEC=nCONFIG_TMEM=nCONFIG_XENOPROF=n
Quoted 1 line
Remember that shim also wants to be as much of a slimline build as possible
Attached is the minimal shim.config to be fed into "make olddefconfig" resulting in the current config used for the shim.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 20 lines · Andrew Cooper
Quoted 19 lines · Wei Liu
Quoted 18 lines · Juergen Gross
Quoted 11 lines · Jan Beulich
tools/firmware/xen-dir/Makefile linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE · line 46
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 19.04.18 at 12:30, <[email protected]> wrote:
tools/firmware/xen-dir/Makefile +0
-3@@ -41,21 +41,22 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE $(D): linkfarm.stamp $(MAKE) -C $(D)/xen distclean -.PHONY: shim-%config -shim-%config: $(D) FORCE - $(MAKE) -C $(D)/xen $*config \I think there was a reason for the % and $*.
The only one I could think of is the possibility to do
make shim-defaultconfig
or similar calls. Question is who will ever need that. In case it is believed to be valuable I can keep it.
Quoted 8 lines
Quoted 1 line
Not likely I think.
Using
make shim-menuconfigwas a specific usecase for my original version, but with this difference in representation, the usecase has mostly gone away.With this change in place, what is the expected workflow for making an update to the configuration?
You can still cd to tools/firmware/xen-dir/xen-root/xen and do the "make menuconfig" there. Afterwards copy the resulting .config to ../../shim.config and you have the same result. Question is whether you want to do that in case we are stripping down shim.config later.
Above assumes V2 of my patch will be taken, of course.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel