Skip to contentSkip to conversation

vfio: ap: AP Queue Interrupt Control

PATCH Superseded Pierre Morel 2 participants 18 messages Apr 26, 2019 – May 2, 2019

Subsystems (5)

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v7 cover vfio: ap: AP Queue Interrupt Control

This patch series implements PQAP/AQIC interception in KVM.

1) Data to handle GISA interrupt for AQIC

To implement this we need to add a new structure, vfio_ap_queue, to be able to retrieve the mediated device associated with a queue and specific values needed to register/unregister the interrupt structures:
- APQN: to be able to issue the commands and search for queue structures
- NIB and old NIB : to unpin the NIB on clear IRQ
- ISC and old ISC : to unregister with the GIB interface
- matrix_mdev: to retrieve the associate matrix and mediated device

Specific handling bei keeping old values when re-registering is needed because the guest could unregister interrupt in a invisble manner bei issuing an un-interceptible RESET command.

Reset commands issued directly by the guest and indirectly when removing the guest unpin the memory and deregister the ISC.

The vfio_ap_queue is associated to the ap_device during the probe of the device and dissociated during the remove of the ap_device.

The vfio_ap_queue is associated to the matrix mediated device during each interception of the AQIC command, so it do not need to be dissociated until the guest is terminated.

The life of the vfio_ap_queue will be protected by the matrix_dev lock to guaranty that no change can occur to the CRYCB or that devices can not be removed when a vfio_ap_queue is in use.

2) KVM destroy race conditions

To make sure that KVM do not vanish and GISA is still available when the VFIO_AP driver is in used we take a reference to KVM during the opening of the mediated device and release it on releasing the mediated device.

3) Interception of PQAP

The driver registers a hook structure to KVM providing:
- a pointer to a function implementing PQAP(AQIC) handling
- the reference to the module owner of the hook

On interception by KVM we do not change the behavior, returning
-EOPNOTSUPP to the user in the case AP instructions are not
supported by the host or by the guest.
Otherwise we verify the exceptions cases before trying to call the vfio_ap hook.

In the case we do not find a hook we assume that the CRYCB has not been setup for the guest and is empty.

4) Removing the AP device

Removing the AP device without having unassign it is clearly discourage by the documentation.
The patch series does not check if the queue is used by a guest and simply free the vfio_ap_queue.

5) Associated QEMU patch

There is a QEMU patch which is needed to enable the PQAP/AQIC facility in the guest.

Posted in [email protected] as:
Message-Id: <[email protected]>

Pierre Morel (4):
s390: ap: kvm: add PQAP interception for AQIC
vfio: ap: register IOMMU VFIO notifier
s390: ap: implement PAPQ AQIC interception in kernel
s390: ap: kvm: Enable PQAP/AQIC facility for the guest

 arch/s390/include/asm/kvm_host.h      |   7 +
 arch/s390/kvm/priv.c                  |  86 +++++++++
 arch/s390/tools/gen_facilities.c      |   1 +
 drivers/s390/crypto/ap_bus.h          |   1 +
 drivers/s390/crypto/vfio_ap_drv.c     |  30 ++-
 drivers/s390/crypto/vfio_ap_ops.c     | 336 +++++++++++++++++++++++++++++++++-
 drivers/s390/crypto/vfio_ap_private.h |  15 ++
 7 files changed, 468 insertions(+), 8 deletions(-)
Signature · 71 lines
2.7.4

Changelog:

Changelog from v6:
- Not taking care if the AP queue is associated with a guest
  admin is warn in the odcumentation
 (Tony, Halil)
- Using WARN_ON_ONCE, direct call to report specification errors
  (Christian)
- Wait until the IRQ bit is cleared when clearing interrupts
 (Tony, Halil)
- Some minor changes and add some comments before
  vfio_ap_free_irq_data
  (Pierre)
- initializing the pointer to matrix_mdev in vfio_ap_queue 
  during the interception and suppress the association during
  assignment and the usage of lists.
  (Tony, Halil)
- Merging patches for creation of vfio_ap_queue, initialization
  and use of vfio_ap_queue during interception of PQAP/AQIC
  (Conny)

Changelog from v5:
- Refactoring of the PQAP interception after all discussions
  (Conny, Halil (offline))
- take a big lock around open to avoid parallel changes through
  assignment
- verify that at least one queue has a APID or APQI when
  first assignment is done to not accept unavailable APID/APQI
  (myself)
- Adding comment for locks on free_list
  (Conny)
- Modified comment for 
  "s390: ap: setup relation betwen KVM and mediated device"
  (Halil)

Changelog from v4:
- Add forgotten locking for vfio_get_queue() in pqap callback
  (Conny / Halil)
- Add KVM reference counting to make sure GISA is free after IRQ
  (Christian / Halil)
- Take care that ISC = 0 is a valid ISC
  (Halil)
- Integrate the PQAP call back in a structure with module owner
  reference counting to make sure the callback does not disappear.
- Restrict functionality to always open KVM before opening the
  VFIO device.
- Search all devices in the vfio_ap driver list when associating
  a queue to a mediated device
  (Halil / Tony)
- Get vfio_ap_free_irq() out of vfio_ap_mdev_reset_queue() to call
  it always, whatever the result of the reset.
  (Tony)

Changelog from v3:
- Associating the vfio_queues during APID/APQI assign
  (Tony)
- Dissociating the vfio_queues during APID/APQI unassign
  (Tony)
- Taking care that the guest can directly disable the interrupt
  by using a RESET
  (Halil)
- Remove the patch creating the matrix bus to accelerate its
  integration in Linux stable
  (Christian)

Changelog from v1:
- Refactoring to handle interception in kernel instead of in
  QEMU
  (Halil)
#1 lore raw

PATCH v7 1/4 s390: ap: kvm: add PQAP interception for AQIC

