Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec0e6bd3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Martin Schwidefsky:
 "One performance optimization for page_clear and a couple of bug fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/mm: fix incorrect ASCE after crst_table_downgrade
  s390/ftrace: fix crashes when switching tracers / add notrace to cpu_relax()
  s390/pci: unify pci_iomap symbol exports
  s390/pci: fix [un]map_resources sequence
  s390: let the compiler do page clearing
  s390/pci: fix possible information leak in mmio syscall
  s390/dcss: array index 'i' is used before limits check.
  s390/scm_block: fix off by one during cluster reservation
  s390/jump label: improve and fix sanity check
  s390/jump label: add missing jump_label_apply_nops() call
parents e7901af1 691d5264
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
{
	int cpu = smp_processor_id();

	S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd);
	if (prev == next)
		return;
	if (MACHINE_HAS_TLB_LC)
@@ -73,7 +74,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
	atomic_dec(&prev->context.attach_count);
	if (MACHINE_HAS_TLB_LC)
		cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
	S390_lowcore.user_asce = next->context.asce_bits | __pa(next->pgd);
}

#define finish_arch_post_lock_switch finish_arch_post_lock_switch
+1 −10
Original line number Diff line number Diff line
@@ -37,16 +37,7 @@ static inline void storage_key_init_range(unsigned long start, unsigned long end
#endif
}

static inline void clear_page(void *page)
{
	register unsigned long reg1 asm ("1") = 0;
	register void *reg2 asm ("2") = page;
	register unsigned long reg3 asm ("3") = 4096;
	asm volatile(
		"	mvcl	2,0"
		: "+d" (reg2), "+d" (reg3) : "d" (reg1)
		: "memory", "cc");
}
#define clear_page(page)	memset((page), 0, PAGE_SIZE)

/*
 * copy_page uses the mvcl instruction with 0xb0 padding byte in order to
+8 −4
Original line number Diff line number Diff line
@@ -36,16 +36,20 @@ static void jump_label_make_branch(struct jump_entry *entry, struct insn *insn)
	insn->offset = (entry->target - entry->code) >> 1;
}

static void jump_label_bug(struct jump_entry *entry, struct insn *insn)
static void jump_label_bug(struct jump_entry *entry, struct insn *expected,
			   struct insn *new)
{
	unsigned char *ipc = (unsigned char *)entry->code;
	unsigned char *ipe = (unsigned char *)insn;
	unsigned char *ipe = (unsigned char *)expected;
	unsigned char *ipn = (unsigned char *)new;

	pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc);
	pr_emerg("Found:    %02x %02x %02x %02x %02x %02x\n",
		 ipc[0], ipc[1], ipc[2], ipc[3], ipc[4], ipc[5]);
	pr_emerg("Expected: %02x %02x %02x %02x %02x %02x\n",
		 ipe[0], ipe[1], ipe[2], ipe[3], ipe[4], ipe[5]);
	pr_emerg("New:      %02x %02x %02x %02x %02x %02x\n",
		 ipn[0], ipn[1], ipn[2], ipn[3], ipn[4], ipn[5]);
	panic("Corrupted kernel text");
}

@@ -69,10 +73,10 @@ static void __jump_label_transform(struct jump_entry *entry,
	}
	if (init) {
		if (memcmp((void *)entry->code, &orignop, sizeof(orignop)))
			jump_label_bug(entry, &old);
			jump_label_bug(entry, &orignop, &new);
	} else {
		if (memcmp((void *)entry->code, &old, sizeof(old)))
			jump_label_bug(entry, &old);
			jump_label_bug(entry, &old, &new);
	}
	probe_kernel_write((void *)entry->code, &new, sizeof(new));
}
+1 −0
Original line number Diff line number Diff line
@@ -436,6 +436,7 @@ int module_finalize(const Elf_Ehdr *hdr,
		    const Elf_Shdr *sechdrs,
		    struct module *me)
{
	jump_label_apply_nops(me);
	vfree(me->arch.syminfo);
	me->arch.syminfo = NULL;
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@

static DEFINE_PER_CPU(struct cpuid, cpu_id);

void cpu_relax(void)
void notrace cpu_relax(void)
{
	if (!smp_cpu_mtid && MACHINE_HAS_DIAG44)
		asm volatile("diag 0,0,0x44");
Loading