aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2017-06-03 04:56:07 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-06-12 10:26:02 -0400
commita752598254016d2f9b4415d43a6402fe083f70b2 (patch)
tree63aed3e4e5ab3caee2a369c3ee7237bfa25e05d9
parent8bb3fdd6863c3b6b84bbab750d6b35e889c1399d (diff)
s390: rename struct psw_bits members
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>
-rw-r--r--arch/s390/include/asm/ptrace.h38
-rw-r--r--arch/s390/kernel/dumpstack.c4
-rw-r--r--arch/s390/kernel/perf_cpum_sf.c10
-rw-r--r--arch/s390/kernel/uprobes.c4
-rw-r--r--arch/s390/kvm/gaccess.c10
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/mm/init.c2
7 files changed, 35 insertions, 35 deletions
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index c8d13bcc9f5d..004f54909235 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -24,25 +24,25 @@
24 PSW_MASK_PSTATE | PSW_ASC_PRIMARY) 24 PSW_MASK_PSTATE | PSW_ASC_PRIMARY)
25 25
26struct psw_bits { 26struct psw_bits {
27 unsigned long : 1; 27 unsigned long : 1;
28 unsigned long r : 1; /* PER-Mask */ 28 unsigned long per : 1; /* PER-Mask */
29 unsigned long : 3; 29 unsigned long : 3;
30 unsigned long t : 1; /* DAT Mode */ 30 unsigned long dat : 1; /* DAT Mode */
31 unsigned long i : 1; /* Input/Output Mask */ 31 unsigned long io : 1; /* Input/Output Mask */
32 unsigned long e : 1; /* External Mask */ 32 unsigned long ext : 1; /* External Mask */
33 unsigned long key : 4; /* PSW Key */ 33 unsigned long key : 4; /* PSW Key */
34 unsigned long : 1; 34 unsigned long : 1;
35 unsigned long m : 1; /* Machine-Check Mask */ 35 unsigned long mcheck : 1; /* Machine-Check Mask */
36 unsigned long w : 1; /* Wait State */ 36 unsigned long wait : 1; /* Wait State */
37 unsigned long p : 1; /* Problem State */ 37 unsigned long pstate : 1; /* Problem State */
38 unsigned long as : 2; /* Address Space Control */ 38 unsigned long as : 2; /* Address Space Control */
39 unsigned long cc : 2; /* Condition Code */ 39 unsigned long cc : 2; /* Condition Code */
40 unsigned long pm : 4; /* Program Mask */ 40 unsigned long pm : 4; /* Program Mask */
41 unsigned long ri : 1; /* Runtime Instrumentation */ 41 unsigned long ri : 1; /* Runtime Instrumentation */
42 unsigned long : 6; 42 unsigned long : 6;
43 unsigned long eaba : 2; /* Addressing Mode */ 43 unsigned long eaba : 2; /* Addressing Mode */
44 unsigned long : 31; 44 unsigned long : 31;
45 unsigned long ia : 64; /* Instruction Address */ 45 unsigned long ia : 64; /* Instruction Address */
46}; 46};
47 47
48enum { 48enum {
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c
index 62904890d127..dab78babfab6 100644
--- a/arch/s390/kernel/dumpstack.c
+++ b/arch/s390/kernel/dumpstack.c
@@ -128,8 +128,8 @@ void show_registers(struct pt_regs *regs)
128 pr_cont(" (%pSR)", (void *)regs->psw.addr); 128 pr_cont(" (%pSR)", (void *)regs->psw.addr);
129 pr_cont("\n"); 129 pr_cont("\n");
130 printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " 130 printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x "
131 "P:%x AS:%x CC:%x PM:%x", psw->r, psw->t, psw->i, psw->e, 131 "P:%x AS:%x CC:%x PM:%x", psw->per, psw->dat, psw->io, psw->ext,
132 psw->key, psw->m, psw->w, psw->p, psw->as, psw->cc, psw->pm); 132 psw->key, psw->mcheck, psw->wait, psw->pstate, psw->as, psw->cc, psw->pm);
133 pr_cont(" RI:%x EA:%x\n", psw->ri, psw->eaba); 133 pr_cont(" RI:%x EA:%x\n", psw->ri, psw->eaba);
134 printk("%s GPRS: %016lx %016lx %016lx %016lx\n", mode, 134 printk("%s GPRS: %016lx %016lx %016lx %016lx\n", mode,
135 regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); 135 regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]);
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index ca960d0370d5..0c82f7903fc7 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -995,11 +995,11 @@ static int perf_push_sample(struct perf_event *event, struct sf_raw_sample *sfr)
995 regs.int_parm = CPU_MF_INT_SF_PRA; 995 regs.int_parm = CPU_MF_INT_SF_PRA;
996 sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long; 996 sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long;
997 997
998 psw_bits(regs.psw).ia = sfr->basic.ia; 998 psw_bits(regs.psw).ia = sfr->basic.ia;
999 psw_bits(regs.psw).t = sfr->basic.T; 999 psw_bits(regs.psw).dat = sfr->basic.T;
1000 psw_bits(regs.psw).w = sfr->basic.W; 1000 psw_bits(regs.psw).wait = sfr->basic.W;
1001 psw_bits(regs.psw).p = sfr->basic.P; 1001 psw_bits(regs.psw).per = sfr->basic.P;
1002 psw_bits(regs.psw).as = sfr->basic.AS; 1002 psw_bits(regs.psw).as = sfr->basic.AS;
1003 1003
1004 /* 1004 /*
1005 * Use the hardware provided configuration level to decide if the 1005 * Use the hardware provided configuration level to decide if the
diff --git a/arch/s390/kernel/uprobes.c b/arch/s390/kernel/uprobes.c
index 0eec45b4575b..d94baa8db507 100644
--- a/arch/s390/kernel/uprobes.c
+++ b/arch/s390/kernel/uprobes.c
@@ -32,7 +32,7 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
32 if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) 32 if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)
33 return -EINVAL; 33 return -EINVAL;
34 clear_pt_regs_flag(regs, PIF_PER_TRAP); 34 clear_pt_regs_flag(regs, PIF_PER_TRAP);
35 auprobe->saved_per = psw_bits(regs->psw).r; 35 auprobe->saved_per = psw_bits(regs->psw).per;
36 auprobe->saved_int_code = regs->int_code; 36 auprobe->saved_int_code = regs->int_code;
37 regs->int_code = UPROBE_TRAP_NR; 37 regs->int_code = UPROBE_TRAP_NR;
38 regs->psw.addr = current->utask->xol_vaddr; 38 regs->psw.addr = current->utask->xol_vaddr;
@@ -81,7 +81,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
81 81
82 clear_tsk_thread_flag(current, TIF_UPROBE_SINGLESTEP); 82 clear_tsk_thread_flag(current, TIF_UPROBE_SINGLESTEP);
83 update_cr_regs(current); 83 update_cr_regs(current);
84 psw_bits(regs->psw).r = auprobe->saved_per; 84 psw_bits(regs->psw).per = auprobe->saved_per;
85 regs->int_code = auprobe->saved_int_code; 85 regs->int_code = auprobe->saved_int_code;
86 86
87 if (fixup & FIXUP_PSW_NORMAL) 87 if (fixup & FIXUP_PSW_NORMAL)
diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
index 6ad4a9797de8..e0f7d5fc7efd 100644
--- a/arch/s390/kvm/gaccess.c
+++ b/arch/s390/kvm/gaccess.c
@@ -551,7 +551,7 @@ static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce,
551 int rc; 551 int rc;
552 struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw); 552 struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw);
553 553
554 if (!psw.t) { 554 if (!psw.dat) {
555 asce->val = 0; 555 asce->val = 0;
556 asce->r = 1; 556 asce->r = 1;
557 return 0; 557 return 0;
@@ -771,7 +771,7 @@ static int low_address_protection_enabled(struct kvm_vcpu *vcpu,
771 771
772 if (!ctlreg0.lap) 772 if (!ctlreg0.lap)
773 return 0; 773 return 0;
774 if (psw_bits(*psw).t && asce.p) 774 if (psw_bits(*psw).dat && asce.p)
775 return 0; 775 return 0;
776 return 1; 776 return 1;
777} 777}
@@ -790,7 +790,7 @@ static int guest_page_range(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar,
790 return trans_exc(vcpu, PGM_PROTECTION, ga, ar, mode, 790 return trans_exc(vcpu, PGM_PROTECTION, ga, ar, mode,
791 PROT_TYPE_LA); 791 PROT_TYPE_LA);
792 ga &= PAGE_MASK; 792 ga &= PAGE_MASK;
793 if (psw_bits(*psw).t) { 793 if (psw_bits(*psw).dat) {
794 rc = guest_translate(vcpu, ga, pages, asce, mode); 794 rc = guest_translate(vcpu, ga, pages, asce, mode);
795 if (rc < 0) 795 if (rc < 0)
796 return rc; 796 return rc;
@@ -831,7 +831,7 @@ int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar, void *data,
831 pages = vmalloc(nr_pages * sizeof(unsigned long)); 831 pages = vmalloc(nr_pages * sizeof(unsigned long));
832 if (!pages) 832 if (!pages)
833 return -ENOMEM; 833 return -ENOMEM;
834 need_ipte_lock = psw_bits(*psw).t && !asce.r; 834 need_ipte_lock = psw_bits(*psw).dat && !asce.r;
835 if (need_ipte_lock) 835 if (need_ipte_lock)
836 ipte_lock(vcpu); 836 ipte_lock(vcpu);
837 rc = guest_page_range(vcpu, ga, ar, pages, nr_pages, asce, mode); 837 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,
899 mode, PROT_TYPE_LA); 899 mode, PROT_TYPE_LA);
900 } 900 }
901 901
902 if (psw_bits(*psw).t && !asce.r) { /* Use DAT? */ 902 if (psw_bits(*psw).dat && !asce.r) { /* Use DAT? */
903 rc = guest_translate(vcpu, gva, gpa, asce, mode); 903 rc = guest_translate(vcpu, gva, gpa, asce, mode);
904 if (rc > 0) 904 if (rc > 0)
905 return trans_exc(vcpu, rc, gva, 0, mode, PROT_TYPE_DAT); 905 return trans_exc(vcpu, rc, gva, 0, mode, PROT_TYPE_DAT);
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index e9dd7efc57b8..e53292a89257 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -374,7 +374,7 @@ static int handle_sske(struct kvm_vcpu *vcpu)
374static int handle_ipte_interlock(struct kvm_vcpu *vcpu) 374static int handle_ipte_interlock(struct kvm_vcpu *vcpu)
375{ 375{
376 vcpu->stat.instruction_ipte_interlock++; 376 vcpu->stat.instruction_ipte_interlock++;
377 if (psw_bits(vcpu->arch.sie_block->gpsw).p) 377 if (psw_bits(vcpu->arch.sie_block->gpsw).pstate)
378 return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); 378 return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
379 wait_event(vcpu->kvm->arch.ipte_wq, !ipte_lock_held(vcpu)); 379 wait_event(vcpu->kvm->arch.ipte_wq, !ipte_lock_held(vcpu));
380 kvm_s390_retry_instr(vcpu); 380 kvm_s390_retry_instr(vcpu);
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index bc8c301f82b6..3348e60dd8ad 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -102,7 +102,7 @@ void __init paging_init(void)
102 __ctl_load(S390_lowcore.kernel_asce, 7, 7); 102 __ctl_load(S390_lowcore.kernel_asce, 7, 7);
103 __ctl_load(S390_lowcore.kernel_asce, 13, 13); 103 __ctl_load(S390_lowcore.kernel_asce, 13, 13);
104 psw.mask = __extract_psw(); 104 psw.mask = __extract_psw();
105 psw_bits(psw).t = 1; 105 psw_bits(psw).dat = 1;
106 psw_bits(psw).as = PSW_BITS_AS_HOME; 106 psw_bits(psw).as = PSW_BITS_AS_HOME;
107 __load_psw_mask(psw.mask); 107 __load_psw_mask(psw.mask);
108 108