WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] [IA64] Fix p2m_size calculation in p2

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] [IA64] Fix p2m_size calculation in p2m_expose_init()
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Jun 2007 06:02:29 -0700
Delivery-date: Sat, 16 Jun 2007 06:00:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1181932812 21600
# Node ID e00077e5b9a399ece201cd9c6afe5eae37cac5e7
# Parent  f59e6fad7c506dbb5103f059143877c60782b640
[IA64] Fix p2m_size calculation in p2m_expose_init()

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 arch/ia64/xen/hypervisor.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -r f59e6fad7c50 -r e00077e5b9a3 arch/ia64/xen/hypervisor.c
--- a/arch/ia64/xen/hypervisor.c        Fri Jun 15 12:37:00 2007 -0600
+++ b/arch/ia64/xen/hypervisor.c        Fri Jun 15 12:40:12 2007 -0600
@@ -1014,7 +1014,8 @@ p2m_expose_init(void)
 #ifdef CONFIG_XEN_IA64_EXPOSE_P2M_USE_DTR
        if (xen_ia64_p2m_expose_use_dtr) {
                unsigned long granule_pfn = 0;
-               p2m_size = p2m_max_low_pfn - p2m_min_low_pfn;
+               p2m_size = ((p2m_max_low_pfn - p2m_min_low_pfn +
+                            PTRS_PER_PTE - 1) / PTRS_PER_PTE) << PAGE_SHIFT;
                for (i = 0;
                     i < sizeof(p2m_page_shifts)/sizeof(p2m_page_shifts[0]);
                     i++) {
@@ -1031,7 +1032,8 @@ p2m_expose_init(void)
                                                      granule_pfn);
                        num_pfn = p2m_convert_max_pfn - p2m_convert_min_pfn;
                        p2m_expose_size = num_pfn << PAGE_SHIFT;
-                       p2m_size = num_pfn / PTRS_PER_PTE;
+                       p2m_size = ((num_pfn + PTRS_PER_PTE - 1) /
+                                   PTRS_PER_PTE) << PAGE_SHIFT;
                        p2m_size = ROUNDUP(p2m_size, granule_pfn << PAGE_SHIFT);
                        if (p2m_size == page_size)
                                break;
@@ -1051,7 +1053,8 @@ p2m_expose_init(void)
                p2m_convert_max_pfn = ROUNDUP(p2m_max_low_pfn, p2m_granule_pfn);
                num_pfn = p2m_convert_max_pfn - p2m_convert_min_pfn;
                p2m_expose_size = num_pfn << PAGE_SHIFT;
-               p2m_size = num_pfn / PTRS_PER_PTE;
+               p2m_size = ((num_pfn + PTRS_PER_PTE - 1) / PTRS_PER_PTE) <<
+                       PAGE_SHIFT;
                p2m_size = ROUNDUP(p2m_size, p2m_granule_pfn << PAGE_SHIFT);
                align = max(privcmd_resource_align,
                            p2m_granule_pfn << PAGE_SHIFT);
@@ -1064,7 +1067,7 @@ p2m_expose_init(void)
        if (error) {
                printk(KERN_ERR P2M_PREFIX
                       "can't allocate region for p2m exposure "
-                      "[0x%016lx, 0x%016lx) 0x%016lx\n",
+                      "[0x%016lx, 0x%016lx] 0x%016lx\n",
                       p2m_convert_min_pfn, p2m_convert_max_pfn, p2m_size);
                goto out;
        }
@@ -1102,10 +1105,10 @@ p2m_expose_init(void)
        p2m_initialized = 1;
        printk(P2M_PREFIX "assign p2m table of [0x%016lx, 0x%016lx)\n",
               p2m_convert_min_pfn << PAGE_SHIFT,
-              p2m_convert_max_pfn << PAGE_SHIFT);
+              (p2m_convert_max_pfn << PAGE_SHIFT) + PAGE_SIZE);
        printk(P2M_PREFIX "to [0x%016lx, 0x%016lx) (%ld KBytes)\n",
               p2m_assign_start_pfn << PAGE_SHIFT,
-              p2m_assign_end_pfn << PAGE_SHIFT,
+              (p2m_assign_end_pfn << PAGE_SHIFT) + PAGE_SIZE,
               p2m_size / 1024);
 out:
        unlock_cpu_hotplug();

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] [IA64] Fix p2m_size calculation in p2m_expose_init(), Xen patchbot-linux-2.6.18-xen <=