We prepare the interception of the PQAP/AQIC instruction for the case the AQIC facility is enabled in the guest.

First of all we do not want to change existing behavior when intercepting AP instructions without the SIE allowing the guest to use AP instructions.

In this patch we only handle the AQIC interception allowed by facility 65 which will be enabled when the complete interception infrastructure will be present.

We add a callback inside the KVM arch structure for s390 for a VFIO driver to handle a specific response to the PQAP instruction with the AQIC command and only this command.

But we want to be able to return a correct answer to the guest even there is no VFIO AP driver in the kernel.
Therefor, we inject the correct exceptions from inside KVM for the case the callback is not initialized, which happens when the vfio_ap driver is not loaded.

We do consider the responsability of the driver to always initialize the PQAP callback if it defines queues by initializing the CRYCB for a guest.
If the callback has been setup we call it.
If not we setup an answer considering that no queue is available for the guest when no callback has been setup.

---
 arch/s390/include/asm/kvm_host.h      |  7 +++
 arch/s390/kvm/priv.c                  | 86 +++++++++++++++++++++++++++++++++++
 drivers/s390/crypto/vfio_ap_private.h |  2 +
 3 files changed, 95 insertions(+)
arch/s390/include/asm/kvm_host.h +7 -0
index 9fff9ab..af10a11 100644
@@ -18,6 +18,7 @@
 #include <linux/kvm_host.h>
 #include <linux/kvm.h>
 #include <linux/seqlock.h>
+#include <linux/module.h>
 #include <asm/debug.h>
 #include <asm/cpu.h>
 #include <asm/fpu/api.h>
@@ -722,8 +723,14 @@ struct kvm_s390_cpu_model {
 	unsigned short ibc;
 };
 
+struct kvm_s390_module_hook {
+	int (*hook)(struct kvm_vcpu *vcpu);
+	struct module *owner;
+};
+
 struct kvm_s390_crypto {
 	struct kvm_s390_crypto_cb *crycb;
+	struct kvm_s390_module_hook *pqap_hook;
 	__u32 crycbd;
 	__u8 aes_kw;
 	__u8 dea_kw;
arch/s390/kvm/priv.c +86 -0

104 lines not on this page · raw message

drivers/s390/crypto/vfio_ap_private.h +2 -0
index 76b7f98..a910be1 100644
@@ -16,6 +16,7 @@
 #include <linux/mdev.h>
 #include <linux/delay.h>
 #include <linux/mutex.h>
+#include <linux/kvm_host.h>
 
 #include "ap_bus.h"
 
@@ -81,6 +82,7 @@ struct ap_matrix_mdev {
 	struct ap_matrix matrix;
 	struct notifier_block group_notifier;
 	struct kvm *kvm;
+	struct kvm_s390_module_hook pqap_hook;
 };
 
 extern int vfio_ap_mdev_register(void);
Signature · 1 line
2.7.4
#2 lore raw

PATCH v7 2/4 vfio: ap: register IOMMU VFIO notifier

In reply to Pierre Morel

To be able to use the VFIO interface to facilitate the mediated device memory pinning/unpinning we need to register a notifier for IOMMU.

While we will start to pin one guest page for the interrupt indicator byte, this is still ok with ballooning as this page will never be used by the guest virtio-balloon driver.
So the pinned page will never be freed. And even a broken guest does so, that would not impact the host as the original page is still in control by vfio.

---
 drivers/s390/crypto/vfio_ap_ops.c     | 43 ++++++++++++++++++++++++++++++++++-
 drivers/s390/crypto/vfio_ap_private.h |  2 ++
 2 files changed, 44 insertions(+), 1 deletion(-)
drivers/s390/crypto/vfio_ap_ops.c +42 -1
index 900b9cf..e8e87bf 100644
@@ -759,6 +759,35 @@ static int vfio_ap_mdev_set_kvm(struct ap_matrix_mdev *matrix_mdev,
 	return 0;
 }
 
+/*
+ * vfio_ap_mdev_iommu_notifier: IOMMU notifier callback
+ *
+ * @nb: The notifier block
+ * @action: Action to be taken
+ * @data: data associated with the request
+ *
+ * For an UNMAP request, unpin the guest IOVA (the NIB guest address we
+ * pinned before). Other requests are ignored.
+ *
+ */
+static int vfio_ap_mdev_iommu_notifier(struct notifier_block *nb,
+				       unsigned long action, void *data)
+{
+	struct ap_matrix_mdev *matrix_mdev;
+
+	matrix_mdev = container_of(nb, struct ap_matrix_mdev, iommu_notifier);
+
+	if (action == VFIO_IOMMU_NOTIFY_DMA_UNMAP) {
+		struct vfio_iommu_type1_dma_unmap *unmap = data;
+		unsigned long g_pfn = unmap->iova >> PAGE_SHIFT;
+
+		vfio_unpin_pages(mdev_dev(matrix_mdev->mdev), &g_pfn, 1);
+		return NOTIFY_OK;
+	}
+
+	return NOTIFY_DONE;
+}
+
 static int vfio_ap_mdev_group_notifier(struct notifier_block *nb,
 				       unsigned long action, void *data)
 {
@@ -858,7 +887,17 @@ static int vfio_ap_mdev_open(struct mdev_device *mdev)
 		return ret;
 	}
 
-	return 0;
+	matrix_mdev->iommu_notifier.notifier_call = vfio_ap_mdev_iommu_notifier;
+	events = VFIO_IOMMU_NOTIFY_DMA_UNMAP;
+	ret = vfio_register_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
+				     &events, &matrix_mdev->iommu_notifier);
+	if (!ret)
+		return ret;
+
+	vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
+				 &matrix_mdev->group_notifier);
+	module_put(THIS_MODULE);
+	return ret;
 }
 
 static void vfio_ap_mdev_release(struct mdev_device *mdev)
