Commit 37950718 authored by arnd@arndb.de's avatar arnd@arndb.de Committed by Paul Mackerras

[POWERPC] spufs: one more fix for 64k pages

The SPU context save/restore code is currently built
for a 4k page size and we provide a _shipped version
of it since most people don't have the spu toolchain
that is needed to rebuild that code.

This patch hardcodes the data structures to a 64k
page alignment, which also guarantees 4k alignment
but unfortunately wastes 60k of memory per SPU
context that is created in the running system.

We will follow up on this with another patch to
reduce that overhead or maybe redo the context
save/restore logic to do this part entirely different,
but for now it should make experimental systems
work with either page size.
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent c9832948
......@@ -10,8 +10,10 @@ SPU_CC := $(SPU_CROSS)gcc
SPU_AS := $(SPU_CROSS)gcc
SPU_LD := $(SPU_CROSS)ld
SPU_OBJCOPY := $(SPU_CROSS)objcopy
SPU_CFLAGS := -O2 -Wall -I$(srctree)/include -I$(objtree)/include2
SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include -I$(objtree)/include2
SPU_CFLAGS := -O2 -Wall -I$(srctree)/include \
-I$(objtree)/include2 -D__KERNEL__
SPU_AFLAGS := -c -D__ASSEMBLY__ -I$(srctree)/include \
-I$(objtree)/include2 -D__KERNEL__
SPU_LDFLAGS := -N -Ttext=0x0
$(obj)/switch.o: $(obj)/spu_save_dump.h $(obj)/spu_restore_dump.h
......@@ -48,7 +50,8 @@ cmd_hexdump = ( \
echo " * Hex-dump auto generated from $*.c." ; \
echo " * Do not edit!" ; \
echo " */" ; \
echo "static unsigned int $*_code[] __page_aligned = {" ; \
echo "static unsigned int $*_code[] " \
"__attribute__((__aligned__(128))) = {" ; \
hexdump -v -e '"0x" 4/1 "%02x" "," "\n"' $< ; \
echo "};" ; \
) > $@
......
......@@ -86,10 +86,18 @@ struct spu_lscsa {
struct spu_reg128 event_mask;
struct spu_reg128 srr0;
struct spu_reg128 stopped_status;
struct spu_reg128 pad[119]; /* 'ls' must be page-aligned. */
unsigned char ls[LS_SIZE];
/*
* 'ls' must be page-aligned on all configurations.
* Since we don't want to rely on having the spu-gcc
* installed to build the kernel and this structure
* is used in the SPU-side code, make it 64k-page
* aligned for now.
*/
unsigned char ls[LS_SIZE] __attribute__((aligned(65536)));
};
#ifndef __SPU__
/*
* struct spu_problem_collapsed - condensed problem state area, w/o pads.
*/
......@@ -250,6 +258,7 @@ extern int spu_restore(struct spu_state *new, struct spu *spu);
extern int spu_switch(struct spu_state *prev, struct spu_state *new,
struct spu *spu);
#endif /* !__SPU__ */
#endif /* __KERNEL__ */
#endif /* !__ASSEMBLY__ */
#endif /* _SPU_CSA_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment