• Alexander Gordeev's avatar
    s390/mcck: cleanup user process termination path · e7ec1d2e
    Alexander Gordeev authored
    If a machine check interrupt hits while user process is
    running __s390_handle_mcck() helper function is called
    directly from the interrupt handler and terminates the
    current process by calling make_task_dead() routine.
    
    The make_task_dead() is not allowed to be called from
    interrupt context which forces the machine check handler
    switch to the kernel stack and enable local interrupts
    first.
    
    The __s390_handle_mcck() could also be called to service
    pending work, but this time from the external interrupts
    handler. It is the machine check handler that establishes
    the work and schedules the external interrupt, therefore
    the machine check interrupt itself should be disabled
    while reading out the corresponding variable:
    
    	local_mcck_disable();
    	mcck = *this_cpu_ptr(&cpu_mcck);
    	memset(this_cpu_ptr(&cpu_mcck), 0, sizeof(mcck));
    	local_mcck_enable();
    
    However, local_mcck_disable() does not have effect when
    __s390_handle_mcck() is called directly form the machine
    check handler, since the machine check interrupt is still
    disabled. Therefore, it is not the opening bracket to the
    following local_mcck_enable() function.
    
    Simplify the user process termination flow by scheduling
    the external interrupt and killing the affected process
    from the interrupt context.
    
    Assume a kernel-generated signal is always delivered and
    ignore a value returned by do_send_sig_info() funciton.
    Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Reviewed-by: default avatarSven Schnelle <svens@linux.ibm.com>
    Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
    Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    e7ec1d2e
nmi.c 13.4 KB