Re: [PATCH v4 08/10] KVM: s390: add functions to (un)register GISC with GISA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/12/2018 10:48, Michael Mueller wrote:


On 03.12.18 10:21, Cornelia Huck wrote:
On Fri, 30 Nov 2018 15:32:13 +0100
Michael Mueller <mimu@xxxxxxxxxxxxx> wrote:

Add the IAM (Interruption Alert Mask) to the architectue specific
s/architectue/architecture/
tx
kvm struct. This mask in the GISA is used to define for which ISC
a GIB alert can be issued.

The functions kvm_s390_gisc_register() and kvm_s390_gisc_unregister()
are used to (un)register a GISC (guest ISC) with a virtual machine and
its GISA.
Add a note that these interfaces are supposed to be used by the
different adapter interrupt users like AP or PCI?
makes sense

Upon successful completion, kvm_s390_gisc_register() returns the
ISC to be used for GIB alert interruptions. A negative return code
indicates an error during registration.

Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxx>
Reviewed-by: Pierre Morel <pmorel@xxxxxxxxxxxxx>
---
  arch/s390/include/asm/kvm_host.h |  6 ++++++
  arch/s390/kvm/interrupt.c        | 44 ++++++++++++++++++++++++++++++++++++++++
  2 files changed, 50 insertions(+)
+int kvm_s390_gisc_unregister(struct kvm *kvm, u32 gisc)
+{
+    int rc = 0;
+
+    if (!kvm->arch.gib_in_use)
+        return -ENODEV;
+    if (gisc > MAX_ISC)
+        return -EINVAL;
+
+    spin_lock(&kvm->arch.iam_ref_lock);
+    if (kvm->arch.iam_ref_count[gisc] == 0) {
+        rc = -EFAULT;
-EFAULT looks odd. -EINVAL?
sure

Can we find some errno return value which is not already used in this function?


--
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux