Re: [RFC PATCH v1] power: don't manage floating point regs when no FPU
From: Christophe Leroy <hidden>
Date: 2020-08-11 14:06:56
Also in:
lkml
Le 11/08/2020 à 14:07, Michael Ellerman a écrit :
Christophe Leroy [off-list ref] writes:quoted
10 files changed, 44 insertions(+), 1 deletion(-)In general this looks fine. It's a bit #ifdef heavy. Maybe some of those can be cleaned up a bit with some wrapper inlines?
Looking at it once more, looks like more or less the same level of #ifdefs as things like CONFIG_ALTIVEC for instance. I can't really see much opportunities to clean it up.
quoted
diff --git a/arch/powerpc/kernel/ptrace/ptrace-novsx.c b/arch/powerpc/kernel/ptrace/ptrace-novsx.c index b2dc4e92d11a..8f87a11f3f8c 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-novsx.c +++ b/arch/powerpc/kernel/ptrace/ptrace-novsx.c@@ -28,6 +29,9 @@ int fpr_get(struct task_struct *target, const struct user_regset *regset, return user_regset_copyout(&pos, &count, &kbuf, &ubuf, &target->thread.fp_state, 0, -1); +#else + return 0; +#endifShould we return -ENODEV/EIO here? Wonder if another arch can give us a clue.
Looks like we have to do another way ... another #ifdef ... in the definition of native_regsets[] in ptrace-view.c . And then we should be able to not build ptrace-novsx.c at all. Will try that. Christophe