summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-03-25 10:01:34 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-25 10:01:34 -0700
commitd710d370c4911e83da5d2bc43d4a2c3b56bd27e7 (patch)
tree9e7a702654feb88e2555c1bf41f71ef4a58b25aa /scripts
parent744465da705f7d8cd893e97738a47b91f3321ce2 (diff)
parentc65f677b62d6180cc174e06f953f7fe860adf6d1 (diff)
downloadlinux-d710d370c4911e83da5d2bc43d4a2c3b56bd27e7.tar.gz
Merge tag 's390-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Vasily Gorbik:

 - Raise minimum supported machine generation to z10, which comes with
   various cleanups and code simplifications (usercopy/spectre
   mitigation/etc).

 - Rework extables and get rid of anonymous out-of-line fixups.

 - Page table helpers cleanup. Add set_pXd()/set_pte() helper functions.
   Covert pte_val()/pXd_val() macros to functions.

 - Optimize kretprobe handling by avoiding extra kprobe on
   __kretprobe_trampoline.

 - Add support for CEX8 crypto cards.

 - Allow to trigger AP bus rescan via writing to /sys/bus/ap/scans.

 - Add CONFIG_EXPOLINE_EXTERN option to build the kernel without COMDAT
   group sections which simplifies kpatch support.

 - Always use the packed stack layout and extend kernel unwinder tests.

 - Add sanity checks for ftrace code patching.

 - Add s390dbf debug log for the vfio_ap device driver.

 - Various virtual vs physical address confusion fixes.

 - Various small fixes and improvements all over the code.

* tag 's390-5.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (69 commits)
  s390/test_unwind: add kretprobe tests
  s390/kprobes: Avoid additional kprobe in kretprobe handling
  s390: convert ".insn" encoding to instruction names
  s390: assume stckf is always present
  s390/nospec: move to single register thunks
  s390: raise minimum supported machine generation to z10
  s390/uaccess: Add copy_from/to_user_key functions
  s390/nospec: align and size extern thunks
  s390/nospec: add an option to use thunk-extern
  s390/nospec: generate single register thunks if possible
  s390/pci: make zpci_set_irq()/zpci_clear_irq() static
  s390: remove unused expoline to BC instructions
  s390/irq: use assignment instead of cast
  s390/traps: get rid of magic cast for per code
  s390/traps: get rid of magic cast for program interruption code
  s390/signal: fix typo in comments
  s390/asm-offsets: remove unused defines
  s390/test_unwind: avoid build warning with W=1
  s390: remove .fixup section
  s390/bpf: encode register within extable entry
  ...
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c5
-rw-r--r--scripts/sorttable.c43
2 files changed, 6 insertions, 42 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 6bfa33217914..dbc0aaf69e43 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -658,6 +658,11 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname)
 		    strstarts(symname, "_savevr_") ||
 		    strcmp(symname, ".TOC.") == 0)
 			return 1;
+
+	if (info->hdr->e_machine == EM_S390)
+		/* Expoline thunks are linked on all kernel modules during final link of .ko */
+		if (strstarts(symname, "__s390_indirect_jump_r"))
+			return 1;
 	/* Do not ignore this symbol */
 	return 0;
 }
diff --git a/scripts/sorttable.c b/scripts/sorttable.c
index 3a8ea5ed553d..d00504c5f530 100644
--- a/scripts/sorttable.c
+++ b/scripts/sorttable.c
@@ -261,45 +261,6 @@ static void sort_relative_table_with_data(char *extab_image, int image_size)
 	}
 }
 
-static void s390_sort_relative_table(char *extab_image, int image_size)
-{
-	int i;
-
-	for (i = 0; i < image_size; i += 16) {
-		char *loc = extab_image + i;
-		uint64_t handler;
-
-		w(r((uint32_t *)loc) + i, (uint32_t *)loc);
-		w(r((uint32_t *)(loc + 4)) + (i + 4), (uint32_t *)(loc + 4));
-		/*
-		 * 0 is a special self-relative handler value, which means that
-		 * handler should be ignored. It is safe, because it means that
-		 * handler field points to itself, which should never happen.
-		 * When creating extable-relative values, keep it as 0, since
-		 * this should never occur either: it would mean that handler
-		 * field points to the first extable entry.
-		 */
-		handler = r8((uint64_t *)(loc + 8));
-		if (handler)
-			handler += i + 8;
-		w8(handler, (uint64_t *)(loc + 8));
-	}
-
-	qsort(extab_image, image_size / 16, 16, compare_relative_table);
-
-	for (i = 0; i < image_size; i += 16) {
-		char *loc = extab_image + i;
-		uint64_t handler;
-
-		w(r((uint32_t *)loc) - i, (uint32_t *)loc);
-		w(r((uint32_t *)(loc + 4)) - (i + 4), (uint32_t *)(loc + 4));
-		handler = r8((uint64_t *)(loc + 8));
-		if (handler)
-			handler -= i + 8;
-		w8(handler, (uint64_t *)(loc + 8));
-	}
-}
-
 static int do_file(char const *const fname, void *addr)
 {
 	int rc = -1;
@@ -340,12 +301,10 @@ static int do_file(char const *const fname, void *addr)
 	case EM_386:
 	case EM_AARCH64:
 	case EM_RISCV:
+	case EM_S390:
 	case EM_X86_64:
 		custom_sort = sort_relative_table_with_data;
 		break;
-	case EM_S390:
-		custom_sort = s390_sort_relative_table;
-		break;
 	case EM_PARISC:
 	case EM_PPC:
 	case EM_PPC64: