ia64/xen-unstable

changeset 19086:2f993fde1dc6

Rename memory_is_conventional_ram() to page_is_conventional_ram().
It now checks that a whole contiguous page is conventional RAM.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sun Jan 25 10:32:26 2009 +0000 (2009-01-25)
parents ef156b933aad
children f2ad1a7ca582
files xen/arch/ia64/xen/mm.c xen/arch/x86/mm.c xen/drivers/passthrough/vtd/iommu.c xen/drivers/video/vga.c xen/include/xen/mm.h
line diff
     1.1 --- a/xen/arch/ia64/xen/mm.c	Sun Jan 25 10:16:11 2009 +0000
     1.2 +++ b/xen/arch/ia64/xen/mm.c	Sun Jan 25 10:32:26 2009 +0000
     1.3 @@ -3246,9 +3246,9 @@ int get_page_type(struct page_info *page
     1.4      return 1;
     1.5  }
     1.6  
     1.7 -int memory_is_conventional_ram(paddr_t p)
     1.8 +int page_is_conventional_ram(unsigned long mfn)
     1.9  {
    1.10 -    return (efi_mem_type(p) == EFI_CONVENTIONAL_MEMORY);
    1.11 +    return (efi_mem_type(pfn_to_paddr(mfn)) == EFI_CONVENTIONAL_MEMORY);
    1.12  }
    1.13  
    1.14  
     2.1 --- a/xen/arch/x86/mm.c	Sun Jan 25 10:16:11 2009 +0000
     2.2 +++ b/xen/arch/x86/mm.c	Sun Jan 25 10:32:26 2009 +0000
     2.3 @@ -290,15 +290,16 @@ void __init arch_init_memory(void)
     2.4      subarch_init_memory();
     2.5  }
     2.6  
     2.7 -int memory_is_conventional_ram(paddr_t p)
     2.8 +int page_is_conventional_ram(unsigned long mfn)
     2.9  {
    2.10 +    uint64_t maddr = pfn_to_paddr(mfn);
    2.11      int i;
    2.12  
    2.13      for ( i = 0; i < e820.nr_map; i++ )
    2.14      {
    2.15          if ( (e820.map[i].type == E820_RAM) &&
    2.16 -             (e820.map[i].addr <= p) &&
    2.17 -             ((e820.map[i].addr + e820.map[i].size) > p) )
    2.18 +             (e820.map[i].addr <= maddr) &&
    2.19 +             ((e820.map[i].addr + e820.map[i].size) >= (maddr + PAGE_SIZE)) )
    2.20              return 1;
    2.21      }
    2.22  
     3.1 --- a/xen/drivers/passthrough/vtd/iommu.c	Sun Jan 25 10:16:11 2009 +0000
     3.2 +++ b/xen/drivers/passthrough/vtd/iommu.c	Sun Jan 25 10:32:26 2009 +0000
     3.3 @@ -998,8 +998,8 @@ static int intel_iommu_domain_init(struc
     3.4          /* Set up 1:1 page table for dom0 for all RAM except Xen bits. */
     3.5          for ( i = 0; i < max_page; i++ )
     3.6          {
     3.7 -            if ( xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) ||
     3.8 -                 !memory_is_conventional_ram(i << PAGE_SHIFT) )
     3.9 +            if ( !page_is_conventional_ram(i) ||
    3.10 +                 xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) )
    3.11                  continue;
    3.12  
    3.13              tmp = 1 << (PAGE_SHIFT - PAGE_SHIFT_4K);
     4.1 --- a/xen/drivers/video/vga.c	Sun Jan 25 10:16:11 2009 +0000
     4.2 +++ b/xen/drivers/video/vga.c	Sun Jan 25 10:32:26 2009 +0000
     4.3 @@ -79,7 +79,7 @@ void __init vga_init(void)
     4.4      switch ( vga_console_info.video_type )
     4.5      {
     4.6      case XEN_VGATYPE_TEXT_MODE_3:
     4.7 -        if ( memory_is_conventional_ram(0xB8000) ||
     4.8 +        if ( page_is_conventional_ram(paddr_to_pfn(0xB8000)) ||
     4.9               ((video = ioremap(0xB8000, 0x8000)) == NULL) )
    4.10              return;
    4.11          outw(0x200a, 0x3d4); /* disable cursor */
     5.1 --- a/xen/include/xen/mm.h	Sun Jan 25 10:16:11 2009 +0000
     5.2 +++ b/xen/include/xen/mm.h	Sun Jan 25 10:32:26 2009 +0000
     5.3 @@ -103,8 +103,8 @@ unsigned long avail_scrub_pages(void);
     5.4  
     5.5  int guest_remove_page(struct domain *d, unsigned long gmfn);
     5.6  
     5.7 -/* Returns TRUE if the memory at address @p is ordinary RAM. */
     5.8 -int memory_is_conventional_ram(paddr_t p);
     5.9 +/* Returns TRUE if the whole page at @mfn is ordinary RAM. */
    5.10 +int page_is_conventional_ram(unsigned long mfn);
    5.11  
    5.12  extern unsigned long *alloc_bitmap;	/* for vmcoreinfo */
    5.13