From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2] kvm: Fix user memslot overlap check Date: Fri, 30 Nov 2012 18:18:59 -0200 Message-ID: <20121130201858.GB19821@amt.cnet> References: <20121129210725.9364.72668.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: gleb@redhat.com, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, xiaoguangrong@linux.vnet.ibm.com To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19331 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260Ab2K3UbP (ORCPT ); Fri, 30 Nov 2012 15:31:15 -0500 Content-Disposition: inline In-Reply-To: <20121129210725.9364.72668.stgit@bling.home> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Nov 29, 2012 at 02:07:59PM -0700, Alex Williamson wrote: > Prior to memory slot sorting this loop compared all of the user memory > slots for overlap with new entries. With memory slot sorting, we're > just checking some number of entries in the array that may or may not > be user slots. Instead, walk all the slots with kvm_for_each_memslot, > which has the added benefit of terminating early when we hit the first > empty slot, and skip comparison to private slots. > > Signed-off-by: Alex Williamson > Cc: stable@vger.kernel.org Applied, thanks.