linux/arch/ppc64/kernel
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
..
vdso32 [PATCH] ppc64: Fix error in vDSO 32 bits date 2005-10-19 23:04:30 -07:00
vdso64 powerpc: Make some #includes explicit. 2005-10-10 14:14:55 +10:00
align.c [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
asm-offsets.c [PATCH] powerpc: Merge thread_info.h 2005-10-21 22:47:23 +10:00
bitops.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bpa_iic.c [PATCH] ppc64: fix IPI on bpa_iic 2005-09-09 22:11:34 +10:00
bpa_iic.h [PATCH] ppc64: Add driver for BPA interrupt controllers 2005-06-23 09:43:43 +10:00
bpa_iommu.c Merge from Linus' tree 2005-10-12 14:43:32 +10:00
bpa_iommu.h [PATCH] ppc64: Add driver for BPA iommu 2005-06-23 09:43:54 +10:00
bpa_nvram.c [PATCH] ppc64: add a minimal nvram driver 2005-06-23 09:43:31 +10:00
bpa_setup.c ppc64: Change ppc_md.get_cpuinfo to ppc_md.show_cpuinfo 2005-10-20 17:02:01 +10:00
btext.c ppc64: Rearrange btext initialization for consistency with ppc32 2005-10-22 15:36:52 +10:00
cpu_setup_power4.S [PATCH] merge some from Rusty's trivial patches 2005-09-10 10:06:30 -07:00
dma.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
eeh.c powerpc: Move iSeries_pci.c to powerpc/platform/iseries 2005-09-28 02:50:25 +10:00
entry.S powerpc: change sys32_ to compat_sys_ 2005-10-18 14:51:57 +10:00
firmware.c [PATCH] ppc64: make firmware_has_feature() stronger 2005-08-29 10:53:35 +10:00
head.S [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
hvconsole.c [PATCH] hvc_console: Separate the NUL character filtering from get_hvc_chars 2005-07-07 18:23:40 -07:00
hvcserver.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
i8259.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
idle.c powerpc: Merge machdep.h 2005-10-19 23:11:21 +10:00
ioctl32.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iomap.c Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/ppc64-2.6 2005-09-09 10:38:02 -07:00
iommu.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
irq.c Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/paulus/ppc64-2.6 2005-06-30 08:48:56 -07:00
kprobes.c Merge from Linus' tree 2005-10-12 14:43:32 +10:00
lparcfg.c [PATCH] ppc64: Allow world readable /proc/ppc64/lparcfg 2005-09-06 16:07:54 +10:00
machine_kexec.c [PATCH] ppc64: Add missing barrier() in kexec code 2005-09-28 07:46:41 -07:00
Makefile [PATCH] ppc64: remove arch/ppc64/kernel/setup.c 2005-10-27 20:20:42 +10:00
maple_pci.c ppc64: Add a `primary' argument to pci_process_bridge_OF_ranges 2005-10-22 15:03:21 +10:00
maple_setup.c powerpc: Merge machdep.h 2005-10-19 23:11:21 +10:00
maple_time.c powerpc/ppc/ppc64: Various compile fixes. 2005-10-20 21:10:09 +10:00
misc.S [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
module.c [PATCH] ppc64: Add R_PPC64_TOC16 module reloc 2005-10-11 09:46:54 -07:00
nvram.c [PATCH] ppc64: simplify nvram partition scanning code 2005-06-28 20:33:49 +10:00
pacaData.c [PATCH] ppc64: Add VMX save flag to VPA 2005-09-05 00:06:01 -07:00
pci_direct_iommu.c Merge from Linus' tree 2005-10-12 14:43:32 +10:00
pci_dn.c powerpc: Move iSeries_pci.c to powerpc/platform/iseries 2005-09-28 02:50:25 +10:00
pci_iommu.c powerpc: move iSeries/iSeries_pci.h to platforms/iseries 2005-10-14 14:51:42 +10:00
pci.c ppc64: Add a `primary' argument to pci_process_bridge_OF_ranges 2005-10-22 15:03:21 +10:00
ppc_ksyms.c powerpc: move more iSeries code 2005-09-28 13:28:01 +10:00
proc_ppc64.c [PATCH] ppc64: add BPA platform type 2005-06-23 09:43:37 +10:00
prom_init.c [PATCH] ppc64: Fix issue with non zero boot cpu 2005-09-21 10:11:54 -07:00
prom.c ppc64: Use the merged lmb routines 2005-10-10 20:49:07 +10:00
rtas_flash.c [PATCH] ppc64: trivial user annotations 2005-04-26 11:26:53 -07:00
rtas_pci.c ppc64: Add a `primary' argument to pci_process_bridge_OF_ranges 2005-10-22 15:03:21 +10:00
rtas-proc.c powerpc: Merge machdep.h 2005-10-19 23:11:21 +10:00
rtasd.c [PATCH] ppc64: replace schedule_timeout() with msleep_interruptible() 2005-09-05 00:06:01 -07:00
rtc.c powerpc: Merge machdep.h 2005-10-19 23:11:21 +10:00
scanlog.c [PATCH] ppc64: replace schedule_timeout() with msleep_interruptible() 2005-09-05 00:06:01 -07:00
semaphore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.c [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
smp-tbsync.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
smp.c ppc64/powerpc: Fix time initialization on SMP systems 2005-10-22 14:55:23 +10:00
spider-pic.c [PATCH] ppc64: Add driver for BPA interrupt controllers 2005-06-23 09:43:43 +10:00
sysfs.c [PATCH] ppc64: add number of PMCs to cputable 2005-09-06 16:09:20 +10:00
u3_iommu.c powerpc: Move iSeries_pci.c to powerpc/platform/iseries 2005-09-28 02:50:25 +10:00
udbg_16550.c [PATCH] ppc64: Remove old includes 2005-09-06 16:07:37 +10:00
udbg_scc.c [PATCH] ppc64: Remove old includes 2005-09-06 16:07:37 +10:00
udbg.c [PATCH] ppc64: iSeries early printk breakage 2005-09-09 22:11:34 +10:00
vdso.c [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
vmlinux.lds.S powerpc: Reduce the 32/64-bit diffs in vmlinux.lds.S 2005-10-10 22:38:46 +10:00
xics.c [PATCH] ppc64: xics cleanup 2005-09-12 17:19:12 +10:00