@@ -869,6 +908,8 @@ static void vfio_ap_mdev_release(struct mdev_device *mdev)
 		kvm_arch_crypto_clear_masks(matrix_mdev->kvm);
 
 	vfio_ap_mdev_reset_queues(mdev);
+	vfio_unregister_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
+				 &matrix_mdev->iommu_notifier);
 	vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
 				 &matrix_mdev->group_notifier);
 	matrix_mdev->kvm = NULL;
drivers/s390/crypto/vfio_ap_private.h +2 -0
index a910be1..18dcc4d 100644
@@ -81,8 +81,10 @@ struct ap_matrix_mdev {
 	struct list_head node;
 	struct ap_matrix matrix;
 	struct notifier_block group_notifier;
+	struct notifier_block iommu_notifier;
 	struct kvm *kvm;
 	struct kvm_s390_module_hook pqap_hook;
+	struct mdev_device *mdev;
 };
 
 extern int vfio_ap_mdev_register(void);
Signature · 1 line
2.7.4
maintainer
#3 lore raw

Re: [PATCH v7 2/4] vfio: ap: register IOMMU VFIO notifier

Quoted 5 lines · On Fri, 26 Apr 2019 15:01:26 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +0 -1
@@ -858,7 +887,17 @@ static int vfio_ap_mdev_open(struct mdev_device *mdev)
 		return ret;
 	}
 
-	return 0;

drivers/s390/crypto/vfio_ap_ops.c static int vfio_ap_mdev_open(struct mdev_device *mdev) · line 899

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+	matrix_mdev->iommu_notifier.notifier_call = vfio_ap_mdev_iommu_notifier;
+	events = VFIO_IOMMU_NOTIFY_DMA_UNMAP;
+	ret = vfio_register_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
+				     &events, &matrix_mdev->iommu_notifier);
+	if (!ret)
+		return ret;
+
+	vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
+				 &matrix_mdev->group_notifier);
+	module_put(THIS_MODULE);

Can you please explain this module_put() here? I don't see anything in the cover letter.

Regards,
Halil

Quoted 2 lines
(quoted diff) +1 -0
+	return ret;
 }
#4 lore raw

Re: [PATCH v7 2/4] vfio: ap: register IOMMU VFIO notifier

Quoted 7 lines · Halil Pasic
Quoted 4 lines · On Fri, 26 Apr 2019 15:01:26 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +0 -0
@@ -858,7 +887,17 @@ static int vfio_ap_mdev_open(struct mdev_device *mdev)
  		return ret;
  	}
 
Quoted 14 lines

drivers/s390/crypto/vfio_ap_ops.c static int vfio_ap_mdev_open(struct mdev_device *mdev) · line 899

Quoted 11 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -1
-	return 0;
+	matrix_mdev->iommu_notifier.notifier_call = vfio_ap_mdev_iommu_notifier;
+	events = VFIO_IOMMU_NOTIFY_DMA_UNMAP;
+	ret = vfio_register_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
+				     &events, &matrix_mdev->iommu_notifier);
+	if (!ret)
+		return ret;
+
+	vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
+				 &matrix_mdev->group_notifier);
+	module_put(THIS_MODULE);

Can you please explain this module_put() here? I don't see anything in the cover letter.

May be you should have a look at the sources or the original patch series of Tony, there is a try_module_get() at the beginning of open to make sure that the module is not taken away while in use by the guest.

In the case we failed to open the mediated device we let fall the reference.

Regards,
Pierre

Quoted 7 lines

Regards,
Halil

Quoted 2 lines
(quoted diff) +1 -0
+	return ret;
  }
Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
maintainer
#5 lore raw

Re: [PATCH v7 2/4] vfio: ap: register IOMMU VFIO notifier

Quoted 23 lines · On Tue, 30 Apr 2019 09:59:51 +0200 Pierre Morel <[email protected]> wrote:
Quoted 7 lines · Halil Pasic
Quoted 4 lines · On Fri, 26 Apr 2019 15:01:26 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +0 -0
@@ -858,7 +887,17 @@ static int vfio_ap_mdev_open(struct mdev_device *mdev)
  		return ret;
  	}
 
Quoted 14 lines

drivers/s390/crypto/vfio_ap_ops.c static int vfio_ap_mdev_open(struct mdev_device *mdev) · line 899

Quoted 11 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -1
-	return 0;
+	matrix_mdev->iommu_notifier.notifier_call = vfio_ap_mdev_iommu_notifier;
+	events = VFIO_IOMMU_NOTIFY_DMA_UNMAP;
+	ret = vfio_register_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY,
+				     &events, &matrix_mdev->iommu_notifier);
+	if (!ret)
+		return ret;
+
+	vfio_unregister_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY,
+				 &matrix_mdev->group_notifier);
+	module_put(THIS_MODULE);

Can you please explain this module_put() here? I don't see anything in the cover letter.

Quoted 6 lines

May be you should have a look at the sources or the original patch series of Tony, there is a try_module_get() at the beginning of open to make sure that the module is not taken away while in use by the guest.

In the case we failed to open the mediated device we let fall the reference.

Right, my bad. I did not notice we were on the error recovery path.

Regards,
Halil

#6 lore raw

PATCH v7 3/4 s390: ap: implement PAPQ AQIC interception in kernel

In reply to Pierre Morel

We register the AP PQAP instruction hook during the open of the mediated device. And unregister it on release.

In the AP PQAP instruction hook, if we receive a demand to enable IRQs,
- we retrieve the vfio_ap_queue based on the APQN we receive in REG1,
- we retrieve the page of the guest address, (NIB), from register REG2
- we the mediated device to use the VFIO pinning infratrsucture to pin the page of the guest address,
- we retrieve the pointer to KVM to register the guest ISC and retrieve the host ISC
- finaly we activate GISA

