powerpc/papr_scm: Use the correct bind address
authorOliver O'Halloran <oohall@gmail.com>
Thu, 31 Jan 2019 01:53:47 +0000 (12:53 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 31 Jan 2019 23:13:51 +0000 (10:13 +1100)
commit5a3840a470c41ec0b85cd36ca80370330656b163
tree94a15b3b0f571febd9d1a039d31f1235ffc22d1e
parent579b9239c1f38665b21e8d0e6ee83ecc96dbd6bb
powerpc/papr_scm: Use the correct bind address

When binding an SCM volume to a physical address the hypervisor has the
option to return early with a continue token with the expectation that
the guest will resume the bind operation until it completes. A quirk of
this interface is that the bind address will only be returned by the
first bind h-call and the subsequent calls will return
0xFFFF_FFFF_FFFF_FFFF for the bind address.

We currently do not save the address returned by the first h-call. As a
result we will use the junk address as the base of the bound region if
the hypervisor decides to split the bind across multiple h-calls. This
bug was found when testing with very large SCM volumes where the bind
process would take more time than they hypervisor's internal h-call time
limit would allow. This patch fixes the issue by saving the bind address
from the first call.

Cc: stable@vger.kernel.org
Fixes: b5beae5e224f ("powerpc/pseries: Add driver for PAPR SCM regions")
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/papr_scm.c