> I would like to know if anybody have tried porting utrace kernel patches to
> arm architecture before. if yes, I would like to know what you've done so
> far, if possible. Thanks in advance!

I don't think anyone has posted here (or told me privately) that they were
doing it.  As you can read about in the archives of this list, the main
task to do for an arch now is the "user_regset" conversion.  You can do
this on the latest vanilla kernel tree (what will be 2.6.25) and send it
upstream independent of utrace per se.

>From a quick perusal of arch/arm/kernel/ptrace.c it looks like all the
user_regset work for ARM is pretty trivial.  The elf_gregset_t layout
already matches struct pt_regs exactly.  So all you need for that is:

static int gpr_get(struct task_struct *target, const struct user_regset *regset,
                   unsigned int pos, unsigned int count,
                   void *kbuf, void __user *ubuf)
{
        return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
                                   task_pt_regs(target), 0, -1);
}

static int gpr_set(struct task_struct *target, const struct user_regset *regset,
                   unsigned int pos, unsigned int count,
                   const void *kbuf, const void __user *ubuf)
{
        struct pt_regs newregs = *task_pt_regs(target);
        int ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
                                     &newregs, 0, -1);
        if (!ret && !valid_user_regs(&newregs))
                ret = -EIO;
        if (!ret)
                *task_pt_regs(target) = newregs;
        return ret;
}

or about like that.  Similarly simple for the FP and iWMMXt and Crunch regsets.
All the PTRACE_*REGS requests can be trivial calls to copy_regset_to_user
and copy_regset_from_user.

I'd be glad to review changes before you send them upstream.


Thanks,
Roland

Reply via email to