mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
s390: Replace S390_lowcore by get_lowcore()
Replace all S390_lowcore usages in arch/s390/ by get_lowcore(). Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
committed by
Vasily Gorbik
parent
7e8f89e5e0
commit
208da1d5fc
@@ -14,6 +14,6 @@
|
||||
|
||||
struct task_struct;
|
||||
|
||||
#define current ((struct task_struct *const)S390_lowcore.current_task)
|
||||
#define current ((struct task_struct *const)get_lowcore()->current_task)
|
||||
|
||||
#endif /* !(_S390_CURRENT_H) */
|
||||
|
||||
@@ -92,8 +92,8 @@ static inline void __stfle(u64 *stfle_fac_list, int size)
|
||||
|
||||
asm volatile(
|
||||
" stfl 0(0)\n"
|
||||
: "=m" (S390_lowcore.stfl_fac_list));
|
||||
stfl_fac_list = S390_lowcore.stfl_fac_list;
|
||||
: "=m" (get_lowcore()->stfl_fac_list));
|
||||
stfl_fac_list = get_lowcore()->stfl_fac_list;
|
||||
memcpy(stfle_fac_list, &stfl_fac_list, 4);
|
||||
nr = 4; /* bytes stored by stfl */
|
||||
if (stfl_fac_list & 0x01000000) {
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
|
||||
#include <asm/lowcore.h>
|
||||
|
||||
#define local_softirq_pending() (S390_lowcore.softirq_pending)
|
||||
#define set_softirq_pending(x) (S390_lowcore.softirq_pending = (x))
|
||||
#define or_softirq_pending(x) (S390_lowcore.softirq_pending |= (x))
|
||||
#define local_softirq_pending() (get_lowcore()->softirq_pending)
|
||||
#define set_softirq_pending(x) (get_lowcore()->softirq_pending = (x))
|
||||
#define or_softirq_pending(x) (get_lowcore()->softirq_pending |= (x))
|
||||
|
||||
#define __ARCH_IRQ_STAT
|
||||
#define __ARCH_IRQ_EXIT_IRQS_DISABLED
|
||||
|
||||
@@ -76,9 +76,9 @@ static inline void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *
|
||||
int cpu = smp_processor_id();
|
||||
|
||||
if (next == &init_mm)
|
||||
S390_lowcore.user_asce = s390_invalid_asce;
|
||||
get_lowcore()->user_asce = s390_invalid_asce;
|
||||
else
|
||||
S390_lowcore.user_asce.val = next->context.asce;
|
||||
get_lowcore()->user_asce.val = next->context.asce;
|
||||
cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
|
||||
/* Clear previous user-ASCE from CR7 */
|
||||
local_ctl_load(7, &s390_invalid_asce);
|
||||
@@ -111,7 +111,7 @@ static inline void finish_arch_post_lock_switch(void)
|
||||
__tlb_flush_mm_lazy(mm);
|
||||
preempt_enable();
|
||||
}
|
||||
local_ctl_load(7, &S390_lowcore.user_asce);
|
||||
local_ctl_load(7, &get_lowcore()->user_asce);
|
||||
}
|
||||
|
||||
#define activate_mm activate_mm
|
||||
@@ -120,7 +120,7 @@ static inline void activate_mm(struct mm_struct *prev,
|
||||
{
|
||||
switch_mm(prev, next, current);
|
||||
cpumask_set_cpu(smp_processor_id(), mm_cpumask(next));
|
||||
local_ctl_load(7, &S390_lowcore.user_asce);
|
||||
local_ctl_load(7, &get_lowcore()->user_asce);
|
||||
}
|
||||
|
||||
#include <asm-generic/mmu_context.h>
|
||||
|
||||
@@ -55,11 +55,11 @@ static __always_inline void pai_kernel_enter(struct pt_regs *regs)
|
||||
return;
|
||||
if (!static_branch_unlikely(&pai_key))
|
||||
return;
|
||||
if (!S390_lowcore.ccd)
|
||||
if (!get_lowcore()->ccd)
|
||||
return;
|
||||
if (!user_mode(regs))
|
||||
return;
|
||||
WRITE_ONCE(S390_lowcore.ccd, S390_lowcore.ccd | PAI_CRYPTO_KERNEL_OFFSET);
|
||||
WRITE_ONCE(get_lowcore()->ccd, get_lowcore()->ccd | PAI_CRYPTO_KERNEL_OFFSET);
|
||||
}
|
||||
|
||||
static __always_inline void pai_kernel_exit(struct pt_regs *regs)
|
||||
@@ -68,11 +68,11 @@ static __always_inline void pai_kernel_exit(struct pt_regs *regs)
|
||||
return;
|
||||
if (!static_branch_unlikely(&pai_key))
|
||||
return;
|
||||
if (!S390_lowcore.ccd)
|
||||
if (!get_lowcore()->ccd)
|
||||
return;
|
||||
if (!user_mode(regs))
|
||||
return;
|
||||
WRITE_ONCE(S390_lowcore.ccd, S390_lowcore.ccd & ~PAI_CRYPTO_KERNEL_OFFSET);
|
||||
WRITE_ONCE(get_lowcore()->ccd, get_lowcore()->ccd & ~PAI_CRYPTO_KERNEL_OFFSET);
|
||||
}
|
||||
|
||||
#define PAI_SAVE_AREA(x) ((x)->hw.event_base)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
* s390 uses its own implementation for per cpu data, the offset of
|
||||
* the cpu local data area is cached in the cpu's lowcore memory.
|
||||
*/
|
||||
#define __my_cpu_offset S390_lowcore.percpu_offset
|
||||
#define __my_cpu_offset get_lowcore()->percpu_offset
|
||||
|
||||
/*
|
||||
* For 64 bit module code, the module may be more than 4G above the
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
static __always_inline int preempt_count(void)
|
||||
{
|
||||
return READ_ONCE(S390_lowcore.preempt_count) & ~PREEMPT_NEED_RESCHED;
|
||||
return READ_ONCE(get_lowcore()->preempt_count) & ~PREEMPT_NEED_RESCHED;
|
||||
}
|
||||
|
||||
static __always_inline void preempt_count_set(int pc)
|
||||
@@ -22,26 +22,26 @@ static __always_inline void preempt_count_set(int pc)
|
||||
int old, new;
|
||||
|
||||
do {
|
||||
old = READ_ONCE(S390_lowcore.preempt_count);
|
||||
old = READ_ONCE(get_lowcore()->preempt_count);
|
||||
new = (old & PREEMPT_NEED_RESCHED) |
|
||||
(pc & ~PREEMPT_NEED_RESCHED);
|
||||
} while (__atomic_cmpxchg(&S390_lowcore.preempt_count,
|
||||
} while (__atomic_cmpxchg(&get_lowcore()->preempt_count,
|
||||
old, new) != old);
|
||||
}
|
||||
|
||||
static __always_inline void set_preempt_need_resched(void)
|
||||
{
|
||||
__atomic_and(~PREEMPT_NEED_RESCHED, &S390_lowcore.preempt_count);
|
||||
__atomic_and(~PREEMPT_NEED_RESCHED, &get_lowcore()->preempt_count);
|
||||
}
|
||||
|
||||
static __always_inline void clear_preempt_need_resched(void)
|
||||
{
|
||||
__atomic_or(PREEMPT_NEED_RESCHED, &S390_lowcore.preempt_count);
|
||||
__atomic_or(PREEMPT_NEED_RESCHED, &get_lowcore()->preempt_count);
|
||||
}
|
||||
|
||||
static __always_inline bool test_preempt_need_resched(void)
|
||||
{
|
||||
return !(READ_ONCE(S390_lowcore.preempt_count) & PREEMPT_NEED_RESCHED);
|
||||
return !(READ_ONCE(get_lowcore()->preempt_count) & PREEMPT_NEED_RESCHED);
|
||||
}
|
||||
|
||||
static __always_inline void __preempt_count_add(int val)
|
||||
@@ -52,11 +52,11 @@ static __always_inline void __preempt_count_add(int val)
|
||||
*/
|
||||
if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES)) {
|
||||
if (__builtin_constant_p(val) && (val >= -128) && (val <= 127)) {
|
||||
__atomic_add_const(val, &S390_lowcore.preempt_count);
|
||||
__atomic_add_const(val, &get_lowcore()->preempt_count);
|
||||
return;
|
||||
}
|
||||
}
|
||||
__atomic_add(val, &S390_lowcore.preempt_count);
|
||||
__atomic_add(val, &get_lowcore()->preempt_count);
|
||||
}
|
||||
|
||||
static __always_inline void __preempt_count_sub(int val)
|
||||
@@ -66,12 +66,12 @@ static __always_inline void __preempt_count_sub(int val)
|
||||
|
||||
static __always_inline bool __preempt_count_dec_and_test(void)
|
||||
{
|
||||
return __atomic_add(-1, &S390_lowcore.preempt_count) == 1;
|
||||
return __atomic_add(-1, &get_lowcore()->preempt_count) == 1;
|
||||
}
|
||||
|
||||
static __always_inline bool should_resched(int preempt_offset)
|
||||
{
|
||||
return unlikely(READ_ONCE(S390_lowcore.preempt_count) ==
|
||||
return unlikely(READ_ONCE(get_lowcore()->preempt_count) ==
|
||||
preempt_offset);
|
||||
}
|
||||
|
||||
@@ -81,12 +81,12 @@ static __always_inline bool should_resched(int preempt_offset)
|
||||
|
||||
static __always_inline int preempt_count(void)
|
||||
{
|
||||
return READ_ONCE(S390_lowcore.preempt_count);
|
||||
return READ_ONCE(get_lowcore()->preempt_count);
|
||||
}
|
||||
|
||||
static __always_inline void preempt_count_set(int pc)
|
||||
{
|
||||
S390_lowcore.preempt_count = pc;
|
||||
get_lowcore()->preempt_count = pc;
|
||||
}
|
||||
|
||||
static __always_inline void set_preempt_need_resched(void)
|
||||
@@ -104,17 +104,17 @@ static __always_inline bool test_preempt_need_resched(void)
|
||||
|
||||
static __always_inline void __preempt_count_add(int val)
|
||||
{
|
||||
S390_lowcore.preempt_count += val;
|
||||
get_lowcore()->preempt_count += val;
|
||||
}
|
||||
|
||||
static __always_inline void __preempt_count_sub(int val)
|
||||
{
|
||||
S390_lowcore.preempt_count -= val;
|
||||
get_lowcore()->preempt_count -= val;
|
||||
}
|
||||
|
||||
static __always_inline bool __preempt_count_dec_and_test(void)
|
||||
{
|
||||
return !--S390_lowcore.preempt_count && tif_need_resched();
|
||||
return !--get_lowcore()->preempt_count && tif_need_resched();
|
||||
}
|
||||
|
||||
static __always_inline bool should_resched(int preempt_offset)
|
||||
|
||||
@@ -46,17 +46,17 @@ typedef long (*sys_call_ptr_t)(struct pt_regs *regs);
|
||||
|
||||
static __always_inline void set_cpu_flag(int flag)
|
||||
{
|
||||
S390_lowcore.cpu_flags |= (1UL << flag);
|
||||
get_lowcore()->cpu_flags |= (1UL << flag);
|
||||
}
|
||||
|
||||
static __always_inline void clear_cpu_flag(int flag)
|
||||
{
|
||||
S390_lowcore.cpu_flags &= ~(1UL << flag);
|
||||
get_lowcore()->cpu_flags &= ~(1UL << flag);
|
||||
}
|
||||
|
||||
static __always_inline bool test_cpu_flag(int flag)
|
||||
{
|
||||
return S390_lowcore.cpu_flags & (1UL << flag);
|
||||
return get_lowcore()->cpu_flags & (1UL << flag);
|
||||
}
|
||||
|
||||
static __always_inline bool test_and_set_cpu_flag(int flag)
|
||||
@@ -269,7 +269,7 @@ static __always_inline unsigned long __current_stack_pointer(void)
|
||||
|
||||
static __always_inline bool on_thread_stack(void)
|
||||
{
|
||||
unsigned long ksp = S390_lowcore.kernel_stack;
|
||||
unsigned long ksp = get_lowcore()->kernel_stack;
|
||||
|
||||
return !((ksp ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
|
||||
}
|
||||
|
||||
@@ -77,24 +77,24 @@ extern unsigned long max_mappable;
|
||||
/* The Write Back bit position in the physaddr is given by the SLPC PCI */
|
||||
extern unsigned long mio_wb_bit_mask;
|
||||
|
||||
#define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
|
||||
#define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
|
||||
#define MACHINE_IS_LPAR (S390_lowcore.machine_flags & MACHINE_FLAG_LPAR)
|
||||
#define MACHINE_IS_VM (get_lowcore()->machine_flags & MACHINE_FLAG_VM)
|
||||
#define MACHINE_IS_KVM (get_lowcore()->machine_flags & MACHINE_FLAG_KVM)
|
||||
#define MACHINE_IS_LPAR (get_lowcore()->machine_flags & MACHINE_FLAG_LPAR)
|
||||
|
||||
#define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
|
||||
#define MACHINE_HAS_ESOP (S390_lowcore.machine_flags & MACHINE_FLAG_ESOP)
|
||||
#define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
|
||||
#define MACHINE_HAS_EDAT1 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT1)
|
||||
#define MACHINE_HAS_EDAT2 (S390_lowcore.machine_flags & MACHINE_FLAG_EDAT2)
|
||||
#define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY)
|
||||
#define MACHINE_HAS_TE (S390_lowcore.machine_flags & MACHINE_FLAG_TE)
|
||||
#define MACHINE_HAS_TLB_LC (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_LC)
|
||||
#define MACHINE_HAS_TLB_GUEST (S390_lowcore.machine_flags & MACHINE_FLAG_TLB_GUEST)
|
||||
#define MACHINE_HAS_NX (S390_lowcore.machine_flags & MACHINE_FLAG_NX)
|
||||
#define MACHINE_HAS_GS (S390_lowcore.machine_flags & MACHINE_FLAG_GS)
|
||||
#define MACHINE_HAS_SCC (S390_lowcore.machine_flags & MACHINE_FLAG_SCC)
|
||||
#define MACHINE_HAS_PCI_MIO (S390_lowcore.machine_flags & MACHINE_FLAG_PCI_MIO)
|
||||
#define MACHINE_HAS_RDP (S390_lowcore.machine_flags & MACHINE_FLAG_RDP)
|
||||
#define MACHINE_HAS_DIAG9C (get_lowcore()->machine_flags & MACHINE_FLAG_DIAG9C)
|
||||
#define MACHINE_HAS_ESOP (get_lowcore()->machine_flags & MACHINE_FLAG_ESOP)
|
||||
#define MACHINE_HAS_IDTE (get_lowcore()->machine_flags & MACHINE_FLAG_IDTE)
|
||||
#define MACHINE_HAS_EDAT1 (get_lowcore()->machine_flags & MACHINE_FLAG_EDAT1)
|
||||
#define MACHINE_HAS_EDAT2 (get_lowcore()->machine_flags & MACHINE_FLAG_EDAT2)
|
||||
#define MACHINE_HAS_TOPOLOGY (get_lowcore()->machine_flags & MACHINE_FLAG_TOPOLOGY)
|
||||
#define MACHINE_HAS_TE (get_lowcore()->machine_flags & MACHINE_FLAG_TE)
|
||||
#define MACHINE_HAS_TLB_LC (get_lowcore()->machine_flags & MACHINE_FLAG_TLB_LC)
|
||||
#define MACHINE_HAS_TLB_GUEST (get_lowcore()->machine_flags & MACHINE_FLAG_TLB_GUEST)
|
||||
#define MACHINE_HAS_NX (get_lowcore()->machine_flags & MACHINE_FLAG_NX)
|
||||
#define MACHINE_HAS_GS (get_lowcore()->machine_flags & MACHINE_FLAG_GS)
|
||||
#define MACHINE_HAS_SCC (get_lowcore()->machine_flags & MACHINE_FLAG_SCC)
|
||||
#define MACHINE_HAS_PCI_MIO (get_lowcore()->machine_flags & MACHINE_FLAG_PCI_MIO)
|
||||
#define MACHINE_HAS_RDP (get_lowcore()->machine_flags & MACHINE_FLAG_RDP)
|
||||
|
||||
/*
|
||||
* Console mode. Override with conmode=
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <asm/lowcore.h>
|
||||
#include <asm/processor.h>
|
||||
|
||||
#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
|
||||
#define raw_smp_processor_id() (get_lowcore()->cpu_nr)
|
||||
|
||||
extern struct mutex smp_cpu_state_mutex;
|
||||
extern unsigned int smp_cpu_mt_shift;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#ifdef CONFIG_SOFTIRQ_ON_OWN_STACK
|
||||
static inline void do_softirq_own_stack(void)
|
||||
{
|
||||
call_on_stack(0, S390_lowcore.async_stack, void, __do_softirq);
|
||||
call_on_stack(0, get_lowcore()->async_stack, void, __do_softirq);
|
||||
}
|
||||
#endif
|
||||
#endif /* __ASM_S390_SOFTIRQ_STACK_H */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <asm/processor.h>
|
||||
#include <asm/alternative.h>
|
||||
|
||||
#define SPINLOCK_LOCKVAL (S390_lowcore.spinlock_lockval)
|
||||
#define SPINLOCK_LOCKVAL (get_lowcore()->spinlock_lockval)
|
||||
|
||||
extern int spin_retry;
|
||||
|
||||
|
||||
@@ -161,16 +161,16 @@ static inline unsigned long local_tick_disable(void)
|
||||
{
|
||||
unsigned long old;
|
||||
|
||||
old = S390_lowcore.clock_comparator;
|
||||
S390_lowcore.clock_comparator = clock_comparator_max;
|
||||
set_clock_comparator(S390_lowcore.clock_comparator);
|
||||
old = get_lowcore()->clock_comparator;
|
||||
get_lowcore()->clock_comparator = clock_comparator_max;
|
||||
set_clock_comparator(get_lowcore()->clock_comparator);
|
||||
return old;
|
||||
}
|
||||
|
||||
static inline void local_tick_enable(unsigned long comp)
|
||||
{
|
||||
S390_lowcore.clock_comparator = comp;
|
||||
set_clock_comparator(S390_lowcore.clock_comparator);
|
||||
get_lowcore()->clock_comparator = comp;
|
||||
set_clock_comparator(get_lowcore()->clock_comparator);
|
||||
}
|
||||
|
||||
#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
static inline void update_timer_sys(void)
|
||||
{
|
||||
S390_lowcore.system_timer += S390_lowcore.last_update_timer - S390_lowcore.exit_timer;
|
||||
S390_lowcore.user_timer += S390_lowcore.exit_timer - S390_lowcore.sys_enter_timer;
|
||||
S390_lowcore.last_update_timer = S390_lowcore.sys_enter_timer;
|
||||
get_lowcore()->system_timer += get_lowcore()->last_update_timer - get_lowcore()->exit_timer;
|
||||
get_lowcore()->user_timer += get_lowcore()->exit_timer - get_lowcore()->sys_enter_timer;
|
||||
get_lowcore()->last_update_timer = get_lowcore()->sys_enter_timer;
|
||||
}
|
||||
|
||||
static inline void update_timer_mcck(void)
|
||||
{
|
||||
S390_lowcore.system_timer += S390_lowcore.last_update_timer - S390_lowcore.exit_timer;
|
||||
S390_lowcore.user_timer += S390_lowcore.exit_timer - S390_lowcore.mcck_enter_timer;
|
||||
S390_lowcore.last_update_timer = S390_lowcore.mcck_enter_timer;
|
||||
get_lowcore()->system_timer += get_lowcore()->last_update_timer - get_lowcore()->exit_timer;
|
||||
get_lowcore()->user_timer += get_lowcore()->exit_timer - get_lowcore()->mcck_enter_timer;
|
||||
get_lowcore()->last_update_timer = get_lowcore()->mcck_enter_timer;
|
||||
}
|
||||
|
||||
#endif /* _S390_VTIME_H */
|
||||
|
||||
@@ -61,28 +61,28 @@ static bool in_task_stack(unsigned long sp, struct task_struct *task,
|
||||
|
||||
static bool in_irq_stack(unsigned long sp, struct stack_info *info)
|
||||
{
|
||||
unsigned long stack = S390_lowcore.async_stack - STACK_INIT_OFFSET;
|
||||
unsigned long stack = get_lowcore()->async_stack - STACK_INIT_OFFSET;
|
||||
|
||||
return in_stack(sp, info, STACK_TYPE_IRQ, stack);
|
||||
}
|
||||
|
||||
static bool in_nodat_stack(unsigned long sp, struct stack_info *info)
|
||||
{
|
||||
unsigned long stack = S390_lowcore.nodat_stack - STACK_INIT_OFFSET;
|
||||
unsigned long stack = get_lowcore()->nodat_stack - STACK_INIT_OFFSET;
|
||||
|
||||
return in_stack(sp, info, STACK_TYPE_NODAT, stack);
|
||||
}
|
||||
|
||||
static bool in_mcck_stack(unsigned long sp, struct stack_info *info)
|
||||
{
|
||||
unsigned long stack = S390_lowcore.mcck_stack - STACK_INIT_OFFSET;
|
||||
unsigned long stack = get_lowcore()->mcck_stack - STACK_INIT_OFFSET;
|
||||
|
||||
return in_stack(sp, info, STACK_TYPE_MCCK, stack);
|
||||
}
|
||||
|
||||
static bool in_restart_stack(unsigned long sp, struct stack_info *info)
|
||||
{
|
||||
unsigned long stack = S390_lowcore.restart_stack - STACK_INIT_OFFSET;
|
||||
unsigned long stack = get_lowcore()->restart_stack - STACK_INIT_OFFSET;
|
||||
|
||||
return in_stack(sp, info, STACK_TYPE_RESTART, stack);
|
||||
}
|
||||
|
||||
+18
-18
@@ -72,7 +72,7 @@ static void __init reset_tod_clock(void)
|
||||
|
||||
memset(&tod_clock_base, 0, sizeof(tod_clock_base));
|
||||
tod_clock_base.tod = TOD_UNIX_EPOCH;
|
||||
S390_lowcore.last_update_clock = TOD_UNIX_EPOCH;
|
||||
get_lowcore()->last_update_clock = TOD_UNIX_EPOCH;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -99,7 +99,7 @@ static noinline __init void detect_machine_type(void)
|
||||
|
||||
/* Check current-configuration-level */
|
||||
if (stsi(NULL, 0, 0, 0) <= 2) {
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_LPAR;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_LPAR;
|
||||
return;
|
||||
}
|
||||
/* Get virtual-machine cpu information. */
|
||||
@@ -108,9 +108,9 @@ static noinline __init void detect_machine_type(void)
|
||||
|
||||
/* Detect known hypervisors */
|
||||
if (!memcmp(vmms->vm[0].cpi, "\xd2\xe5\xd4", 3))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_KVM;
|
||||
else if (!memcmp(vmms->vm[0].cpi, "\xa9\x61\xe5\xd4", 4))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_VM;
|
||||
}
|
||||
|
||||
/* Remove leading, trailing and double whitespace. */
|
||||
@@ -166,7 +166,7 @@ static __init void setup_topology(void)
|
||||
|
||||
if (!test_facility(11))
|
||||
return;
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_TOPOLOGY;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_TOPOLOGY;
|
||||
for (max_mnest = 6; max_mnest > 1; max_mnest--) {
|
||||
if (stsi(&sysinfo_page, 15, 1, max_mnest) == 0)
|
||||
break;
|
||||
@@ -186,8 +186,8 @@ static noinline __init void setup_lowcore_early(void)
|
||||
|
||||
psw.addr = (unsigned long)early_pgm_check_handler;
|
||||
psw.mask = PSW_KERNEL_BITS;
|
||||
S390_lowcore.program_new_psw = psw;
|
||||
S390_lowcore.preempt_count = INIT_PREEMPT_COUNT;
|
||||
get_lowcore()->program_new_psw = psw;
|
||||
get_lowcore()->preempt_count = INIT_PREEMPT_COUNT;
|
||||
}
|
||||
|
||||
static noinline __init void setup_facility_list(void)
|
||||
@@ -211,43 +211,43 @@ static __init void detect_diag9c(void)
|
||||
EX_TABLE(0b,1b)
|
||||
: "=d" (rc) : "0" (-EOPNOTSUPP), "d" (cpu_address) : "cc");
|
||||
if (!rc)
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_DIAG9C;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_DIAG9C;
|
||||
}
|
||||
|
||||
static __init void detect_machine_facilities(void)
|
||||
{
|
||||
if (test_facility(8)) {
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT1;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_EDAT1;
|
||||
system_ctl_set_bit(0, CR0_EDAT_BIT);
|
||||
}
|
||||
if (test_facility(78))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_EDAT2;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_EDAT2;
|
||||
if (test_facility(3))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_IDTE;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_IDTE;
|
||||
if (test_facility(50) && test_facility(73)) {
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_TE;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_TE;
|
||||
system_ctl_set_bit(0, CR0_TRANSACTIONAL_EXECUTION_BIT);
|
||||
}
|
||||
if (test_facility(51))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_TLB_LC;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_TLB_LC;
|
||||
if (test_facility(129))
|
||||
system_ctl_set_bit(0, CR0_VECTOR_BIT);
|
||||
if (test_facility(130))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_NX;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_NX;
|
||||
if (test_facility(133))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_GS;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_GS;
|
||||
if (test_facility(139) && (tod_clock_base.tod >> 63)) {
|
||||
/* Enabled signed clock comparator comparisons */
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_SCC;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_SCC;
|
||||
clock_comparator_max = -1ULL >> 1;
|
||||
system_ctl_set_bit(0, CR0_CLOCK_COMPARATOR_SIGN_BIT);
|
||||
}
|
||||
if (IS_ENABLED(CONFIG_PCI) && test_facility(153)) {
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_PCI_MIO;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_PCI_MIO;
|
||||
/* the control bit is set during PCI initialization */
|
||||
}
|
||||
if (test_facility(194))
|
||||
S390_lowcore.machine_flags |= MACHINE_FLAG_RDP;
|
||||
get_lowcore()->machine_flags |= MACHINE_FLAG_RDP;
|
||||
}
|
||||
|
||||
static inline void save_vector_registers(void)
|
||||
|
||||
@@ -34,13 +34,13 @@ void account_idle_time_irq(void)
|
||||
this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
|
||||
}
|
||||
|
||||
idle_time = S390_lowcore.int_clock - idle->clock_idle_enter;
|
||||
idle_time = get_lowcore()->int_clock - idle->clock_idle_enter;
|
||||
|
||||
S390_lowcore.steal_timer += idle->clock_idle_enter - S390_lowcore.last_update_clock;
|
||||
S390_lowcore.last_update_clock = S390_lowcore.int_clock;
|
||||
get_lowcore()->steal_timer += idle->clock_idle_enter - get_lowcore()->last_update_clock;
|
||||
get_lowcore()->last_update_clock = get_lowcore()->int_clock;
|
||||
|
||||
S390_lowcore.system_timer += S390_lowcore.last_update_timer - idle->timer_idle_enter;
|
||||
S390_lowcore.last_update_timer = S390_lowcore.sys_enter_timer;
|
||||
get_lowcore()->system_timer += get_lowcore()->last_update_timer - idle->timer_idle_enter;
|
||||
get_lowcore()->last_update_timer = get_lowcore()->sys_enter_timer;
|
||||
|
||||
/* Account time spent with enabled wait psw loaded as idle time. */
|
||||
WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time);
|
||||
|
||||
@@ -100,8 +100,8 @@ static const struct irq_class irqclass_sub_desc[] = {
|
||||
|
||||
static void do_IRQ(struct pt_regs *regs, int irq)
|
||||
{
|
||||
if (tod_after_eq(S390_lowcore.int_clock,
|
||||
S390_lowcore.clock_comparator))
|
||||
if (tod_after_eq(get_lowcore()->int_clock,
|
||||
get_lowcore()->clock_comparator))
|
||||
/* Serve timer interrupts first. */
|
||||
clock_comparator_work();
|
||||
generic_handle_irq(irq);
|
||||
@@ -111,7 +111,7 @@ static int on_async_stack(void)
|
||||
{
|
||||
unsigned long frame = current_frame_address();
|
||||
|
||||
return ((S390_lowcore.async_stack ^ frame) & ~(THREAD_SIZE - 1)) == 0;
|
||||
return ((get_lowcore()->async_stack ^ frame) & ~(THREAD_SIZE - 1)) == 0;
|
||||
}
|
||||
|
||||
static void do_irq_async(struct pt_regs *regs, int irq)
|
||||
@@ -119,7 +119,7 @@ static void do_irq_async(struct pt_regs *regs, int irq)
|
||||
if (on_async_stack()) {
|
||||
do_IRQ(regs, irq);
|
||||
} else {
|
||||
call_on_stack(2, S390_lowcore.async_stack, void, do_IRQ,
|
||||
call_on_stack(2, get_lowcore()->async_stack, void, do_IRQ,
|
||||
struct pt_regs *, regs, int, irq);
|
||||
}
|
||||
}
|
||||
@@ -153,8 +153,8 @@ void noinstr do_io_irq(struct pt_regs *regs)
|
||||
|
||||
set_cpu_flag(CIF_NOHZ_DELAY);
|
||||
do {
|
||||
regs->tpi_info = S390_lowcore.tpi_info;
|
||||
if (S390_lowcore.tpi_info.adapter_IO)
|
||||
regs->tpi_info = get_lowcore()->tpi_info;
|
||||
if (get_lowcore()->tpi_info.adapter_IO)
|
||||
do_irq_async(regs, THIN_INTERRUPT);
|
||||
else
|
||||
do_irq_async(regs, IO_INTERRUPT);
|
||||
@@ -183,9 +183,9 @@ void noinstr do_ext_irq(struct pt_regs *regs)
|
||||
current->thread.last_break = regs->last_break;
|
||||
}
|
||||
|
||||
regs->int_code = S390_lowcore.ext_int_code_addr;
|
||||
regs->int_parm = S390_lowcore.ext_params;
|
||||
regs->int_parm_long = S390_lowcore.ext_params2;
|
||||
regs->int_code = get_lowcore()->ext_int_code_addr;
|
||||
regs->int_parm = get_lowcore()->ext_params;
|
||||
regs->int_parm_long = get_lowcore()->ext_params2;
|
||||
|
||||
from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
|
||||
if (from_idle)
|
||||
|
||||
@@ -52,7 +52,7 @@ static void __do_machine_kdump(void *data)
|
||||
purgatory = (purgatory_t)image->start;
|
||||
|
||||
/* store_status() saved the prefix register to lowcore */
|
||||
prefix = (unsigned long) S390_lowcore.prefixreg_save_area;
|
||||
prefix = (unsigned long)get_lowcore()->prefixreg_save_area;
|
||||
|
||||
/* Now do the reset */
|
||||
s390_reset_system();
|
||||
@@ -91,7 +91,7 @@ static noinline void __machine_kdump(void *image)
|
||||
continue;
|
||||
}
|
||||
/* Store status of the boot CPU */
|
||||
mcesa = __va(S390_lowcore.mcesad & MCESA_ORIGIN_MASK);
|
||||
mcesa = __va(get_lowcore()->mcesad & MCESA_ORIGIN_MASK);
|
||||
if (cpu_has_vx())
|
||||
save_vx_regs((__vector128 *) mcesa->vector_save_area);
|
||||
if (MACHINE_HAS_GS) {
|
||||
|
||||
+14
-15
@@ -125,7 +125,7 @@ static notrace void s390_handle_damage(void)
|
||||
smp_emergency_stop();
|
||||
diag_amode31_ops.diag308_reset();
|
||||
ptr = nmi_puts(message, "System stopped due to unrecoverable machine check, code: 0x");
|
||||
u64_to_hex(ptr, S390_lowcore.mcck_interruption_code);
|
||||
u64_to_hex(ptr, get_lowcore()->mcck_interruption_code);
|
||||
|
||||
/*
|
||||
* Disable low address protection and make machine check new PSW a
|
||||
@@ -135,17 +135,17 @@ static notrace void s390_handle_damage(void)
|
||||
cr0_new = cr0;
|
||||
cr0_new.lap = 0;
|
||||
local_ctl_load(0, &cr0_new.reg);
|
||||
psw_save = S390_lowcore.mcck_new_psw;
|
||||
psw_bits(S390_lowcore.mcck_new_psw).io = 0;
|
||||
psw_bits(S390_lowcore.mcck_new_psw).ext = 0;
|
||||
psw_bits(S390_lowcore.mcck_new_psw).wait = 1;
|
||||
psw_save = get_lowcore()->mcck_new_psw;
|
||||
psw_bits(get_lowcore()->mcck_new_psw).io = 0;
|
||||
psw_bits(get_lowcore()->mcck_new_psw).ext = 0;
|
||||
psw_bits(get_lowcore()->mcck_new_psw).wait = 1;
|
||||
sclp_emergency_printk(message);
|
||||
|
||||
/*
|
||||
* Restore machine check new PSW and control register 0 to original
|
||||
* values. This makes possible system dump analysis easier.
|
||||
*/
|
||||
S390_lowcore.mcck_new_psw = psw_save;
|
||||
get_lowcore()->mcck_new_psw = psw_save;
|
||||
local_ctl_load(0, &cr0.reg);
|
||||
disabled_wait();
|
||||
while (1);
|
||||
@@ -226,7 +226,7 @@ static bool notrace nmi_registers_valid(union mci mci)
|
||||
/*
|
||||
* Set the clock comparator register to the next expected value.
|
||||
*/
|
||||
set_clock_comparator(S390_lowcore.clock_comparator);
|
||||
set_clock_comparator(get_lowcore()->clock_comparator);
|
||||
if (!mci.gr || !mci.fp || !mci.fc)
|
||||
return false;
|
||||
/*
|
||||
@@ -252,7 +252,7 @@ static bool notrace nmi_registers_valid(union mci mci)
|
||||
* check handling must take care of this. The host values are saved by
|
||||
* KVM and are not affected.
|
||||
*/
|
||||
cr2.reg = S390_lowcore.cregs_save_area[2];
|
||||
cr2.reg = get_lowcore()->cregs_save_area[2];
|
||||
if (cr2.gse && !mci.gs && !test_cpu_flag(CIF_MCCK_GUEST))
|
||||
return false;
|
||||
if (!mci.ms || !mci.pm || !mci.ia)
|
||||
@@ -278,11 +278,10 @@ static void notrace s390_backup_mcck_info(struct pt_regs *regs)
|
||||
|
||||
sie_page = container_of(sie_block, struct sie_page, sie_block);
|
||||
mcck_backup = &sie_page->mcck_info;
|
||||
mcck_backup->mcic = S390_lowcore.mcck_interruption_code &
|
||||
mcck_backup->mcic = get_lowcore()->mcck_interruption_code &
|
||||
~(MCCK_CODE_CP | MCCK_CODE_EXT_DAMAGE);
|
||||
mcck_backup->ext_damage_code = S390_lowcore.external_damage_code;
|
||||
mcck_backup->failing_storage_address
|
||||
= S390_lowcore.failing_storage_address;
|
||||
mcck_backup->ext_damage_code = get_lowcore()->external_damage_code;
|
||||
mcck_backup->failing_storage_address = get_lowcore()->failing_storage_address;
|
||||
}
|
||||
NOKPROBE_SYMBOL(s390_backup_mcck_info);
|
||||
|
||||
@@ -314,7 +313,7 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
|
||||
if (user_mode(regs))
|
||||
update_timer_mcck();
|
||||
inc_irq_stat(NMI_NMI);
|
||||
mci.val = S390_lowcore.mcck_interruption_code;
|
||||
mci.val = get_lowcore()->mcck_interruption_code;
|
||||
mcck = this_cpu_ptr(&cpu_mcck);
|
||||
|
||||
/*
|
||||
@@ -382,9 +381,9 @@ void notrace s390_do_machine_check(struct pt_regs *regs)
|
||||
}
|
||||
if (mci.ed && mci.ec) {
|
||||
/* External damage */
|
||||
if (S390_lowcore.external_damage_code & (1U << ED_STP_SYNC))
|
||||
if (get_lowcore()->external_damage_code & (1U << ED_STP_SYNC))
|
||||
mcck->stp_queue |= stp_sync_check();
|
||||
if (S390_lowcore.external_damage_code & (1U << ED_STP_ISLAND))
|
||||
if (get_lowcore()->external_damage_code & (1U << ED_STP_ISLAND))
|
||||
mcck->stp_queue |= stp_island_check();
|
||||
mcck_pending = 1;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user