If we receive a demand to disable IRQs,
- we deactivate GISA
- unregister from the GIB
- unping the NIB

---
 drivers/s390/crypto/ap_bus.h          |   1 +
 drivers/s390/crypto/vfio_ap_drv.c     |  30 +++-
 drivers/s390/crypto/vfio_ap_ops.c     | 293 +++++++++++++++++++++++++++++++++-
 drivers/s390/crypto/vfio_ap_private.h |  11 ++
 4 files changed, 328 insertions(+), 7 deletions(-)
drivers/s390/crypto/ap_bus.h +1 -0
index 15a98a6..60e70f3 100644
@@ -43,6 +43,7 @@ static inline int ap_test_bit(unsigned int *ptr, unsigned int nr)
 #define AP_RESPONSE_BUSY		0x05
 #define AP_RESPONSE_INVALID_ADDRESS	0x06
 #define AP_RESPONSE_OTHERWISE_CHANGED	0x07
+#define AP_RESPONSE_INVALID_GISA	0x08
 #define AP_RESPONSE_Q_FULL		0x10
 #define AP_RESPONSE_NO_PENDING_REPLY	0x10
 #define AP_RESPONSE_INDEX_TOO_BIG	0x11
drivers/s390/crypto/vfio_ap_drv.c +29 -1
index e9824c3..ecaa4ab 100644
@@ -5,6 +5,7 @@
  * Copyright IBM Corp. 2018
  *
  * Author(s): Tony Krowiak <[email protected]>
+ *	      Pierre Morel <[email protected]>
  */
 
 #include <linux/module.h>
@@ -40,14 +41,41 @@ static struct ap_device_id ap_queue_ids[] = {
 
 MODULE_DEVICE_TABLE(vfio_ap, ap_queue_ids);
 
+/**
+ * vfio_ap_queue_dev_probe:
+ *
+ * Allocate a vfio_ap_queue structure and associate it
+ * with the device as driver_data.
+ */
 static int vfio_ap_queue_dev_probe(struct ap_device *apdev)
 {
+	struct vfio_ap_queue *q;
+
+	q = kzalloc(sizeof(*q), GFP_KERNEL);
+	if (!q)
+		return -ENOMEM;
+	dev_set_drvdata(&apdev->device, q);
+	q->apqn = to_ap_queue(&apdev->device)->qid;
+	q->a_isc = VFIO_AP_ISC_INVALID;
+	q->p_isc = VFIO_AP_ISC_INVALID;
 	return 0;
 }
 
+/**
+ * vfio_ap_queue_dev_remove:
+ *
+ * Takes the matrix lock to avoid actions on this device while removing
+ * Free the associated vfio_ap_queue structure
+ */
 static void vfio_ap_queue_dev_remove(struct ap_device *apdev)
 {
-	/* Nothing to do yet */
+	struct vfio_ap_queue *q;
+
+	mutex_lock(&matrix_dev->lock);
+	q = dev_get_drvdata(&apdev->device);
+	kfree(q);
+	dev_set_drvdata(&apdev->device, NULL);
+	mutex_unlock(&matrix_dev->lock);
 }
 
 static void vfio_ap_matrix_dev_release(struct device *dev)
drivers/s390/crypto/vfio_ap_ops.c +287 -6

355 lines not on this page · raw message

drivers/s390/crypto/vfio_ap_private.h +11 -0
index 18dcc4d..7cc02ff 100644
@@ -4,6 +4,7 @@
  *
  * Author(s): Tony Krowiak <[email protected]>
  *	      Halil Pasic <[email protected]>
+ *	      Pierre Morel <[email protected]>
  *
  * Copyright IBM Corp. 2018
  */
@@ -90,4 +91,14 @@ struct ap_matrix_mdev {
 extern int vfio_ap_mdev_register(void);
 extern void vfio_ap_mdev_unregister(void);
 
+struct vfio_ap_queue {
+	struct ap_matrix_mdev *matrix_mdev;
+	unsigned long a_nib;
+	unsigned long a_pfn;
+	unsigned long p_pfn;
+	int	apqn;
+#define VFIO_AP_ISC_INVALID 0xff
+	unsigned char a_isc;
+	unsigned char p_isc;
+};
 #endif /* _VFIO_AP_PRIVATE_H_ */
Signature · 1 line
2.7.4
maintainer
#7 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 11 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +11 -0
+static struct ap_queue_status vfio_ap_setirq(struct vfio_ap_queue *q)
+{
+	struct ap_qirq_ctrl aqic_gisa = {};
+	struct ap_queue_status status = {};
+	struct kvm_s390_gisa *gisa;
+	struct kvm *kvm;
+	unsigned long h_nib, h_pfn;
+	int ret;
+
+	q->a_pfn = q->a_nib >> PAGE_SHIFT;
+	ret = vfio_pin_pages(mdev_dev(q->matrix_mdev->mdev), &q->a_pfn, 1,

drivers/s390/crypto/vfio_ap_ops.c line 167

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+			     IOMMU_READ | IOMMU_WRITE, &h_pfn);
+	switch (ret) {
+	case 1:
+		break;
+	case -EINVAL:
+	case -E2BIG:
+		status.response_code = AP_RESPONSE_INVALID_ADDRESS;
+		/* Fallthrough */
+	default:
+		return status;

Can we actually hit the default label? AFICT you would return an all-zero status, i.e. status.response_code == 0 'Normal completion'.

drivers/s390/crypto/vfio_ap_ops.c line 177

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+	}
+
+	kvm = q->matrix_mdev->kvm;
+	gisa = kvm->arch.gisa_int.origin;
+
+	h_nib = (h_pfn << PAGE_SHIFT) | (q->a_nib & ~PAGE_MASK);
+	aqic_gisa.gisc = q->a_isc;
+	aqic_gisa.isc = kvm_s390_gisc_register(kvm, q->a_isc);
+	aqic_gisa.ir = 1;
+	aqic_gisa.gisa = gisa->next_alert >> 4;

Why gisa->next_alert? Isn't this supposed to get set to gisa origin (without some bits on the left)?

Quoted 7 lines
drivers/s390/crypto/vfio_ap_ops.c +7 -0
+
+	status = ap_aqic(q->apqn, aqic_gisa, (void *)h_nib);
+	switch (status.response_code) {
+	case AP_RESPONSE_NORMAL:
+		/* See if we did clear older IRQ configuration */
+		if (q->p_pfn)
+			vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev),

drivers/s390/crypto/vfio_ap_ops.c line 194

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+					 &q->p_pfn, 1);
+		if (q->p_isc != VFIO_AP_ISC_INVALID)
+			kvm_s390_gisc_unregister(kvm, q->p_isc);
+		q->p_pfn = q->a_pfn;
+		q->p_isc = q->a_isc;
+		break;
+	case AP_RESPONSE_OTHERWISE_CHANGED:
+		/* We could not modify IRQ setings: clear new configuration */
+		vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev), &q->a_pfn, 1);
+		kvm_s390_gisc_unregister(kvm, q->a_isc);

