powerpc/vas: Map paste address only if window is active
authorHaren Myneni <haren@linux.ibm.com>
Tue, 1 Mar 2022 01:13:54 +0000 (17:13 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 7 Mar 2022 13:04:55 +0000 (00:04 +1100)
commit6a8d4ca891aa5f9402973eab5d7d9cf3929678b7
tree585fb4c2b677d103328d6369ce8d817a67f8cb4d
parentb5c63d90cc2de8ac6724fec84d1d72cfebcae41d
powerpc/vas: Map paste address only if window is active

The paste address mapping is done with mmap() after the window is
opened with ioctl. The partition has to close VAS windows in the
hypervisor if it lost credits due to DLPAR core removal. But the
kernel marks these windows inactive until the previously lost
credits are available later. If the window is inactive due to
DLPAR after this mmap(), the paste instruction returns failure
until the the OS reopens this window again.

Before the user space issuing mmap(), there is a possibility of
happening DLPAR core removal event which causes the corresponding
window inactive. So if the window is not active, return mmap()
failure with -EACCES and expects the user space reissue mmap()
when the window is active or open a new window when the credit
is available.

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/bbb203c26b324534e25658cb1dbbcb5160a2f93a.camel@linux.ibm.com
arch/powerpc/platforms/book3s/vas-api.c