s390/ctlreg: change parameters of __local_ctl_load() and __local_ctl_store()
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 11 Sep 2023 19:40:01 +0000 (21:40 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 19 Sep 2023 11:26:56 +0000 (13:26 +0200)
Change __local_ctl_load() and __local_ctl_store(), so that control
register parameters come first.

This way all control handling functions consistently have control
register(s) parameter first.

Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/ctlreg.h
arch/s390/kernel/ctlreg.c
arch/s390/kernel/kprobes.c
arch/s390/kernel/ptrace.c
arch/s390/kernel/setup.c
arch/s390/kernel/smp.c

index 86887b490bb5fe8646c5af7f527ec3bf2968cb7d..e60c672ffb9c4421ceb387e0ba47ae6988b9bf0b 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <linux/bug.h>
 
-#define __local_ctl_load(array, low, high) do {                                \
+#define __local_ctl_load(low, high, array) do {                                \
        struct addrtype {                                               \
                char _[sizeof(array)];                                  \
        };                                                              \
@@ -53,7 +53,7 @@
                : "memory");                                            \
 } while (0)
 
-#define __local_ctl_store(array, low, high) do {                       \
+#define __local_ctl_store(low, high, array) do {                       \
        struct addrtype {                                               \
                char _[sizeof(array)];                                  \
        };                                                              \
index 795e7f4861fbaa09b79f1fa78fc26769b5c47869..1c9fee1ca4a3bede592e736e2623b1b82535ef68 100644 (file)
@@ -38,10 +38,10 @@ static void ctl_bit_callback(void *info)
        struct ctl_bit_parms *pp = info;
        unsigned long regs[16];
 
-       __local_ctl_store(regs, 0, 15);
+       __local_ctl_store(0, 15, regs);
        regs[pp->cr] &= pp->andval;
        regs[pp->cr] |= pp->orval;
-       __local_ctl_load(regs, 0, 15);
+       __local_ctl_load(0, 15, regs);
 }
 
 void system_ctl_set_clear_bit(unsigned int cr, unsigned int bit, bool set)
index 1b2e1903a54c72971c4d064e1a9aa9fc326c8734..ef556b93596d57979e0590bd9482cf32de297fb3 100644 (file)
@@ -232,12 +232,12 @@ static void enable_singlestep(struct kprobe_ctlblk *kcb,
        per_kprobe.end = ip;
 
        /* Save control regs and psw mask */
-       __local_ctl_store(kcb->kprobe_saved_ctl, 9, 11);
+       __local_ctl_store(9, 11, kcb->kprobe_saved_ctl);
        kcb->kprobe_saved_imask = regs->psw.mask &
                (PSW_MASK_PER | PSW_MASK_IO | PSW_MASK_EXT);
 
        /* Set PER control regs, turns on single step for the given address */
-       __local_ctl_load(per_kprobe, 9, 11);
+       __local_ctl_load(9, 11, per_kprobe);
        regs->psw.mask |= PSW_MASK_PER;
        regs->psw.mask &= ~(PSW_MASK_IO | PSW_MASK_EXT);
        regs->psw.addr = ip;
@@ -249,7 +249,7 @@ static void disable_singlestep(struct kprobe_ctlblk *kcb,
                               unsigned long ip)
 {
        /* Restore control regs and psw mask, set new psw address */
-       __local_ctl_load(kcb->kprobe_saved_ctl, 9, 11);
+       __local_ctl_load(9, 11, kcb->kprobe_saved_ctl);
        regs->psw.mask &= ~PSW_MASK_PER;
        regs->psw.mask |= kcb->kprobe_saved_imask;
        regs->psw.addr = ip;
index a1fb4536784fa72c86cd6b20e3b9068d1e453699..c03fda09f68922ead8280384987919d0bcdc35f5 100644 (file)
@@ -104,9 +104,9 @@ void update_cr_regs(struct task_struct *task)
                return;
        }
        regs->psw.mask |= PSW_MASK_PER;
-       __local_ctl_store(old, 9, 11);
+       __local_ctl_store(9, 11, old);
        if (memcmp(&new, &old, sizeof(struct per_regs)) != 0)
-               __local_ctl_load(new, 9, 11);
+               __local_ctl_load(9, 11, new);
 }
 
 void user_enable_single_step(struct task_struct *task)
index 48a456a10206182e2357f74ab67ca69063e1c6dc..2c4bfe41d2845f47a18d44ce16af3075f8366984 100644 (file)
@@ -449,7 +449,7 @@ static void __init setup_lowcore(void)
        lc->restart_fn = (unsigned long) do_restart;
        lc->restart_data = 0;
        lc->restart_source = -1U;
-       __local_ctl_store(lc->cregs_save_area, 0, 15);
+       __local_ctl_store(0, 15, lc->cregs_save_area);
        lc->spinlock_lockval = arch_spin_lockval(0);
        lc->spinlock_index = 0;
        arch_spin_lock_setup(0);
index 1c65bbd411c75d9d968920400f4695236aba2982..90d3502379aa4fbfdb71e8227a6a53e722edba2e 100644 (file)
@@ -922,11 +922,11 @@ int __cpu_disable(void)
        /* Disable pseudo page faults on this cpu. */
        pfault_fini();
        /* Disable interrupt sources via control register. */
-       __local_ctl_store(cregs, 0, 15);
+       __local_ctl_store(0, 15, cregs);
        cregs[0]  &= ~0x0000ee70UL;     /* disable all external interrupts */
        cregs[6]  &= ~0xff000000UL;     /* disable all I/O interrupts */
        cregs[14] &= ~0x1f000000UL;     /* disable most machine checks */
-       __local_ctl_load(cregs, 0, 15);
+       __local_ctl_load(0, 15, cregs);
        clear_cpu_flag(CIF_NOHZ_DELAY);
        return 0;
 }