[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e26b8254-7e71-4079-bbbb-f43598c586e6@linux.ibm.com>
Date: Wed, 20 Oct 2021 10:06:55 +0200
From: Michael Mueller <mimu@...ux.ibm.com>
To: Halil Pasic <pasic@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Matthew Rosato <mjrosato@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Pierre Morel <pmorel@...ux.ibm.com>,
Tony Krowiak <akrowiak@...ux.ibm.com>,
Niklas Schnelle <schnelle@...ux.ibm.com>, farman@...ux.ibm.com,
kvm@...r.kernel.org
Subject: Re: [PATCH 1/3] KVM: s390: clear kicked_mask before sleeping again
On 19.10.21 19:53, Halil Pasic wrote:
> The idea behind kicked mask is that we should not re-kick a vcpu that
> is already in the "kick" process, i.e. that was kicked and is
> is about to be dispatched if certain conditions are met.
>
> The problem with the current implementation is, that it assumes the
> kicked vcpu is going to enter SIE shortly. But under certain
> circumstances, the vcpu we just kicked will be deemed non-runnable and
> will remain in wait state. This can happen, if the interrupt(s) this
> vcpu got kicked to deal with got already cleared (because the interrupts
> got delivered to another vcpu). In this case kvm_arch_vcpu_runnable()
> would return false, and the vcpu would remain in kvm_vcpu_block(),
> but this time with its kicked_mask bit set. So next time around we
> wouldn't kick the vcpu form __airqs_kick_single_vcpu(), but would assume
> that we just kicked it.
>
> Let us make sure the kicked_mask is cleared before we give up on
> re-dispatching the vcpu.
>
> Signed-off-by: Halil Pasic <pasic@...ux.ibm.com>
> Reported-by: Matthew Rosato <mjrosato@...ux.ibm.com>
> Fixes: 9f30f6216378 ("KVM: s390: add gib_alert_irq_handler()")
Reviewed-by: Michael Mueller <mimu@...ux.ibm.com>
> ---
> arch/s390/kvm/kvm-s390.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 6a6dd5e1daf6..1c97493d21e1 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -3363,6 +3363,7 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu)
>
> int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
> {
> + clear_bit(vcpu->vcpu_idx, vcpu->kvm->arch.gisa_int.kicked_mask);
> return kvm_s390_vcpu_has_irq(vcpu, 0);
> }
>
>
Powered by blists - more mailing lists