powerpc/pseries/cmm: Simulation mode
authorDavid Hildenbrand <david@redhat.com>
Thu, 31 Oct 2019 14:29:31 +0000 (15:29 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 13 Nov 2019 05:58:02 +0000 (16:58 +1100)
commitb1713975c31ae20ecc40fd00191ee3fa51445d4a
tree68ad9d016415cb09a004e36a52751bbf3ae7e4db
parente8decafefb67794ba30fddf7d9e90a247b5aa172
powerpc/pseries/cmm: Simulation mode

Let's allow to test the implementation without needing HW support.
When "simulate=1" is specified when loading the module, we bypass all
HW checks and HW calls. The sysfs file "simulate_loan_target_kb" can
be used to simulate HW requests.

The simualtion mode can be activated using:
  modprobe cmm debug=1 simulate=1

And the requested loan target can be changed using:
  echo X > /sys/devices/system/cmm/cmm0/simulate_loan_target_kb

Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191031142933.10779-11-david@redhat.com
arch/powerpc/platforms/pseries/cmm.c