]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
s390: rename struct psw_bits members
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 3 Jun 2017 08:56:07 +0000 (10:56 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 12 Jun 2017 14:26:02 +0000 (16:26 +0200)
Rename a couple of the struct psw_bits members so it is more obvious
for what they are good. Initially I thought using the single character
names from the PoP would be sufficient and obvious, but admittedly
that is not true.

The current implementation is not easy to use, if one has to look into
the source file to figure out which member represents the 'per' bit
(which is the 'r' member).

Therefore rename the members to sane names that are identical to the
uapi psw mask defines:

r -> per
i -> io
e -> ext
t -> dat
m -> mcheck
w -> wait
p -> pstate

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/ptrace.h
arch/s390/kernel/dumpstack.c
arch/s390/kernel/perf_cpum_sf.c
arch/s390/kernel/uprobes.c
arch/s390/kvm/gaccess.c
arch/s390/kvm/priv.c
arch/s390/mm/init.c

index c8d13bcc9f5d6d6114980d8757af50f619445e7a..004f549092351d000a54671df81252f31e312c19 100644 (file)
                         PSW_MASK_PSTATE | PSW_ASC_PRIMARY)
 
 struct psw_bits {
-       unsigned long      :  1;
-       unsigned long r    :  1; /* PER-Mask */
-       unsigned long      :  3;
-       unsigned long t    :  1; /* DAT Mode */
-       unsigned long i    :  1; /* Input/Output Mask */
-       unsigned long e    :  1; /* External Mask */
-       unsigned long key  :  4; /* PSW Key */
-       unsigned long      :  1;
-       unsigned long m    :  1; /* Machine-Check Mask */
-       unsigned long w    :  1; /* Wait State */
-       unsigned long p    :  1; /* Problem State */
-       unsigned long as   :  2; /* Address Space Control */
-       unsigned long cc   :  2; /* Condition Code */
-       unsigned long pm   :  4; /* Program Mask */
-       unsigned long ri   :  1; /* Runtime Instrumentation */
-       unsigned long      :  6;
-       unsigned long eaba :  2; /* Addressing Mode */
-       unsigned long      : 31;
-       unsigned long ia   : 64; /* Instruction Address */
+       unsigned long        :  1;
+       unsigned long per    :  1; /* PER-Mask */
+       unsigned long        :  3;
+       unsigned long dat    :  1; /* DAT Mode */
+       unsigned long i    :  1; /* Input/Output Mask */
+       unsigned long ext    :  1; /* External Mask */
+       unsigned long key    :  4; /* PSW Key */
+       unsigned long        :  1;
+       unsigned long mcheck :  1; /* Machine-Check Mask */
+       unsigned long wait   :  1; /* Wait State */
+       unsigned long pstate :  1; /* Problem State */
+       unsigned long as     :  2; /* Address Space Control */
+       unsigned long cc     :  2; /* Condition Code */
+       unsigned long pm     :  4; /* Program Mask */
+       unsigned long ri     :  1; /* Runtime Instrumentation */
+       unsigned long        :  6;
+       unsigned long eaba   :  2; /* Addressing Mode */
+       unsigned long        : 31;
+       unsigned long ia     : 64; /* Instruction Address */
 };
 
 enum {
index 62904890d1277a56849450a6abec0c8d665445c1..dab78babfab6dd39c9517d4c73aef0de52c09dd3 100644 (file)
@@ -128,8 +128,8 @@ void show_registers(struct pt_regs *regs)
                pr_cont(" (%pSR)", (void *)regs->psw.addr);
        pr_cont("\n");
        printk("           R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x "
-              "P:%x AS:%x CC:%x PM:%x", psw->r, psw->t, psw->i, psw->e,
-              psw->key, psw->m, psw->w, psw->p, psw->as, psw->cc, psw->pm);
+              "P:%x AS:%x CC:%x PM:%x", psw->per, psw->dat, psw->io, psw->ext,
+              psw->key, psw->mcheck, psw->wait, psw->pstate, psw->as, psw->cc, psw->pm);
        pr_cont(" RI:%x EA:%x\n", psw->ri, psw->eaba);
        printk("%s GPRS: %016lx %016lx %016lx %016lx\n", mode,
               regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]);
index ca960d0370d56517f7cf10ec86f20c7ea31c3746..0c82f7903fc7a7c0bfc9c7d5b02ab79ab4a2be89 100644 (file)
@@ -995,11 +995,11 @@ static int perf_push_sample(struct perf_event *event, struct sf_raw_sample *sfr)
        regs.int_parm = CPU_MF_INT_SF_PRA;
        sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long;
 
