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-devel

[Xen-devel] [PATCH] xen: convert pt_base to a physical address before co

To: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: [Xen-devel] [PATCH] xen: convert pt_base to a physical address before converting to PFN
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Wed, 11 Mar 2009 13:26:54 +0000
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 11 Mar 2009 06:28:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
(applies to xen/dom0/hackery)

Otherwise xen_map_identity_early can try and creating a mapping which extends
too far into invalid PFN territory creating invalid page tables:
  mapping kernel into physical memory
  (XEN) mm.c:703:d50 Non-privileged (50) attempt to map I/O space 7fffffff
  (XEN) mm.c:1093:d50 Failure in alloc_l1_table: entry 0
  (XEN) mm.c:2008:d50 Error while validating mfn de047 (pfn 497) for type 
2000000000000000: caf=8000000000000003 taf=2000000000000001
  (XEN) mm.c:770:d50 Attempt to create linear p.t. with write perms
  (XEN) mm.c:1253:d50 Failure in alloc_l2_table: entry 48
  (XEN) mm.c:2008:d50 Error while validating mfn de074 (pfn 46a) for type 
4400000000000000: caf=8000000000000003 taf=4400000000000001
  (XEN) mm.c:1342:d50 Failure in alloc_l3_table: entry 3
  (XEN) mm.c:2008:d50 Error while validating mfn df405 (pfn 3d9) for type 
6000000000000000: caf=8000000000000003 taf=6000000000000001
  (XEN) mm.c:848:d50 Attempt to create linear p.t. with write perms
  (XEN) mm.c:2375:d50 Error while installing new compat baseptr df405

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 arch/x86/xen/mmu.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 6c24275..375548f 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1819,7 +1819,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
        l2 = m2v(l3[pud_index(__START_KERNEL_map + PMD_SIZE)].pud);
        memcpy(level2_fixmap_pgt, l2, sizeof(pmd_t) * PTRS_PER_PMD);
 
-       max_pfn_mapped = PFN_DOWN(xen_start_info->pt_base +
+       max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
                                  xen_start_info->nr_pt_frames * PAGE_SIZE +
                                  512*1024);
 
@@ -1871,7 +1871,7 @@ __init pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd,
 
        level2_kernel_pgt = extend_brk(PAGE_SIZE, PAGE_SIZE);
 
-       max_pfn_mapped = PFN_DOWN(xen_start_info->pt_base +
+       max_pfn_mapped = PFN_DOWN(__pa(xen_start_info->pt_base) +
                                  xen_start_info->nr_pt_frames * PAGE_SIZE +
                                  512*1024);
 
-- 
1.5.6.5




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

<Prev in Thread] Current Thread [Next in Thread>