powerpc/vas: Setup thread IRQ handler per VAS instance
authorHaren Myneni <haren@linux.ibm.com>
Thu, 16 Apr 2020 06:03:02 +0000 (23:03 -0700)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 20 Apr 2020 06:53:00 +0000 (16:53 +1000)
commit9774628acf86409771acad6269ad24ea31ddb4b3
tree14ea6ba4995fc1a98d177d0f9d79802882445cf6
parentdb1c08a7406351673c52594f5c8a65829baf5bf6
powerpc/vas: Setup thread IRQ handler per VAS instance

When NX encounters translation error on CRB and any request buffer,
raises an interrupt on the CPU to handle the fault. It can raise one
interrupt for multiple faults. Expects OS to handle these faults and
return credits for fault window after processing faults.

Setup thread IRQ handler and IRQ thread function per each VAS instance.
IRQ handler checks if the thread is already woken up and can handle new
faults. If so returns with IRQ_HANDLED, otherwise wake up thread to
process new faults.

The thread functions reads each CRB entry from fault FIFO until sees
invalid entry. After reading each CRB, determine the corresponding
send window using pswid (from CRB) and process fault CRB. Then
invalidate the entry and return credit. Processing fault CRB and
return credit is described in subsequent patches.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1587016982.2275.1060.camel@hbabu-laptop
arch/powerpc/platforms/powernv/vas-fault.c
arch/powerpc/platforms/powernv/vas-window.c
arch/powerpc/platforms/powernv/vas.c
arch/powerpc/platforms/powernv/vas.h