Skip to contentSkip to conversation

KVM: s390: add functions to (un)register GISC with GISA

PATCH Superseded Michael Mueller 1 participant 1 message Nov 30, 2018

Subsystems (2)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 8/10 KVM: s390: add functions to (un)register GISC with GISA

Add the IAM (Interruption Alert Mask) to the architectue specific 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.

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.

---
 arch/s390/include/asm/kvm_host.h |  6 ++++++
 arch/s390/kvm/interrupt.c        | 44 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
arch/s390/include/asm/kvm_host.h +6 -0
index 0deba3ae8bc7..e34cc9b107fb 100644
@@ -849,6 +849,9 @@ struct kvm_arch{
 	DECLARE_BITMAP(cpu_feat, KVM_S390_VM_CPU_FEAT_NR_BITS);
 	struct kvm_s390_gisa *gisa;
 	int gib_in_use;
+	u8 iam;
+	u32 iam_ref_count[MAX_ISC + 1];
+	spinlock_t iam_ref_lock;
 };
 
 #define KVM_HVA_ERR_BAD		(-1UL)
@@ -882,6 +885,9 @@ void kvm_arch_crypto_set_masks(struct kvm *kvm, unsigned long *apm,
 extern int sie64a(struct kvm_s390_sie_block *, u64 *);
 extern char sie_exit;
 
+extern int kvm_s390_gisc_register(struct kvm *kvm, u32 gisc);
+extern int kvm_s390_gisc_unregister(struct kvm *kvm, u32 gisc);
+
 static inline void kvm_arch_hardware_disable(void) {}
 static inline void kvm_arch_check_processor_compat(void *rtn) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}
arch/s390/kvm/interrupt.c +44 -0

58 lines not on this page · raw message

Signature · 1 line
2.13.4