From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111348 invoked by alias); 4 Dec 2017 08:00:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 111216 invoked by uid 89); 4 Dec 2017 07:59:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,URIBL_DBL_ABUSE_SPAM autolearn=no version=3.3.2 spammy=restored, Hx-languages-length:1967 X-HELO: mx0a-001b2d01.pphosted.com Subject: Re: [PATCH] S390: Fix backtrace in vdso functions. To: libc-alpha@sourceware.org References: <6698d098-aea3-14cc-8ed7-762def848dc9@linaro.org> From: Stefan Liebler Date: Mon, 04 Dec 2017 08:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <6698d098-aea3-14cc-8ed7-762def848dc9@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17120407-0008-0000-0000-000004B307EB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17120407-0009-0000-0000-00001E45F665 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-04_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1712040117 X-SW-Source: 2017-12/txt/msg00064.txt.bz2 On 11/28/2017 02:09 PM, Adhemerval Zanella wrote: > > > On 28/11/2017 10:44, Stefan Liebler wrote: >> Hi, >> >> On s390, GDB fails to show the complete backtrace from within vdso functions. The macro INTERNAL_VSYSCALL_CALL saves the return address in r14 to r10 before branching to the vdso function. The branch-instruction updates r14 in order to let the vdso function return. Then the original address in r14 is restored from r10. Unfortunately, there are no cfi-rules and GDB fails. >> >> Furthermore the call of the vdso function does not comply with the s390 ABI as no stack-frame for the vdso-function is generated. >> >> This patch removes the s390 specific macro INTERNAL_VSYSCALL_CALL and the common implementation in sysdeps/unix/sysv/linux/sysdep-vdso.h is used. Then the vdso function is called via function-pointer and GCC generates a new stack-frame and emits all needed cfi-rules. >> >> The defines CLOBBER_[0-6] are removed as they  were only used in macro INTERNAL_VSYSCALL_CALL. >> >> The macro INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK is not used on s390. The only user is power. Thus it is removed from s390 sysdep.h. > > I am almost sure we can remove it for powerpc as well (I can't see > no immediate gain on doing a function call using inline assembly > as for INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK on powerpc). > > >> >> ChangeLog: >> >>     * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h >>     (INTERNAL_VSYSCALL_CALL, CLOBBER_0, CLOBBER_1, CLOBBER_2, >>      CLOBBER_3, CLOBBER_4, CLOBBER_5, CLOBBER_6, >>     INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Remove. >>     * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise. > > Reviewed-by: Adhemerval Zanella > If there are no objections regarding the s390 patch, I'll commit. Adhemerval: Do you keep working on removing INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK on powerpc? Bye. Stefan