Hm, see below. Wouldn't you want to set a_isc to VFIO_AP_ISC_INVALID?

Review

Quoted 2 lines
(quoted diff) +2 -0
+		break;
+	default:	/* Fall Through */

Is it 'break' or is it 'Fall Through'?

Quoted 8 lines
drivers/s390/crypto/vfio_ap_ops.c +8 -0
+		pr_warn("%s: apqn %04x: response: %02x\n", __func__, q->apqn,
+			status.response_code);
+		vfio_ap_free_irq_data(q);
+		break;
+	}
+
+	return status;
+}
#8 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 19 lines · Halil Pasic
Quoted 16 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +16 -0
+static struct ap_queue_status vfio_ap_setirq(struct vfio_ap_queue *q)
+{
+	struct ap_qirq_ctrl aqic_gisa = {};
+	struct ap_queue_status status = {};
+	struct kvm_s390_gisa *gisa;
+	struct kvm *kvm;
+	unsigned long h_nib, h_pfn;
+	int ret;
+
+	q->a_pfn = q->a_nib >> PAGE_SHIFT;
+	ret = vfio_pin_pages(mdev_dev(q->matrix_mdev->mdev), &q->a_pfn, 1,
+			     IOMMU_READ | IOMMU_WRITE, &h_pfn);
+	switch (ret) {
+	case 1:
+		break;
+	case -EINVAL:
Quoted 8 lines

drivers/s390/crypto/vfio_ap_ops.c line 167

Quoted 5 lines
drivers/s390/crypto/vfio_ap_ops.c +5 -0
+	case -E2BIG:
+		status.response_code = AP_RESPONSE_INVALID_ADDRESS;
+		/* Fallthrough */
+	default:
+		return status;

Can we actually hit the default label? AFICT you would return an all-zero status, i.e. status.response_code == 0 'Normal completion'.

hum right, the setting of AP_INVALID_ADDRESS should be in the default and there is no need for the two error cases, they will match the default.

Quoted 14 lines

drivers/s390/crypto/vfio_ap_ops.c line 177

Quoted 11 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+	}
+
+	kvm = q->matrix_mdev->kvm;
+	gisa = kvm->arch.gisa_int.origin;
+
+	h_nib = (h_pfn << PAGE_SHIFT) | (q->a_nib & ~PAGE_MASK);
+	aqic_gisa.gisc = q->a_isc;
+	aqic_gisa.isc = kvm_s390_gisc_register(kvm, q->a_isc);
+	aqic_gisa.ir = 1;
+	aqic_gisa.gisa = gisa->next_alert >> 4;

Why gisa->next_alert? Isn't this supposed to get set to gisa origin (without some bits on the left)?

Someone already asked this question.
The answer is: look at the ap_qirq_ctrl structure, you will see that the gisa field is 27 bits wide.

Quoted 12 lines
Quoted 12 lines
drivers/s390/crypto/vfio_ap_ops.c +11 -0
+
+	status = ap_aqic(q->apqn, aqic_gisa, (void *)h_nib);
+	switch (status.response_code) {
+	case AP_RESPONSE_NORMAL:
+		/* See if we did clear older IRQ configuration */
+		if (q->p_pfn)
+			vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev),
+					 &q->p_pfn, 1);
+		if (q->p_isc != VFIO_AP_ISC_INVALID)
+			kvm_s390_gisc_unregister(kvm, q->p_isc);
+		q->p_pfn = q->a_pfn;
Quoted 8 lines

drivers/s390/crypto/vfio_ap_ops.c line 194

Quoted 6 lines
drivers/s390/crypto/vfio_ap_ops.c +6 -0
+		q->p_isc = q->a_isc;
+		break;
+	case AP_RESPONSE_OTHERWISE_CHANGED:
+		/* We could not modify IRQ setings: clear new configuration */
+		vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev), &q->a_pfn, 1);
+		kvm_s390_gisc_unregister(kvm, q->a_isc);

Hm, see below. Wouldn't you want to set a_isc to VFIO_AP_ISC_INVALID?

grrr!!! when did I insert these 3 lines, it was OK in previous series! all 3 lines, vfio_unpin() / gisc_unregister / break must go away.

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+		break;
+	default:	/* Fall Through */

Is it 'break' or is it 'Fall Through'?

it is a fall through

