lkml.org 
[lkml]   [2007]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 26/26] POWERPC: Fix handling of stfiwx math emulation
    2.6.22-stable review patch.  If anyone has any objections, please let us
    know.

    ------------------
    From: Kumar Gala <galak@kernel.crashing.org>

    patch ba02946a903015840ef672ccc9dc8620a7e83de6 in mainline

    Its legal for the stfiwx instruction to have RA = 0 as part of its
    effective address calculation. This is illegal for all other XE
    form instructions.

    Add code to compute the proper effective address for stfiwx if
    RA = 0 rather than treating it as illegal.

    Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    arch/powerpc/math-emu/math.c | 13 +++++++++----
    1 file changed, 9 insertions(+), 4 deletions(-)

    --- a/arch/powerpc/math-emu/math.c
    +++ b/arch/powerpc/math-emu/math.c
    @@ -407,11 +407,16 @@ do_mathemu(struct pt_regs *regs)

    case XE:
    idx = (insn >> 16) & 0x1f;
    - if (!idx)
    - goto illegal;
    -
    op0 = (void *)&current->thread.fpr[(insn >> 21) & 0x1f];
    - op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
    + if (!idx) {
    + if (((insn >> 1) & 0x3ff) == STFIWX)
    + op1 = (void *)(regs->gpr[(insn >> 11) & 0x1f]);
    + else
    + goto illegal;
    + } else {
    + op1 = (void *)(regs->gpr[idx] + regs->gpr[(insn >> 11) & 0x1f]);
    + }
    +
    break;

    case XEU:
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-10-31 16:35    [W:0.032 / U:30.752 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site