Commit 5e441f61 authored by Alexander Gordeev's avatar Alexander Gordeev
Browse files

Revert "s390/smp: rework absolute lowcore access"



This reverts commit 7d06fed7.

This introduced vmem_mutex locking from vmem_map_4k_page()
function called from smp_reinit_ipl_cpu() with interrupts
disabled. While it is a pre-SMP early initcall no other CPUs
running in parallel nor other code taking vmem_mutex on this
boot stage - it still needs to be fixed.

Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent 3fb39cb7
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -10,13 +10,11 @@
#include <asm/sclp.h>
#include <asm/diag.h>
#include <asm/uv.h>
#include <asm/abs_lowcore.h>
#include "decompressor.h"
#include "boot.h"
#include "uv.h"

unsigned long __bootdata_preserved(__kaslr_offset);
unsigned long __bootdata_preserved(__abs_lowcore);
unsigned long __bootdata(__amode31_base);
unsigned long __bootdata_preserved(VMALLOC_START);
unsigned long __bootdata_preserved(VMALLOC_END);
@@ -182,8 +180,7 @@ static void setup_kernel_memory_layout(void)
	/* force vmalloc and modules below kasan shadow */
	vmax = min(vmax, KASAN_SHADOW_START);
#endif
	__abs_lowcore = round_down(vmax - ABS_LOWCORE_MAP_SIZE, sizeof(struct lowcore));
	MODULES_END = round_down(__abs_lowcore, _SEGMENT_SIZE);
	MODULES_END = vmax;
	MODULES_VADDR = MODULES_END - MODULES_LEN;
	VMALLOC_END = MODULES_VADDR;

+0 −17
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_S390_ABS_LOWCORE_H
#define _ASM_S390_ABS_LOWCORE_H

#include <asm/lowcore.h>

#define ABS_LOWCORE_MAP_SIZE	(NR_CPUS * sizeof(struct lowcore))

extern unsigned long __abs_lowcore;
extern bool abs_lowcore_mapped;

struct lowcore *get_abs_lowcore(unsigned long *flags);
void put_abs_lowcore(struct lowcore *lc, unsigned long flags);
int abs_lowcore_map(int cpu, struct lowcore *lc);
void abs_lowcore_unmap(int cpu);

#endif /* _ASM_ABS_S390_LOWCORE_H */
+0 −2
Original line number Diff line number Diff line
@@ -1781,8 +1781,6 @@ static inline swp_entry_t __swp_entry(unsigned long type, unsigned long offset)

extern int vmem_add_mapping(unsigned long start, unsigned long size);
extern void vmem_remove_mapping(unsigned long start, unsigned long size);
extern int vmem_map_4k_page(unsigned long addr, unsigned long phys, pgprot_t prot);
extern void vmem_unmap_4k_page(unsigned long addr);
extern int s390_enable_sie(void);
extern int s390_enable_skey(void);
extern void s390_reset_cmma(struct mm_struct *mm);
+15 −0
Original line number Diff line number Diff line
@@ -307,6 +307,21 @@ static __always_inline void __noreturn disabled_wait(void)
#define ARCH_LOW_ADDRESS_LIMIT	0x7fffffffUL

extern int memcpy_real(void *, unsigned long, size_t);
extern void memcpy_absolute(void *, void *, size_t);

#define put_abs_lowcore(member, x) do {					\
	unsigned long __abs_address = offsetof(struct lowcore, member);	\
	__typeof__(((struct lowcore *)0)->member) __tmp = (x);		\
									\
	memcpy_absolute(__va(__abs_address), &__tmp, sizeof(__tmp));	\
} while (0)

#define get_abs_lowcore(x, member) do {					\
	unsigned long __abs_address = offsetof(struct lowcore, member);	\
	__typeof__(((struct lowcore *)0)->member) *__ptr = &(x);	\
									\
	memcpy_absolute(__ptr, __va(__abs_address), sizeof(*__ptr));	\
} while (0)

extern int s390_isolate_bp(void);
extern int s390_isolate_bp_guest(void);
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ obj-y += sysinfo.o lgr.o os_info.o machine_kexec.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 ipl_vmparm.o machine_kexec_reloc.o unwind_bc.o
obj-y	+= smp.o text_amode31.o stacktrace.o abs_lowcore.o
obj-y	+= smp.o text_amode31.o stacktrace.o

extra-y				+= head64.o vmlinux.lds

Loading