-       psw_bits(regs.psw).ia = sfr->basic.ia;
-       psw_bits(regs.psw).t  = sfr->basic.T;
-       psw_bits(regs.psw).w  = sfr->basic.W;
-       psw_bits(regs.psw).p  = sfr->basic.P;
-       psw_bits(regs.psw).as = sfr->basic.AS;
+       psw_bits(regs.psw).ia   = sfr->basic.ia;
+       psw_bits(regs.psw).dat  = sfr->basic.T;
+       psw_bits(regs.psw).wait = sfr->basic.W;
+       psw_bits(regs.psw).per  = sfr->basic.P;
+       psw_bits(regs.psw).as   = sfr->basic.AS;
 
        /*
         * Use the hardware provided configuration level to decide if the
index 0eec45b4575bf404f2cef4ad96262dc78a285941..d94baa8db507cc1cad8fdca9a04d74e8f3d1c8da 100644 (file)
@@ -32,7 +32,7 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
        if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)
                return -EINVAL;
        clear_pt_regs_flag(regs, PIF_PER_TRAP);
-       auprobe->saved_per = psw_bits(regs->psw).r;
+       auprobe->saved_per = psw_bits(regs->psw).per;
        auprobe->saved_int_code = regs->int_code;
        regs->int_code = UPROBE_TRAP_NR;
        regs->psw.addr = current->utask->xol_vaddr;
@@ -81,7 +81,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 
        clear_tsk_thread_flag(current, TIF_UPROBE_SINGLESTEP);
        update_cr_regs(current);
-       psw_bits(regs->psw).r = auprobe->saved_per;
+       psw_bits(regs->psw).per = auprobe->saved_per;
        regs->int_code = auprobe->saved_int_code;
 
        if (fixup & FIXUP_PSW_NORMAL)
index 6ad4a9797de803bcfa3c3cf964b59c14cee02245..e0f7d5fc7efdd4db9d891641b51de889cd6109b9 100644 (file)
@@ -551,7 +551,7 @@ static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce,
        int rc;
        struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw);
 
-       if (!psw.t) {
+       if (!psw.dat) {
                asce->val = 0;
                asce->r = 1;
                return 0;
@@ -771,7 +771,7 @@ static int low_address_protection_enabled(struct kvm_vcpu *vcpu,
 
        if (!ctlreg0.lap)
                return 0;
-       if (psw_bits(*psw).t && asce.p)
+       if (psw_bits(*psw).dat && asce.p)
                return 0;
        return 1;
 }
@@ -790,7 +790,7 @@ static int guest_page_range(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
                        return trans_exc(vcpu, PGM_PROTECTION, ga, ar, mode,
                                         PROT_TYPE_LA);
                ga &= PAGE_MASK;
-               if (psw_bits(*psw).t) {
+               if (psw_bits(*psw).dat) {
                        rc = guest_translate(vcpu, ga, pages, asce, mode);
                        if (rc < 0)
                                return rc;
@@ -831,7 +831,7 @@ int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar, void *data,
                pages = vmalloc(nr_pages * sizeof(unsigned long));
        if (!pages)
                return -ENOMEM;
-       need_ipte_lock = psw_bits(*psw).t && !asce.r;
+       need_ipte_lock = psw_bits(*psw).dat && !asce.r;
        if (need_ipte_lock)
                ipte_lock(vcpu);
        rc = guest_page_range(vcpu, ga, ar, pages, nr_pages, asce, mode);
@@ -899,7 +899,7 @@ int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, u8 ar,
                                         mode, PROT_TYPE_LA);
        }
 
-       if (psw_bits(*psw).t && !asce.r) {      /* Use DAT? */
+       if (psw_bits(*psw).dat && !asce.r) {    /* Use DAT? */
                rc = guest_translate(vcpu, gva, gpa, asce, mode);
                if (rc > 0)
                        return trans_exc(vcpu, rc, gva, 0, mode, PROT_TYPE_DAT);
index e9dd7efc57b8f5088c098175c679737bf48b7796..e53292a892575c40134d5cc35c999fea9a64b97c 100644 (file)
@@ -374,7 +374,7 @@ static int handle_sske(struct kvm_vcpu *vcpu)
 static int handle_ipte_interlock(struct kvm_vcpu *vcpu)
 {
        vcpu->stat.instruction_ipte_interlock++;
-       if (psw_bits(vcpu->arch.sie_block->gpsw).p)
+       if (psw_bits(vcpu->arch.sie_block->gpsw).pstate)
                return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
        wait_event(vcpu->kvm->arch.ipte_wq, !ipte_lock_held(vcpu));
        kvm_s390_retry_instr(vcpu);
index bc8c301f82b6289f0c5910f8e6fc9b4460bd1252..3348e60dd8ada3b647571c1e971f772b32bd074d 100644 (file)
@@ -102,7 +102,7 @@ void __init paging_init(void)
        __ctl_load(S390_lowcore.kernel_asce, 7, 7);
        __ctl_load(S390_lowcore.kernel_asce, 13, 13);
        psw.mask = __extract_psw();
-       psw_bits(psw).t = 1;
+       psw_bits(psw).dat = 1;
        psw_bits(psw).as = PSW_BITS_AS_HOME;
        __load_psw_mask(psw.mask);