Commit a7525982 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 8bb3fdd6
...@@ -25,16 +25,16 @@ ...@@ -25,16 +25,16 @@
struct psw_bits { struct psw_bits {
unsigned long : 1; unsigned long : 1;
unsigned long r : 1; /* PER-Mask */ unsigned long per : 1; /* PER-Mask */
unsigned long : 3; unsigned long : 3;
unsigned long t : 1; /* DAT Mode */ unsigned long dat : 1; /* DAT Mode */
unsigned long i : 1; /* Input/Output Mask */ unsigned long io : 1; /* Input/Output Mask */
unsigned long e : 1; /* External Mask */ unsigned long ext : 1; /* External Mask */
unsigned long key : 4; /* PSW Key */ unsigned long key : 4; /* PSW Key */
unsigned long : 1; unsigned long : 1;
unsigned long m : 1; /* Machine-Check Mask */ unsigned long mcheck : 1; /* Machine-Check Mask */
unsigned long w : 1; /* Wait State */ unsigned long wait : 1; /* Wait State */
unsigned long p : 1; /* Problem State */ unsigned long pstate : 1; /* Problem State */
unsigned long as : 2; /* Address Space Control */ unsigned long as : 2; /* Address Space Control */
unsigned long cc : 2; /* Condition Code */ unsigned long cc : 2; /* Condition Code */
unsigned long pm : 4; /* Program Mask */ unsigned long pm : 4; /* Program Mask */
......
...@@ -128,8 +128,8 @@ void show_registers(struct pt_regs *regs) ...@@ -128,8 +128,8 @@ void show_registers(struct pt_regs *regs)
pr_cont(" (%pSR)", (void *)regs->psw.addr); pr_cont(" (%pSR)", (void *)regs->psw.addr);
pr_cont("\n"); pr_cont("\n");
printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " 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, "P:%x AS:%x CC:%x PM:%x", psw->per, psw->dat, psw->io, psw->ext,
psw->key, psw->m, psw->w, psw->p, psw->as, psw->cc, psw->pm); 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); pr_cont(" RI:%x EA:%x\n", psw->ri, psw->eaba);
printk("%s GPRS: %016lx %016lx %016lx %016lx\n", mode, printk("%s GPRS: %016lx %016lx %016lx %016lx\n", mode,
regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]);
......
...@@ -996,9 +996,9 @@ static int perf_push_sample(struct perf_event *event, struct sf_raw_sample *sfr) ...@@ -996,9 +996,9 @@ static int perf_push_sample(struct perf_event *event, struct sf_raw_sample *sfr)
sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long; sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long;
psw_bits(regs.psw).ia = sfr->basic.ia; psw_bits(regs.psw).ia = sfr->basic.ia;
psw_bits(regs.psw).t = sfr->basic.T; psw_bits(regs.psw).dat = sfr->basic.T;
psw_bits(regs.psw).w = sfr->basic.W; psw_bits(regs.psw).wait = sfr->basic.W;
psw_bits(regs.psw).p = sfr->basic.P; psw_bits(regs.psw).per = sfr->basic.P;
psw_bits(regs.psw).as = sfr->basic.AS; psw_bits(regs.psw).as = sfr->basic.AS;
/* /*
......
...@@ -32,7 +32,7 @@ int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) ...@@ -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) if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT)
return -EINVAL; return -EINVAL;
clear_pt_regs_flag(regs, PIF_PER_TRAP); 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; auprobe->saved_int_code = regs->int_code;
regs->int_code = UPROBE_TRAP_NR; regs->int_code = UPROBE_TRAP_NR;
regs->psw.addr = current->utask->xol_vaddr; 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,7 +81,7 @@ int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
clear_tsk_thread_flag(current, TIF_UPROBE_SINGLESTEP); clear_tsk_thread_flag(current, TIF_UPROBE_SINGLESTEP);
update_cr_regs(current); 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; regs->int_code = auprobe->saved_int_code;
if (fixup & FIXUP_PSW_NORMAL) if (fixup & FIXUP_PSW_NORMAL)
......
...@@ -551,7 +551,7 @@ static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce, ...@@ -551,7 +551,7 @@ static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce,
int rc; int rc;
struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw); struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw);
if (!psw.t) { if (!psw.dat) {
asce->val = 0; asce->val = 0;
asce->r = 1; asce->r = 1;
return 0; return 0;
...@@ -771,7 +771,7 @@ static int low_address_protection_enabled(struct kvm_vcpu *vcpu, ...@@ -771,7 +771,7 @@ static int low_address_protection_enabled(struct kvm_vcpu *vcpu,
if (!ctlreg0.lap) if (!ctlreg0.lap)
return 0; return 0;
if (psw_bits(*psw).t && asce.p) if (psw_bits(*psw).dat && asce.p)
return 0; return 0;
return 1; return 1;
} }
...@@ -790,7 +790,7 @@ static int guest_page_range(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar, ...@@ -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, return trans_exc(vcpu, PGM_PROTECTION, ga, ar, mode,
PROT_TYPE_LA); PROT_TYPE_LA);
ga &= PAGE_MASK; ga &= PAGE_MASK;
if (psw_bits(*psw).t) { if (psw_bits(*psw).dat) {
rc = guest_translate(vcpu, ga, pages, asce, mode); rc = guest_translate(vcpu, ga, pages, asce, mode);
if (rc < 0) if (rc < 0)
return rc; return rc;
...@@ -831,7 +831,7 @@ int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, u8 ar, void *data, ...@@ -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)); pages = vmalloc(nr_pages * sizeof(unsigned long));
if (!pages) if (!pages)
return -ENOMEM; return -ENOMEM;
need_ipte_lock = psw_bits(*psw).t && !asce.r; need_ipte_lock = psw_bits(*psw).dat && !asce.r;
if (need_ipte_lock) if (need_ipte_lock)
ipte_lock(vcpu); ipte_lock(vcpu);
rc = guest_page_range(vcpu, ga, ar, pages, nr_pages, asce, mode); 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,7 +899,7 @@ int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, u8 ar,
mode, PROT_TYPE_LA); 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); rc = guest_translate(vcpu, gva, gpa, asce, mode);
if (rc > 0) if (rc > 0)
return trans_exc(vcpu, rc, gva, 0, mode, PROT_TYPE_DAT); return trans_exc(vcpu, rc, gva, 0, mode, PROT_TYPE_DAT);
......
...@@ -374,7 +374,7 @@ static int handle_sske(struct kvm_vcpu *vcpu) ...@@ -374,7 +374,7 @@ static int handle_sske(struct kvm_vcpu *vcpu)
static int handle_ipte_interlock(struct kvm_vcpu *vcpu) static int handle_ipte_interlock(struct kvm_vcpu *vcpu)
{ {
vcpu->stat.instruction_ipte_interlock++; 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); return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
wait_event(vcpu->kvm->arch.ipte_wq, !ipte_lock_held(vcpu)); wait_event(vcpu->kvm->arch.ipte_wq, !ipte_lock_held(vcpu));
kvm_s390_retry_instr(vcpu); kvm_s390_retry_instr(vcpu);
......
...@@ -102,7 +102,7 @@ void __init paging_init(void) ...@@ -102,7 +102,7 @@ void __init paging_init(void)
__ctl_load(S390_lowcore.kernel_asce, 7, 7); __ctl_load(S390_lowcore.kernel_asce, 7, 7);
__ctl_load(S390_lowcore.kernel_asce, 13, 13); __ctl_load(S390_lowcore.kernel_asce, 13, 13);
psw.mask = __extract_psw(); psw.mask = __extract_psw();
psw_bits(psw).t = 1; psw_bits(psw).dat = 1;
psw_bits(psw).as = PSW_BITS_AS_HOME; psw_bits(psw).as = PSW_BITS_AS_HOME;
__load_psw_mask(psw.mask); __load_psw_mask(psw.mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment