android_kernel_xiaomi_sm8350/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
bpa_iic.c
bpa_iic.h
bpa_iommu.c Merge from Linus' tree 2005-10-12 14:43:32 +10:00
bpa_iommu.h
bpa_nvram.c
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
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
head.S [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
hvconsole.c
hvcserver.c
i8259.h
idle.c powerpc: Merge machdep.h 2005-10-19 23:11:21 +10:00
ioctl32.c
iomap.c
iommu.c [PATCH] gfp flags annotations - part 1 2005-10-08 15:00:57 -07:00
irq.c
kprobes.c Merge from Linus' tree 2005-10-12 14:43:32 +10:00
lparcfg.c
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
pacaData.c
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
prom_init.c
prom.c ppc64: Use the merged lmb routines 2005-10-10 20:49:07 +10:00
rtas_flash.c
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
rtc.c powerpc: Merge machdep.h 2005-10-19 23:11:21 +10:00
scanlog.c
semaphore.c
signal.c [PATCH] powerpc: Fix handling of fpscr on 64-bit 2005-10-27 20:48:50 +10:00
smp-tbsync.c
smp.c ppc64/powerpc: Fix time initialization on SMP systems 2005-10-22 14:55:23 +10:00
spider-pic.c
sysfs.c
u3_iommu.c powerpc: Move iSeries_pci.c to powerpc/platform/iseries 2005-09-28 02:50:25 +10:00
udbg_16550.c
udbg_scc.c
udbg.c
vdso.c
vmlinux.lds.S powerpc: Reduce the 32/64-bit diffs in vmlinux.lds.S 2005-10-10 22:38:46 +10:00
xics.c