Skip to contentSkip to conversation

Modules and CONFIG_ALTIVEC

DISCUSSION Samuel Rydh 4 participants 4 messages Aug 5, 2001 – Aug 6, 2001

lore
Share & tools
lore
#0 lore raw

On ppc, the size of thread_struct depends on the CONFIG_ALTIVEC setting. Thus, the offset of various task_struct fields are dependent upon this config option.

This makes it difficult to distribute precompiled module binaries (in a safe manner). It really shouldn't be necessary to bundle:

	module-2.4.X
	module-2.4.X-smp
	module-2.4.X-altivec
	module-2.4.X-altivec-smp

To avoid this problem, one could do something like:

unsigned long fpscr; /* Floating point status */
-#ifdef CONFIG_ALTIVEC

-       vector128       vr[32];         /* Complete AltiVec set */
-       vector128       vscr;           /* AltiVec status */
-       unsigned long   vrsave;

-#endif /* CONFIG_ALTIVEC */
+ altivec_t *vregs;

I'm not sure the affected task_struct fields are ever referenced by a typical kernel module. But this is difficult to check and besides, new fields might be added to the end of the struct.

Thoughts?

/Samuel

----------------------------------------------------------
E-mail <[email protected]> WWW: <http://www.ibrium.se>
Phone/fax: (home) +46 8 4418431, (work) +46 8 790nnnn
----------------------------------------------------------

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 3 lines · Samuel Rydh

On ppc, the size of thread_struct depends on the CONFIG_ALTIVEC setting. Thus, the offset of various task_struct fields are dependent upon this config option.

[snip]

Review

Quoted 7 lines

unsigned long fpscr; /* Floating point status */

(quoted diff) +1 -5
-#ifdef CONFIG_ALTIVEC
-       vector128       vr[32];         /* Complete AltiVec set */
-       vector128       vscr;           /* AltiVec status */
-       unsigned long   vrsave;
-#endif /* CONFIG_ALTIVEC */
+	altivec_t	*vregs;

This also affects gdb. When gdb reads a core file, it gets upset if the size of a regset isn't what it thinks it should be. Currently it's a bit too easy to change that size...

-Hollis

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 6 lines · Hollis
Quoted 3 lines · Samuel Rydh

On ppc, the size of thread_struct depends on the CONFIG_ALTIVEC setting. Thus, the offset of various task_struct fields are dependent upon this config option.

[snip]

Quoted 11 lines

Review

Quoted 7 lines

unsigned long fpscr; /* Floating point status */

(quoted diff) +1 -5
-#ifdef CONFIG_ALTIVEC
-       vector128       vr[32];         /* Complete AltiVec set */
-       vector128       vscr;           /* AltiVec status */
-       unsigned long   vrsave;
-#endif /* CONFIG_ALTIVEC */
+	altivec_t	*vregs;

This also affects gdb. When gdb reads a core file, it gets upset if the size of a regset isn't what it thinks it should be. Currently it's a bit too easy to change that size...

Yup. Expect GDB patches to deal with that (and with altivec) from me in the next month, if no one beats me to it. It's approaching the top of my TODO list.

--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 16 lines · Daniel Jacobowitz
Quoted 6 lines · Hollis
Quoted 3 lines · Samuel Rydh

On ppc, the size of thread_struct depends on the CONFIG_ALTIVEC setting. Thus, the offset of various task_struct fields are dependent upon this config option.

[snip]

Quoted 9 lines

Review

Quoted 7 lines

unsigned long fpscr; /* Floating point status */

(quoted diff) +1 -5
-#ifdef CONFIG_ALTIVEC
-       vector128       vr[32];         /* Complete AltiVec set */
-       vector128       vscr;           /* AltiVec status */
-       unsigned long   vrsave;
-#endif /* CONFIG_ALTIVEC */
+   altivec_t       *vregs;

This also affects gdb. When gdb reads a core file, it gets upset if the

Quoted 8 lines

size

Quoted 1 line

of a regset isn't what it thinks it should be. Currently it's a bit too

easy

Quoted 1 line

to change that size...

Yup. Expect GDB patches to deal with that (and with altivec) from me in the next month, if no one beats me to it. It's approaching the top of my TODO list.

Uhm, I sent a patch to Daniel Berlin a while ago for commenting, but haven't heard back yet. I can send it to you if you want to take a look.

Franz.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/