Quoted 9 lines
Quoted 9 lines
drivers/s390/crypto/vfio_ap_ops.c +8 -0
+		pr_warn("%s: apqn %04x: response: %02x\n", __func__, q->apqn,
+			status.response_code);
+		vfio_ap_free_irq_data(q);
+		break;
+	}
+
+	return status;
+}
Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
#9 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 69 lines · Pierre Morel
Quoted 19 lines · Halil Pasic
Quoted 16 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +16 -0
+static struct ap_queue_status vfio_ap_setirq(struct vfio_ap_queue *q)
+{
+    struct ap_qirq_ctrl aqic_gisa = {};
+    struct ap_queue_status status = {};
+    struct kvm_s390_gisa *gisa;
+    struct kvm *kvm;
+    unsigned long h_nib, h_pfn;
+    int ret;
+
+    q->a_pfn = q->a_nib >> PAGE_SHIFT;
+    ret = vfio_pin_pages(mdev_dev(q->matrix_mdev->mdev), &q->a_pfn, 1,
+                 IOMMU_READ | IOMMU_WRITE, &h_pfn);
+    switch (ret) {
+    case 1:
+        break;
+    case -EINVAL:
Quoted 8 lines
Quoted 5 lines

+    case -E2BIG:
+        status.response_code = AP_RESPONSE_INVALID_ADDRESS; +        /* Fallthrough */
+    default:
+        return status;

Can we actually hit the default label? AFICT you would return an all-zero status, i.e. status.response_code == 0 'Normal completion'.

hum right, the setting of AP_INVALID_ADDRESS should be in the default and there is no need for the two error cases, they will match the default.

Quoted 14 lines

drivers/s390/crypto/vfio_ap_ops.c line 177

Quoted 11 lines

+    }

drivers/s390/crypto/vfio_ap_ops.c +9 -0
+
+    kvm = q->matrix_mdev->kvm;
+    gisa = kvm->arch.gisa_int.origin;
+
+    h_nib = (h_pfn << PAGE_SHIFT) | (q->a_nib & ~PAGE_MASK);
+    aqic_gisa.gisc = q->a_isc;
+    aqic_gisa.isc = kvm_s390_gisc_register(kvm, q->a_isc);
+    aqic_gisa.ir = 1;
+    aqic_gisa.gisa = gisa->next_alert >> 4;

Why gisa->next_alert? Isn't this supposed to get set to gisa origin (without some bits on the left)?

Someone already asked this question.
The answer is: look at the ap_qirq_ctrl structure, you will see that the gisa field is 27 bits wide.

Quoted 19 lines
Quoted 18 lines

+
+    status = ap_aqic(q->apqn, aqic_gisa, (void *)h_nib);
+    switch (status.response_code) {
+    case AP_RESPONSE_NORMAL:
+        /* See if we did clear older IRQ configuration */
+        if (q->p_pfn)
+            vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev), +                     &q->p_pfn, 1);
+        if (q->p_isc != VFIO_AP_ISC_INVALID)
+            kvm_s390_gisc_unregister(kvm, q->p_isc);
+        q->p_pfn = q->a_pfn;
+        q->p_isc = q->a_isc;
+        break;
+    case AP_RESPONSE_OTHERWISE_CHANGED:
+        /* We could not modify IRQ setings: clear new configuration */ +        vfio_unpin_pages(mdev_dev(q->matrix_mdev->mdev), &q->a_pfn, 1); +        kvm_s390_gisc_unregister(kvm, q->a_isc);

Quoted 4 lines
Quoted 1 line

Hm, see below. Wouldn't you want to set a_isc to VFIO_AP_ISC_INVALID?

grrr!!! when did I insert these 3 lines, it was OK in previous series! all 3 lines, vfio_unpin() / gisc_unregister / break must go away.

No it wasn't, I will correct this.

Quoted 20 lines
Quoted 6 lines
Quoted 4 lines

+        break;
+    default:    /* Fall Through */

Is it 'break' or is it 'Fall Through'?

it is a fall through

Quoted 9 lines
Quoted 9 lines

+        pr_warn("%s: apqn %04x: response: %02x\n", __func__, q->apqn, +            status.response_code);
+        vfio_ap_free_irq_data(q);
+        break;
+    }

drivers/s390/crypto/vfio_ap_ops.c +3 -0
+
+    return status;
+}
Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
maintainer
#10 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 4 lines · On Tue, 30 Apr 2019 10:32:52 +0200 Pierre Morel <[email protected]> wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

+    aqic_gisa.gisa = gisa->next_alert >> 4;

Why gisa->next_alert? Isn't this supposed to get set to gisa origin (without some bits on the left)?

s/left/right/

Quoted 2 lines
Quoted 2 lines

Someone already asked this question.

It must have been in some previous iteration... Can you give me a pointer?

Quoted 2 lines
Quoted 2 lines

The answer is: look at the ap_qirq_ctrl structure, you will see that the gisa field is 27 bits wide.

My question was not about the width, but about gisa->next_alert being used.

Regards,
Halil

#11 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 16 lines · Halil Pasic
Quoted 4 lines · On Tue, 30 Apr 2019 10:32:52 +0200 Pierre Morel <[email protected]> wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

+    aqic_gisa.gisa = gisa->next_alert >> 4;

Why gisa->next_alert? Isn't this supposed to get set to gisa origin (without some bits on the left)?

s/left/right/

Quoted 2 lines
Quoted 2 lines

Someone already asked this question.

It must have been in some previous iteration... Can you give me a pointer?

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

The answer is: look at the ap_qirq_ctrl structure, you will see that the gisa field is 27 bits wide.

My question was not about the width, but about gisa->next_alert being used.

Regards,
Halil

Ah, OK, I understand.
it is inherited from the time I allocated the GISA myself, before the Mimu GISA/GIB patches.

So now indeed I must use the GISA origin for the case next_alert is used by GIB alert queue.

Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
maintainer
#12 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

In reply to Pierre Morel
Quoted 12 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +12 -0
+/**
+ * vfio_ap_clrirq: Disable Interruption for a APQN
+ *
+ * @dev: the device associated with the ap_queue
+ * @q:   the vfio_ap_queue holding AQIC parameters
+ *
+ * Issue the host side PQAP/AQIC
+ * On success: unpin the NIB saved in *q and unregister from GIB
+ * interface
+ *
+ * Return the ap_queue_status returned by the ap_aqic()
+ */

drivers/s390/crypto/vfio_ap_ops.c line 119

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+static struct ap_queue_status vfio_ap_clrirq(struct vfio_ap_queue *q)
+{
+	struct ap_qirq_ctrl aqic_gisa = {};
+	struct ap_queue_status status;
+	int checks = 10;
+
+	status = ap_aqic(q->apqn, aqic_gisa, NULL);
+	if (!status.response_code) {
+		while (status.irq_enabled && checks--) {
+			msleep(20);

Hm, that seems like a lot of time to me. And I suppose we are holding the kvm lock: e.g. no other instruction can be interpreted by kvm in the meantime.

drivers/s390/crypto/vfio_ap_ops.c line 123

Quoted 4 lines
drivers/s390/crypto/vfio_ap_ops.c +4 -0
+			status = ap_tapq(q->apqn, NULL);
+		}
+		if (checks >= 0)
+			vfio_ap_free_irq_data(q);

Actually we don't have to wait for the async part to do it's magic (indicated by the status.irq_enabled --> !status.irq_enabled transition) in the instruction handler. We have to wait so we can unpin the NIB but that could be done async (e.g. workqueue).

BTW do you have any measurements here? How many msleep(20) do we experience for one clear on average?

If linux is not using clear (you told so offline, and I also remember something similar), we can probably get away with something like this, and do it properly (from performance standpoint) later.

Regards,
Halil

Quoted 6 lines
drivers/s390/crypto/vfio_ap_ops.c +6 -0
+		else
+			WARN_ONCE("%s: failed disabling IRQ", __func__);
+	}
+
+	return status;
+}
#13 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 40 lines · Halil Pasic
Quoted 12 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +12 -0
+/**
+ * vfio_ap_clrirq: Disable Interruption for a APQN
+ *
+ * @dev: the device associated with the ap_queue
+ * @q:   the vfio_ap_queue holding AQIC parameters
+ *
+ * Issue the host side PQAP/AQIC
+ * On success: unpin the NIB saved in *q and unregister from GIB
+ * interface
+ *
+ * Return the ap_queue_status returned by the ap_aqic()
+ */

drivers/s390/crypto/vfio_ap_ops.c line 119

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+static struct ap_queue_status vfio_ap_clrirq(struct vfio_ap_queue *q)
+{
+	struct ap_qirq_ctrl aqic_gisa = {};
+	struct ap_queue_status status;
+	int checks = 10;
+
+	status = ap_aqic(q->apqn, aqic_gisa, NULL);
+	if (!status.response_code) {
+		while (status.irq_enabled && checks--) {
+			msleep(20);

Hm, that seems like a lot of time to me. And I suppose we are holding the kvm lock: e.g. no other instruction can be interpreted by kvm in the meantime.

drivers/s390/crypto/vfio_ap_ops.c line 123

Quoted 4 lines
drivers/s390/crypto/vfio_ap_ops.c +4 -0
+			status = ap_tapq(q->apqn, NULL);
+		}
+		if (checks >= 0)
+			vfio_ap_free_irq_data(q);

Actually we don't have to wait for the async part to do it's magic (indicated by the status.irq_enabled --> !status.irq_enabled transition) in the instruction handler. We have to wait so we can unpin the NIB but that could be done async (e.g. workqueue).

Quoted 2 lines

BTW do you have any measurements here? How many msleep(20) do we experience for one clear on average?

No idea but it is probably linked to the queue state and usage history. I can use a lower sleep time and increment the retry count.

Quoted 4 lines

If linux is not using clear (you told so offline, and I also remember something similar), we can probably get away with something like this, and do it properly (from performance standpoint) later.

In the Linux AP code it is only used once, in the explicit ap_queue_enable_interruption() function.

Yes, thanks, I will keep it as is, may be just play with msleep()time and retry count.

Regards,
Pierre

Quoted 11 lines

Regards,
Halil

Quoted 6 lines
drivers/s390/crypto/vfio_ap_ops.c +6 -0
+		else
+			WARN_ONCE("%s: failed disabling IRQ", __func__);
+	}
+
+	return status;
+}
Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
#14 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 48 lines · Pierre Morel
Quoted 35 lines · Halil Pasic
Quoted 12 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_ops.c +12 -0
+/**
+ * vfio_ap_clrirq: Disable Interruption for a APQN
+ *
+ * @dev: the device associated with the ap_queue
+ * @q:   the vfio_ap_queue holding AQIC parameters
+ *
+ * Issue the host side PQAP/AQIC
+ * On success: unpin the NIB saved in *q and unregister from GIB
+ * interface
+ *
+ * Return the ap_queue_status returned by the ap_aqic()
+ */

drivers/s390/crypto/vfio_ap_ops.c line 119

