Skip to contentSkip to conversation

KVM: s390: add the GIB and its related life-cyle functions

GIT PULL Janosch Frank 1 participant 1 message Feb 22, 2019

Subsystems (2)
lore
Share & tools
lore

Janosch Frank

author maintainer
#0 lore raw

From: Michael Mueller <[email protected]>

The Guest Information Block (GIB) links the GISA of all guests that have adapter interrupts pending. These interrupts cannot be delivered because all vcpus of these guests are currently in WAIT state or have masked the respective Interruption Sub Class (ISC). If enabled, a GIB alert is issued on the host to schedule these guests to run suitable vcpus to consume the pending interruptions.

This mechanism allows to process adapter interrupts for currently not running guests.

The GIB is created during host initialization and associated with the Adapter Interruption Facility in case an Adapter Interruption Virtualization Facility is available.

The GIB initialization and thus the activation of the related code will be done in an upcoming patch of this series.

Message-Id: <[email protected]>

---
 arch/s390/include/asm/kvm_host.h |  9 +++++++++
 arch/s390/kvm/interrupt.c        | 43 ++++++++++++++++++++++++++++++++++++++++
 arch/s390/kvm/kvm-s390.c         |  1 +
 arch/s390/kvm/kvm-s390.h         |  2 ++
 4 files changed, 55 insertions(+)
arch/s390/include/asm/kvm_host.h +9 -0
index 0941571..397af0d 100644
@@ -784,6 +784,15 @@ struct kvm_s390_gisa {
 	};
 };
 
+struct kvm_s390_gib {
+	u32 alert_list_origin;
+	u32 reserved01;
+	u8:5;
+	u8  nisc:3;
+	u8  reserved03[3];
+	u32 reserved04[5];
+};
+
 /*
  * sie_page2 has to be allocated as DMA because fac_list, crycb and
  * gisa need 31bit addresses in the sie control block.
arch/s390/kvm/interrupt.c +43 -0

58 lines not on this page · raw message

arch/s390/kvm/kvm-s390.c +1 -0
index 5eaffb3..ede8917 100644
@@ -444,6 +444,7 @@ int kvm_arch_init(void *opaque)
 
 void kvm_arch_exit(void)
 {
+	kvm_s390_gib_destroy();
 	debug_unregister(kvm_s390_dbf);
 }
 
arch/s390/kvm/kvm-s390.h +2 -0
index 72ef877..6d9448d 100644
@@ -381,6 +381,8 @@ int kvm_s390_get_irq_state(struct kvm_vcpu *vcpu,
 void kvm_s390_gisa_init(struct kvm *kvm);
 void kvm_s390_gisa_clear(struct kvm *kvm);
 void kvm_s390_gisa_destroy(struct kvm *kvm);
+int kvm_s390_gib_init(u8 nisc);
+void kvm_s390_gib_destroy(void);
 
 /* implemented in guestdbg.c */
 void kvm_s390_backup_guest_per_regs(struct kvm_vcpu *vcpu);
Signature · 1 line
2.7.4