diff mbox series

linux: sparc: Fix clone for LEON/sparcv8 (BZ 31394)

Message ID 20240902195854.1455369-1-adhemerval.zanella@linaro.org
State Accepted
Commit 5e8cfc5d625e6dd000a0371d21d792836ea7951a
Headers show
Series linux: sparc: Fix clone for LEON/sparcv8 (BZ 31394) | expand

Commit Message

Adhemerval Zanella Sept. 2, 2024, 7:58 p.m. UTC
The sparc clone mitigation (faeaa3bc9f76030) added the use of
flushw, which is not support by LEON/sparcv8.  As discussed in
the libc-alpha, 'ta 3' is a working alternative [1].

[1] https://sourceware.org/pipermail/libc-alpha/2024-August/158905.html

Checked with a build for sparcv8-linux-gnu targetting leon.
---
 sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 4 ++++
 1 file changed, 4 insertions(+)

Comments

John Paul Adrian Glaubitz Sept. 26, 2024, 6:09 p.m. UTC | #1
On Mon, 2024-09-02 at 16:58 -0300, Adhemerval Zanella wrote:
> The sparc clone mitigation (faeaa3bc9f76030) added the use of
> flushw, which is not support by LEON/sparcv8.  As discussed in
                       ^^^^^^^
                       supported

> the libc-alpha, 'ta 3' is a working alternative [1].
  ^^^^^^^^^^^^^^
"on libc-alpha" instead of "in the libc-alpha"

> [1] https://sourceware.org/pipermail/libc-alpha/2024-August/158905.html
> 
> Checked with a build for sparcv8-linux-gnu targetting leon.
> ---
>  sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
> index c9cf9bb055..c84244f56b 100644
> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
> @@ -29,7 +29,11 @@
>  ENTRY (__clone)
>  	save	%sp,-96,%sp
>  	save	%sp,-96,%sp
> +#ifdef __sparcv9
>  	flushw
> +#else
> +	ta 3
> +#endif
>  	restore
>  	cfi_def_cfa_register(%fp)
>  	cfi_window_save

Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Thanks,
Adrian
Florian Weimer Sept. 29, 2024, 5:06 a.m. UTC | #2
* John Paul Adrian Glaubitz:

> On Mon, 2024-09-02 at 16:58 -0300, Adhemerval Zanella wrote:
>> The sparc clone mitigation (faeaa3bc9f76030) added the use of
>> flushw, which is not support by LEON/sparcv8.  As discussed in
>                        ^^^^^^^
>                        supported
>
>> the libc-alpha, 'ta 3' is a working alternative [1].
>   ^^^^^^^^^^^^^^
> "on libc-alpha" instead of "in the libc-alpha"
>
>> [1] https://sourceware.org/pipermail/libc-alpha/2024-August/158905.html
>> 
>> Checked with a build for sparcv8-linux-gnu targetting leon.
>> ---
>>  sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
>> index c9cf9bb055..c84244f56b 100644
>> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
>> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
>> @@ -29,7 +29,11 @@
>>  ENTRY (__clone)
>>  	save	%sp,-96,%sp
>>  	save	%sp,-96,%sp
>> +#ifdef __sparcv9
>>  	flushw
>> +#else
>> +	ta 3
>> +#endif
>>  	restore
>>  	cfi_def_cfa_register(%fp)
>>  	cfi_window_save
>
> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Adhemerval, could we please move forward with this?  This issue obscures
another LEON failure?

Thanks,
Florian
Adhemerval Zanella Oct. 1, 2024, 1:37 p.m. UTC | #3
On 29/09/24 02:06, Florian Weimer wrote:
> * John Paul Adrian Glaubitz:
> 
>> On Mon, 2024-09-02 at 16:58 -0300, Adhemerval Zanella wrote:
>>> The sparc clone mitigation (faeaa3bc9f76030) added the use of
>>> flushw, which is not support by LEON/sparcv8.  As discussed in
>>                        ^^^^^^^
>>                        supported
>>
>>> the libc-alpha, 'ta 3' is a working alternative [1].
>>   ^^^^^^^^^^^^^^
>> "on libc-alpha" instead of "in the libc-alpha"
>>
>>> [1] https://sourceware.org/pipermail/libc-alpha/2024-August/158905.html
>>>
>>> Checked with a build for sparcv8-linux-gnu targetting leon.
>>> ---
>>>  sysdeps/unix/sysv/linux/sparc/sparc32/clone.S | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
>>> index c9cf9bb055..c84244f56b 100644
>>> --- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
>>> +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
>>> @@ -29,7 +29,11 @@
>>>  ENTRY (__clone)
>>>  	save	%sp,-96,%sp
>>>  	save	%sp,-96,%sp
>>> +#ifdef __sparcv9
>>>  	flushw
>>> +#else
>>> +	ta 3
>>> +#endif
>>>  	restore
>>>  	cfi_def_cfa_register(%fp)
>>>  	cfi_window_save
>>
>> Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> 
> Adhemerval, could we please move forward with this?  This issue obscures
> another LEON failure?

I will install this patch.  I do not know about current LEON status.
diff mbox series

Patch

diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
index c9cf9bb055..c84244f56b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/clone.S
@@ -29,7 +29,11 @@ 
 ENTRY (__clone)
 	save	%sp,-96,%sp
 	save	%sp,-96,%sp
+#ifdef __sparcv9
 	flushw
+#else
+	ta 3
+#endif
 	restore
 	cfi_def_cfa_register(%fp)
 	cfi_window_save