Bug 27623 - powerpc: Missing registers in sc[v] clobbers list
Summary: powerpc: Missing registers in sc[v] clobbers list
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.33
: P2 normal
Target Milestone: 2.34
Assignee: Matheus Castanho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-22 13:23 UTC by Matheus Castanho
Modified: 2021-04-19 13:18 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc64*
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matheus Castanho 2021-03-22 13:23:48 UTC
The current clobbers list for syscalls using sc or scv in
sysdeps/unix/sysv/linux/powerpc/sysdep.h is not complete, as the kernel
zeroes XER register on exit and per the kernel documentation scv may also
clobber the condition register.

This is unlikely to be causing issues in the wild today, as the code has
been missing the XER clobber for years and I couldn't find any reported bugs
related to that. Also, the kernel currently restores the CR on exit, but
that could change in the future, as that is not mandated by the ABI for all
CR fields.
Comment 1 Matheus Castanho 2021-03-22 13:24:19 UTC
I'm preparing a patch and will post to libc-alpha shortly.
Comment 2 Matheus Castanho 2021-04-16 11:47:14 UTC
Fixed by 

commit 5d61fc2021922b4f572be218dad5b299e2939346
Author: Matheus Castanho <msc@linux.ibm.com>
Date:   Wed Mar 17 10:14:15 2021 -0300

    powerpc: Add missing registers to clobbers list for syscalls [BZ #27623]

https://sourceware.org/git/?p=glibc.git;a=commit;h=5d61fc2021922b4f572be218dad5b299e2939346