Skip to contentSkip to conversation

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

PATCH Cornelia Huck 1 participant 1 message Dec 3, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 51 lines · On Mon, 3 Dec 2018 10:31:00 +0100 Michael Mueller <[email protected]> wrote:
Quoted 41 lines · Cornelia Huck
Quoted 38 lines · On Fri, 30 Nov 2018 15:32:08 +0100 Michael Mueller <[email protected]> wrote:

The GIB (Guest Information Block) links the GISA of all guests that have adapter interrupts pending. These interrupts cannot be delivered because no vcpu of these guests is currently running in SIE context. Instead, a GIB alert is issued on the host to schedule these guests to run.

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.

---
  arch/s390/include/asm/kvm_host.h | 10 ++++++++++
  arch/s390/kvm/interrupt.c        | 37 +++++++++++++++++++++++++++++++++++++
  arch/s390/kvm/kvm-s390.c         |  1 +
  arch/s390/kvm/kvm-s390.h         |  2 ++
  4 files changed, 50 insertions(+)
(quoted diff) +11 -0
+int kvm_s390_gib_init(u8 nisc)
+{
+	if (!css_general_characteristics.aiv) {
+		KVM_EVENT(3, "%s", "gib not initialized, no AIV facility");
+		return 0;
+	}
+
+	gib = (struct kvm_s390_gib *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+	if (!gib) {
+		KVM_EVENT(3, "gib 0x%pK memory allocation failed", gib);
+		return -ENOMEM;
Quoted 8 lines

Review

Quoted 5 lines
(quoted diff) +5 -0
+	}
+
+	gib->nisc = nisc;
+	if (chsc_sgib((u32)(u64)gib)) {
+		KVM_EVENT(3, "gib 0x%pK AIV association failed", gib);  

I think that's the one place where a message in addition to the dbf event makes sense (if kvm is built as a module), as mentioned last time.

Quoted 2 lines

The message is printed when kvm_s390_gib_init() fails. See last patch of series.

But that only logs the rc (-EIO), not the extra information here? I'm worried that we might end up with non-unique rcs for different problems.

Quoted 15 lines
Quoted 14 lines

Review

Quoted 11 lines
(quoted diff) +6 -0
+		free_page((unsigned long)gib);
+		gib = NULL;
+		return -EIO;
+	}
+
+	KVM_EVENT(3, "gib 0x%pK (nisc=%d) initialized", gib,

gib->nisc);

(quoted diff) +2 -0
+	return 0;
+}  

Otherwise, looks good to me.