[PATCH] microblaze: fix __syscall_cancel_arch

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Fri Oct 17 13:02:52 GMT 2025



On 17/10/25 09:29, Frager, Neal wrote:
> [AMD Official Use Only - AMD Internal Distribution Only]
> 
>> The __syscall_cancel_arch function has an epilogue that does not match
>> the prologue. The stack is not used and the return address still lies in
>> r15 when reaching the epilogue. Fix the epilogue by simply returning
>> from the function.
>>
>> Signed-off-by: Luc Michel <luc.michel@amd.com>
> 
>> LGTM.  How did you tested? I tried to come up with an simulated microblaze
>> environment, but there is no official qemu support (only qemu-user).
> 
> I believe the easiest solution is to use Buildroot for verifying this patch,
> as a qemu is included for microblaze.
> 
> To test with Buildroot, you can take the master branch:
> git clone https://gitlab.com/buildroot.org/buildroot.git
> 
> Then add this patch to the package/glibc directory, so that it gets applied
> to the glibc build.
> 
> Next modify the configs/qemu_microblazeel_mmu_defconfig file to
> add the following config:
> BR2_GCC_VERSION_15_X=y
> 
> Then to build:
> make qemu_microblazeel_mmu_defconfig
> make
> 
> Then to run:
> qemu-system-microblazeel -M petalogix-s3adsp1800 -kernel output/images/linux.bin -serial stdio

It worked, thanks.

>> ---
>>
>> Hi,
>> This bug was introduced by 89b53077d2a58f00e7debdfe58afabe953dac60d
>> (BZ#12683).
>>
>> https://sourceware.org/bugzilla/show_bug.cgi?id=12683 suggests that the
>> author copied coded generated by GCC. This is probably why the epilogue
>> was wrong.
>>
>> I have yet to create a Bugzilla entry for this. I just requested an
>> accound and waiting for it.
>>
>> Thanks
>>
>> Luc
>>
>> ---
>>  sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S b/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S
>> index 38150e6a94..3e8dc96a93 100644
>> --- a/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S
>> +++ b/sysdeps/unix/sysv/linux/microblaze/syscall_cancel.S
>> @@ -48,13 +48,12 @@ __syscall_cancel_arch_start:
>>
>>       .globl __syscall_cancel_arch_end
>>  __syscall_cancel_arch_end:
>>
>>       nop
>> -     lwi     r15,r1,0
>>       rtsd    r15,8
>> -     addik   r1,r1,28
>> +     nop
>>
>>  1:
>>       brlid   r15, __syscall_do_cancel
>>       nop
>>
> 
> Reviewed-by: Neal Frager <neal.frager@amd.com>
> 
> Best regards,
> Neal Frager
> AMD
> 



More information about the Libc-alpha mailing list