Hello, I am having some problems to update the page table entries of my domain with the hypervisor call do_mmu_update(). With 2 level paging XEN refers to the page global directory (PGD) as level2 and page tables (PT) as level1. I am taking a page frame that my domain owns, I am going to use that page frame as a page table (level1 PT) and I am adding the ''address'' of that page frame as an entry of my page global directory (level2 PGD). So my request ''mmu_update_t'' to the hypercall do_mmu_update() looks like this. mmu_update_t.ptr = machine address of PGD entry that I want to update mmu_update_t.val = machine frame number of PT with appropriate flags do_mmu_update() and its helper functions in xen/arch/x86/memory.c do many checks. One of the checks is to verify the flags in ''(struct pfn_info).u.inuse.type_info''. The upper bits of ''type_info'' contain the type of the page frame: PGT_none, PGT_l1_page_table, PGT_l2_page_table etc ... In my case, do_mmu_update() verifies that the page frame that I am going to use as a page table is actually of type PGT_l1_page_table. Therefore, I cannot just take any random page frame that my domain owns and use it as page table. How do I create a new page table ? How do I register a page frame that I own with XEN so that I can use it as a page table ? I am trying to see how XenoLinux is doing its page table allocation.>From what I can see, function pte_alloc_map() in mm/memory.c is notdoing anything special. It is just getting a free page frame and using the function pmd_populate() to use that page frame as a page table. Function pmd_populate() uses macro set_pmd() that expands to function xen_l2_entry_update() to update the (PGD) level2 page tables. 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On 3 Mar 2005, at 03:07, Richard wrote:> How do I create a new page table ? > How do I register a page frame that I own with XEN so that I can use > it as a page table ?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. There are also mmu_op calls to pin a page to L1 or L2 type. This is particularly important for L2 pages to get good performance. Before a page has pagetable type you can have a writable mapping of it and initiaqlise it directly. When Xen infers the pagetable type or you pin it to such a type, you must already have relinuqished and writable mappings you had of that page. -- Keir ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
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@gmail.com> 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
Hi I am trying to boot Xen kernel 2.6.11rc5bk4 from SUSE on a Dell 2850 machine with SUSE 9.2 Professional as base OS. I have noticed that if I plug in an Ethernet or a fiber channel connection to the box, the boot process hangs after loading the kernel! Any suggestions..? -Puneet. ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Thu, 3 Mar 2005 17:00:17 -0500, Richard <judicator3@gmail.com> wrote:> > 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.The L1 type gets set in get_page_type, when the page''s type count is zero and the page was of a different type until then (code path with the "On type change" comment). For this to work, the type count needs to be zero which it isn''t when there is already a writeable mapping to the page. You should use a debug=y build of xen, it will tell you why and when your attempt to use a new L1 page fails.> 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().No, you have to make sure the page is not otherwise used, that there are at most read-only mappings to it. christian ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On 3 Mar 2005, at 22:00, Richard wrote:> 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(). >get_page_from_l2e() will do a get_page_type() on your new page, asserting type PGT_l1_pagetable. If the page was previously untyped or was already an L1 pagetable then the call will succeed, else it will fail. -- Keir ] ------------------------------------------------------- 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel