Skip to contentSkip to conversation

s390: remove unneeded 'select BUILD_BIN2C'

PATCH Applied Masahiro Yamada 2 participants 7 messages Jun 13, 2022 – Jun 23, 2022 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 s390: remove unneeded 'select BUILD_BIN2C'

Since commit 4c0f032d4963 ("s390/purgatory: Omit use of bin2c"), s390 builds the purgatory without using bin2c.

Remove 'select BUILD_BIN2C' to avoid the unneeded build of bin2c.

Fixes 4c0f032d4963 ("s390/purgatory: Omit use of bin2c")

---

 arch/s390/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/s390/Kconfig +0 -1
index 91c0b80a8bf0..8cd9e56c629b 100644
@@ -484,7 +484,6 @@ config KEXEC
 config KEXEC_FILE
 	bool "kexec file based system call"
 	select KEXEC_CORE
-	select BUILD_BIN2C
 	depends on CRYPTO
 	depends on CRYPTO_SHA256
 	depends on CRYPTO_SHA256_S390
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/3 s390/purgatory: hard-code obj-y in Makefile

The purgatory/ directory is entirely guarded in arch/s390/Kbuild. CONFIG_ARCH_HAS_KEXEC_PURGATORY is bool type.

$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) is always 'y' when Kbuild visits this Makefile for building.

---

 arch/s390/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/purgatory/Makefile +1 -1
index 360ada80d20c..3e2c17ba04de 100644
@@ -51,4 +51,4 @@ $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE
 $(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
 	$(call if_changed_rule,as_o_S)
 
-obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o
+obj-y += kexec-purgatory.o
Signature · 1 line
2.32.0
maintainer Applied
#2 lore raw

Re: [PATCH 2/3] s390/purgatory: hard-code obj-y in Makefile

Quoted 17 lines · Masahiro Yamada

The purgatory/ directory is entirely guarded in arch/s390/Kbuild. CONFIG_ARCH_HAS_KEXEC_PURGATORY is bool type.

$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) is always 'y' when Kbuild visits this Makefile for building.

---

 arch/s390/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/purgatory/Makefile +0 -0
index 360ada80d20c..3e2c17ba04de 100644

arch/s390/purgatory/Makefile $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE · line 54

Quoted 5 lines
arch/s390/purgatory/Makefile +1 -1
@@ -51,4 +51,4 @@ $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE
 $(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
 	$(call if_changed_rule,as_o_S)
 
-obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o
+obj-y += kexec-purgatory.o

Applied, thanks!

BTW, it looks like x86 and riscv also need similar change.

In addition, x86 use of CONFIG_ARCH_HAS_KEXEC_PURGATORY vs CONFIG_KEXEC_FILE is not consistent with other architectures (may be even incorrect?).

Quoted 3 lines
Signature · 1 line
2.32.0
#3 lore raw

Re: [PATCH 2/3] s390/purgatory: hard-code obj-y in Makefile

Quoted 22 lines · Alexander Gordeev
Quoted 20 lines · Masahiro Yamada

The purgatory/ directory is entirely guarded in arch/s390/Kbuild. CONFIG_ARCH_HAS_KEXEC_PURGATORY is bool type.

$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) is always 'y' when Kbuild visits this Makefile for building.

---

 arch/s390/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/purgatory/Makefile +0 -0
index 360ada80d20c..3e2c17ba04de 100644
@@ -51,4 +51,4 @@ $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE
 $(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
      $(call if_changed_rule,as_o_S)
 
Quoted 6 lines

arch/s390/purgatory/Makefile $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE · line 54

Quoted 2 lines
arch/s390/purgatory/Makefile +1 -1
-obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o
+obj-y += kexec-purgatory.o

Applied, thanks!

BTW, it looks like x86 and riscv also need similar change.

A patch for x86 exists:

https://lore.kernel.org/all/[email protected]/

I will send riscv patches later.

Quoted 2 lines

In addition, x86 use of CONFIG_ARCH_HAS_KEXEC_PURGATORY vs CONFIG_KEXEC_FILE is not consistent with other architectures (may be even incorrect?).

I thought of this when I reworked Makefiles,
but did not touch this part.

Quoted 4 lines
Quoted 4 lines

--
2.32.0

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

PATCH 3/3 s390/purgatory: remove duplicated build rule of kexec-purgatory.o

In reply to Masahiro Yamada

This is equivalent to the pattern rule in scripts/Makefile.build.

Having the dependency on $(obj)/purgatory.ro is enough.

---

 arch/s390/purgatory/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/purgatory/Makefile +1 -2
index 3e2c17ba04de..d237bc6841cb 100644
@@ -48,7 +48,6 @@ OBJCOPYFLAGS_purgatory.ro += --remove-section='.note.*'
 $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE
 		$(call if_changed,objcopy)
 
-$(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
-	$(call if_changed_rule,as_o_S)
+$(obj)/kexec-purgatory.o: $(obj)/purgatory.ro
 
 obj-y += kexec-purgatory.o
Signature · 1 line
2.32.0
maintainer Applied
#5 lore raw

Re: [PATCH 3/3] s390/purgatory: remove duplicated build rule of kexec-purgatory.o

Quoted 15 lines · Masahiro Yamada

This is equivalent to the pattern rule in scripts/Makefile.build.

Having the dependency on $(obj)/purgatory.ro is enough.

---

 arch/s390/purgatory/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/s390/purgatory/Makefile +0 -0
index 3e2c17ba04de..d237bc6841cb 100644

arch/s390/purgatory/Makefile OBJCOPYFLAGS_purgatory.ro += --remove-section='.note.*' · line 53

Quoted 8 lines
arch/s390/purgatory/Makefile +1 -2
@@ -48,7 +48,6 @@ OBJCOPYFLAGS_purgatory.ro += --remove-section='.note.*'
 $(obj)/purgatory.ro: $(obj)/purgatory $(obj)/purgatory.chk FORCE
 		$(call if_changed,objcopy)
 
-$(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
-	$(call if_changed_rule,as_o_S)
+$(obj)/kexec-purgatory.o: $(obj)/purgatory.ro
 
 obj-y += kexec-purgatory.o

Applied, thanks!

Quoted 3 lines
Signature · 1 line
2.32.0
maintainer Applied
#6 lore raw
In reply to Masahiro Yamada
Quoted 17 lines · Masahiro Yamada

Since commit 4c0f032d4963 ("s390/purgatory: Omit use of bin2c"), s390 builds the purgatory without using bin2c.

Remove 'select BUILD_BIN2C' to avoid the unneeded build of bin2c.

Fixes 4c0f032d4963 ("s390/purgatory: Omit use of bin2c")

---

 arch/s390/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/s390/Kconfig +0 -0
index 91c0b80a8bf0..8cd9e56c629b 100644

arch/s390/Kconfig config KEXEC · line 489

Quoted 7 lines
arch/s390/Kconfig +0 -1
@@ -484,7 +484,6 @@ config KEXEC
 config KEXEC_FILE
 	bool "kexec file based system call"
 	select KEXEC_CORE
-	select BUILD_BIN2C
 	depends on CRYPTO
 	depends on CRYPTO_SHA256
 	depends on CRYPTO_SHA256_S390

Applied, thanks!

Quoted 3 lines
Signature · 1 line
2.32.0