lkml.org 
[lkml]   [2007]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC PATCH 11/12] PAT 64b: devmem do not read pages not mapped in identity map
    Enable valid_phys_addr_range for x86_64 and check whether the identity
    mapping exists before reading /dev/mem. For reserved regions there is no
    identity mappings any more and then cannot be read from /dev/mem.

    Side effect is that dd of entire memory will not work any more, once there are
    reserved holes in memory space.

    TBD: Read reserved regions as 0xffff or something, and continue reading
    across holes, till we reach the high_memory (end of memory).

    Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
    Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
    ---

    Index: linux-2.6.24-rc/arch/x86/kernel/e820_64.c
    ===================================================================
    --- linux-2.6.24-rc.orig/arch/x86/kernel/e820_64.c
    +++ linux-2.6.24-rc/arch/x86/kernel/e820_64.c
    @@ -220,6 +220,11 @@ int is_memory_all_valid(unsigned long st
    }
    EXPORT_SYMBOL_GPL(is_memory_all_valid);

    +int valid_phys_addr_range(unsigned long addr, size_t count)
    +{
    + return is_memory_all_valid(addr, addr + count);
    +}
    +
    /*
    * Find a free area in a specific range.
    */
    Index: linux-2.6.24-rc/include/asm-x86/io_64.h
    ===================================================================
    --- linux-2.6.24-rc.orig/include/asm-x86/io_64.h
    +++ linux-2.6.24-rc/include/asm-x86/io_64.h
    @@ -265,6 +265,15 @@ extern int iommu_bio_merge;
    */
    #define xlate_dev_kmem_ptr(p) p

    +#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
    +extern int valid_phys_addr_range (unsigned long addr, size_t count);
    +
    +static inline int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)
    +{
    + return 1;
    +}
    +
    +
    #endif /* __KERNEL__ */

    #endif
    --


    \
     
     \ /
      Last update: 2007-12-14 01:01    [W:0.020 / U:30.808 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site