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/ > 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? > > 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? > + goto out; > + } > + kvm->arch.iam_ref_count[gisc]--; > + if (kvm->arch.iam_ref_count[gisc] == 0) > + kvm->arch.iam &= ~(0x80 >> gisc); > +out: > + spin_unlock(&kvm->arch.iam_ref_lock); > + > + return rc; > +} > +EXPORT_SYMBOL_GPL(kvm_s390_gisc_unregister); > + > void kvm_s390_gib_destroy(void) > { > if (!gib)