Kaustubh Kabra
2011-Jan-28 19:23 UTC
[Xen-devel] Doubt regarding virtual memory mapping from hypervisor to a domain
Hi, I have allocated few order=9 pages in Xen memory space using alloc_domheap_pages(NULL,9,0) during boot time just before domain is created (dom0 = domain_create(0, DOMCRF_s3_integrity, DOM0_SSIDREF) in xen/arch/x86/setup.c). I got the following virtual addresses in xen log message- (XEN) a2k2: Virt_addr:ffff83011cc00000 MFN:11cc00 (XEN) a2k2: Virt_addr:ffff83011ca00000 MFN:11ca00 (XEN) a2k2: Virt_addr:ffff83011c800000 MFN:11c800 (XEN) a2k2: Virt_addr:ffff83011c600000 MFN:11c600 (XEN) a2k2: Virt_addr:ffff83011c400000 MFN:11c400 (XEN) a2k2: Virt_addr:ffff83011c200000 MFN:11c200 (XEN) a2k2: Virt_addr:ffff83011c000000 MFN:11c000 (XEN) a2k2: Virt_addr:ffff83011be00000 MFN:11be00 As per config.h file Xen memory map,the virtual mapping shows that the memory is allocated in 1:1 direct mapping of all physical memory .Can anyone elaborate regarding this mapping ? Now can I allocate this mapped memory reserved by Xen hypervisor to any domain through any existing or my new hypercall? -- Regards, Kaustubh Kabra Pune Institute Of Computer Technology, University of Pune, India. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Dan Magenheimer
2011-Jan-31 15:36 UTC
[Xen-devel] RE: Doubt regarding virtual memory mapping from hypervisor to a domain
> From: Kaustubh Kabra [mailto:kaustubhwise@gmail.com] > I have allocated few order=9 pages in Xen memory space using > alloc_domheap_pages(NULL,9,0) during boot time just before domain is > created (dom0 = domain_create(0, DOMCRF_s3_integrity, DOM0_SSIDREF) in > xen/arch/x86/setup.c). > > I got the following virtual addresses in xen log message- > (XEN) a2k2: Virt_addr:ffff83011cc00000 MFN:11cc00 > (XEN) a2k2: Virt_addr:ffff83011ca00000 MFN:11ca00 > (XEN) a2k2: Virt_addr:ffff83011c800000 MFN:11c800 > (XEN) a2k2: Virt_addr:ffff83011c600000 MFN:11c600 > (XEN) a2k2: Virt_addr:ffff83011c400000 MFN:11c400 > (XEN) a2k2: Virt_addr:ffff83011c200000 MFN:11c200 > (XEN) a2k2: Virt_addr:ffff83011c000000 MFN:11c000 > (XEN) a2k2: Virt_addr:ffff83011be00000 MFN:11be00 > > As per config.h file Xen memory map,the virtual mapping shows that the > memory is allocated in > 1:1 direct mapping of all physical memory .Can anyone elaborate > regarding this mapping ?It''s not clear what you are asking. Can you be more precise?> Now can I allocate this mapped memory reserved by Xen hypervisor to > any domain through any existing or my new hypercall?Again, it''s not clear what you are asking. If you are asking if the guest can map the order=9 page into its memory space, I think the answer is no. If you are asking if Xen can use the memory on behalf of a domain, for example to copy data from the domain into Xen (like tmem does), I think the answer is yes. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kaustubh Kabra
2011-Feb-10 13:26 UTC
[Xen-devel] Re: Doubt regarding virtual memory mapping from hypervisor to a domain
On Mon, Jan 31, 2011 at 9:06 PM, Dan Magenheimer <dan.magenheimer@oracle.com> wrote:> > From: Kaustubh Kabra [mailto:kaustubhwise@gmail.com] > > I have allocated few order=9 pages in Xen memory space using > > alloc_domheap_pages(NULL,9,0) during boot time just before domain is > > created (dom0 = domain_create(0, DOMCRF_s3_integrity, DOM0_SSIDREF) in > > xen/arch/x86/setup.c). > > > > I got the following virtual addresses in xen log message- > > (XEN) a2k2: Virt_addr:ffff83011cc00000 MFN:11cc00 > > (XEN) a2k2: Virt_addr:ffff83011ca00000 MFN:11ca00 > > (XEN) a2k2: Virt_addr:ffff83011c800000 MFN:11c800 > > (XEN) a2k2: Virt_addr:ffff83011c600000 MFN:11c600 > > (XEN) a2k2: Virt_addr:ffff83011c400000 MFN:11c400 > > (XEN) a2k2: Virt_addr:ffff83011c200000 MFN:11c200 > > (XEN) a2k2: Virt_addr:ffff83011c000000 MFN:11c000 > > (XEN) a2k2: Virt_addr:ffff83011be00000 MFN:11be00 > > > > As per config.h file Xen memory map,the virtual mapping shows that the > > memory is allocated in > > 1:1 direct mapping of all physical memory .Can anyone elaborate > > regarding this mapping ? > > It''s not clear what you are asking. Can you be more precise? > > > Now can I allocate this mapped memory reserved by Xen hypervisor to > > any domain through any existing or my new hypercall? > >Precisely, i want to allocate this mfn to a requesting domain by making a PMD entry. I tried using xen_set_pte and other hugetlb functions but it cannot write as it is in read-only area . So, I passed this new formed PTE formed using this mfn to hypervisor and tried setting the required PMD entry to this new PTE, but xen crashes .> Again, it''s not clear what you are asking. If you are > asking if the guest can map the order=9 page into its > memory space, I think the answer is no. If you are > asking if Xen can use the memory on behalf of a > domain, for example to copy data from the domain into > Xen (like tmem does), I think the answer is yes. >Also attached are two patches for xen-4.0.1 and jeremy-2.6.32.27 to check the modifications done till now. -- Kaustubh Kabra* <http://www.kaustubhwise.000a.biz>* _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2011-Feb-10 15:13 UTC
Re: [Xen-devel] Re: Doubt regarding virtual memory mapping from hypervisor to a domain
On Thu, Feb 10, 2011 at 06:56:52PM +0530, Kaustubh Kabra wrote:> On Mon, Jan 31, 2011 at 9:06 PM, Dan Magenheimer <dan.magenheimer@oracle.com > > wrote: > > > > From: Kaustubh Kabra [mailto:kaustubhwise@gmail.com] > > > I have allocated few order=9 pages in Xen memory space using > > > alloc_domheap_pages(NULL,9,0) during boot time just before domain is > > > created (dom0 = domain_create(0, DOMCRF_s3_integrity, DOM0_SSIDREF) in > > > xen/arch/x86/setup.c). > > > > > > I got the following virtual addresses in xen log message- > > > (XEN) a2k2: Virt_addr:ffff83011cc00000 MFN:11cc00 > > > (XEN) a2k2: Virt_addr:ffff83011ca00000 MFN:11ca00 > > > (XEN) a2k2: Virt_addr:ffff83011c800000 MFN:11c800 > > > (XEN) a2k2: Virt_addr:ffff83011c600000 MFN:11c600 > > > (XEN) a2k2: Virt_addr:ffff83011c400000 MFN:11c400 > > > (XEN) a2k2: Virt_addr:ffff83011c200000 MFN:11c200 > > > (XEN) a2k2: Virt_addr:ffff83011c000000 MFN:11c000 > > > (XEN) a2k2: Virt_addr:ffff83011be00000 MFN:11be00 > > > > > > As per config.h file Xen memory map,the virtual mapping shows that the > > > memory is allocated in > > > 1:1 direct mapping of all physical memory .Can anyone elaborate > > > regarding this mapping ? > > > > It''s not clear what you are asking. Can you be more precise? > > > > > Now can I allocate this mapped memory reserved by Xen hypervisor to > > > any domain through any existing or my new hypercall? > > > > > Precisely, i want to allocate this mfn to a requesting domain by making a > PMD entry. I tried using xen_set_pte and other hugetlb functions but it > cannot write as it is in read-only area . So, I passed this new formed PTE > formed using this mfn to hypervisor and tried setting the required PMD entry > to this new PTE, but xen crashes .With what? _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel