From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: Re: [PATCH v2] KVM: s390: add proper locking for CMMA migration bitmap Date: Wed, 24 Jan 2018 15:21:44 +0100 Message-ID: <20180124152144.4ba21dca.cohuck@redhat.com> References: <20180124124100.15690-1-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180124124100.15690-1-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Christian Borntraeger Cc: KVM , linux-s390 , Janosch Frank , David Hildenbrand , Claudio Imbrenda List-ID: On Wed, 24 Jan 2018 13:41:00 +0100 Christian Borntraeger wrote: > Some parts of the cmma migration bitmap is already protected > with the kvm->lock (e.g. the migration start). On the other > hand the read of the cmma bits is not protected against a > concurrent free, neither is the emulation of the ESSA instruction. > Let's extend the locking to all related ioctls by using > the slots lock and wait for the freeing until all unlocked > users have finished (those hold kvm->srcu for read). > > Reported-by: David Hildenbrand > Signed-off-by: Christian Borntraeger > Cc: stable@vger.kernel.org # 4.13+ > Fixes: 190df4a212a7 (KVM: s390: CMMA tracking, ESSA emulation, migration mode) > Reviewed-by: Claudio Imbrenda > --- > v1->v2: fix comments in kvm_s390_vm_[start|stop]_migration > arch/s390/kvm/kvm-s390.c | 18 +++++++++++------- > 1 file changed, 11 insertions(+), 7 deletions(-) Reviewed-by: Cornelia Huck