From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PULL 4/4] KVM: s390: clear local interrupts at cpu initial reset Date: Tue, 25 Mar 2014 15:18:12 +0100 Message-ID: <53319024.1030306@de.ibm.com> References: <1395754523-43697-1-git-send-email-borntraeger@de.ibm.com> <1395754523-43697-5-git-send-email-borntraeger@de.ibm.com> <53318B25.9070805@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: KVM , linux-s390 , Cornelia Huck , Jens Freimann To: Paolo Bonzini Return-path: Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:53604 "EHLO e06smtp10.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752740AbaCYOSR (ORCPT ); Tue, 25 Mar 2014 10:18:17 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Mar 2014 14:18:15 -0000 In-Reply-To: <53318B25.9070805@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 25/03/14 14:56, Paolo Bonzini wrote: > Il 25/03/2014 14:35, Christian Borntraeger ha scritto: >> + spin_lock_bh(&li->lock); >> + list_for_each_entry_safe(inti, n, &li->list, list) { >> + list_del(&inti->list); >> + kfree(inti); >> + } >> + atomic_set(&li->active, 0); >> + spin_unlock_bh(&li->lock); >> +} > > Out of curiosity, why the _bh? Probably just copied from all other accesses. We normally protect against the hrtimer wakeup bottom half(see kvm_s390_tasklet). For normal guests/userspace this should not happen, (after all we are resetting the CPU only on startup or during reset when the vCPUS are nor running) but the KVM interface allows to trigger this while the CPU is waiting for a timer. In fact I think your question just made me realize that this code needs some more fixes, e.g. resetting the timer on initial reset and getting the CPU out of wait. Will investigate. Christian