All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eamon Walsh <ewalsh@tycho.nsa.gov>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: George Coker <gscoker@tycho.nsa.gov>,
	Xen-devel <xen-devel@lists.xensource.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: Fbdev graphics broken in xen/next dom0
Date: Fri, 12 Mar 2010 19:44:11 -0500	[thread overview]
Message-ID: <4B9ADFDB.1070300@tycho.nsa.gov> (raw)
In-Reply-To: <4B9AB559.1070709@goop.org>

[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]

On 03/12/2010 04:42 PM, Jeremy Fitzhardinge wrote:
> On 03/12/2010 12:24 PM, Eamon Walsh wrote:
>   
>> I work in the same group as Dave Quigley and George Coker.  I'm working
>> on a graphical switcher application for Xen which uses the DirectFB
>> library on top of Linux VESA fbdev.  This runs in dom0 at the moment.
>> I'm using the latest xen/next pvops dom0 and xen-unstable hypervisor
>> compiled from source, with vga=ask so I can boot dom0 in a graphical mode.
>>
>> The problem I'm having is illustrated by the attached test program that
>> displays a green background with a white square for 10 seconds when run
>> as root.  It doesn't work on the xen/next / xen-unstable combo.  The
>> program runs and exits normally but all I see is a black screen.
>>
>> The program *does* work on xen/next running on the bare metal.  It also
>> works using the xen-unstable hypervisor with an older dom0, the 2.6.31.4
>> kernel with Novell patches.  So I think the issue is in the xen/next
>> kernel.  I've run the test program on different machines and observed
>> the same behavior.
>>
>> The xen-unstable / 2.6.31.4 dom0 combination works and I'm using that
>> for the moment but I'd like to be using pvops.  I would be happy to run
>> more tests / provide more data if needed.
>>    
>>     
> What's the hardware?  Do any messages appear either on the dom0 console 
> or the Xen console?  Does booting with a vga console help?
>   

The hardware is a Dell Latitude E6500 with nvidia graphics.  I also see
the issue on a Dell Optiplex 960 desktop with Intel graphics.  No
obvious messages on the consoles.  I am booting in VGA mode.

I have narrowed the problem down: it has something to do with mmap of
/dev/fb0 not syncing.  The attached C code mmaps /dev/fb0 and writes
some random bits.  On a configuration that does work (2.6.31.4 on
4.0-rc6, or xen/next on bare metal) the random bits are visible on the
screen.  With xen/next on 4.0-rc6, nothing is visible.  Calling msync()
before the sleep has no effect.  Also, using write() on /dev/fb0 always
works so it appears to be mmap related.


-- 

Eamon Walsh 
National Security Agency


[-- Attachment #2: mmaptest.c --]
[-- Type: text/plain, Size: 676 bytes --]

#include <sys/types.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>

static void bail(int cond, const char *msg)
{
	if (cond) {
		perror(msg);
		exit(1);
	}
}

int main(void)
{
	int id = open("/dev/urandom", O_RDONLY), fd = open("/dev/fb0", O_RDWR);
	unsigned *addr;
	char buf[4096];

	bail(fd < 0, "/dev/fb0");
	bail(id < 0, "/dev/urandom");

	addr = mmap(NULL, sizeof(buf), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
	bail(addr == MAP_FAILED, "mmap");

	read(id, buf, sizeof(buf));
	memcpy(addr, buf, sizeof(buf));
	// write(fd, buf, sizeof(buf));

	sleep(10);

	close(id);
	close(fd);

	return 0;
}

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

  reply	other threads:[~2010-03-13  0:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-12 20:24 Fbdev graphics broken in xen/next dom0 Eamon Walsh
2010-03-12 21:42 ` Jeremy Fitzhardinge
2010-03-13  0:44   ` Eamon Walsh [this message]
2010-03-13  0:51     ` Jeremy Fitzhardinge
2010-03-16  0:46       ` Konrad Rzeszutek Wilk
2010-03-16 21:52         ` Eamon Walsh
2010-03-16 22:19           ` Konrad Rzeszutek Wilk
2010-03-25 23:55             ` Eamon Walsh
2010-03-27  9:14               ` Arvind R
2010-03-27 21:52                 ` Jeremy Fitzhardinge
2010-03-28  9:33                   ` Arvind R

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=4B9ADFDB.1070300@tycho.nsa.gov \
    --to=ewalsh@tycho.nsa.gov \
    --cc=gscoker@tycho.nsa.gov \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.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.