Received: from eggs.gnu.org ([2001:4830:134:3::10]:47155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AWI-0002R1-Lb for qemu-devel@nongnu.org; Wed, 03 Jun 2015 11:23:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0AWE-00074F-I0 for qemu-devel@nongnu.org; Wed, 03 Jun 2015 11:23:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AWE-00074A-DF for qemu-devel@nongnu.org; Wed, 03 Jun 2015 11:23:50 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id E9FC3370206 for ; Wed, 3 Jun 2015 15:23:49 +0000 (UTC) Date: Wed, 3 Jun 2015 17:23:47 +0200 From: Igor Mammedov Message-ID: <20150603172347.481107ae@nial.brq.redhat.com> In-Reply-To: <556F1850.7090903@redhat.com> References: <1433334157-37665-1-git-send-email-imammedo@redhat.com> <1433334157-37665-3-git-send-email-imammedo@redhat.com> <556EF7AE.8040609@redhat.com> <20150603160526.7727e4e4@nial.brq.redhat.com> <556F1850.7090903@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 2/2] pc: fix QEMU crashing when more than ~50 memory hotplugged List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, mst@redhat.com On Wed, 03 Jun 2015 17:08:00 +0200 Paolo Bonzini wrote: > > > On 03/06/2015 16:05, Igor Mammedov wrote: > >>> > > + rsvd_hva = memory_region_find_rsvd_hva(section->mr); > >>> > > + if (rsvd_hva.mr) { > >>> > > + start_addr = rsvd_hva.offset_within_address_space; > >>> > > + size = int128_get64(rsvd_hva.size); > >>> > > + ram = memory_region_get_ram_ptr(rsvd_hva.mr); > >>> > > + } else { > >>> > > + ram = memory_region_get_ram_ptr(section->mr) + section->offset_within_region; > >>> > > + } > >> > > >> > I don't think this is needed. > >> > > >> > What _could_ be useful is to merge adjacent ranges even if they are > >> > partly unmapped, but your patch doesn't do that. > > merging/splitting for adjacent regions is done at following > > vhost_dev_(un)assign_memory() but it doesn't cover cases with > > gaps in between. > > > > Trying to make merging/splitting work with gaps might be more > > complicated (I haven't tried though), than just passing known > > in advance whole rsvd_hva range. > > > > More over if/when initial memory also converted to rsvd_hva > > (aliasing stopped me there for now), we could throw away all > > this merging and just keep a single rsvd_hva range for all RAM here. > > Understood now. This still should be a separate patch. I'm much more > confident with the other two (e.g. what happens if a malicious guest > writes to memory that is still MAP_NORESERVE), it should get SIGSEVG due to access to PROT_NONE. > so feel free to post > those without RFC tag. But the vhost one really needs mst's eyes. ok, I'll split it out. > > Paolo