lkml.org 
[lkml]   [2011]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5/5] efi: Ensure that the entirity of a region is mapped
    Date
    It's possible for init_memory_mapping() to fail to map the entire region
    if it crosses a boundary, so ensure that we complete the mapping.

    Signed-off-by: Matthew Garrett <mjg@redhat.com>
    ---
    arch/x86/platform/efi/efi_64.c | 6 ++++--
    1 files changed, 4 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
    index 94d6b39..2649426 100644
    --- a/arch/x86/platform/efi/efi_64.c
    +++ b/arch/x86/platform/efi/efi_64.c
    @@ -89,8 +89,10 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
    return ioremap(phys_addr, size);

    last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
    - if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size)
    - return NULL;
    + if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) {
    + unsigned long top = last_map_pfn << PAGE_SHIFT;
    + efi_ioremap(top, size - (top - phys_addr), type);
    + }

    return (void __iomem *)__va(phys_addr);
    }
    --
    1.7.5


    \
     
     \ /
      Last update: 2011-05-05 21:23    [W:3.441 / U:0.268 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site