From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 741191F45E for ; Tue, 11 Feb 2020 13:31:58 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=r5uCkOiFGlhPYOMt /D0KKDFY2GA0gGtW7VAZKB11WDAU9TqH8P/y/nUxUhiyR9ZpbbiLtpgTiQNLp2VI zlh2KhzUPrWr4yWruaUBeox4SbQgSMbLP5yYV4dY1RjwXrFKkxJBCTMnUDzj3aWO ApDuYro4CMhigbD+S18qSPvvWhI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=hjNdSMYGBzvdGzeVhTKhDh cYkfQ=; b=brPc7PgX0ZrhS6cLVANgXN6cLxfOGRG25/KKrFFpIZ+wK5yzZyCfw+ WcK1GfqnsaQfdDqxqiAsDRmv5cZi6JDdR/YgevVv9MGam7V9O0+lY2BuiuGANNcA xfH/prBEMd4z2X4ssxZVjpupjVsa38w59SRWTpUmdF2s8Trsi9Z1c= Received: (qmail 40671 invoked by alias); 11 Feb 2020 13:31:56 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 40663 invoked by uid 89); 11 Feb 2020 13:31:55 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qk1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hsnVhlvGF/BJC9eYWxRaePxXiC4xMigJVzieDBxxUow=; b=KlZYhBkXqvtNPPCdhlVaa9oqVVYjGyWwrtoQZtAmtBWnqUgkZ/7uNOvCThWG6+WKAm TePb7niPOLXXt74Z8zom8eFrf+j7pL3u3cNaYNKMJzI6zkCLUvG5vZ/mpgs3Am03YM9l P/ILurNNbI8JQfhJd1aoDArBUZJcXS6oayWTbUtOcaeVlCYaHeUSSpedM4qnUgq8DoHp nhDRaWp6ZzUxdw6tKFim2F39FtqDYnLVbUMIGuXsaZ2gmp61yE0VrLfRqK8FurSZAYSl qAQSNwpwn9BHY5nBV1LvqzlNgnngTv/ty4Wc5cvG/sRsjI+KNR3Jb8aRU5x+5juLe04n DJzw== Subject: Re: [PATCH 02/15] powerpc: Use Linux kABI for syscall return To: Florian Weimer Cc: libc-alpha@sourceware.org References: <20200210192038.23588-1-adhemerval.zanella@linaro.org> <20200210192038.23588-2-adhemerval.zanella@linaro.org> <874kvxpe2x.fsf@oldenburg2.str.redhat.com> <871rr1nw3r.fsf@oldenburg2.str.redhat.com> From: Adhemerval Zanella Message-ID: <81646234-6f39-bde0-ace5-482d87dabe0d@linaro.org> Date: Tue, 11 Feb 2020 10:31:49 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <871rr1nw3r.fsf@oldenburg2.str.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 11/02/2020 09:31, Florian Weimer wrote: > * Adhemerval Zanella: > >> On 11/02/2020 08:18, Florian Weimer wrote: >>> * Adhemerval Zanella: >>> >>>> diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/sysdep.h >>>> index 01c26be24b..abdcfd4a63 100644 >>>> --- a/sysdeps/unix/sysv/linux/powerpc/sysdep.h >>>> +++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.h >>>> @@ -60,9 +60,8 @@ >>>> : "+r" (r0), "+r" (r3), "+r" (r4), "+r" (r5), "+r" (r6), \ >>>> "+r" (r7), "+r" (r8) \ >>>> : : "r9", "r10", "r11", "r12", "cr0", "ctr", "lr", "memory"); \ >>>> - err = (long int) r0; \ >>>> __asm__ __volatile__ ("" : "=r" (rval) : "r" (r3)); \ >>>> - rval; \ >>>> + (long int) r0 & (1 << 28) ? -rval : rval; \ >>>> }) >>>> >>>> #define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ >>>> @@ -110,21 +109,20 @@ >>>> : ASM_INPUT_##nr \ >>>> : "r9", "r10", "r11", "r12", \ >>>> "cr0", "ctr", "memory"); \ >>>> - err = r0; \ >>>> - r3; \ >>>> + r0 & (1 << 28) ? -r3 : r3; \ >>>> }) >>>> #define INTERNAL_SYSCALL(name, err, nr, args...) \ >>>> INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, args) >>>> >>>> #undef INTERNAL_SYSCALL_DECL >>>> -#define INTERNAL_SYSCALL_DECL(err) long int err __attribute__ ((unused)) >>>> +#define INTERNAL_SYSCALL_DECL(err) do { } while (0) >>>> >>>> #undef INTERNAL_SYSCALL_ERROR_P >>>> #define INTERNAL_SYSCALL_ERROR_P(val, err) \ >>>> - ((void) (val), __builtin_expect ((err) & (1 << 28), 0)) >>>> + ((unsigned long) (val) >= (unsigned long) -4095) >>>> >>>> #undef INTERNAL_SYSCALL_ERRNO >>>> -#define INTERNAL_SYSCALL_ERRNO(val, err) (val) >>>> +#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) >>>> >>>> #if defined(__PPC64__) || defined(__powerpc64__) >>>> # define SYSCALL_ARG_SIZE 8 >>> >>> What's the baseline for this patch? >> >> To simplify the Linux syscall handling on all architectures by using the >> already set kABI interface (where returns values from >> 0xfffffffffffff000 to 0xffffffffffffffff indicates an error). The idea >> is initially to consolidate the INLINE_SYSCALL macro and remove the >> INTERNAL_SYSCALL_DECL macro. >> >> This refactoring is an initial one, my long-term goal is twofold: >> >> 1. Remove the assembly macros to define syscall and only use the >> C interface. It simplifies ports, requires less hackery to handle >> all its subtitles in C generations (static/pic/etc), and most likely >> would play nice on a possible LTO build. >> >> 2. Rework the syscall interfaces to use static inline instead of >> macros. It will avoid the argument handling that led to the >> subtle BZ#25523 bug and it defines a proper kABI interface. > > I meant that the patch doesn't seem to be against master. Hum I just rebase against master (eb948facd8) and it does apply. Why do you think it does not seem to be apply against master? > > I don't have the object 01c26be24b locally. > > Thanks, > Florian >