Re: [PATCH v5 14/15] KVM: s390: add and wire function gib_alert_irq_handler()

From: Pierre Morel
Date: Wed Jan 09 2019 - 07:35:55 EST


On 08/01/2019 11:06, Michael Mueller wrote:


On 03.01.19 16:16, Pierre Morel wrote:
On 19/12/2018 20:17, Michael Mueller wrote:
The patch implements a handler for GIB alert interruptions
on the host. Its task is to alert guests that interrupts are
pending for them.


...snip...

 {
ÂÂÂÂÂ u32 final, next_alert, origin = 0UL;
ÂÂÂÂÂ struct kvm_s390_gisa *gisa;
@@ -3091,7 +3092,10 @@ void kvm_s390_gisa_clear(struct kvm *kvm)
 {
ÂÂÂÂÂ if (!kvm->arch.gisa)
ÂÂÂÂÂÂÂÂÂ return;
+ÂÂÂ if (set_iam(kvm->arch.gisa, 0) == -EBUSY)
+ÂÂÂÂÂÂÂ process_gib_alert_list();

We call process_gib_alert_list() from different contexts shouldn't we protect the calls?

That should not be necessary as the xcgh() guarantees that both
instances will work on gib alert lists with disjunctive gisas.

Here is how I see the problem:

A CPU get the GAL IRQ and start processing the ALERT list.

On another guest we clear floating interrupt...
we call gisa_clear()
we return from set_iam with -EBUSY, meaning the GISA is in alert list.
-> we call process_gib_alert_list()
-> since the list has been disjunct by the GAL IRQ routine we return
immediately
-> we nullify the GISA while it has not been handled by the IRQ
routine

!! if my assumption is right, we loose all GISA following the GISA we just nullified.


Regards,
Pierre



--
Pierre Morel
Linux/KVM/QEMU in BÃblingen - Germany