WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

RE: [Xen-users] 3D acceleration

To: "David Shirley" <tephra@xxxxxxxxx>, xen-users@xxxxxxxxxxxxxxxxxxx
Subject: RE: [Xen-users] 3D acceleration
From: "Petersson, Mats" <Mats.Petersson@xxxxxxx>
Date: Tue, 8 Aug 2006 10:38:46 +0200
Delivery-date: Tue, 08 Aug 2006 01:41:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <f0e65c090608072213o13e00d4au4dee4d5cbe002b44@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aca6qZTpFsdxgrjqTgOq0BBQ++e6+AAGy0YQ
Thread-topic: [Xen-users] 3D acceleration
 

> -----Original Message-----
> From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx 
> [mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
> David Shirley
> Sent: 08 August 2006 06:14
> To: xen-users@xxxxxxxxxxxxxxxxxxx
> Subject: RE: [Xen-users] 3D acceleration
> 
> Very clear explanation there - :)
> 
> However could this all be solved if the graphics card driver just
> asked for the correct address?
> 
> ie if Nvidia added Xen Aware windows drivers and you "passthroughed"
> your VGA card to domU then it *should just work*?

Assuming we first implement the necessary features for a Xen-aware
driver to talk to Xen, yes, it can be done. There is some work right now
to support Linux drivers that are Xen-aware in an otherwise unmodified
Linux. As far as I'm aware, no work yet for Windows. And the drivers
that have been worked on so far are relatively easy drivers, Network and
Disk drivers, that have Back-end/Front-end drivers. 

Note that it's not just a case of asking for the base of the memory once
either. My example below is very much simplified. In a real Xen system,
you could very well have every single 4KB page come from a different
place in memory. So it's not as simple as "memory starts at 256MB" -
that's just to illustrate that the memory of DomU isn't quite where it
thinks itself to be. [It's still true that the guest thinks that memory
starts at 0 and goes to whatever size we've given it - it's just that
that memory behind the scenes could be just ANYWHERE]. 

To further complicate things, a graphics driver will often send complex
commands that contain addresses of main memory inside the command. So
for example, a bitblt command to copy pixels to the screen from main
memory would contain the address of the source bitmap to copy. There are
probably hundreds if not thousands of places where the graphics driver
needs to know the REAL physical address and pass it along to a the
graphics card - of course, it already has some sort of call to the OS to
do this, so replacing that should do the trick [at least, we presume
they are well-behaved programmers and they don't go walking the
page-table by hand!]

--
Mats
> 
> Cheers
> Dave
> 
> --snip--
> You don't have to have a Xenified driver if there is an IOMMU in the
> system. But those don't exist today in most systems (IBM has one, but
> it's only used in LARGE multiprocessor systems - and there's no
> support in Xen for it anyways - yet at least).
> 
> So to explain why:
> 
> Let's say you have a Dom0 that has 256MB of memory, and a DomU that
> also has 256MB of memory.
> 
> The DomU will think that the memory starts at zero, because Xen will
> fake the memory configuration for the domain when it's starting. There
> are mechanisms (called shadow-paging) to hide the actual memory
> configuration from the guest, and the guest _WILL_ believe that it's
> got memory from 0 ... 256MB.
> 
> Now, the driver for the graphics card will be given a bitmap in
> user-memory to draw to the video-card. Since we assume this is a
> "fancy" graphics card, it can do direct memory access (DMA) from the
> main memory into the video-memory. So the driver will just say "at
> address XXXXX you can find a bitmap, please DMA it into video memory
> at address YYYYY". However, XXXXX is a PHYSICAL address within the
> guest memory - but the ACTUAL physical address that the guest doesn't
> know about is 256MB + XXXXX. But neither the guest, nor the graphcis
> card knows that the Guest address is not ACTUAL physical address... So
> what gets drawn to your screen in this case, would be whatever is at
> physical address XXXXX - not the INTENDED XXXXX+256MB - and you'll
> probably find that at XXXXX is some completely different type of data,
> so the screen will look like someone spilt a bunch of mixed pixels and
> swept them up into a pile... Or put another way, rubbish will appear
> on the screen.
> 
> Does that make it clear?
> 
> --
> Mats
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
> 
> 
> 



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

<Prev in Thread] Current Thread [Next in Thread>