[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210611170610.GV1002214@nvidia.com>
Date: Fri, 11 Jun 2021 14:06:10 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Tony Krowiak <akrowiak@...ux.ibm.com>
Cc: linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org,
borntraeger@...ibm.com, cohuck@...hat.com,
pasic@...ux.vnet.ibm.com, jjherne@...ux.ibm.com,
alex.williamson@...hat.com, kwankhede@...dia.com,
frankja@...ux.ibm.com, david@...hat.com, imbrenda@...ux.ibm.com,
hca@...ux.ibm.com
Subject: Re: [PATCH 3/3] s390/vfio-ap: r/w lock for PQAP interception handler
function pointer
On Wed, Jun 09, 2021 at 06:46:34PM -0400, Tony Krowiak wrote:
> The function pointer to the interception handler for the PQAP instruction
> can get changed during the interception process. Let's add a
> semaphore to struct kvm_s390_crypto to control read/write access to the
> function pointer contained therein.
>
> The semaphore must be locked for write access by the vfio_ap device driver
> when notified that the KVM pointer has been set or cleared. It must be
> locked for read access by the interception framework when the PQAP
> instruction is intercepted.
>
> Signed-off-by: Tony Krowiak <akrowiak@...ux.ibm.com>
> ---
> arch/s390/include/asm/kvm_host.h | 6 +++---
> arch/s390/kvm/kvm-s390.c | 1 +
> arch/s390/kvm/priv.c | 6 +++---
> drivers/s390/crypto/vfio_ap_ops.c | 14 ++++++++++----
> drivers/s390/crypto/vfio_ap_private.h | 2 +-
> 5 files changed, 18 insertions(+), 11 deletions(-)
This is alot better than the try_module_get!
Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
Jason
Powered by blists - more mailing lists