[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Where and How the P2M table and M2P table create?



hi

this may help you。。。


hvm_vcpu_initialise 
  - .vcpu_initialise  = vmx_vcpu_initialise,
  - vmx_create_vmcs
    - construct_vmcs
      -     if ( paging_mode_hap(d) )
            {
               struct p2m_domain *p2m = p2m_get_hostp2m(d);
               struct ept_data *ept = &p2m->ept;
  
               ept->asr  = pagetable_get_pfn(p2m_get_pagetable(p2m));
               __vmwrite(EPT_POINTER, ept_get_eptp(ept));
             }

main --> main_create --> create_domain --> libxl_domain_create_new 
--> do_domain_create --> initiate_domain_create -->  libxl__bootloader_run
 --> libxl__device_disk_local_initiate_detach --> local_device_detach_cb 
--> bootloader_local_detached_cb --> domcreate_bootloader_done --> 
libxl__domain_build
 --> libxl__build_hvm --> libxl__build_dom --> xc_dom_boot_mem_init -->
 meminit_hvm
  --> xc_domain_populate_physmap 
     -->  err = do_memory_op(xch, XENMEM_populate_physmap, &reservation);


- do_memory_op(xch, XENMEM_populate_physmap, &reservation)  (memory.c)
  - populate_physmap
  - is_domain_direct_mapped
     - mfn = gpfn
     - put_page
  - else
   - page = alloc_domheap_pages(d, a->extent_order, a->memflags);
   - mfn = page_to_mfn(page);
   - guest_physmap_add_page(d, gpfn, mfn, a->extent_order);
   - guest_physmap_add_entry(d, gfn, mfn, page_order, p2m_ram_rw)
     /* First, remove m->p mappings for existing p->m mappings */
     -  for ( i = 0; i < (1UL << page_order); i++ )
        -  omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL, NULL);
           - mfn = _mfn(ept_entry->mfn)  
        -  set_gpfn_from_mfn
           - _set_gpfn_from_mfn(mfn, pfn)
             - machine_to_phys_mapping[(mfn)] = (entry) 
     /* Then, look for m->p mappings for this range and deal with them */
     /* Now, actually do the two-way mapping */
     -   rc = p2m_set_entry(p2m, gfn, _mfn(mfn), page_order, t,
                             p2m->default_access);
     -    set_gpfn_from_mfn(mfn+i, gfn+i);   
>Hi,alls,
>
>As we know,in xen ,when create shadow page table and EPT page table,we need 
>the p2m and m2p.I want to know when are the p2m been created.Was it created at 
>the time of the creation of the domainU?Or at the beginning is a empty table 
>and in the subsequent gradually established?
>
>And how was it been created?
>
>Thanks!
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.