From patchwork Tue Nov 24 07:51:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: max X-Patchwork-Id: 547872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 99D961401F0 for ; Tue, 24 Nov 2015 18:51:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=e3Zt/yLn; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=vtGNdIbZ1R/dX+Vfq fgm2SqXGS9fT57Ubfs6CFzY6OAsZ35HXP7lHFiWRILTYT5pwjZf4mS1Bo3jc9ZuY SfQuBESf27p7CQnNzTfIY2nU5UCmGVVNimMUDVgt1YXGNoyaIugX8B3j4e09d1On hcOISHjYMXnvKp0fLdw8kNDKzA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=MlPYqlhtzso5gVENkUy+zdG zBOA=; b=e3Zt/yLnRkSNF2PyXk7Qf9zMi41+nRCsWQuFu5mtMSAv2bc1BhK7BrY Y2EaP4wlHtqITGtLFdjemTjl5KtN1hCF1rfmhkkEjPZfehW7AgLOhQZYFcZOrPl8 TF9F32FnWzLpW1i2hMocjLyjC5IpRUTzzTIH9+YgvVMInzlEkxfA= Received: (qmail 48746 invoked by alias); 24 Nov 2015 07:51:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 47894 invoked by uid 89); 24 Nov 2015 07:51:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mailout2.w1.samsung.com Received: from mailout2.w1.samsung.com (HELO mailout2.w1.samsung.com) (210.118.77.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 24 Nov 2015 07:51:16 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYB00CDW75CK030@mailout2.w1.samsung.com> for gcc-patches@gcc.gnu.org; Tue, 24 Nov 2015 07:51:12 +0000 (GMT) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id B0.CA.16778.FE614565; Tue, 24 Nov 2015 07:51:11 +0000 (GMT) Received: from [106.109.128.194] by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYB00GMG75AOT30@eusync3.samsung.com>; Tue, 24 Nov 2015 07:51:11 +0000 (GMT) Subject: Re: [PATCH 1/2] Libsanitizer merge from upstream r253555. To: Jakub Jelinek , Christophe Lyon References: <5652C3E0.4030000@partner.samsung.com> <5652C459.8090500@partner.samsung.com> <20151123080753.GS5675@tucnak.redhat.com> <565307B5.3000901@partner.samsung.com> <20151123124112.GA5675@tucnak.redhat.com> <565312DE.2020207@partner.samsung.com> <20151123132411.GB5675@tucnak.redhat.com> Cc: Kostya Serebryany , GCC Patches , Yury Gribov , Vyacheslav Barinov , Slava Garbuzov , Adhemerval Zanella From: Maxim Ostapenko Message-id: <565416E9.3080905@partner.samsung.com> Date: Tue, 24 Nov 2015 10:51:05 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-version: 1.0 In-reply-to: <20151123132411.GB5675@tucnak.redhat.com> Content-type: multipart/mixed; boundary=------------050006000109080004010509 X-IsSubscribed: yes On 23/11/15 16:24, Jakub Jelinek wrote: > On Mon, Nov 23, 2015 at 04:21:34PM +0300, Maxim Ostapenko wrote: >> Yeah, right. I've asked about kernel headers just to make sure I correctly >> understand the issue. >> >> Actually, I see such code in >> lib/sanitizer_common/sanitizer_platform_limits_posix.cc: >> >> #if defined(PTRACE_GETVFPREGS) && defined(PTRACE_SETVFPREGS) >> int ptrace_getvfpregs = PTRACE_GETVFPREGS; >> int ptrace_setvfpregs = PTRACE_SETVFPREGS; >> #else >> int ptrace_getvfpregs = -1; >> int ptrace_setvfpregs = -1; >> #endif >> >> and in ptrace interceptor: >> >> else if (request == ptrace_setvfpregs) >> COMMON_INTERCEPTOR_READ_RANGE(ctx, data, struct_user_vfpregs_struct_sz); >> else if (request == ptrace_getvfpregs) >> COMMON_INTERCEPTOR_WRITE_RANGE(ctx, data, struct_user_vfpregs_struct_sz) >> >> So, perhaps we can do the same thing with ARM_VFPREGS_SIZE, something like >> this? >> >> diff --git >> a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc >> b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc >> index 9866cc9..20ff224 100644 >> --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc >> +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc >> @@ -323,10 +323,14 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); >> unsigned struct_user_fpxregs_struct_sz = sizeof(struct >> user_fpxregs_struct); >> #endif // __x86_64 || __mips64 || __powerpc64__ || __aarch64__ || __arm__ >> #ifdef __arm__ >> +#if defined(ARM_VFPREGS_SIZE) >> unsigned struct_user_vfpregs_struct_sz = ARM_VFPREGS_SIZE; >> #else >> unsigned struct_user_vfpregs_struct_sz = 0; >> #endif >> +#else >> + unsigned struct_user_vfpregs_struct_sz = 0; >> +#endif > Maybe, but then it would need to be approved upstream. > If you just define ARM_VFPREGS_SIZE to 0 or whatever else in > the GCC owned wrapper headers, you can avoid that. > I guess talk to upstream. > > Jakub > Ok, I posted a fix to upstream (http://reviews.llvm.org/D14921) yesterday, but it's still not reviewed. So, I'm wondering if I should fix the issue locally? Attaching proposed fix following Jakub's suggestion. Christophe could you try the patch? diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index b97fc7d..c392c57 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,7 @@ +2015-11-24 Maxim Ostapenko + + * include/system/linux/asm/ptrace.h: New header. + 2015-11-23 Maxim Ostapenko * All source files: Merge from upstream r253555. diff --git a/libsanitizer/include/system/linux/asm/ptrace.h b/libsanitizer/include/system/linux/asm/ptrace.h new file mode 100644 index 0000000..dbdd58b --- /dev/null +++ b/libsanitizer/include/system/linux/asm/ptrace.h @@ -0,0 +1,8 @@ +#include_next +#if defined(__arm__) +#ifndef ARM_VFPREGS_SIZE +/* The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS + and core dumps. */ +#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ ) +#endif +#endif