powerpc/fscr: Enable interrupts earlier before calling get_user()
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Thu, 29 Mar 2018 06:23:37 +0000 (11:53 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 10 Apr 2018 01:23:23 +0000 (11:23 +1000)
commit709b973c844c0b4d115ac3a227a2e5a68722c912
tree003f922542c606be3d9ede19c0e14e9172f6e8e3
parent501a78cbc17c329fabf8e9750a1e9ab810c88a0e
powerpc/fscr: Enable interrupts earlier before calling get_user()

The function get_user() can sleep while trying to fetch instruction
from user address space and causes the following warning from the
scheduler.

BUG: sleeping function called from invalid context

Though interrupts get enabled back but it happens bit later after
get_user() is called. This change moves enabling these interrupts
earlier covering the function get_user(). While at this, lets check
for kernel mode and crash as this interrupt should not have been
triggered from the kernel context.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/traps.c