Skip to contentSkip to conversation

KVM: s390: factor out nullify_gisa()

PATCH David Hildenbrand 1 participant 1 message Nov 29, 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]

David Hildenbrand

author Reviewed-by
#1 lore raw
Quoted 16 lines · Michael Mueller

This function will be used by the GIB alert handler and during the GISA clear operation. Thus it gets factored out here.

---
 arch/s390/kvm/interrupt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
arch/s390/kvm/interrupt.c +0 -0
index 5d20a0ce8a30..97e5da9a0814 100644

arch/s390/kvm/interrupt.c int kvm_s390_get_irq_state(struct kvm_vcpu *vcpu, __u8 __user *buf, int len) · line 2893

Quoted 8 lines
arch/s390/kvm/interrupt.c +5 -0
@@ -2886,11 +2886,16 @@ int kvm_s390_get_irq_state(struct kvm_vcpu *vcpu, __u8 __user *buf, int len)
 	return n;
 }
 
+static void nullify_gisa(struct kvm_s390_gisa *gisa)
+{
+	memset(gisa, 0, sizeof(struct kvm_s390_gisa));
+	gisa->next_alert = (u32)(u64)gisa;
+}

Just wondering if this should be rather named "reset_gisa" or "gisa_reset" similar as you are also resetting the next_alert.

Apart from that

Quoted 11 lines
arch/s390/kvm/interrupt.c +2 -2
+
 void kvm_s390_gisa_clear(struct kvm *kvm)
 {
 	if (kvm->arch.gisa) {
-		memset(kvm->arch.gisa, 0, sizeof(struct kvm_s390_gisa));
-		kvm->arch.gisa->next_alert = (u32)(u64)kvm->arch.gisa;
+		nullify_gisa(kvm->arch.gisa);
 		VM_EVENT(kvm, 3, "gisa 0x%pK cleared", kvm->arch.gisa);
 	}
 }
Signature · 3 lines
Thanks,

David / dhildenb