* Question about the memory layout of xen hypervisor, dom0 and domU
@ 2013-11-22 20:04 Meng Xu
2013-11-23 17:13 ` Dario Faggioli
0 siblings, 1 reply; 3+ messages in thread
From: Meng Xu @ 2013-11-22 20:04 UTC (permalink / raw)
To: xen-devel@lists.xen.org; +Cc: Meng Xu, Sisu Xi
[-- Attachment #1.1: Type: text/plain, Size: 1503 bytes --]
Hi,
I have a question about the memory layout of the Xen hypervisor, dom0 and
domU.
*The goal I want to achieve is:
I want to show which RAM area is used by hypervisor, which RAM area is used
by dom0, which RAM area is used by each domU (PV guest domain).
I hope to know the above information when xen is booted as well as when xen
is running some domUs.
I already know that we can dedicate a fix size of RAM to dom0 according to (
http://wiki.xen.org/wiki/Xen_Best_Practices). But it's unclear which RAM
area is allocated.
I read the paravirtualised memory management on
http://wiki.xen.org/wiki/X86_Paravirtualised_Memory_Management; but it only
shows the virtual address range of each domain.
I also looked at the xen/common/page_alloc.c; I think the function
alloc_domheap_pages() is used to allocate machine pages to doms, and
alloc_xenheap_pages() is used to allocate machine pages to hypervisor.
Maybe I can just print out the machine address when each machine page is
allocated and freed. But it seems too nasty.
*My question is:
Is there any command or tool showing the RAM layout of hypervisor, dom0 and
domUs?
If not, is there any better way to achieve the goal of showing the RAM
layout? For example, if there is any structure I can traverse to get all
machine address used by hypervisor, dom0 and domUs, that will be great!
Thank you very much for your help and advice!
Best,
Meng
-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
[-- Attachment #1.2: Type: text/html, Size: 2099 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about the memory layout of xen hypervisor, dom0 and domU
2013-11-22 20:04 Question about the memory layout of xen hypervisor, dom0 and domU Meng Xu
@ 2013-11-23 17:13 ` Dario Faggioli
2013-12-12 21:46 ` Meng Xu
0 siblings, 1 reply; 3+ messages in thread
From: Dario Faggioli @ 2013-11-23 17:13 UTC (permalink / raw)
To: Meng Xu; +Cc: Sisu Xi, xen-devel@lists.xen.org
[-- Attachment #1.1: Type: text/plain, Size: 1252 bytes --]
On ven, 2013-11-22 at 15:04 -0500, Meng Xu wrote:
> Hi,
>
Hi,
> I have a question about the memory layout of the Xen hypervisor, dom0
> and domU.
>
>
> *The goal I want to achieve is:
> I want to show which RAM area is used by hypervisor, which RAM area is
> used by dom0, which RAM area is used by each domU (PV guest domain).
>
> I hope to know the above information when xen is booted as well as
> when xen is running some domUs.
>
Mmm... Where (hypervisor, dom0/domu kernel space, user space) and for
what reason you need that?
I'm asking because, at some point, I needed a _similar_ information, and
wrote this:
http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=ae763e4224304983a1cde2fbb3d6e0c4d60b2688
It's probably not exactly what you mean, but it has the capability of
showing who is using some MFNs.
The point is I only needed it for debugging/understanding purposes so,
if your aim is different, it may not fit.
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question about the memory layout of xen hypervisor, dom0 and domU
2013-11-23 17:13 ` Dario Faggioli
@ 2013-12-12 21:46 ` Meng Xu
0 siblings, 0 replies; 3+ messages in thread
From: Meng Xu @ 2013-12-12 21:46 UTC (permalink / raw)
To: Dario Faggioli; +Cc: Sisu Xi, xen-devel@lists.xen.org
[-- Attachment #1.1: Type: text/plain, Size: 3546 bytes --]
Hi Dario,
Thank you so much for your help and information! It is really helpful!
> > I have a question about the memory layout of the Xen hypervisor, dom0
> > and domU.
> >
> >
> > *The goal I want to achieve is:
> > I want to show which RAM area is used by hypervisor, which RAM area is
> > used by dom0, which RAM area is used by each domU (PV guest domain).
> >
> > I hope to know the above information when xen is booted as well as
> > when xen is running some domUs.
> >
> Mmm... Where (hypervisor, dom0/domu kernel space, user space) and for
> what reason you need that?
>
>
I'm doing research on real time systems, especially on real time scheduling
and analysis. I'm considering the cache effect on the scheduling. For
example, what is the performance of different scheduling policies when
cache effect is considered. As you know, the cache location of a
program/domain depends on the memory address of the program/domain, so I'm
interested in the memory layout of domains/hypervisor and want to
investigate the cache interference among domains and hypervisor.
> I'm asking because, at some point, I needed a _similar_ information, and
> wrote this:
>
>
> http://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=ae763e4224304983a1cde2fbb3d6e0c4d60b2688
>
> It's probably not exactly what you mean, but it has the capability of
> showing who is using some MFNs.
>
The point is I only needed it for debugging/understanding purposes so,
> if your aim is different, it may not fit.
>
>
Thank you very much for your pointer! I applied your patch and it works
very well for the guest domains! I can dump the pfn->mfn for each guest
domain. But I also have several questions about your patch and the output
of the program:
1) I can use the command "xen-mfndump dump-p2m 3" to dump dom3's pfn->mfn;
But when I use the command "xen-mfndump dump-p2m 0" to dump the domain 0's
pfn->mfn, it reports error as follows:
xc: error: Could not map the shared info frame (MFN 0xcecfd) (3 = No such
process): Internal error
xc: error: Could not map domain 0 memory information: Internal error
Did I miss something if xen-mfndump does have such function. If the
xen-mfndump cannot be used to dump the machine address of dom0 and
hypervisor, is there any other tool I can use?
2) I found that the page frames that are used as L1 table are not always
continuous (some of them are continuous). For example:
pfn=0x3844 ==> mfn=0x13d1be (type 0x9) [mapped] [pinned] L1 table
pfn=0x3845 ==> mfn=0x13d1bd (type 0x0) [mapped]
pfn=0x3846 ==> mfn=0x13d1bc (type 0x0) [mapped]
pfn=0x3847 ==> mfn=0x13d1bb (type 0x0) [mapped]
pfn=0x3848 ==> mfn=0x13d1ba (type 0x0) [mapped]
pfn=0x3849 ==> mfn=0x13d1b9 (type 0x0) [mapped]
pfn=0x384a ==> mfn=0x13d1b8 (type 0x0) [mapped]
pfn=0x384b ==> mfn=0x13d1b7 (type 0x0) [mapped]
pfn=0x384c ==> mfn=0x13d1b6 (type 0x0) [mapped]
pfn=0x384d ==> mfn=0x13d1b5 (type 0x0) [mapped]
pfn=0x384e ==> mfn=0x13d1b4 (type 0x0) [mapped]
pfn=0x384f ==> mfn=0x13d1b3 (type 0x0) [mapped]
pfn=0x3850 ==> mfn=0x13d1b2 (type 0x9) [mapped] [pinned] L1 table
I don't quite understand the reason why the page frames that are used as L1
table are not continuous. In my understanding, the memory allocation will
try to allocate a bulk of memory first instead of distribute them. I think
I must misunderstand something. Could you help me point it out?
Thank you so much for your help!
Best,
Meng
-----------
Meng Xu
PhD Student in Computer and Information Science
University of Pennsylvania
www.cis.upenn.edu/~mengxu/
[-- Attachment #1.2: Type: text/html, Size: 5584 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-12 21:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-22 20:04 Question about the memory layout of xen hypervisor, dom0 and domU Meng Xu
2013-11-23 17:13 ` Dario Faggioli
2013-12-12 21:46 ` Meng Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).