powerpc/pseries/vas: Modify reconfig open/close functions for migration
authorHaren Myneni <haren@linux.ibm.com>
Mon, 28 Feb 2022 07:52:08 +0000 (23:52 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 7 Mar 2022 13:04:56 +0000 (00:04 +1100)
commit716d7a2e3764cb79061371767bff1a691adb4e7f
tree3e23d09192683a8d41f1ae673264724209de67df
parent278fe1cc2205a05bfd92c794be3d207372b17289
powerpc/pseries/vas: Modify reconfig open/close functions for migration

VAS is a hardware engine stays on the chip. So when the partition
migrates, all VAS windows on the source system have to be closed
and reopen them on the destination after migration.

The kernel has to consider both DLPAR CPU and migration events to
take action on VAS windows. So using VAS_WIN_NO_CRED_CLOSE and
VAS_WIN_MIGRATE_CLOSE status bits and windows will be reopened
after migration only after both status bits are cleared.

This patch make changes to the current reconfig_open/close_windows
functions to support migration:
- Set VAS_WIN_MIGRATE_CLOSE to the window status when closes and
  reopen windows with the same status during resume.
- Continue to close all windows even if deallocate HCALL failed
  (should not happen) since no way to stop migration with the
  current LPM implementation.
- If the DLPAR CPU event happens while migration is in progress,
  set VAS_WIN_NO_CRED_CLOSE to the window status. Close window
  happens with the first event (migration or DLPAR) and Reopen
  window happens only with the last event (migration or DLPAR).

Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/0aad580387cb58379496b4cbbd7c5596e9ea70be.camel@linux.ibm.com
arch/powerpc/include/asm/vas.h
arch/powerpc/platforms/pseries/vas.c