linux/arch
David Gibson 25c8a78b1e [PATCH] powerpc: Fix handling of fpscr on 64-bit
The recent merge of fpu.S broken the handling of fpscr for
ARCH=powerpc and CONFIG_PPC64=y.  FP registers could be corrupted,
leading to strange random application crashes.

The confusion arises, because the thread_struct has (and requires) a
64-bit area to save the fpscr, because we use load/store double
instructions to get it in to/out of the FPU.  However, only the low
32-bits are actually used, so we want to treat it as a 32-bit quantity
when manipulating its bits to avoid extra load/stores on 32-bit.  This
patch replaces the current definition with a structure of two 32-bit
quantities (pad and val), to clarify things as much as is possible.
The 'val' field is used when manipulating bits, the structure itself
is used when obtaining the address for loading/unloading the value
from the FPU.

While we're at it, consolidate the 4 (!) almost identical versions of
cvt_fd() and cvt_df() (arch/ppc/kernel/misc.S,
arch/ppc64/kernel/misc.S, arch/powerpc/kernel/misc_32.S,
arch/powerpc/kernel/misc_64.S) into a single version in fpu.S.  The
new version takes a pointer to thread_struct and applies the correct
offset itself, rather than a pointer to the fpscr field itself, again
to avoid confusion as to which is the correct field to use.

Finally, this patch makes ARCH=ppc64 also use the consolidated fpu.S
code, which it previously did not.

Built for G5 (ARCH=ppc64 and ARCH=powerpc), 32-bit powermac (ARCH=ppc
and ARCH=powerpc) and Walnut (ARCH=ppc, CONFIG_MATH_EMULATION=y).
Booted on G5 (ARCH=powerpc) and things which previously fell over no
longer do.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2005-10-27 20:48:50 +10:00
..
alpha [PATCH] alpha: fix kernel alignment traps 2005-10-02 14:32:49 -07:00
arm [ARM] Fix Integrator IM/PD-1 support 2005-10-21 10:17:37 +01:00
arm26 [PATCH] Remove arch/arm26/boot/compressed/hw-bse.c 2005-09-17 11:49:59 -07:00
cris [NETFILTER]: Fix OOPSes on machines with discontiguous cpu numbering. 2005-10-13 14:41:23 -07:00
frv kbuild: frv,m32r,sparc64 introduce fake asm-offsets.h file 2005-09-09 22:47:53 +02:00
h8300 kbuild: h8300,m68knommu,sh,sh64 use generic asm-offsets.h support 2005-09-09 20:28:49 +02:00
i386 [PATCH] typo fix in last cpufreq powernow patch 2005-10-21 17:08:30 -07:00
ia64 [PATCH] swiotlb: make sure initial DMA allocations really are in DMA memory 2005-10-19 23:11:33 -07:00
m32r [PATCH] m32r: Fix smp.c for preempt kernel 2005-10-14 17:10:12 -07:00
m68k Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild 2005-09-09 15:46:49 -07:00
m68knommu [PATCH] m68knommu: startup code for the Drangen Engine 68328 based board 2005-09-12 20:04:15 -07:00
mips [PATCH] mips: fix build error in TANBAC TB0226 2005-10-14 17:10:11 -07:00
parisc [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
powerpc [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
ppc [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
ppc64 [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
s390 [PATCH] s390 signal annotations 2005-09-29 08:46:27 -07:00
sh [NETFILTER]: Fix OOPSes on machines with discontiguous cpu numbering. 2005-10-13 14:41:23 -07:00
sh64 kbuild: rename prepare to archprepare to fix dependency chain 2005-09-11 22:30:22 +02:00
sparc [SPARC32]: Revert IOMAP change eb98129eec 2005-10-10 21:02:26 -07:00
sparc64 [SPARC64]: Fix powering off on SMP. 2005-10-14 15:26:08 -07:00
um [PATCH] build fix for uml/amd64 2005-10-19 23:18:16 -07:00
v850 [PATCH] V850: C99 initializers for hw_interrupt_type structures 2005-09-10 10:06:27 -07:00
x86_64 [PATCH] x86_64: Allocate cpu local data for all possible CPUs 2005-10-10 16:33:25 -07:00
xtensa [PATCH] xtensa: remove io_remap_page_range and minor clean-ups 2005-09-22 22:17:37 -07:00