[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86: Update map_pages_to_xen() to avoid arithmetic based on



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1172507255 0
# Node ID 0070b18869f7ac1ad5514186eff001be9cdccf44
# Parent  9e5e94942045ac09a4d3e4aa87ef49e226b79d56
x86: Update map_pages_to_xen() to avoid arithmetic based on
uninitialised frame_table variable.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff -r 9e5e94942045 -r 0070b18869f7 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Mon Feb 26 16:25:17 2007 +0000
+++ b/xen/arch/x86/mm.c Mon Feb 26 16:27:35 2007 +0000
@@ -3401,7 +3401,7 @@ int map_pages_to_xen(
             {
                 local_flush_tlb_pge();
                 if ( !(l2e_get_flags(ol2e) & _PAGE_PSE) )
-                    free_xen_pagetable(page_to_virt(l2e_get_page(ol2e)));
+                    free_xen_pagetable(mfn_to_virt(l2e_get_pfn(ol2e)));
             }
 
             virt    += 1UL << L2_PAGETABLE_SHIFT;
@@ -3415,8 +3415,8 @@ int map_pages_to_xen(
             {
                 pl1e = alloc_xen_pagetable();
                 clear_page(pl1e);
-                l2e_write(pl2e, l2e_from_page(virt_to_page(pl1e),
-                                              __PAGE_HYPERVISOR));
+                l2e_write(pl2e, l2e_from_pfn(virt_to_mfn(pl1e),
+                                             __PAGE_HYPERVISOR));
             }
             else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
             {
@@ -3425,8 +3425,8 @@ int map_pages_to_xen(
                     l1e_write(&pl1e[i],
                               l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
                                            l2e_get_flags(*pl2e) & ~_PAGE_PSE));
-                l2e_write(pl2e, l2e_from_page(virt_to_page(pl1e),
-                                              __PAGE_HYPERVISOR));
+                l2e_write(pl2e, l2e_from_pfn(virt_to_mfn(pl1e),
+                                             __PAGE_HYPERVISOR));
                 local_flush_tlb_pge();
             }
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.