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-devel

Re: [Xen-devel] Page table and memory management

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Page table and memory management
From: Richard <judicator3@xxxxxxxxx>
Date: Thu, 3 Mar 2005 17:11:31 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 03 Mar 2005 22:12:42 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=Ph9TbS58FuAONuKCR5/pa6kCWDqWd4GwJ0vcHRHa31xz6OSUNYsFU78O0F75FXRVcR8W0sTLI4sgoYc73aiWW8dWXCKNMhV8d+aq6RCc8rkcQxYaYlQh1NQ0zNY75XWv91vjPUyOYXSZn3o+1K8QUPXJvBZ7p4PmleAvxV3P+70=
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
In-reply-to: <a146ff9b05030314006a47e40d@xxxxxxxxxxxxxx>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
References: <a146ff9b050302190711a1c1f0@xxxxxxxxxxxxxx> <2fcc2621218074768a944b7fce18ddf3@xxxxxxxxxxxx> <a146ff9b05030314006a47e40d@xxxxxxxxxxxxxx>
Reply-to: Richard <judicator3@xxxxxxxxx>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Hi,

I think the flow graph in the previous email was too big and might not
display properly:

               do_mmu_update
                     |
                     |
    /---------------------------------\
    |                                 |
    |                                 |
    \/                                \/
 mod_l2_entry              do_extended_command
    |                                 |
    |                                 |
    \/                                |
get_page_from_l2e                     |
    |                                 |
    |                                 |
    \---------------------------------/
                     |
                     |
                     \/
          get_page_and_type_from_pagenr
                     |
                     |
                     \/
               get_page_type

Richard


On Thu, 3 Mar 2005 17:00:17 -0500, Richard <judicator3@xxxxxxxxx> wrote:
> Hi Keir,
> 
> I am still having trouble to edit the page table entries with the
> mmu_update hypercall.
> I am actually updating the mini-os. The mem management in mini-os is
> pretty outdated. For example, it assumes that the initial page tables
> are placed at the top of available memory and hence does not count
> properly the total amount of pages that have been allocated to the
> domain. I am extending the initial PGD and PT given to mini-os at boot
> time to map the available memory that I can use.
> 
> I tried to first pin a level 1 page frame before inserting it as an
> entry in the level 2 PGD.
> Whether I pin a level1 page frame first or I start using it directly
> as a page table, it does not matter the mmu_update hypercall still
> fails.
> 
> I traced through the XEN code, in the file arch/x86/memory.c. Whether
> excuting a MMU_NORMAL_PT_UPDATE or a MMU_EXTENDED_COMMAND type of
> command, the function do_mmu_update() eventually calls the helper
> function get_page_and_type_from_pagenr() which in turns call the
> function get_page_type(). Below I drew a call graph.
> 
>                                                  do_mmu_update
>                                                             |
>                                                             |
> 
> /------------------------------------------------------------------------------\
>                        |
>                                |
>                        \/
>                                \/
>                mod_l2_entry
>    do_extended_command
>                        |
>                                |
>                        \/
>                                |
>             get_page_from_l2e
>                     |
>                        |
>                                |
>                        |
>                                |
> 
> \------------------------------------------------------------------------------/
>                                                               |
>                                                               \/
>                                         get_page_and_type_from_pagenr
>                                                               |
>                                                               \/
>                                                      get_page_type
> 
> The get_page_type() checks the upperbits of the 'typeinfo' field of
> the page frame to make sure it is of type 'PGT_l1_page_table'.
> get_page_type() also does another check to verify that the 'typeinfo'
> field also contains the 10 upper bits of the virtual address that this
> page frame is suppose to eventually map to.
> 
> > Xen will automatically infer the type when you attach an L1 to an
> > existing L2. Xen will infer the L2 type when the L2 gets used as
> > current pagetable base.
> So I do not see where XEN is automatically inferring the L1 type when
> I am inserting for the 1st time the L1 page frame into the L2. In
> order to use a page frame as an L1 page table, I have to find a way to
> tell XEN to update the corresponding typeinfo field in order to pass
> the verification in get_page_type().
> 
> Thanks
> Richard
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel