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

Re: [Xen-devel] How to initialize the grant table in a HVM guest OS and its bios



Hi Ian,

Yes, I'm working on the PV support on tianocore UEFI bios.

I have read the code in drivers/xen/grant-table.c. And my understanding of the initialization of the grant table in HVM is as the following. Please correct me if possible.

1. DomU sets up the grant table for itself. (Uses the hypercall HYPERVISOR_grant_table_op)
2. DomU maps the shared grant table to its address space. (Uses the hypercall HYPERVISOR_memory_op)
3. DomU needs to map the the shared grant table to the installed grant table in step 1 (Maybe it's done in the method apply_to_page_range()). Then, DomU can operate the shared grant table through the installed grant table.

Thank you very much.

Best Regards,
Bei Guan


 
> Hi Ian,
>
>
> Thank you very much for this information. It's very useful to me.
>
>
> However, I'm still confused with the initialization of the grant table
> in HVM.
>
>
> The relationship of the methods in the initialization of the grant
> table in linux source code (driver/xen) is:
> platform_pci_init()-->gnttab_init()-->gnttab_resume()-->gnttab_map()-->arch_gnttab_map_shared()-->apply_to_page_range().
>
>
> So, I am not sure that what's the function of the method
> apply_to_page_range(), which is implemented in code file [1].
> This function is a little complex. Is there any simple method to do
> this? Thank you for your time.

This function is the simple method ;-)

All it basically does is iterate over the page tables corresponding to a
range of addresses and calling a user supplied function on each leaf
PTE. In the case of the gnttab_map this user supplied function simply
sets the leaf PTEs to point to the right grant table page.

I suppose you are working on tianocore? I've no idea what the page table
layout is in that environment, I suppose it either has a linear map or
some other way of getting at the leaf ptes. Anyway since the method to
use is specific to the OS (or firmware) environment you are running in I
think you'll have to ask on the tianocore development list.

Ian.



_______________________________________________
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®.