From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yosuke Iwamatsu Subject: Re: Fix PVFB backend to validate frontend's frame buffer description Date: Mon, 19 May 2008 21:02:58 +0900 Message-ID: <48316C72.50106@ab.jp.nec.com> References: <877idyxq1i.fsf@pike.pond.sub.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <877idyxq1i.fsf@pike.pond.sub.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Markus Armbruster Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.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