lkml.org 
[lkml]   [2011]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[tip:x86/urgent] x86, setup: When probing memory with e801, use ax/bx as a pair
    Commit-ID:  39b68976ac653cfdc7f872a293e8b7928de2dcc6
    Gitweb: http://git.kernel.org/tip/39b68976ac653cfdc7f872a293e8b7928de2dcc6
    Author: H. Peter Anvin <hpa@linux.intel.com>
    AuthorDate: Mon, 25 Apr 2011 14:52:37 -0700
    Committer: H. Peter Anvin <hpa@linux.intel.com>
    CommitDate: Mon, 25 Apr 2011 14:52:37 -0700

    x86, setup: When probing memory with e801, use ax/bx as a pair

    When we use BIOS function e801 to probe memory, we should use ax/bx
    (or cx/dx) as a pair, not mix and match. This was a typo during the
    translation from assembly code, and breaks at least one set of
    machines in the field (which return cx = dx = 0).

    Reported-and-tested-by: Chris Samuel <chris@csamuel.org>
    Fix-proposed-by: Thomas Meyer <thomas@m3y3r.de>
    Link: http://lkml.kernel.org/r/1303566747.12067.10.camel@localhost.localdomain
    ---
    arch/x86/boot/memory.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)
    diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c
    index cae3feb..db75d07 100644
    --- a/arch/x86/boot/memory.c
    +++ b/arch/x86/boot/memory.c
    @@ -91,7 +91,7 @@ static int detect_memory_e801(void)
    if (oreg.ax > 15*1024) {
    return -1; /* Bogus! */
    } else if (oreg.ax == 15*1024) {
    - boot_params.alt_mem_k = (oreg.dx << 6) + oreg.ax;
    + boot_params.alt_mem_k = (oreg.bx << 6) + oreg.ax;
    } else {
    /*
    * This ignores memory above 16MB if we have a memory

    \
     
     \ /
      Last update: 2011-04-26 01:29    [from the cache]
    ©2003-2011 Jasper Spaans