diff options
author | Alexander Gordeev <agordeev@linux.ibm.com> | 2022-03-17 17:03:03 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2022-03-27 23:18:39 +0300 |
commit | ed0192bc644f3553d64a5cb461bdd0b1fbae3fdf (patch) | |
tree | 68c6c09a3732b8b580974bcd070951de8354e28c /arch/s390/kernel/smp.c | |
parent | 9097fc793f74ef9c677f8c4aed0c24f6f07f0133 (diff) | |
download | linux-ed0192bc644f3553d64a5cb461bdd0b1fbae3fdf.tar.xz |
s390/maccess: rework absolute lowcore accessors
Macro mem_assign_absolute() is able to access the whole memory, but
is only used and makes sense when updating the absolute lowcore.
Instead, introduce get_abs_lowcore() and put_abs_lowcore() macros
that limit access to absolute lowcore addresses only.
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r-- | arch/s390/kernel/smp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index cc6971a09aaf..51529c33c7bf 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -332,10 +332,10 @@ static void pcpu_delegate(struct pcpu *pcpu, lc->restart_data = (unsigned long)data; lc->restart_source = source_cpu; } else { - mem_assign_absolute(lc->restart_stack, stack); - mem_assign_absolute(lc->restart_fn, (unsigned long)func); - mem_assign_absolute(lc->restart_data, (unsigned long)data); - mem_assign_absolute(lc->restart_source, source_cpu); + put_abs_lowcore(restart_stack, stack); + put_abs_lowcore(restart_fn, (unsigned long)func); + put_abs_lowcore(restart_data, (unsigned long)data); + put_abs_lowcore(restart_source, source_cpu); } __bpon(); asm volatile( @@ -591,9 +591,9 @@ void smp_ctl_set_clear_bit(int cr, int bit, bool set) parms.andval = ~(1UL << bit); } spin_lock(&ctl_lock); - memcpy_absolute(&ctlreg, &S390_lowcore.cregs_save_area[cr], sizeof(ctlreg)); + get_abs_lowcore(ctlreg, cregs_save_area[cr]); ctlreg = (ctlreg & parms.andval) | parms.orval; - memcpy_absolute(&S390_lowcore.cregs_save_area[cr], &ctlreg, sizeof(ctlreg)); + put_abs_lowcore(cregs_save_area[cr], ctlreg); spin_unlock(&ctl_lock); on_each_cpu(smp_ctl_bit_callback, &parms, 1); } |