@@ -2884,12 +2884,17 @@ 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;
+}
+
void kvm_s390_gisa_clear(struct kvm *kvm)
{
if (!kvm->arch.gisa)
return;
- 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);
}
@@ -2898,8 +2903,8 @@ void kvm_s390_gisa_init(struct kvm *kvm)
if (!css_general_characteristics.aiv)
return;
kvm->arch.gisa = &kvm->arch.sie_page2->gisa;
+ nullify_gisa(kvm->arch.gisa);
VM_EVENT(kvm, 3, "gisa 0x%pK initialized", kvm->arch.gisa);
- kvm_s390_gisa_clear(kvm);
}
void kvm_s390_gisa_destroy(struct kvm *kvm)