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

[Xen-changelog] [linux-2.6.18-xen] [IA64] Disable paravirtualization to remap /dev/mem.



# HG changeset patch
# User Alex Williamson <alex.williamson@xxxxxx>
# Date 1185814416 21600
# Node ID f017328288ea42600509b62882f687d7331ce194
# Parent  6d84769b52563c8ecdbe3ee001befcbfbbf6bfcd
[IA64] Disable paravirtualization to remap /dev/mem.

Signed-off-by: Jun Kamada <kama@xxxxxxxxxxxxxx>
---
 arch/ia64/xen/mem.c        |   75 ---------------------------------------------
 arch/ia64/Kconfig          |    3 +
 arch/ia64/xen/Makefile     |    2 -
 include/asm-ia64/io.h      |    5 ---
 include/asm-ia64/uaccess.h |   20 ------------
 5 files changed, 4 insertions(+), 101 deletions(-)

diff -r 6d84769b5256 -r f017328288ea arch/ia64/Kconfig
--- a/arch/ia64/Kconfig Mon Jul 30 10:51:55 2007 -0600
+++ b/arch/ia64/Kconfig Mon Jul 30 10:53:36 2007 -0600
@@ -582,6 +582,9 @@ if XEN
 if XEN
 config XEN_SMPBOOT
        default n
+
+config XEN_DEVMEM
+       default n
 endif
 
 source "drivers/xen/Kconfig"
diff -r 6d84769b5256 -r f017328288ea arch/ia64/xen/Makefile
--- a/arch/ia64/xen/Makefile    Mon Jul 30 10:51:55 2007 -0600
+++ b/arch/ia64/xen/Makefile    Mon Jul 30 10:53:36 2007 -0600
@@ -4,6 +4,6 @@
 
 obj-y := hypercall.o xenivt.o xenentry.o xensetup.o xenpal.o xenhpski.o \
         hypervisor.o util.o xencomm.o xcom_hcall.o xcom_mini.o \
-        xcom_privcmd.o mem.o xen_dma.o
+        xcom_privcmd.o xen_dma.o
 
 obj-$(CONFIG_IA64_GENERIC) += machvec.o
diff -r 6d84769b5256 -r f017328288ea arch/ia64/xen/mem.c
--- a/arch/ia64/xen/mem.c       Mon Jul 30 10:51:55 2007 -0600
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- *  Originally from linux/drivers/char/mem.c
- *
- *  Copyright (C) 1991, 1992  Linus Torvalds
- *
- *  Added devfs support. 
- *    Jan-11-1998, C. Scott Ananian <cananian@xxxxxxxxxxxxxxxxxxxx>
- *  Shared /dev/zero mmaping support, Feb 2000, Kanoj Sarcar <kanoj@xxxxxxx>
- */
-/*
- * taken from
- * linux/drivers/char/mem.c and linux-2.6-xen-sparse/drivers/xen/char/mem.c.
- * adjusted for IA64 and made transparent.
- * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
- *                    VA Linux Systems Japan K.K.
- */
-
-#include <linux/mm.h>
-#include <linux/efi.h>
-
-/*
- * Architectures vary in how they handle caching for addresses
- * outside of main memory.
- *
- */
-static inline int uncached_access(struct file *file, unsigned long addr)
-{
-       /*
-        * On ia64, we ignore O_SYNC because we cannot tolerate memory 
attribute aliases.
-        */
-       return !(efi_mem_attributes(addr) & EFI_MEMORY_WB);
-}
-
-int xen_mmap_mem(struct file * file, struct vm_area_struct * vma)
-{
-       unsigned long addr = vma->vm_pgoff << PAGE_SHIFT;
-       size_t size = vma->vm_end - vma->vm_start;
-
-
-#if 0
-       /*
-        *XXX FIXME: linux-2.6.16.29, linux-2.6.17
-        *    valid_mmap_phys_addr_range() in linux/arch/ia64/kernel/efi.c
-        *    fails checks.
-        *    linux-2.6.18.1's returns always 1. 
-        *    Its comments says
-        *
-         * MMIO regions are often missing from the EFI memory map.
-         * We must allow mmap of them for programs like X, so we
-         * currently can't do any useful validation.
-         */
-       if (!valid_mmap_phys_addr_range(addr, &size))
-               return -EINVAL;
-       if (size < vma->vm_end - vma->vm_start)
-               return -EINVAL;
-#endif
-
-       if (is_running_on_xen()) {
-               unsigned long offset = HYPERVISOR_ioremap(addr, size);
-               if (IS_ERR_VALUE(offset))
-                       return offset;
-       }
-
-       if (uncached_access(file, vma->vm_pgoff << PAGE_SHIFT))
-               vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
-
-        /* Remap-pfn-range will mark the range VM_IO and VM_RESERVED */
-        if (remap_pfn_range(vma,
-                            vma->vm_start,
-                            vma->vm_pgoff,
-                            size,
-                            vma->vm_page_prot))
-                return -EAGAIN;
-        return 0;
-}
diff -r 6d84769b5256 -r f017328288ea include/asm-ia64/io.h
--- a/include/asm-ia64/io.h     Mon Jul 30 10:51:55 2007 -0600
+++ b/include/asm-ia64/io.h     Mon Jul 30 10:53:36 2007 -0600
@@ -128,11 +128,6 @@ extern int valid_mmap_phys_addr_range (u
        (((bvec_to_bus((vec1)) + (vec1)->bv_len) == bvec_to_bus((vec2))) && \
         ((bvec_to_pseudophys((vec1)) + (vec1)->bv_len) ==              \
          bvec_to_pseudophys((vec2))))
-
-/* We will be supplying our own /dev/mem implementation */
-#define ARCH_HAS_DEV_MEM
-#define ARCH_HAS_DEV_MEM_MMAP_MEM
-int xen_mmap_mem(struct file * file, struct vm_area_struct * vma);
 #endif /* CONFIG_XEN */
 
 # endif /* KERNEL */
diff -r 6d84769b5256 -r f017328288ea include/asm-ia64/uaccess.h
--- a/include/asm-ia64/uaccess.h        Mon Jul 30 10:51:55 2007 -0600
+++ b/include/asm-ia64/uaccess.h        Mon Jul 30 10:53:36 2007 -0600
@@ -365,7 +365,6 @@ ia64_done_with_exception (struct pt_regs
 }
 
 #define ARCH_HAS_TRANSLATE_MEM_PTR     1
-#ifndef CONFIG_XEN
 static __inline__ char *
 xlate_dev_mem_ptr (unsigned long p)
 {
@@ -380,25 +379,6 @@ xlate_dev_mem_ptr (unsigned long p)
 
        return ptr;
 }
-#else
-static __inline__ char *
-xen_xlate_dev_mem_ptr (unsigned long p, ssize_t sz)
-{
-       unsigned long pfn = p >> PAGE_SHIFT;
-
-       if (pfn_valid(pfn) && !PageUncached(pfn_to_page(pfn)))
-               return __va(p);
-
-       return ioremap(p, sz);
-}
-
-static __inline__ void
-xen_xlate_dev_mem_ptr_unmap (char* v)
-{
-       if (REGION_NUMBER(v) == RGN_UNCACHED)
-               iounmap(v);
-}
-#endif
 
 /*
  * Convert a virtual cached kernel memory pointer to an uncached pointer

_______________________________________________
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®.