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] VIRT to MACHINE conversion

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] VIRT to MACHINE conversion
From: Mark Williamson <mark.williamson@xxxxxxxxxxxx>
Date: Wed, 10 Jan 2007 14:14:30 +0000
Cc: "Petersson, Mats" <Mats.Petersson@xxxxxxx>, Ulrich Windl <ulrich.windl@xxxxxxxxxxxxxxxxxxxx>, Security Initiative Team <passrete@xxxxxxxxx>
Delivery-date: Wed, 10 Jan 2007 06:13:23 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <907625E08839C4409CE5768403633E0B018E1860@xxxxxxxxxxxxxxxxx>
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>
References: <907625E08839C4409CE5768403633E0B018E1860@xxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.5
> > In the default mode of operation, doesn't Xen work without SPTs?
>
> Xenified guests (non-HVM) do indeed write directly to the page-table via
> the Hypercalls.
>
> > The addresses entered into the PTs of the guest are actual
> > machine addresses,
> > right?
> > So the PTs remain a virtual-to-machine address mapping,
> > so where do the (pseudo) physical addresses come into play.
>
> That's the HVM way of working - since OS's need memory to start "at
> zero", the hypervisor will have a three-level translation.

Additional note for the original poster:

PV kernels still use "physical" addresses but it's an abstraction that's 
(mostly) internal to the guest.  Xen provides assistance in managing it, but 
the guest is expected to use machine addresses in the pagetables...

The "physical" address abstraction in PV guests is necessary because although 
the Xen-aware code understands that memory is sparse and doesn't necessarily 
start at zero under Xen, the generic OS code for most kernels assumes a 
memory based at zero with few holes.

"physical" addresses are presented to the generic OS code in a PV kernel and 
only translated to real machine addresses by the Xen arch-specific code when 
necessary (e.g. before putting them into the page tables).

On HVM the translation from physical to machine addresses is *also* handled by 
Xen using shadow PTs and the guest OS is not aware of it.

Cheers,
Mark

> > Also, when a guest domain wants to update the PT of a process,
> > (say to change the permissions from read-only to writable),
> > what is the exact parameter that it sends to the hypervisor --
> > page frame number ?
>
> Look at the code in xen/arch/x86/mm.c:do_mmu_update and you'll be at a
> good starting point.
>
> --
> Mats
>
> > "Petersson, Mats" <Mats.Petersson@xxxxxxx> wrote:
> >     > > I'm confused about the relation between
> >     > > virt and phy addresses in a guest domain?
> >     > > What is the co-relation between the two?
> >
> >     The guest will manage it's own virtual memory mappings.
> > However, those
> >     are guest physical addresses, so the guest will think
> > that it's got
> >     0..256M address range, whilst the machine physical
> > address is, say,
> >     256M..512M.
> >
> >     So there is, essentially, a second level of
> > indirection. This is managed
> >     by the shadow page table code in Xen - this works in
> > essence by having
> >     two different page-tables, one that the guest updates,
> > one that is
> >     maintained by the SPT code. The SPT table will be the
> > one that the
> >     processor actually uses.
> >
> >
> >
> > ________________________________
> >
> > Access over 1 million songs - Yahoo! Music Unlimited.
> > <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http:/
> > /music.yahoo.com/unlimited/>
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users

-- 
Dave: Just a question. What use is a unicyle with no seat?  And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!

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

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