s390/cpumf: simplify psw generation

Use the psw_bits macro and simplify the code. The generated code is
also better since it doesn't contain any conditional branches anymore.

Reviewed-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Heiko Carstens 2016-11-14 07:46:06 +01:00 committed by Martin Schwidefsky
parent 3a890380e4
commit 1e16b09666
1 changed files with 5 additions and 21 deletions

View File

@ -995,27 +995,11 @@ static int perf_push_sample(struct perf_event *event, struct sf_raw_sample *sfr)
regs.int_parm = CPU_MF_INT_SF_PRA; regs.int_parm = CPU_MF_INT_SF_PRA;
sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long; sde_regs = (struct perf_sf_sde_regs *) &regs.int_parm_long;
regs.psw.addr = sfr->basic.ia; psw_bits(regs.psw).ia = sfr->basic.ia;
if (sfr->basic.T) psw_bits(regs.psw).t = sfr->basic.T;
regs.psw.mask |= PSW_MASK_DAT; psw_bits(regs.psw).w = sfr->basic.W;
if (sfr->basic.W) psw_bits(regs.psw).p = sfr->basic.P;
regs.psw.mask |= PSW_MASK_WAIT; psw_bits(regs.psw).as = sfr->basic.AS;
if (sfr->basic.P)
regs.psw.mask |= PSW_MASK_PSTATE;
switch (sfr->basic.AS) {
case 0x0:
regs.psw.mask |= PSW_ASC_PRIMARY;
break;
case 0x1:
regs.psw.mask |= PSW_ASC_ACCREG;
break;
case 0x2:
regs.psw.mask |= PSW_ASC_SECONDARY;
break;
case 0x3:
regs.psw.mask |= PSW_ASC_HOME;
break;
}
/* /*
* A non-zero guest program parameter indicates a guest * A non-zero guest program parameter indicates a guest