lkml.org 
[lkml]   [2020]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v10 06/16] s390/vfio-ap: introduce shadow APCB
From
Date


On 9/17/20 10:22 AM, Cornelia Huck wrote:
> On Fri, 21 Aug 2020 15:56:06 -0400
> Tony Krowiak <akrowiak@linux.ibm.com> wrote:
>
>> The APCB is a field within the CRYCB that provides the AP configuration
>> to a KVM guest. Let's introduce a shadow copy of the KVM guest's APCB and
>> maintain it for the lifespan of the guest.
>>
>> Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
>> ---
>> drivers/s390/crypto/vfio_ap_ops.c | 32 ++++++++++++++++++++++-----
>> drivers/s390/crypto/vfio_ap_private.h | 2 ++
>> 2 files changed, 29 insertions(+), 5 deletions(-)
> (...)
>
>> @@ -1202,13 +1223,12 @@ static int vfio_ap_mdev_group_notifier(struct notifier_block *nb,
>> if (ret)
>> return NOTIFY_DONE;
>>
>> - /* If there is no CRYCB pointer, then we can't copy the masks */
>> - if (!matrix_mdev->kvm->arch.crypto.crycbd)
>> + if (!vfio_ap_mdev_has_crycb(matrix_mdev))
>> return NOTIFY_DONE;
>>
>> - kvm_arch_crypto_set_masks(matrix_mdev->kvm, matrix_mdev->matrix.apm,
>> - matrix_mdev->matrix.aqm,
>> - matrix_mdev->matrix.adm);
>> + memcpy(&matrix_mdev->shadow_apcb, &matrix_mdev->matrix,
>> + sizeof(matrix_mdev->shadow_apcb));
>> + vfio_ap_mdev_commit_crycb(matrix_mdev);
> We are sure that the shadow APCB always matches up as we are the only
> ones manipulating the APCB in the CRYCB, right?

Yes

>
>>
>> return NOTIFY_OK;
>> }

\
 
 \ /
  Last update: 2020-09-18 19:05    [W:0.130 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site