Does Xorg server pin composition buffer's MFNs?

Rafal Wojtczuk rafal at invisiblethingslab.com
Fri Apr 16 01:47:02 PDT 2010


On Wed, Apr 14, 2010 at 03:59:39PM -0400, Adam Jackson wrote:
> On Wed, 2010-04-14 at 20:07 +0200, Rafal Wojtczuk wrote:
> > Hello,
> > A bit of background: apparently under Linux, the mfn (say, physical address) 
> > of the frame, that holds an usermode page, can change, unless precautions 
> > are made. See http://lists.xensource.com/archives/html/xen-devel/2010-04/msg00514.html
> > why it might be an issue in certain virtualized environments.
> > 
> > Question 1: does X server (running under Linux), allocate the composition 
> > buffers in an usual way (using malloc() or similar), or does it do anything 
> > fancier in order to make sure the physical address of composition buffers is 
> > stable in time ? 
> > Question 2: Does ever X server schedule a DMA transaction (to graphics card 
> > presumably) from a composition buffer ? (in such case it would make sense to 
> > pin its physical pages).
> 
> I'm assuming by "composition buffer" you mean the thing you're actually
> scanning out on the display.
No. I mean the per-window offscreen storage mechanism, activated by 
XCompositeRedirectSubwindows() function. Referred to as "windows backing
pixmap" in http://ktown.kde.org/~fredrik/composite_howto.html. Apologies if
I did not make it clear enough.

>  I'll use the word "framebuffer" for that, since that's the usual X name for it.
> In the absence of an accelerated driver, X doesn't care about the
> ...
Unfortunately, that is not the piece of information I would like to know. In
fact if CompositeRedirectManual flag is specified, the actual framebuffer is
not touched by xlib calls at all.

> It's not really clear what you're asking though, or what you're trying
> to accomplish.
Briefly, the goal is to get the location of a composition buffer created by 
X server running in virtual machine A, and map it in the address space of 
virtual machine B. Such mapping has to be defined in terms of physical 
addresses; consequently, it is crucial to make sure that the frames backing a 
composition buffer do not change in time.

So, once again: is it true that X server allocates a composition buffer (a 
window backing pixmap) by a normal malloc call, and does no additional
effort to pin its physical pages so that they do not change in time ?

Regards,
Rafal Wojtczuk
The Qubes OS Project
http://qubes-os.org



More information about the xorg mailing list