ia64/xen-unstable

changeset 14145:0070b18869f7

x86: Update map_pages_to_xen() to avoid arithmetic based on
uninitialised frame_table variable.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Feb 26 16:27:35 2007 +0000 (2007-02-26)
parents 9e5e94942045
children d2a91b73899a
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Mon Feb 26 16:25:17 2007 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Mon Feb 26 16:27:35 2007 +0000
     1.3 @@ -3401,7 +3401,7 @@ int map_pages_to_xen(
     1.4              {
     1.5                  local_flush_tlb_pge();
     1.6                  if ( !(l2e_get_flags(ol2e) & _PAGE_PSE) )
     1.7 -                    free_xen_pagetable(page_to_virt(l2e_get_page(ol2e)));
     1.8 +                    free_xen_pagetable(mfn_to_virt(l2e_get_pfn(ol2e)));
     1.9              }
    1.10  
    1.11              virt    += 1UL << L2_PAGETABLE_SHIFT;
    1.12 @@ -3415,8 +3415,8 @@ int map_pages_to_xen(
    1.13              {
    1.14                  pl1e = alloc_xen_pagetable();
    1.15                  clear_page(pl1e);
    1.16 -                l2e_write(pl2e, l2e_from_page(virt_to_page(pl1e),
    1.17 -                                              __PAGE_HYPERVISOR));
    1.18 +                l2e_write(pl2e, l2e_from_pfn(virt_to_mfn(pl1e),
    1.19 +                                             __PAGE_HYPERVISOR));
    1.20              }
    1.21              else if ( l2e_get_flags(*pl2e) & _PAGE_PSE )
    1.22              {
    1.23 @@ -3425,8 +3425,8 @@ int map_pages_to_xen(
    1.24                      l1e_write(&pl1e[i],
    1.25                                l1e_from_pfn(l2e_get_pfn(*pl2e) + i,
    1.26                                             l2e_get_flags(*pl2e) & ~_PAGE_PSE));
    1.27 -                l2e_write(pl2e, l2e_from_page(virt_to_page(pl1e),
    1.28 -                                              __PAGE_HYPERVISOR));
    1.29 +                l2e_write(pl2e, l2e_from_pfn(virt_to_mfn(pl1e),
    1.30 +                                             __PAGE_HYPERVISOR));
    1.31                  local_flush_tlb_pge();
    1.32              }
    1.33