From: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: Fix PVFB backend to validate frontend's frame buffer description
Date: Mon, 19 May 2008 21:02:58 +0900 [thread overview]
Message-ID: <48316C72.50106@ab.jp.nec.com> (raw)
In-Reply-To: <877idyxq1i.fsf@pike.pond.sub.org>
Hi,
Sorry for late reply.
I found that with this patch applied, qemu-dm got stuck while creating
a domain that had vfb but no 'videoram' parameter in its configuration.
It seems when no 'videoram' is specified, videoram is set to 0 and
xenfb_configure_fb() fails. It results in qemu-dm abort.
Is this an expected behavior? I think we should allow guest domains to
use at least a few MBs of videoram by default.
Thanks,
--Yosuke
Markus Armbruster wrote:
> @@ -745,29 +807,18 @@ static int xenfb_read_frontend_fb_config
> xenfb_xs_printf(xenfb->xsh, xenfb->fb.nodename, "request-update", "1");
> xenfb->refresh_period = -1;
>
> - /* TODO check for permitted ranges */
> - fb_page = xenfb->fb.page;
> - xenfb->depth = fb_page->depth;
> - xenfb->width = fb_page->width;
> - xenfb->height = fb_page->height;
> - /* TODO check for consistency with the above */
> - xenfb->fb_len = fb_page->mem_length;
> - xenfb->row_stride = fb_page->line_length;
> -
> - /* Protect against hostile frontend, limit fb_len to max allowed */
> if (xenfb_xs_scanf1(xenfb->xsh, xenfb->fb.nodename, "videoram", "%d",
> &videoram) < 0)
> videoram = 0;
> - videoram = videoram * 1024 * 1024;
> - if (videoram && xenfb->fb_len > videoram) {
> - fprintf(stderr, "Framebuffer requested length of %zd exceeded allowed %d\n",
> - xenfb->fb_len, videoram);
> - xenfb->fb_len = videoram;
> - if (xenfb->row_stride * xenfb->height > xenfb->fb_len)
> - xenfb->height = xenfb->fb_len / xenfb->row_stride;
> - }
> - fprintf(stderr, "Framebuffer depth %d width %d height %d line %d\n",
> - fb_page->depth, fb_page->width, fb_page->height, fb_page->line_length);
> + fb_page = xenfb->fb.page;
> + if (xenfb_configure_fb(xenfb, videoram * 1024 * 1024U,
> + fb_page->width, fb_page->height, fb_page->depth,
> + fb_page->mem_length, 0, fb_page->line_length)
> + < 0) {
> + errno = EINVAL;
> + return -1;
> + }
> +
> if (xenfb_map_fb(xenfb, xenfb->fb.otherend_id) < 0)
> return -1;
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2008-05-19 12:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-13 14:00 Fix PVFB backend to validate frontend's frame buffer description Markus Armbruster
2008-05-14 18:04 ` Pat Campbell
2008-05-15 7:40 ` Markus Armbruster
2008-05-15 7:53 ` [PATCH] ioemu: Fix PVFB backend to limit frame buffer size Markus Armbruster
2008-05-19 13:06 ` [PATCH] ioemu: Fix interpretation of missing or zero vfb videoram Markus Armbruster
2008-05-19 12:02 ` Yosuke Iwamatsu [this message]
2008-05-19 12:45 ` Fix PVFB backend to validate frontend's frame buffer description Markus Armbruster
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=48316C72.50106@ab.jp.nec.com \
--to=y-iwamatsu@ab.jp.nec.com \
--cc=armbru@redhat.com \
--cc=xen-devel@lists.xensource.com \
/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.