RE: [RFC PATCH v4] MIPS: fix build with binutils 2.24.51+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Manuel,

Sorry for taking a while to respond to you, from a toolchain perspective
I think this patch is looking good with one extra change as below. I'll
leave the kernel guys to comment further.

Manuel Lauss <manuel.lauss@xxxxxxxxx> writes:
> diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S
> index 8352523..f21c046 100644
> --- a/arch/mips/kernel/r4k_fpu.S
> +++ b/arch/mips/kernel/r4k_fpu.S
> @@ -33,10 +34,14 @@
>  	.set	arch=r4000
> 
>  LEAF(_save_fp_context)
> +	.set	push
> +	SET_HARDFLOAT
>  	cfc1	t1, fcr31
> +	.set	pop
> 
>  #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
>  	.set	push
> +	SET_HARDFLOAT
>  #ifdef CONFIG_CPU_MIPS32_R2
>  	.set	mips64r2

I know you haven't modified the lines with .set mips64r2 on them but
they are not strictly correct.
Instead of mips64r2 (which is dangerous to put in 32-bit code for a
variety of reasons unless absolutely critical)... this should be:

.set mips32r2
.set fp=64

There should be no need to protect this change based on assembler version
as I believe .set fp=... support predates .set mips64r2. This change
protects the kernel source from failing to build depending on how future
toolchains are configured and it would be ideal to include in this patch
to keep all these tweaks in one place.

For the record the issue is that .set mips64r2 is getting used with the
O32 ABI which is OK albeit weird. Under some circumstances the use of
.set mips64r2 will result in implicitly setting fp=64 which is required
for the SDC1 instructions which follow, however it will not always set
fp=64. Markos has a set of tools which are configured such that .set
mips64r2 used with an O32 ABI will not switch to 64-bit FP registers
which is the reason he has seen a problem which you can't reproduce.

> @@ -150,6 +161,7 @@ LEAF(_restore_fp_context)
> 
>  #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
>  	.set	push
> +	SET_HARDFLOAT
>  #ifdef CONFIG_CPU_MIPS32_R2
>  	.set	mips64r2

Likewise.

Thanks,
Matthew





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux