Skip to contentSkip to conversation

shim: don't let build modify shim.config

PATCH Superseded Juergen Gross 5 participants 10 messages Apr 19, 2018 – Apr 20, 2018 1 message not in the archive

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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
index 7004349d5a..e7983859ba 100644
@@ -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
index a7e69ae777..666cb10018 100644
@@ -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
#1 lore raw

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]

#3 lore raw
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

#4 lore raw
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 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 $*.

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

#5 lore raw
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

#6 lore raw
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-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?

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

#7 lore raw
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-menuconfig was 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=y
CONFIG_PVH_GUEST=y
CONFIG_PV_SHIM=y
CONFIG_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

#8 lore raw
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-menuconfig was 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=y
CONFIG_PVH_GUEST=y
CONFIG_PV_SHIM=y
CONFIG_PV_SHIM_EXCLUSIVE=y

But I expect some more might be needed.

CONFIG_SHADOW_PAGING=n
CONFIG_NR_CPUS=32
CONFIG_VIDEO=n
CONFIG_HVM_FEP=n
CONFIG_TBOOT=n
CONFIG_KEXEC=n
CONFIG_TMEM=n
CONFIG_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

#9 lore raw
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-menuconfig was 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=y
CONFIG_PVH_GUEST=y
CONFIG_PV_SHIM=y
CONFIG_PV_SHIM_EXCLUSIVE=y

But I expect some more might be needed.

CONFIG_SHADOW_PAGING=n
CONFIG_NR_CPUS=32
CONFIG_VIDEO=n
CONFIG_HVM_FEP=n
CONFIG_TBOOT=n
CONFIG_KEXEC=n
CONFIG_TMEM=n
CONFIG_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

#10 lore raw
In reply to Andrew Cooper
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-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?

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