lkml.org 
[lkml]   [2009]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [BUG 2.6.31-rc1] HIGHMEM64G causes hang in PCI init on 32-bit x86
    H. Peter Anvin wrote:
    > Yinghai Lu wrote:
    >> continue;
    >> @@ -1409,8 +1409,10 @@ void __init e820_reserve_resources_late(
    >> end = round_up(start, ram_alignment(start));
    >> if (start == end)
    >> continue;
    >> - reserve_region_with_split(&iomem_resource, start,
    >> - end - 1, "RAM buffer");
    >> + if (end != (resource_size_t)end)
    >> + continue;
    >> + reserve_region_with_split(&iomem_resource, (resource_size_t)start,
    >> + (resource_size_t)(end - 1), "RAM buffer");
    >> }
    >> }
    >>
    >
    > That doesn't quite look right; for one thing it doesn't handle the
    > (admittedly somewhat unlikely) case of end pointing to the end of the
    > address space.
    >
    > Something like:
    >
    > if (start > (resource_size_t)end-1)
    > continue;
    >
    > ... should work better.
    >

    ok this one?

    ---
    arch/x86/kernel/e820.c | 16 ++++++++--------
    1 file changed, 8 insertions(+), 8 deletions(-)

    Index: linux-2.6/arch/x86/kernel/e820.c
    ===================================================================
    --- linux-2.6.orig/arch/x86/kernel/e820.c
    +++ linux-2.6/arch/x86/kernel/e820.c
    @@ -1367,9 +1367,9 @@ void __init e820_reserve_resources(void)
    }

    /* How much should we pad RAM ending depending on where it is? */
    -static unsigned long ram_alignment(resource_size_t pos)
    +static u64 ram_alignment(u64 pos)
    {
    - unsigned long mb = pos >> 20;
    + u64 mb = pos >> 20;

    /* To 64kB in the first megabyte */
    if (!mb)
    @@ -1400,17 +1400,17 @@ void __init e820_reserve_resources_late(
    * avoid stolen RAM:
    */
    for (i = 0; i < e820.nr_map; i++) {
    - struct e820entry *entry = &e820_saved.map[i];
    - resource_size_t start, end;
    + struct e820entry *entry = &e820.map[i];
    + u64 start, end;

    if (entry->type != E820_RAM)
    continue;
    start = entry->addr + entry->size;
    - end = round_up(start, ram_alignment(start));
    - if (start == end)
    + end = round_up(start, ram_alignment(start)) - 1;
    + if (start > (resource_size_t)end)
    continue;
    - reserve_region_with_split(&iomem_resource, start,
    - end - 1, "RAM buffer");
    + reserve_region_with_split(&iomem_resource, (resource_size_t)start,
    + (resource_size_t)end, "RAM buffer");
    }
    }


    \
     
     \ /
      Last update: 2009-06-30 03:19    [W:0.024 / U:3.240 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site