Two patches for OVMF build system
cover Two patches for OVMF build system
Wei Liu (2):
tools: OVMF parallel build
tools: provide distclean target for OVMF
tools/firmware/ovmf-makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/2 tools: OVMF parallel build
Though it doesn't work with make's "-j" option, the build system of OVMF has an option to specify parallel threads used to run the build.
Using 4 threads to build OVMF looks like a sensible default.
--- tools/firmware/ovmf-makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
tools/firmware/ovmf-makefile +2 -4
@@ -1,6 +1,3 @@ -# OVMF building system is not ready yet to run in parallel. -# Force it to be serial in order to exploit parallelism for neighbors. - XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk
@@ -10,6 +7,7 @@ else TARGET=RELEASE endif +# OVMF build system has its own parallel building support. .NOTPARALLEL: MAKEFLAGS += -j1
@@ -18,7 +16,7 @@ all: build .PHONY: build build: - OvmfPkg/build.sh -a X64 -b $(TARGET) + OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4 cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin .PHONY: clean
Signature · 1 line
1.9.1
Re: [PATCH 1/2] tools: OVMF parallel build
Quoted 4 lines · Wei Liu
Though it doesn't work with make's "-j" option, the build system of OVMF has an option to specify parallel threads used to run the build.
Using 4 threads to build OVMF looks like a sensible default.
It's a bit arbitrary, but it'll do, I suppose.
It's worth noting that this won't interact with gnu makes token handling which is used to make sure there are only N processes across the recursive build. So this will consume 1 token but launch 4 threads. So if -j4 is used you'll actually get 7 things happening.
I think we can live with that.
So I'm happy with the patch, but I'd like to give others a chance to disagree before applying.
Quoted 2 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>
Quoted 17 lines
Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)tools/firmware/ovmf-makefile +0
-3@@ -1,6 +1,3 @@ -# OVMF building system is not ready yet to run in parallel. -# Force it to be serial in order to exploit parallelism for neighbors. - XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk
tools/firmware/ovmf-makefile else · line 12
Quoted 6 lines
tools/firmware/ovmf-makefile +1
-0@@ -10,6 +7,7 @@ else TARGET=RELEASE endif +# OVMF build system has its own parallel building support. .NOTPARALLEL: MAKEFLAGS += -j1
TBH I'm not sure what if anything these actually do...
Quoted 10 lines
tools/firmware/ovmf-makefile +1
-1@@ -18,7 +16,7 @@ all: build .PHONY: build build: - OvmfPkg/build.sh -a X64 -b $(TARGET) + OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4 cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin .PHONY: clean
Re: [PATCH 1/2] tools: OVMF parallel build
Quoted 43 lines · Ian Campbell
Quoted 4 lines · Wei Liu
Though it doesn't work with make's "-j" option, the build system of OVMF has an option to specify parallel threads used to run the build.
Using 4 threads to build OVMF looks like a sensible default.
It's a bit arbitrary, but it'll do, I suppose.
It's worth noting that this won't interact with gnu makes token handling which is used to make sure there are only N processes across the recursive build. So this will consume 1 token but launch 4 threads. So if -j4 is used you'll actually get 7 things happening.
I think we can live with that.
So I'm happy with the patch, but I'd like to give others a chance to disagree before applying.
Quoted 2 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Acked-by Ian Campbell <[email protected]>Quoted 20 lines
Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)tools/firmware/ovmf-makefile +0
-3@@ -1,6 +1,3 @@ -# OVMF building system is not ready yet to run in parallel. -# Force it to be serial in order to exploit parallelism for neighbors. - XEN_ROOT=$(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk@@ -10,6 +7,7 @@ else TARGET=RELEASE endif
Quoted 6 lines
tools/firmware/ovmf-makefile else · line 12
Quoted 3 lines
tools/firmware/ovmf-makefile +1
-0+# OVMF build system has its own parallel building support. .NOTPARALLEL: MAKEFLAGS += -j1TBH I'm not sure what if anything these actually do...
Without this OVMF won't build. It plays with MAKEFLAGS to enforce there is only one thread used. I haven't really looked into whether it's the correct rune but it seems to work fine.
Wei.
Quoted 11 lines
Quoted 10 lines
tools/firmware/ovmf-makefile +1
-1@@ -18,7 +16,7 @@ all: build .PHONY: build build: - OvmfPkg/build.sh -a X64 -b $(TARGET) + OvmfPkg/build.sh -a X64 -b $(TARGET) -n 4 cp Build/OvmfX64/$(TARGET)_GCC*/FV/OVMF.fd ovmf.bin .PHONY: clean
Re: [PATCH 1/2] tools: OVMF parallel build
In reply to Ian CampbellQuoted 13 lines · Ian Campbell
Quoted 4 lines · Wei Liu
Though it doesn't work with make's "-j" option, the build system of OVMF has an option to specify parallel threads used to run the build.
Using 4 threads to build OVMF looks like a sensible default.
It's a bit arbitrary, but it'll do, I suppose.
It's worth noting that this won't interact with gnu makes token handling which is used to make sure there are only N processes across the recursive build. So this will consume 1 token but launch 4 threads. So if -j4 is used you'll actually get 7 things happening.
Quoted 4 lines
I think we can live with that.
So I'm happy with the patch, but I'd like to give others a chance to disagree before applying.
They had their chance...
Quoted 5 lines
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Acked-by Ian Campbell <[email protected]>
... applied.
Did the distclean issue which the second patch was addressing get fixed another way or is there a patch outstanding somewhere?
Re: [PATCH 1/2] tools: OVMF parallel build
Quoted 24 lines · Ian Campbell
Quoted 13 lines · Ian Campbell
Quoted 4 lines · Wei Liu
Though it doesn't work with make's "-j" option, the build system of OVMF has an option to specify parallel threads used to run the build.
Using 4 threads to build OVMF looks like a sensible default.
It's a bit arbitrary, but it'll do, I suppose.
It's worth noting that this won't interact with gnu makes token handling which is used to make sure there are only N processes across the recursive build. So this will consume 1 token but launch 4 threads. So if -j4 is used you'll actually get 7 things happening.
Quoted 4 lines
I think we can live with that.
So I'm happy with the patch, but I'd like to give others a chance to disagree before applying.
They had their chance...
Quoted 4 lines
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>
Quoted 6 lines
Quoted 1 line
Acked-by Ian Campbell <[email protected]>... applied.
Did the distclean issue which the second patch was addressing get fixed another way or is there a patch outstanding somewhere?
Urgh. I thought I posted it somewhere, but apparently I was wrong.
I will send it now.
Wei.
PATCH 2/2 tools: provide distclean target for OVMF
In reply to Wei LiuOVMF's distclean target was missed in f9c9b1277 (tools: fix "make distclean").
--- tools/firmware/ovmf-makefile | 3 +++ 1 file changed, 3 insertions(+)
tools/firmware/ovmf-makefile +3 -0
@@ -22,3 +22,6 @@ build: .PHONY: clean clean: rm -rf ovmf.bin Build/* + +.PHONY: distclean +distclean: clean
Signature · 1 line
1.9.1
Re: [PATCH 2/2] tools: provide distclean target for OVMF
Quoted 2 lines · Wei Liu
OVMF's distclean target was missed in
f9c9b1277(tools: fix "make distclean").
tools/firmware/Makefile has:
subdir-distclean-ovmf: .phony
rm -rf ovmf-dir ovmf-dir-remote
Shouldn't this be avoiding recursing into ovmf-dir in the first place?
Or is there some other reason to want this?
Quoted 20 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 3 +++ 1 file changed, 3 insertions(+)tools/firmware/ovmf-makefile +3
-0@@ -22,3 +22,6 @@ build: .PHONY: clean clean: rm -rf ovmf.bin Build/* + +.PHONY: distclean +distclean: clean
Re: [PATCH 2/2] tools: provide distclean target for OVMF
Quoted 4 lines · Ian Campbell
Quoted 2 lines · Wei Liu
OVMF's distclean target was missed in
f9c9b1277(tools: fix "make distclean").
Quoted 8 lines
tools/firmware/Makefilehas:
subdir-distclean-ovmf: .phony
rm -rf ovmf-dir ovmf-dir-remoteShouldn't this be avoiding recursing into ovmf-dir in the first place?
Or is there some other reason to want this?
If you're in firmware directory and do "make distclean", make will recurse into ovmf to do "make distclean".
Wei.
Quoted 21 lines
Quoted 20 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 3 +++ 1 file changed, 3 insertions(+)tools/firmware/ovmf-makefile +3
-0@@ -22,3 +22,6 @@ build: .PHONY: clean clean: rm -rf ovmf.bin Build/* + +.PHONY: distclean +distclean: clean
Re: [PATCH 2/2] tools: provide distclean target for OVMF
Quoted 9 lines · Wei Liu
Quoted 8 lines · Ian Campbell
Quoted 2 lines · Wei Liu
OVMF's distclean target was missed in
f9c9b1277(tools: fix "make distclean").
tools/firmware/Makefilehas:
subdir-distclean-ovmf: .phony
rm -rf ovmf-dir ovmf-dir-remote
Quoted 7 lines
Quoted 4 lines
Shouldn't this be avoiding recursing into ovmf-dir in the first place?
Or is there some other reason to want this?
If you're in firmware directory and do "make distclean", make will recurse into ovmf to do "make distclean".
Really? Despite the rule I quoted above? How strange, I wonder why that is.
I'd have expected "make distclean" to behave the same whether run in the directory or recursed into frmo a higher level.
Quoted 24 lines
Wei.
Quoted 21 lines
Quoted 20 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 3 +++ 1 file changed, 3 insertions(+)tools/firmware/ovmf-makefile +3
-0@@ -22,3 +22,6 @@ build: .PHONY: clean clean: rm -rf ovmf.bin Build/* + +.PHONY: distclean +distclean: clean
Re: [PATCH 2/2] tools: provide distclean target for OVMF
Quoted 15 lines · Ian Campbell
Quoted 14 lines · Wei Liu
Quoted 12 lines · Ian Campbell
Quoted 2 lines · Wei Liu
OVMF's distclean target was missed in
f9c9b1277(tools: fix "make distclean").
tools/firmware/Makefilehas:
subdir-distclean-ovmf: .phony
rm -rf ovmf-dir ovmf-dir-remoteShouldn't this be avoiding recursing into ovmf-dir in the first place?
Or is there some other reason to want this?
Quoted 9 lines
Quoted 2 lines
If you're in firmware directory and do "make distclean", make will recurse into ovmf to do "make distclean".
Really? Despite the rule I quoted above? How strange, I wonder why that is.
I'd have expected "make distclean" to behave the same whether run in the directory or recursed into frmo a higher level.
The problem is that subdir-distclean-ovmf should have been subdir-distclean-ovmf-dir. I think you prefer I fix it this way?
subidr-clean-ovmf should be -ovmf-dir following the same rule. I shall fix them all in one go.
Wei.
Quoted 25 lines
Quoted 24 lines
Wei.
Quoted 21 lines
Quoted 20 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 3 +++ 1 file changed, 3 insertions(+)tools/firmware/ovmf-makefile +3
-0@@ -22,3 +22,6 @@ build: .PHONY: clean clean: rm -rf ovmf.bin Build/* + +.PHONY: distclean +distclean: clean
Re: [PATCH 2/2] tools: provide distclean target for OVMF
Quoted 22 lines · Wei Liu
Quoted 21 lines · Ian Campbell
Quoted 9 lines · Wei Liu
Quoted 8 lines · Ian Campbell
Quoted 2 lines · Wei Liu
OVMF's distclean target was missed in
f9c9b1277(tools: fix "make distclean").
tools/firmware/Makefilehas:
subdir-distclean-ovmf: .phony
rm -rf ovmf-dir ovmf-dir-remoteQuoted 7 lines
Quoted 4 lines
Shouldn't this be avoiding recursing into ovmf-dir in the first place?
Or is there some other reason to want this?
If you're in firmware directory and do "make distclean", make will recurse into ovmf to do "make distclean".
Really? Despite the rule I quoted above? How strange, I wonder why that is.
Quoted 6 lines
Quoted 3 lines
I'd have expected "make distclean" to behave the same whether run in the directory or recursed into frmo a higher level.
The problem is that subdir-distclean-ovmf should have been subdir-distclean-ovmf-dir. I think you prefer I fix it this way?
You guessed right!
Quoted 2 lines
subidr-clean-ovmf should be -ovmf-dir following the same rule. I shall fix them all in one go.
Yes please.
Quoted 28 lines
Wei.
Quoted 25 lines
Quoted 24 lines
Wei.
Quoted 21 lines
Quoted 20 lines
Signed-off-by Wei Liu <[email protected]>Cc Anthony Perard <[email protected]>Cc Ian Campbell <[email protected]>Cc Ian Jackson <[email protected]>--- tools/firmware/ovmf-makefile | 3 +++ 1 file changed, 3 insertions(+)tools/firmware/ovmf-makefile +3
-0@@ -22,3 +22,6 @@ build: .PHONY: clean clean: rm -rf ovmf.bin Build/* + +.PHONY: distclean +distclean: clean