Received: from eggs.gnu.org ([2001:4830:134:3::10]:44084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdUOz-0006at-6X for qemu-devel@nongnu.org; Mon, 04 Nov 2013 19:21:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VdUOt-0005LD-6A for qemu-devel@nongnu.org; Mon, 04 Nov 2013 19:21:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VdUOs-0005L6-Se for qemu-devel@nongnu.org; Mon, 04 Nov 2013 19:21:43 -0500 Date: Tue, 5 Nov 2013 08:21:36 +0800 From: Amos Kong Message-ID: <20131105002136.GB6803@amosk.info> References: <1380300560-21086-1-git-send-email-akong@redhat.com> <5245B7E2.7030303@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5245B7E2.7030303@redhat.com> Subject: Re: [Qemu-devel] [PATCH] extend limit of physical sections number List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, anthony@codemonkey.ws On Fri, Sep 27, 2013 at 06:52:50PM +0200, Paolo Bonzini wrote: > Il 27/09/2013 18:49, Amos Kong ha scritto: > > # qemu -drive file=/disk0,if=none,id=v0,format=qcow2 \ > > -device virtio-blk-pci,drive=v0,id=v00,multifunction=on,addr=0x04.0 > > .... > > > > Launching guest with more than 32 virtio-blk disks, > > qemu will crash, because there are too many BARs. > > > > This patch brings the limit of non-tcg up by a factor > > of 8 (32767 / 4096), i.e. 32*8 = 256. > > > > Signed-off-by: Paolo Bonzini > > Signed-off-by: Amos Kong Hi Anthony, others Can you help to review this patch? Thanks, Amos > > --- > > exec.c | 17 ++++++++++++----- > > 1 file changed, 12 insertions(+), 5 deletions(-) > > > > diff --git a/exec.c b/exec.c > > index 5aef833..f639c01 100644 > > --- a/exec.c > > +++ b/exec.c > > @@ -763,11 +763,18 @@ void phys_mem_set_alloc(void *(*alloc)(ram_addr_t)) > > > > static uint16_t phys_section_add(MemoryRegionSection *section) > > { > > - /* The physical section number is ORed with a page-aligned > > - * pointer to produce the iotlb entries. Thus it should > > - * never overflow into the page-aligned value. > > - */ > > - assert(next_map.sections_nb < TARGET_PAGE_SIZE); > > + if (tcg_enabled()) { > > + /* The physical section number is ORed with a page-aligned > > + * pointer to produce the iotlb entries. Thus it should > > + * never overflow into the page-aligned value. > > + */ > > + assert(next_map.sections_nb < TARGET_PAGE_SIZE); > > + } else { > > + /* For KVM or Xen we can use the full range of the ptr field > > + * in PhysPageEntry. > > + */ > > + assert(next_map.sections_nb < SHRT_MAX); > > + } > > > > if (next_map.sections_nb == next_map.sections_nb_alloc) { > > next_map.sections_nb_alloc = MAX(next_map.sections_nb_alloc * 2, > > > > Thanks for testing this patch Amos! > > Paolo