hmm.. are we always going to include the IO space in dom0->p2m[] or only when dom0->maxpage > IO_Base?
On Feb 23, 2007, at 1:05 PM, Ryan Harper wrote:

* Hollis Blanchard <[EMAIL PROTECTED]> [2007-02-23 11:43]:
On Fri, 2007-02-23 at 11:12 -0600, Ryan Harper wrote:
* Hollis Blanchard <[EMAIL PROTECTED]> [2007-02-23 10:58]:
On Fri, 2007-02-23 at 10:21 -0600, Ryan Harper wrote:

The other method I was going to look into was to allocate dom0's rma,
and then calculation would look like:

   dom0_start_mfn = page_to_mfn(d->arch.rma_base);
   dom0_overlap = (dom0_start_mfn + dom0_nrpages - rma_sz) -

Any other good way to figure how much of dom0's allocation will fall
within 2-4G IO hole?

Why are you looking for another approach? What's wrong with this

I was hoping I'd find this:


    xenheap_phys_end = xh_pages << PAGE_SHIFT;
    printk("End of Xen Area: %luMiB (%luKiB)\n",
           xenheap_phys_end >> 20, xenheap_phys_end >> 10);

which marks the end of the xen area; just what I was looking for.

Now I can do:

   /* overlap in pages into 2G-4G IO range (if any) */
dom0_overlap = ((xenheap_phys_end >> PAGE_SHIFT) + dom0_nrpages) -

You're assuming that the Xen heap ends exactly where dom0 will begin
(i.e. where dom0's RMA is allocated), which is not the case. From your
boot log, we see this:
        (XEN) End of Xen Area: 144MiB (147456KiB)
        (XEN) xenheap: 000000000006d000 - 0000000000400000
        (XEN) xenheap: 0000000000c46000 - 0000000009000000
        (XEN) Xen Heap: 135MiB (138548KiB)

xenheap_phys_end is 144MB (0x9000000), and when you subtract the space from the middle (e.g. occupied by Xen itself), you end up with a total
of 135MB.

In this case, dom0's RMA will be allocated at 192MB (0xc000000), and the
space from 144MB (0x9000000) to 192MB will be assigned to the domain

Ah, I see, RMA alignment issues.  192MB is the next 64MB aligned
chunk past xenheap_phys_end.

Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253

Xen-ppc-devel mailing list

Reply via email to