direct-io.hg

changeset 11521:33266be3c635

[POWERPC][XEN] Clean up init_frame_table()

figure out its size correctly and remove unused global

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Thu Sep 14 14:20:48 2006 -0400 (2006-09-14)
parents 2b8660a8a9bc
children 1fae74cd3963
files xen/arch/powerpc/mm.c xen/include/asm-powerpc/mm.h
line diff
     1.1 --- a/xen/arch/powerpc/mm.c	Mon Sep 18 13:21:39 2006 -0500
     1.2 +++ b/xen/arch/powerpc/mm.c	Thu Sep 14 14:20:48 2006 -0400
     1.3 @@ -39,7 +39,6 @@
     1.4  
     1.5  /* Frame table and its size in pages. */
     1.6  struct page_info *frame_table;
     1.7 -unsigned long frame_table_size;
     1.8  unsigned long max_page;
     1.9  unsigned long total_pages;
    1.10  
    1.11 @@ -190,17 +189,20 @@ int get_page_type(struct page_info *page
    1.12  void __init init_frametable(void)
    1.13  {
    1.14      unsigned long p;
    1.15 +    unsigned long nr_pages;
    1.16 +    int i;
    1.17  
    1.18 -    frame_table_size = PFN_UP(max_page * sizeof(struct page_info));
    1.19 +    nr_pages = PFN_UP(max_page * sizeof(struct page_info));
    1.20 +    nr_pages = min(nr_pages, (4UL << (20 - PAGE_SHIFT)));
    1.21 +    
    1.22  
    1.23 -    p = alloc_boot_pages(min(frame_table_size, 4UL << 20), 1);
    1.24 +    p = alloc_boot_pages(nr_pages, 1);
    1.25      if (p == 0)
    1.26          panic("Not enough memory for frame table\n");
    1.27  
    1.28      frame_table = (struct page_info *)(p << PAGE_SHIFT);
    1.29 -    frame_table_size = (frame_table_size + PAGE_SIZE - 1) & PAGE_MASK;
    1.30 -
    1.31 -    memset(frame_table, 0, frame_table_size);
    1.32 +    for (i = 0; i < nr_pages; i += 1)
    1.33 +        clear_page((void *)((p + i) << PAGE_SHIFT));
    1.34  }
    1.35  
    1.36  long arch_memory_op(int op, XEN_GUEST_HANDLE(void) arg)
     2.1 --- a/xen/include/asm-powerpc/mm.h	Mon Sep 18 13:21:39 2006 -0500
     2.2 +++ b/xen/include/asm-powerpc/mm.h	Thu Sep 14 14:20:48 2006 -0400
     2.3 @@ -229,8 +229,6 @@ extern vm_assist_info_t vm_assist_info[]
     2.4  #define share_xen_page_with_guest(p, d, r) do { } while (0)
     2.5  #define share_xen_page_with_privileged_guests(p, r) do { } while (0)
     2.6  
     2.7 -extern unsigned long frame_table_size;
     2.8 -
     2.9  /* hope that accesses to this will fail spectacularly */
    2.10  #define machine_to_phys_mapping ((u32 *)-1UL)
    2.11