Quoted 10 lines
drivers/s390/crypto/vfio_ap_ops.c +10 -0
+static struct ap_queue_status vfio_ap_clrirq(struct vfio_ap_queue *q)
+{
+    struct ap_qirq_ctrl aqic_gisa = {};
+    struct ap_queue_status status;
+    int checks = 10;
+
+    status = ap_aqic(q->apqn, aqic_gisa, NULL);
+    if (!status.response_code) {
+        while (status.irq_enabled && checks--) {
+            msleep(20);

Hm, that seems like a lot of time to me. And I suppose we are holding the kvm lock: e.g. no other instruction can be interpreted by kvm in the meantime.

Quoted 4 lines

+            status = ap_tapq(q->apqn, NULL);
+        }
+        if (checks >= 0)
+            vfio_ap_free_irq_data(q);

Quoted 7 lines

Actually we don't have to wait for the async part to do it's magic (indicated by the status.irq_enabled --> !status.irq_enabled transition) in the instruction handler. We have to wait so we can unpin the NIB but that could be done async (e.g. workqueue).

BTW do you have any measurements here? How many msleep(20) do we experience for one clear on average?

No idea but it is probably linked to the queue state and usage history. I can use a lower sleep time and increment the retry count.

Quoted 1 line
Quoted 6 lines
Quoted 3 lines

If linux is not using clear (you told so offline, and I also remember something similar), we can probably get away with something like this, and do it properly (from performance standpoint) later.

In the Linux AP code it is only used once, in the explicit ap_queue_enable_interruption() function.

My answer is not clear: ap_aqic() is used only once, during the bus probe, in the all code to enable interrupt and is never used to disable interrupt.

Interrupt disabling is only done by using ap_zapq() or ap_rapq() which can not be intercepted.

Quoted 19 lines

Yes, thanks, I will keep it as is, may be just play with msleep()time and retry count.

Regards,
Pierre

Quoted 11 lines

Regards,
Halil

Quoted 6 lines

+        else
+            WARN_ONCE("%s: failed disabling IRQ", __func__); +    }

drivers/s390/crypto/vfio_ap_ops.c +3 -0
+
+    return status;
+}
Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
maintainer
#15 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

In reply to Pierre Morel
Quoted 13 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_private.h +1 -0
index 18dcc4d..7cc02ff 100644
@@ -4,6 +4,7 @@
  *
  * Author(s): Tony Krowiak <[email protected]>
  *	      Halil Pasic <[email protected]>
+ *	      Pierre Morel <[email protected]>
  *
  * Copyright IBM Corp. 2018
  */

drivers/s390/crypto/vfio_ap_private.h struct ap_matrix_mdev { · line 100

Quoted 10 lines
drivers/s390/crypto/vfio_ap_private.h +7 -0
@@ -90,4 +91,14 @@ struct ap_matrix_mdev {
 extern int vfio_ap_mdev_register(void);
 extern void vfio_ap_mdev_unregister(void);
 
+struct vfio_ap_queue {
+	struct ap_matrix_mdev *matrix_mdev;
+	unsigned long a_nib;
+	unsigned long a_pfn;
+	unsigned long p_pfn;
+	int	apqn;
+#define VFIO_AP_ISC_INVALID 0xff

How about -1?

drivers/s390/crypto/vfio_ap_private.h struct ap_matrix_mdev { · line 104

Quoted 4 lines
drivers/s390/crypto/vfio_ap_private.h +3 -0
+	unsigned char a_isc;
+	unsigned char p_isc;
+};
 #endif /* _VFIO_AP_PRIVATE_H_ */

I assume a_ and p_ are for argument and private, or? Anyway it would be nice to have nicer names for these.

If the a_ members are really just arguments, we could probably live without the. I'm fine either way.

Regards,
Halil

#16 lore raw

Re: [PATCH v7 3/4] s390: ap: implement PAPQ AQIC interception in kernel

Quoted 37 lines · Halil Pasic
Quoted 13 lines · On Fri, 26 Apr 2019 15:01:27 +0200 Pierre Morel <[email protected]> wrote:
drivers/s390/crypto/vfio_ap_private.h +1 -0
index 18dcc4d..7cc02ff 100644
@@ -4,6 +4,7 @@
   *
   * Author(s): Tony Krowiak <[email protected]>
   *	      Halil Pasic <[email protected]>
+ *	      Pierre Morel <[email protected]>
   *
   * Copyright IBM Corp. 2018
   */

drivers/s390/crypto/vfio_ap_private.h struct ap_matrix_mdev { · line 100

Quoted 10 lines
drivers/s390/crypto/vfio_ap_private.h +7 -0
@@ -90,4 +91,14 @@ struct ap_matrix_mdev {
  extern int vfio_ap_mdev_register(void);
  extern void vfio_ap_mdev_unregister(void);
 
+struct vfio_ap_queue {
+	struct ap_matrix_mdev *matrix_mdev;
+	unsigned long a_nib;
+	unsigned long a_pfn;
+	unsigned long p_pfn;
+	int	apqn;
+#define VFIO_AP_ISC_INVALID 0xff

How about -1?

drivers/s390/crypto/vfio_ap_private.h struct ap_matrix_mdev { · line 104

Quoted 4 lines
drivers/s390/crypto/vfio_ap_private.h +3 -0
+	unsigned char a_isc;
+	unsigned char p_isc;
+};
  #endif /* _VFIO_AP_PRIVATE_H_ */

I assume a_ and p_ are for argument and private, or? Anyway it would be nice to have nicer names for these.

Quoted 6 lines

If the a_ members are really just arguments, we could probably live without the. I'm fine either way.

Regards,
Halil

Since there will be another iteration to modify other part of this patch I will simplify this handling and make the names clearer.

Thanks
Pierre

Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
#17 lore raw

PATCH v7 4/4 s390: ap: kvm: Enable PQAP/AQIC facility for the guest

In reply to Pierre Morel

AP Queue Interruption Control (AQIC) facility gives the guest the possibility to control interruption for the Cryptographic Adjunct Processor queues.

---
 arch/s390/tools/gen_facilities.c | 1 +
 1 file changed, 1 insertion(+)
arch/s390/tools/gen_facilities.c +1 -0
index 61ce5b5..aed14fc 100644
@@ -114,6 +114,7 @@ static struct facility_def facility_defs[] = {
 		.bits = (int[]){
 			12, /* AP Query Configuration Information */
 			15, /* AP Facilities Test */
+			65, /* AP Queue Interruption Control */
 			156, /* etoken facility */
 			-1  /* END */
 		}
Signature · 1 line
2.7.4