lkml.org 
[lkml]   [2008]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 5/7] ftrace, PPC64: handle module trampolines for dyn ftrace
    Steven Rostedt writes:

    > + if (!rec->arch.mod) {
    > + if (!mod) {
    > + printk(KERN_ERR "No module loaded addr=%lx\n",
    > + addr);
    > + return -EFAULT;
    > + }
    > + rec->arch.mod = mod;
    > + } else if (mod) {
    > + printk(KERN_ERR
    > + "Record mod %p not equal to passed in mod %p\n",
    > + rec->arch.mod, mod);
    > + return -EINVAL;

    That looks wrong; surely you need an if (mod != rec->arch.mod)
    somewhere here?

    > + /* Make sure that that this is still a 24bit jump */
    > + if ((*op & 0xff000000) != 0x48000000) {
    > + printk(KERN_ERR "Not expected bl: opcode is %x\n", *op);
    > + return -EINVAL;
    > + }

    Needs to be

    if ((*op & 0xfc000003) != 0x48000001)

    since the major opcode is the top 6 bits, and the bottom 2 bits are
    the link bit and the absolute address bit.

    > + /* lets find where the pointer goes */
    > + offset = (*op & 0x03fffffc);
    > + /* make it signed */
    > + if (offset & 0x02000000)
    > + offset |= 0xfe000000;

    but you got that right... :)

    > + /* get the address this jumps too */
    > + tramp = mod->arch.toc + offset + 32;

    Why + 32?

    Paul.


    \
     
     \ /
      Last update: 2008-11-17 06:09    [W:0.023 / U:29.660 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site