From: Paolo Bonzini <pbonzini@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH] extend limit of physical sections number
Date: Fri, 27 Sep 2013 18:52:50 +0200 [thread overview]
Message-ID: <5245B7E2.7030303@redhat.com> (raw)
In-Reply-To: <1380300560-21086-1-git-send-email-akong@redhat.com>
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 <pbonzini@redhat.com>
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
> 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
next prev parent reply other threads:[~2013-09-27 16:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 16:49 [Qemu-devel] [PATCH] extend limit of physical sections number Amos Kong
2013-09-27 16:52 ` Paolo Bonzini [this message]
2013-11-05 0:21 ` Amos Kong
2013-11-05 0:36 ` Peter Maydell
2013-11-05 9:00 ` Paolo Bonzini
2013-11-05 12:23 ` Peter Maydell
2013-11-05 12:27 ` Paolo Bonzini
2013-11-19 11:11 ` Amos Kong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5245B7E2.7030303@redhat.com \
--to=pbonzini@redhat.com \
--cc=akong@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.