Skip to contentSkip to conversation

__switch_to test-and-branch ALTIVEC specific?

PATCH Marcelo Tosatti 6 participants 9 messages Sep 13, 2005 – Sep 18, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

This test&branch looks AltiVec specific, any reason for not #ifdef'ing it out?

ppc/kernel/process.c 2005-09-13 14:43:51.000000000 -0300 renamed from ppc/kernel/process.c.orig 2005-09-13 14:43:13.000000000 -0300 +2 -0
@@ -287,11 +287,13 @@ struct task_struct *__switch_to(struct t
 #endif /* CONFIG_SPE */
 #endif /* CONFIG_SMP */
 
+#ifdef CONFIG_ALTIVEC
        /* Avoid the trap.  On smp this this never happens since
         * we don't set last_task_used_altivec -- Cort
         */
        if (new->thread.regs && last_task_used_altivec == new)
                new->thread.regs->msr |= MSR_VEC;
+#endif
 #ifdef CONFIG_SPE
        /* Avoid the trap.  On smp this this never happens since
         * we don't set last_task_used_spe
#1 lore raw

This probably has to due with what happens on a G4 system with a kernel not build with Altivec.. However, I dont remember exactly what behavior is desired.

- kumar

Quoted 29 lines · Marcelo Tosatti

Hi,

This test&branch looks AltiVec specific, any reason for not #ifdef'ing it
out?

--- arch/ppc/kernel/process.c.orig 2005-09-13 14:43:13.000000000
-0300
+++ arch/ppc/kernel/process.c 2005-09-13 14:43:51.000000000 -0300

ppc/kernel/process.c 2005-09-13 14:43:51.000000000 -0300 renamed from ppc/kernel/process.c.orig 2005-09-13 14:43:13.000000000 -0300 +2 -0
@@ -287,11 +287,13 @@ struct task_struct *__switch_to(struct t
 #endif /* CONFIG_SPE */
 #endif /* CONFIG_SMP */
 
+#ifdef CONFIG_ALTIVEC
        /* Avoid the trap.  On smp this this never happens since
         * we don't set last_task_used_altivec -- Cort
         */
        if (new->thread.regs && last_task_used_altivec == new)
                new->thread.regs->msr |= MSR_VEC;
+#endif
 #ifdef CONFIG_SPE
        /* Avoid the trap.  On smp this this never happens since
         * we don't set last_task_used_spe

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

#2 lore raw
Quoted 3 lines · Kumar Gala

This probably has to due with what happens on a G4 system with a kernel not build with Altivec.. However, I dont remember exactly what behavior is desired.

What would be the appropriate set of definitions to use, then ?

#if defined (CONFIG_ALTIVEC || CONFIG_6xx) ?

#3 lore raw
Quoted 7 lines · Marcelo Tosatti
Quoted 3 lines · Kumar Gala

This probably has to due with what happens on a G4 system with a kernel not build with Altivec.. However, I dont remember exactly what

Quoted 6 lines
Quoted 2 lines

behavior is desired.

What would be the appropriate set of definitions to use, then ?

#if defined (CONFIG_ALTIVEC || CONFIG_6xx) ?

That's probably better. Hopefully Ben will have some reason if what you suggest is not sufficient.

- k

#7 lore raw

-dev and -embedded cross-posting

In reply to Marcelo Tosatti

Guys,

let's not cross-post -dev posts here. In general, -embedded isn't a totally separate list, it just covers embedded specific stuff, which is not interesting to several loud -dev readers :). Things which aren't embedded specific should go -dev.

I think, everybody *interested* in general PPC32 development issues here, are also subscribed to -dev list.

Thanks.

Signature · 1 line
Eugene
#5 lore raw
In reply to Marcelo Tosatti
Quoted 3 lines
Quoted 3 lines

This probably has to due with what happens on a G4 system with a kernel not build with Altivec.. However, I dont remember exactly what behavior is desired.

A kernel not build with AltiVec support will just
SIGILL any user process that tries to use it (and
MSR[VEC] = 0).

The code here can safely be #ifdef'ed out (but note I only looked at the code, I didn't test it ;-) )

Segher

#8 lore raw
In reply to Marcelo Tosatti
Quoted 2 lines · Marcelo Tosatti

This test&branch looks AltiVec specific, any reason for not #ifdef'ing it out?

No, your patch looks fine. (/me wishes patchwork had a "Queued" state.)

Paul.

#6 lore raw
In reply to Kumar Gala
Quoted 3 lines · Kumar Gala

This probably has to due with what happens on a G4 system with a kernel not build with Altivec.. However, I dont remember exactly what behavior is desired.

No, we should never set MSR_VEC on a kernel not built with CONFIG_ALTIVEC.

Ben.

#4 lore raw
In reply to Kumar Gala
Quoted 12 lines · Kumar Gala
Quoted 10 lines · Marcelo Tosatti
Quoted 7 lines · Kumar Gala

This probably has to due with what happens on a G4 system with a kernel not build with Altivec.. However, I dont remember exactly what

behavior is desired.

Quoted 6 lines
Quoted 3 lines

What would be the appropriate set of definitions to use, then ?

#if defined (CONFIG_ALTIVEC || CONFIG_6xx) ?

That's probably better. Hopefully Ben will have some reason if what you suggest is not sufficient.

Just #ifdef CONFIG_ALTIVEC is fine

Ben.