OSDN Git Service

s390/boot: make head.S and als.c be part of the decompressor only
authorVasily Gorbik <gor@linux.ibm.com>
Tue, 12 Jun 2018 13:11:40 +0000 (15:11 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 25 Jun 2018 08:14:38 +0000 (10:14 +0200)
Since uncompressed kernel image does not have to be bootable anymore,
move head.S, head_kdump.S and als.c to boot/ folder and compile them
in just in the decompressor.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/Makefile
arch/s390/boot/Makefile
arch/s390/boot/als.c [moved from arch/s390/kernel/als.c with 99% similarity]
arch/s390/boot/compressed/Makefile
arch/s390/boot/head.S [moved from arch/s390/kernel/head.S with 100% similarity]
arch/s390/boot/head_kdump.S [moved from arch/s390/kernel/head_kdump.S with 100% similarity]
arch/s390/kernel/Makefile
arch/s390/kernel/entry.h
arch/s390/kernel/head64.S
arch/s390/kernel/vmlinux.lds.S

index ea3e610..d25fbc1 100644 (file)
@@ -113,8 +113,7 @@ export KBUILD_CFLAGS_DECOMPRESSOR
 
 OBJCOPYFLAGS   := -O binary
 
-head-y         := arch/s390/kernel/head.o
-head-y         += arch/s390/kernel/head64.o
+head-y         := arch/s390/kernel/head64.o
 
 # See arch/s390/Kbuild for content of core part of the kernel
 core-y         += arch/s390/
index da5f299..05e92d4 100644 (file)
@@ -3,15 +3,42 @@
 # Makefile for the linux s390-specific parts of the memory manager.
 #
 
-targets := bzImage
-subdir- := compressed
+KCOV_INSTRUMENT := n
+GCOV_PROFILE := n
+UBSAN_SANITIZE := n
+
+KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
+KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
+
+#
+# Use -march=z900 for als.c to be able to print an error
+# message if the kernel is started on a machine which is too old
+#
+ifneq ($(CC_FLAGS_MARCH),-march=z900)
+AFLAGS_REMOVE_head.o   += $(CC_FLAGS_MARCH)
+AFLAGS_head.o          += -march=z900
+CFLAGS_REMOVE_als.o    += $(CC_FLAGS_MARCH)
+CFLAGS_als.o           += -march=z900
+endif
+
+obj-y  := head.o als.o
+targets        := bzImage startup.a $(obj-y)
+subdir-        := compressed
+
+OBJECTS := $(addprefix $(obj)/,$(obj-y))
 
 $(obj)/bzImage: $(obj)/compressed/vmlinux FORCE
        $(call if_changed,objcopy)
 
-$(obj)/compressed/vmlinux: FORCE
+$(obj)/compressed/vmlinux: $(obj)/startup.a FORCE
        $(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
+quiet_cmd_ar = AR      $@
+      cmd_ar = rm -f $@; $(AR) rcsTP$(KBUILD_ARFLAGS) $@ $(filter-out FORCE, $^)
+
+$(obj)/startup.a: $(OBJECTS) FORCE
+       $(call if_changed,ar)
+
 install: $(CONFIGURE) $(obj)/bzImage
        sh -x  $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
              System.map "$(INSTALL_PATH)"
similarity index 99%
rename from arch/s390/kernel/als.c
rename to arch/s390/boot/als.c
index d1892bf..b6287a9 100644 (file)
@@ -8,7 +8,6 @@
 #include <asm/facility.h>
 #include <asm/lowcore.h>
 #include <asm/sclp.h>
-#include "entry.h"
 
 /*
  * The code within this file will be called very early. It may _not_
index 9b48e7b..855f7fd 100644 (file)
@@ -16,12 +16,12 @@ targets += misc.o piggy.o sizes.h head.o
 KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
 KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
 
-OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o ebcdic.o als.o)
+OBJECTS := $(objtree)/arch/s390/kernel/ebcdic.o
 OBJECTS += $(objtree)/drivers/s390/char/sclp_early_core.o
 OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o
 
 LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
-$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
+$(obj)/vmlinux: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OBJECTS)
        $(call if_changed,ld)
 
 TRIM_HEAD_SIZE := 0x100000
index 2fed39b..dbfd173 100644 (file)
@@ -9,39 +9,21 @@ ifdef CONFIG_FUNCTION_TRACER
 CFLAGS_REMOVE_ftrace.o         = $(CC_FLAGS_FTRACE)
 
 # Do not trace early setup code
-CFLAGS_REMOVE_als.o            = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_early.o          = $(CC_FLAGS_FTRACE)
 CFLAGS_REMOVE_early_nobss.o    = $(CC_FLAGS_FTRACE)
 
 endif
 
-GCOV_PROFILE_als.o             := n
 GCOV_PROFILE_early.o           := n
 GCOV_PROFILE_early_nobss.o     := n
 
-KCOV_INSTRUMENT_als.o          := n
 KCOV_INSTRUMENT_early.o                := n
 KCOV_INSTRUMENT_early_nobss.o  := n
 
-UBSAN_SANITIZE_als.o           := n
 UBSAN_SANITIZE_early.o         := n
 UBSAN_SANITIZE_early_nobss.o   := n
 
 #
-# Use -march=z900 for als.c to be able to print an error
-# message if the kernel is started on a machine which is too old
-#
-ifneq ($(CC_FLAGS_MARCH),-march=z900)
-CFLAGS_REMOVE_als.o    += $(CC_FLAGS_MARCH)
-CFLAGS_REMOVE_als.o    += $(CC_FLAGS_EXPOLINE)
-CFLAGS_als.o           += -march=z900
-AFLAGS_REMOVE_head.o   += $(CC_FLAGS_MARCH)
-AFLAGS_head.o          += -march=z900
-endif
-
-CFLAGS_als.o           += -D__NO_FORTIFY
-
-#
 # Passing null pointers is ok for smp code, since we access the lowcore here.
 #
 CFLAGS_smp.o           := -Wno-nonnull
@@ -61,13 +43,13 @@ CFLAGS_ptrace.o             += -DUTS_MACHINE='"$(UTS_MACHINE)"'
 
 obj-y  := traps.o time.o process.o base.o early.o setup.o idle.o vtime.o
 obj-y  += processor.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o nmi.o
-obj-y  += debug.o irq.o ipl.o dis.o diag.o vdso.o als.o early_nobss.o
+obj-y  += debug.o irq.o ipl.o dis.o diag.o vdso.o early_nobss.o
 obj-y  += sysinfo.o jump_label.o lgr.o os_info.o machine_kexec.o pgm_check.o
 obj-y  += runtime_instr.o cache.o fpu.o dumpstack.o guarded_storage.o sthyi.o
 obj-y  += entry.o reipl.o relocate_kernel.o kdebugfs.o alternative.o
 obj-y  += nospec-branch.o
 
-extra-y                                += head.o head64.o vmlinux.lds
+extra-y                                += head64.o vmlinux.lds
 
 obj-$(CONFIG_SYSFS)            += nospec-sysfs.o
 CFLAGS_REMOVE_nospec-branch.o  += $(CC_FLAGS_EXPOLINE)
@@ -99,5 +81,5 @@ obj-$(CONFIG_TRACEPOINTS)     += trace.o
 obj-y                          += vdso64/
 obj-$(CONFIG_COMPAT)           += vdso32/
 
-chkbss := head.o head64.o als.o early_nobss.o
+chkbss := head64.o early_nobss.o
 include $(srctree)/arch/s390/scripts/Makefile.chkbss
index 961abfa..472fa2f 100644 (file)
@@ -83,7 +83,6 @@ long sys_s390_sthyi(unsigned long function_code, void __user *buffer, u64 __user
 
 DECLARE_PER_CPU(u64, mt_cycles[8]);
 
-void verify_facilities(void);
 void gs_load_bc_cb(struct pt_regs *regs);
 void set_fs_fixup(void);
 
index 53e5cb0..6a840bc 100644 (file)
@@ -16,7 +16,7 @@
 #include <asm/page.h>
 
 __HEAD
-       .org    0x100000 - 0x11000              # head.o ends at 0x11000
+       .org    0x100000
 ENTRY(startup_continue)
        tm      __LC_STFLE_FAC_LIST+5,0x80      # LPP available ?
        jz      0f
index f0414f5..31f530b 100644 (file)
@@ -19,7 +19,7 @@
 
 OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390")
 OUTPUT_ARCH(s390:64-bit)
-ENTRY(startup)
+ENTRY(startup_continue)
 jiffies = jiffies_64;
 
 PHDRS {