|
|
|
|
|
|
|
|
|
|
xen-users
Re: [Xen-users] VIRT to MACHINE conversion
> > 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
|
|
|
|
|