Commit 81f907b2 authored by Sven Schnelle's avatar Sven Schnelle Committed by Vasily Gorbik

s390/mm: Remove duplicate get_lowcore() calls

Assign the output from get_lowcore() to a local variable,
so the code is easier to read.
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 15428734
......@@ -288,15 +288,16 @@ static void __init test_monitor_call(void)
void __init trap_init(void)
{
struct lowcore *lc = get_lowcore();
unsigned long flags;
struct ctlreg cr0;
local_irq_save(flags);
cr0 = local_ctl_clear_bit(0, CR0_LOW_ADDRESS_PROTECTION_BIT);
psw_bits(get_lowcore()->external_new_psw).mcheck = 1;
psw_bits(get_lowcore()->program_new_psw).mcheck = 1;
psw_bits(get_lowcore()->svc_new_psw).mcheck = 1;
psw_bits(get_lowcore()->io_new_psw).mcheck = 1;
psw_bits(lc->external_new_psw).mcheck = 1;
psw_bits(lc->program_new_psw).mcheck = 1;
psw_bits(lc->svc_new_psw).mcheck = 1;
psw_bits(lc->io_new_psw).mcheck = 1;
local_ctl_load(0, &cr0);
local_irq_restore(flags);
local_mcck_enable();
......@@ -307,11 +308,12 @@ static void (*pgm_check_table[128])(struct pt_regs *regs);
void noinstr __do_pgm_check(struct pt_regs *regs)
{
unsigned int trapnr;
struct lowcore *lc = get_lowcore();
irqentry_state_t state;
unsigned int trapnr;
regs->int_code = get_lowcore()->pgm_int_code;
regs->int_parm_long = get_lowcore()->trans_exc_code;
regs->int_code = lc->pgm_int_code;
regs->int_parm_long = lc->trans_exc_code;
state = irqentry_enter(regs);
......@@ -324,19 +326,19 @@ void noinstr __do_pgm_check(struct pt_regs *regs)
current->thread.last_break = regs->last_break;
}
if (get_lowcore()->pgm_code & 0x0200) {
if (lc->pgm_code & 0x0200) {
/* transaction abort */
current->thread.trap_tdb = get_lowcore()->pgm_tdb;
current->thread.trap_tdb = lc->pgm_tdb;
}
if (get_lowcore()->pgm_code & PGM_INT_CODE_PER) {
if (lc->pgm_code & PGM_INT_CODE_PER) {
if (user_mode(regs)) {
struct per_event *ev = &current->thread.per_event;
set_thread_flag(TIF_PER_TRAP);
ev->address = get_lowcore()->per_address;
ev->cause = get_lowcore()->per_code_combined;
ev->paid = get_lowcore()->per_access_id;
ev->address = lc->per_address;
ev->cause = lc->per_code_combined;
ev->paid = lc->per_access_id;
} else {
/* PER event in kernel is kprobes */
__arch_local_irq_ssm(regs->psw.mask & ~PSW_MASK_PER);
......
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