lkml.org 
[lkml]   [2021]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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@linux.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@nvidia.com>

    Jason

    \
     
     \ /
      Last update: 2021-06-11 19:07    [W:2.468 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site