Re: [RFC PATCH v1] power: don't manage floating point regs when no FPU

From: Christophe Leroy
Date: Tue Aug 11 2020 - 10:06:56 EST




Le 11/08/2020 à 14:07, Michael Ellerman a écrit :
Christophe Leroy <christophe.leroy@xxxxxxxxxx> writes:
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.


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;
+#endif

Should 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