On 4/8/21 4:38 PM, Halil Pasic wrote:
On Tue, 6 Apr 2021 11:31:09 -0400
Tony Krowiak wrote:
Tony Krowiak (13):
s390/vfio-ap: fix circular lockdep when setting/clearing crypto masks
The subsequent patches, re introduce this circular locking dependency
problem. See my kernel messages
Update the documentation in vfio-ap.rst to include information about the
AP dynamic configuration support (i.e., hot plug of adapters, domains
and control domains via the matrix mediated device's sysfs assignment
attributes).
Signed-off-by: Tony Krowiak
---
Documentation/s390/vfio-ap.rst
em one at a time when the
probe callback is invoked.
Please note that changes to the apmask and aqmask do not trigger
these two callbacks since the bus scan function is not invoked by changes
to those masks.
Signed-off-by: Harald Freudenberger
Reviewed-by: Halil Pasic
Signed-off-by: Tony K
is or will be using the matrix mdev. For a matrix mdev denoted by
$uuid, the guest matrix can be displayed as follows:
cat /sys/devices/vfio_ap/matrix/$uuid/guest_matrix
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 51 ++-
1 file change
o a matrix_mdev as well as during the in_use callback, the
mutex_trylock(&matrix_dev->lock) function will be used. If the lock is not
obtained, then the assignment and in_use functions will terminate with
-EAGAIN.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_drv.
rix mdev). This will enforce the proper procedure for
removing AP resources intended for guest usage which is to
first unassign them from the matrix mdev, then unbind them from the
vfio_ap device driver.
Signed-off-by: Tony Krowiak
Reviewed-by: Harald Freudenberger
Reviewed-by: Halil Pasic
---
driv
available
to the system.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 228 --
1 file changed, 56 insertions(+), 172 deletions(-)
diff --git a/drivers/s390/crypto/vfio_ap_ops.c
b/drivers/s390/crypto/vfio_ap_ops.c
index a8ae1d22aeba..69b58b0fac8f
eshed.
After refreshing the APCB, if the mdev is in use by a KVM guest, it is
hot plugged into the guest to provide access to dynamically provide
access to the adapters, domains and control domains provided via the
newly refreshed APCB.
Signed-off-by: Tony Krowiak
Acked-by: Halil Pasic
---
drivers
assigned to the mdev.
The filtering will take place:
* Whenever an adapter, domain or control domains is assigned or
unassigned.
* When a queue device is bound to or unbound from the vfio_ap device
driver.
Signed-off-by: Tony Krowiak
Acked-by: Halil Pasic
---
drivers/s390/crypto/vfi
o the mdev will be removed.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.c | 162 ++
drivers/s390/crypto/vfio_ap_private.h | 3 +
2 files changed, 140 insertions(+), 25 deletions(-)
diff --git a/drivers/s390/crypto/v
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
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.
river.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_drv.c | 41 ++-
drivers/s390/crypto/vfio_ap_ops.c | 28 ++
drivers/s390/crypto/vfio_ap_private.h | 5 ++--
3 files changed, 33 insertions(+), 41 dele
uot;s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 308 ++
drivers/s390/crypto/vfio_ap_private.h | 2 +
2 files changed, 215 insertions
ed by APQN. This is much more efficient than looping over
the list of devices attached to the AP bus by several orders of
magnitude.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.c | 23 +--
1 file changed, 9 insertions(+), 14
o test CRYCB masks before taking the vCPUs
out of SIE. Now checking the shadow CRYCB in the vfio_ap driver.
Change log v1->v2:
-
* Removed patches preventing root user from unbinding AP queues from
the vfio_ap device driver
* Introduced a shadow CRYCB in the vfio_ap driver to
a new set of patches with the fix included.
On 4/1/21 3:17 PM, Halil Pasic wrote:
On Wed, 31 Mar 2021 11:22:43 -0400
Tony Krowiak wrote:
Change log v13-v14:
--
When testing I've experienced this kernel panic.
[ 4422.479706] vfio_ap matrix: MDEV: Registered
[ 4422.5
On 4/1/21 3:17 PM, Halil Pasic wrote:
On Wed, 31 Mar 2021 11:22:43 -0400
Tony Krowiak wrote:
Change log v13-v14:
--
When testing I've experienced this kernel panic.
I am able to recreate this, but only when the kernel is built with
the debug_defconfig configuration.
em one at a time when the
probe callback is invoked.
Please note that changes to the apmask and aqmask do not trigger
these two callbacks since the bus scan function is not invoked by changes
to those masks.
Signed-off-by: Harald Freudenberger
Reviewed-by: Halil Pasic
Signed-off-by: Tony K
o a matrix_mdev as well as during the in_use callback, the
mutex_trylock(&matrix_dev->lock) function will be used. If the lock is not
obtained, then the assignment and in_use functions will terminate with
-EAGAIN.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_drv.
Update the documentation in vfio-ap.rst to include information about the
AP dynamic configuration support (i.e., hot plug of adapters, domains
and control domains via the matrix mediated device's sysfs assignment
attributes).
Signed-off-by: Tony Krowiak
---
Documentation/s390/vfio-ap.rst
rix mdev). This will enforce the proper procedure for
removing AP resources intended for guest usage which is to
first unassign them from the matrix mdev, then unbind them from the
vfio_ap device driver.
Signed-off-by: Tony Krowiak
Reviewed-by: Harald Freudenberger
Reviewed-by: Halil Pasic
---
driv
eshed.
After refreshing the APCB, if the mdev is in use by a KVM guest, it is
hot plugged into the guest to provide access to dynamically provide
access to the adapters, domains and control domains provided via the
newly refreshed APCB.
Signed-off-by: Tony Krowiak
Acked-by: Halil Pasic
---
drivers
is or will be using the matrix mdev. For a matrix mdev denoted by
$uuid, the guest matrix can be displayed as follows:
cat /sys/devices/vfio_ap/matrix/$uuid/guest_matrix
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 51 ++-
1 file change
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
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.
available
to the system.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 228 --
1 file changed, 56 insertions(+), 172 deletions(-)
diff --git a/drivers/s390/crypto/vfio_ap_ops.c
b/drivers/s390/crypto/vfio_ap_ops.c
index 241051565783..1f2a3049b283
assigned to the mdev.
The filtering will take place:
* Whenever an adapter, domain or control domains is assigned or
unassigned.
* When a queue device is bound to or unbound from the vfio_ap device
driver.
Signed-off-by: Tony Krowiak
Acked-by: Halil Pasic
---
drivers/s390/crypto/vfi
ed by APQN. This is much more efficient than looping over
the list of devices attached to the AP bus by several orders of
magnitude.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.c | 23 +--
1 file changed, 9 insertions(+), 14
river.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_drv.c | 41 ++-
drivers/s390/crypto/vfio_ap_ops.c | 28 ++
drivers/s390/crypto/vfio_ap_private.h | 5 ++--
3 files changed, 33 insertions(+), 41 dele
er or domain is unassigned from a matrix mdev, for each
APQN unassigned that references a queue device bound to the vfio_ap
device driver, the structures representing the queue device and the
matrix mdev will be unlinked.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypt
.
Change log v1->v2:
-
* Removed patches preventing root user from unbinding AP queues from
the vfio_ap device driver
* Introduced a shadow CRYCB in the vfio_ap driver to manage dynamic
changes to the AP guest configuration due to root user interventions
or hardware anomalies
uot;s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 308 ++
drivers/s390/crypto/vfio_ap_private.h | 2 +
2 files changed, 215 insertions
On 1/14/21 8:44 PM, Halil Pasic wrote:
On Thu, 14 Jan 2021 12:54:39 -0500
Tony Krowiak wrote:
/**
* vfio_ap_mdev_verify_no_sharing
*
- * Verifies that the APQNs derived from the cross product of the AP adapter IDs
- * and AP queue indexes comprising the AP matrix are not
On 3/25/21 4:32 PM, Halil Pasic wrote:
On Thu, 25 Mar 2021 08:46:40 -0400
Tony Krowiak wrote:
This patch fixes a lockdep splat introduced by commit f21916ec4826
("s390/vfio-ap: clean up vfio_ap resources when KVM pointer invalidated").
The lockdep splat only occurs when startin
uot;s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 309 ++
drivers/s390/crypto/vfio_ap_private.h | 2 +
2 files changed, 215 insertions
age
AP resources used by the KVM guest in the vfio_ap_mdev_set_kvm()
function instead of the group notifier callback.
* Check for the matrix mdev's KVM pointer in the vfio_ap_mdev_unset_kvm()
function instead of the vfio_ap_mdev_release() function.
Tony Krowiak (1):
s390/vfio-ap: fix
On 3/17/21 7:17 PM, Halil Pasic wrote:
On Wed, 10 Mar 2021 10:05:59 -0500
Tony Krowiak wrote:
- ret = vfio_ap_mdev_reset_queues(mdev);
+ matrix_mdev = mdev_get_drvdata(mdev);
Is it guaranteed that matrix_mdev can't be NULL here? If yes, please
remind me o
On 3/17/21 7:17 PM, Halil Pasic wrote:
On Wed, 10 Mar 2021 10:05:59 -0500
Tony Krowiak wrote:
- ret = vfio_ap_mdev_reset_queues(mdev);
+ matrix_mdev = mdev_get_drvdata(mdev);
Is it guaranteed that matrix_mdev can't be NULL here? If yes, please
remind me o
uot;s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 309 ++
drivers/s390/crypto/vfio_ap_private.h | 2 +
2 files changed, 215 insertions
upplying the AP configuration to a KVM guest.
* Make all updates to the data in the matrix mdev that is used to manage
AP resources used by the KVM guest in the vfio_ap_mdev_set_kvm()
function instead of the group notifier callback.
* Check for the matrix mdev's KVM pointer in the vfio_ap_mde
On 3/9/21 5:23 AM, Halil Pasic wrote:
On Thu, 4 Mar 2021 12:43:44 -0500
Tony Krowiak wrote:
On the other hand, if we don't have ->kvm because something broke,
then we may be out of luck anyway. There will certainly be no
way to unregister the GISC; however, it may still be pos
On 3/3/21 2:47 PM, Halil Pasic wrote:
On Wed, 3 Mar 2021 12:10:11 -0500
Tony Krowiak wrote:
On 3/3/21 10:23 AM, Halil Pasic wrote:
On Tue, 2 Mar 2021 15:43:22 -0500
Tony Krowiak wrote:
This patch fixes a lockdep splat introduced by commit f21916ec4826
("s390/vfio-ap: cle
On 3/3/21 2:42 PM, Halil Pasic wrote:
On Wed, 3 Mar 2021 11:41:22 -0500
Tony Krowiak wrote:
How do you exect userspace to react to this -ENODEV?
The VFIO_DEVICE_RESET ioctl expects a return code.
The vfio_ap_mdev_reset_queues() function can return -EIO or
-EBUSY, so I would expect
On 3/3/21 10:23 AM, Halil Pasic wrote:
On Tue, 2 Mar 2021 15:43:22 -0500
Tony Krowiak wrote:
This patch fixes a lockdep splat introduced by commit f21916ec4826
("s390/vfio-ap: clean up vfio_ap resources when KVM pointer invalidated").
The lockdep splat only occurs when startin
On 3/3/21 10:23 AM, Halil Pasic wrote:
On Tue, 2 Mar 2021 15:43:22 -0500
Tony Krowiak wrote:
This patch fixes a lockdep splat introduced by commit f21916ec4826
("s390/vfio-ap: clean up vfio_ap resources when KVM pointer invalidated").
The lockdep splat only occurs when startin
uot;s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 312 ++
drivers/s390/crypto/vfio_ap_private.h | 2 +
2 files changed, 218 insertions
masks supplying the AP configuration to a KVM guest.
* Make all updates to the data in the matrix mdev that is used to manage
AP resources used by the KVM guest in the vfio_ap_mdev_set_kvm() function
instead of the group notifier callback.
* Check for the matrix mdev's KVM pointer in the v
gions = 0;
info.num_irqs = 0;
- return copy_to_user((void __user *)arg, &info, minsz);
+ return copy_to_user((void __user *)arg, &info, minsz) ? -EFAULT : 0;
}
LGTM
Reviewed-by: Tony Krowiak
static ssize_t vfio_ap_mdev_ioctl(struct mdev_device *mdev,
On 2/25/21 10:35 AM, Halil Pasic wrote:
On Thu, 25 Feb 2021 10:25:24 -0500
Tony Krowiak wrote:
On 2/25/21 8:53 AM, Tony Krowiak wrote:
On 2/25/21 6:28 AM, Halil Pasic wrote:
On Wed, 24 Feb 2021 22:28:50 -0500
Tony Krowiak wrote:
static void vfio_ap_mdev_unset_kvm(struct
On 2/25/21 8:53 AM, Tony Krowiak wrote:
On 2/25/21 6:28 AM, Halil Pasic wrote:
On Wed, 24 Feb 2021 22:28:50 -0500
Tony Krowiak wrote:
static void vfio_ap_mdev_unset_kvm(struct ap_matrix_mdev *matrix_mdev)
{
- kvm_arch_crypto_clear_masks(matrix_mdev->kvm);
- matrix_m
On 2/24/21 11:10 AM, Christian Borntraeger wrote:
On 23.02.21 10:48, Halil Pasic wrote:
On Mon, 15 Feb 2021 20:15:47 -0500
Tony Krowiak wrote:
This patch fixes a circular locking dependency in the CI introduced by
commit f21916ec4826 ("s390/vfio-ap: clean up vfio_ap resources whe
On 2/19/21 8:45 AM, Cornelia Huck wrote:
On Mon, 15 Feb 2021 20:15:47 -0500
Tony Krowiak wrote:
This patch fixes a circular locking dependency in the CI introduced by
commit f21916ec4826 ("s390/vfio-ap: clean up vfio_ap resources when KVM
pointer invalidated"). The lockdep only o
ta in the matrix mdev that is used to manage
AP resources used by the KVM guest in the vfio_ap_mdev_set_kvm() function
instead of the group notifier callback.
* Check for the matrix mdev's KVM pointer in the vfio_ap_mdev_unset_kvm()
function instead of the vfio_ap_mdev_release() function.
Tony Krowia
arily critical for setting the masks, so this will not be done under
protection of the matrix_dev->lock.
Fixes: f21916ec4826 ("s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers/
On 2/11/21 11:47 AM, Halil Pasic wrote:
On Thu, 11 Feb 2021 09:21:26 -0500
Tony Krowiak wrote:
Yes, it makes sense. I guess I didn't look closely at your
suggestion when I said it was exactly what I implemented
after agreeing with Connie. I had a slight difference in
my implement
On 2/11/21 7:23 AM, Cornelia Huck wrote:
On Wed, 10 Feb 2021 15:34:24 -0500
Tony Krowiak wrote:
On 2/10/21 5:53 AM, Cornelia Huck wrote:
On Tue, 9 Feb 2021 14:48:30 -0500
Tony Krowiak wrote:
This patch fixes a circular locking dependency in the CI introduced by
commit f21916ec4826
On 2/10/21 5:46 PM, Halil Pasic wrote:
On Wed, 10 Feb 2021 17:05:48 -0500
Tony Krowiak wrote:
On 2/10/21 10:32 AM, Halil Pasic wrote:
On Wed, 10 Feb 2021 16:24:29 +0100
Halil Pasic wrote:
Maybe you could
- grab a reference to kvm while holding the lock
- call the mask handling
On 2/10/21 10:24 AM, Halil Pasic wrote:
On Wed, 10 Feb 2021 11:53:34 +0100
Cornelia Huck wrote:
On Tue, 9 Feb 2021 14:48:30 -0500
Tony Krowiak wrote:
This patch fixes a circular locking dependency in the CI introduced by
commit f21916ec4826 ("s390/vfio-ap: clean up vfio_ap reso
On 2/10/21 10:32 AM, Halil Pasic wrote:
On Wed, 10 Feb 2021 16:24:29 +0100
Halil Pasic wrote:
Maybe you could
- grab a reference to kvm while holding the lock
- call the mask handling functions with that kvm reference
- lock again, drop the reference, and do the rest of the processing?
I a
On 2/10/21 5:53 AM, Cornelia Huck wrote:
On Tue, 9 Feb 2021 14:48:30 -0500
Tony Krowiak wrote:
This patch fixes a circular locking dependency in the CI introduced by
commit f21916ec4826 ("s390/vfio-ap: clean up vfio_ap resources when KVM
pointer invalidated"). The lockdep only o
arily critical for setting the masks, so this will not be done under
protection of the matrix_dev->lock.
Fixes: f21916ec4826 ("s390/vfio-ap: clean up vfio_ap resources when KVM pointer
invalidated")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
---
drivers
matrix_dev->lock
#1: handle_pqap:matrix_dev->lock
kvm_vcpu_ioctl: vcpu->mutex
#0: kvm_s390_cpus_to_pv:vcpu->mutex
kvm_vm_ioctl: kvm->lock
Tony Krowiak (1):
s390/vfio-ap
On 1/12/21 12:55 PM, Halil Pasic wrote:
On Tue, 12 Jan 2021 02:12:51 +0100
Halil Pasic wrote:
@@ -1347,8 +1437,11 @@ void vfio_ap_mdev_remove_queue(struct ap_device *apdev)
apqi = AP_QID_QUEUE(q->apqn);
vfio_ap_mdev_reset_queue(apid, apqi, 1);
- if (q->matrix_mdev)
+
On 1/12/21 12:55 PM, Halil Pasic wrote:
On Tue, 12 Jan 2021 02:12:51 +0100
Halil Pasic wrote:
@@ -1347,8 +1437,11 @@ void vfio_ap_mdev_remove_queue(struct ap_device *apdev)
apqi = AP_QID_QUEUE(q->apqn);
vfio_ap_mdev_reset_queue(apid, apqi, 1);
- if (q->matrix_mdev)
+
On 1/11/21 5:58 PM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:59 -0500
Tony Krowiak wrote:
The matrix of adapters and domains configured in a guest's APCB may
differ from the matrix of adapters and domains assigned to the matrix mdev,
so this patch introduces a sysfs attribu
On 1/11/21 5:50 PM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:58 -0500
Tony Krowiak 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 gues
On 1/13/21 9:50 PM, Halil Pasic wrote:
On Wed, 13 Jan 2021 16:41:27 -0500
Tony Krowiak wrote:
On 1/11/21 2:17 PM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:56 -0500
Tony Krowiak wrote:
Let's create links between each queue device bound to the vfio_ap device
driver and the m
On 1/11/21 3:40 PM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:57 -0500
Tony Krowiak wrote:
The current implementation does not allow assignment of an AP adapter or
domain to an mdev device if each APQN resulting from the assignment
does not reference an AP queue device that is bound to
On 1/13/21 4:21 PM, Halil Pasic wrote:
On Wed, 13 Jan 2021 12:06:28 -0500
Tony Krowiak wrote:
On 1/11/21 11:32 AM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:53 -0500
Tony Krowiak wrote:
The queues assigned to a matrix mediated device are currently reset when:
* The
On 1/11/21 2:17 PM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:56 -0500
Tony Krowiak wrote:
Let's create links between each queue device bound to the vfio_ap device
driver and the matrix mdev to which the queue's APQN is assigned. The idea
is to facilitate efficient retrie
On 1/11/21 11:32 AM, Halil Pasic wrote:
On Tue, 22 Dec 2020 20:15:53 -0500
Tony Krowiak wrote:
The queues assigned to a matrix mediated device are currently reset when:
* The VFIO_DEVICE_RESET ioctl is invoked
* The mdev fd is closed by userspace (QEMU)
* The mdev is removed from sysfs
Ping
On 12/22/20 8:15 PM, Tony Krowiak wrote:
Note: Patch 1, s390/vfio-ap: clean up vfio_ap resources when KVM
pointer invalidated does not belong to this series. It has been
posted as a separate patch to fix a known problem. It is included
here because it will likely pre
when the KVM pointer was set.
Fixes: 258287c994de ("s390: vfio-ap: implement mediated device open callback")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
Reviewed-by: Cornelia Huck
---
drivers/s390/crypto/vfio_ap_ops.c | 49 ++--
when the KVM pointer was set.
Fixes: 258287c994de ("s390: vfio-ap: implement mediated device open callback")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
Reviewed-by: Cornelia Huck
---
drivers/s390/crypto/vfio_ap_ops.c | 49 ++--
ed by APQN. This is much more efficient than looping over
the list of devices attached to the AP bus by several orders of
magnitude.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.c | 25 ++---
1 file changed, 10 insertions(+), 15
structures representing the queue device and the
matrix mdev will be unlinked.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 140 +-
drivers/s390/crypto/vfio_ap_private.h | 3 +
2 files changed, 117 insertions(+), 26 deletions(-)
diff --git a/dr
is or will be using the matrix mdev. For a matrix mdev denoted by
$uuid, the guest matrix can be displayed as follows:
cat /sys/devices/vfio_ap/matrix/$uuid/guest_matrix
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 51 ++-
1 file change
are not available to the system.
2. APQNs that do not reference a queue device bound to the vfio_ap
device driver will not be assigned to the guest's CRYCB, so the
guest will not get access to queues not bound to the vfio_ap driver.
Signed-off-by: Tony Krowiak
---
drivers
rix mdev). This will enforce the proper procedure for
removing AP resources intended for guest usage which is to
first unassign them from the matrix mdev, then unbind them from the
vfio_ap device driver.
Signed-off-by: Tony Krowiak
Reviewed-by: Harald Freudenberger
---
drivers/s390/crypto
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
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_ops.
APQN derived from the newly added APQI of the domain and the APIDs
already assigned to the guest's APCB references an AP queue device bound
to the vfio_ap driver
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_drv.c | 1 +
drivers/s390/crypto/vfio_ap_ops.
n use by a KVM guest, it is
hot plugged into the guest to provide access to dynamically provide
access to the adapters, domains and control domains provided via the
newly refreshed APCB.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 143 --
Update the documentation in vfio-ap.rst to include information about the
AP dynamic configuration support (i.e., hot plug of adapters, domains
and control domains via the matrix mediated device's sysfs assignment
attributes).
Signed-off-by: Tony Krowiak
---
Documentation/s390/vfio-ap.rst
mains assigned to a given matrix mdev have been
removed from the host AP configuration, the APCB of the matrix mdev will
be refreshed. If a KVM guest is using the matrix mdev, the APCB will be hot
plugged into the guest to refresh its AP configuration.
Signed-off-by: Tony Krowiak
---
drivers/s390
o a matrix_mdev as well as during the in_use callback, the
mutex_trylock(&matrix_dev->lock) function will be used. If the lock is not
obtained, then the assignment and in_use functions will terminate with
-EBUSY.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_drv.
em one at a time when the
probe callback is invoked.
Please note that changes to the apmask and aqmask do not trigger
these two callbacks since the bus scan function is not invoked by changes
to those masks.
Signed-off-by: Harald Freudenberger
Signed-off-by: Tony Krowiak
---
drivers/
river.
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
---
drivers/s390/crypto/vfio_ap_drv.c | 44 ++-
drivers/s390/crypto/vfio_ap_ops.c | 34 +++--
drivers/s390/crypto/vfio_ap_private.h | 6 ++--
3 files changed, 37 insertions(+), 47 dele
entirely unnecessary because the reset of
a queue disables interrupts, so this will be removed.
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_drv.c | 1 -
drivers/s390/crypto/vfio_ap_ops.c | 40 +--
drivers/s390/crypto/vfio_ap_private.h | 1 -
3 files
s before taking the vCPUs
out of SIE. Now checking the shadow CRYCB in the vfio_ap driver.
Change log v1->v2:
-
* Removed patches preventing root user from unbinding AP queues from
the vfio_ap device driver
* Introduced a shadow CRYCB in the vfio_ap driver to manage dynamic
changes to the
On 12/22/20 2:43 PM, Halil Pasic wrote:
On Tue, 22 Dec 2020 16:57:06 +0100
Cornelia Huck wrote:
On Tue, 22 Dec 2020 10:37:01 -0500
Tony Krowiak wrote:
On 12/21/20 11:05 PM, Halil Pasic wrote:
On Mon, 21 Dec 2020 13:56:25 -0500
Tony Krowiak wrote:
static int
On 12/21/20 11:05 PM, Halil Pasic wrote:
On Mon, 21 Dec 2020 13:56:25 -0500
Tony Krowiak wrote:
The vfio_ap device driver registers a group notifier with VFIO when the
file descriptor for a VFIO mediated device for a KVM guest is opened to
receive notification that the KVM pointer is set
when the KVM pointer was set.
Fixes: 258287c994de ("s390: vfio-ap: implement mediated device open callback")
Cc: sta...@vger.kernel.org
Signed-off-by: Tony Krowiak
Reviewed-by: Halil Pasic
Reviewed-by: Cornelia Huck
---
drivers/s390/crypto/vfio_ap_ops.c | 42 +---
tions taken when the KVM pointer was set.
Fixes: 258287c994de ("s390: vfio-ap: implement mediated device open callback")
Signed-off-by: Tony Krowiak
---
drivers/s390/crypto/vfio_ap_ops.c | 29 -
1 file changed, 20 insertions(+), 9 deletions(-)
diff --git
On 12/14/20 11:56 AM, Tony Krowiak wrote:
The vfio_ap device driver registers a group notifier with VFIO when the
file descriptor for a VFIO mediated device for a KVM guest is opened to
receive notification that the KVM pointer is set (VFIO_GROUP_NOTIFY_SET_KVM
event). When the KVM pointer is
On 11/30/20 4:18 AM, h...@d06av26.portsmouth.uk.ibm.com wrote:
On Tue, 24 Nov 2020 16:40:13 -0500
Tony Krowiak wrote:
This patch intruduces an extension to the ap bus to notify device drivers
when the host AP configuration changes - i.e., adapters, domains or
control domains are added or
On 12/9/20 2:20 AM, Harald Freudenberger wrote:
On 30.11.20 10:18, h...@d06av26.portsmouth.uk.ibm.com wrote:
On Tue, 24 Nov 2020 16:40:13 -0500
Tony Krowiak wrote:
This patch intruduces an extension to the ap bus to notify device drivers
when the host AP configuration changes - i.e
On 11/28/20 8:09 PM, Halil Pasic wrote:
On Tue, 24 Nov 2020 16:40:09 -0500
Tony Krowiak wrote:
The APCB is a control block containing the masks that specify the adapters,
domains and control domains to which a KVM guest is granted access. When
the vfio_ap device driver is notified that the
On 11/28/20 8:17 PM, Halil Pasic wrote:
On Tue, 24 Nov 2020 16:40:10 -0500
Tony Krowiak wrote:
The current implementation does not allow assignment of an AP adapter or
domain to an mdev device if each APQN resulting from the assignment
does not reference an AP queue device that is bound to
Thanks for the review.
On 11/28/20 7:49 PM, Halil Pasic wrote:
On Tue, 24 Nov 2020 16:40:08 -0500
Tony Krowiak wrote:
The matrix of adapters and domains configured in a guest's APCB may
differ from the matrix of adapters and domains assigned to the matrix mdev,
so this patch introdu
On 11/26/20 10:54 AM, Halil Pasic wrote:
On Tue, 24 Nov 2020 16:40:06 -0500
Tony Krowiak wrote:
Let's implement the callback to indicate when an APQN
is in use by the vfio_ap device driver. The callback is
invoked whenever a change to the apmask or aqmask would
result in one or more
On 11/26/20 9:08 AM, Halil Pasic wrote:
On Tue, 24 Nov 2020 16:40:04 -0500
Tony Krowiak wrote:
@@ -1155,6 +1243,11 @@ static int vfio_ap_mdev_reset_queues(struct mdev_device
*mdev)
matrix_mdev->matrix.apm_max + 1) {
for_each_set_bit_inv(a
1 - 100 of 889 matches
Mail list logo