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 3C42E1F45E for ; Wed, 12 Feb 2020 12:56:20 +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:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=AwIPj6svbchEOryC jzhPaJnLyYjY7pfBBC472WuHiVV8RMD+xc7wNddw0xDxc9kCLn4lElpFXXZ9lavE 1uAlqZlI6xL6S84VylceWStfUp4nktNPbozzsug3gJiQRAoukR3nL7kPm7exUyvn o0qUlJoUnns2jltJDbnX/LzI3tQ= 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:to:cc:references:from:subject:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=DINvPLRJaE9Ex0rRy7QGvo mJ/20=; b=cGCGuz1BdNF1jPiv4Ezxr/T7a+N+lkVdsbkRnAWNcByGrWRWjxowq1 qjd7UW8+9y94rK3Aw260cOlRmpYUH4rfrJyIpXkgIWIVYXs7LJNhmPYhuW47J0Kr bS4rRFxBQCb/xbf9i2gtOUv3hhuUu1+1tkX44HXbvUqL0OtoGVcgM= Received: (qmail 83680 invoked by alias); 12 Feb 2020 12:56:17 -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 83672 invoked by uid 89); 12 Feb 2020 12:56:17 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qt1-f196.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=to:cc:references:from:autocrypt:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Fc7W5lmt/rGPLZ7mRMrnVXDZ7OM6bVB6GIWEcDh4Lts=; b=XdMIuF/B1q59g1EIMw8LHWr7e/hW8n8GVSg2cfEQz1BU9Z3+VGbsbCSsfqS5s4adwF 1UjCF0ge6ysWAn6YAgyjTJBV6+0fCLnOk6sUcFdJIgQp7pcGqT6BRNeFJAUPEyN9T5Vf c1b2sackhlXuo0ghW2I5plSS5A7L+AyUDASgRvHJDMiatflMVZ0giNMy5gokzcVqXNja aS2G5nqd7vKaJPTH1zl1AYkyIOiUkxVJ9I+dvS5saDCb/J8U5DzP+eCdeNhuDbC5iZ2C fVlq92zkK2kZta0MgUj5lkMGrBDILi0rRPla+dMw+7IVv5Bn6gQC8drBB4ScJIrQi/yt qaqQ== To: Florian Weimer Cc: libc-alpha@sourceware.org References: <20200210192038.23588-1-adhemerval.zanella@linaro.org> <20200210192038.23588-3-adhemerval.zanella@linaro.org> <878sl9pe78.fsf@oldenburg2.str.redhat.com> <10c5636d-6ea7-e95c-3a3c-67be298472fd@linaro.org> <874kvxnczu.fsf@mid.deneb.enyo.de> <87tv3wltbb.fsf@mid.deneb.enyo.de> <7b15c63a-8379-d549-1a31-83803a365c5e@linaro.org> <87mu9onfoo.fsf@mid.deneb.enyo.de> From: Adhemerval Zanella Subject: Re: [PATCH 03/15] sparc: Use Linux kABI for syscall return Message-ID: <8fbc5667-cf0e-e029-3665-d0a6087e30ab@linaro.org> Date: Wed, 12 Feb 2020 09:56:07 -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: <87mu9onfoo.fsf@mid.deneb.enyo.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 12/02/2020 09:38, Florian Weimer wrote: > * Adhemerval Zanella: > >> This code seems to come from since initial git repository >> (Linux-2.6.12-rc2). >> >> From a glibc standpoint, the error handling will be the same in fact, >> since what indicates the syscall has failed is the carry condition code >> value, not the syscall returned value ('o0' register). > > The kernel will not set the carry condition code for large errors due > to the faulty check. I think before your changes, we would not treat > these cases as errors because the carry condition is not set and we > check the separate err value. After your changes, the carry condition > code is still not set, but the return value looks like an error return > value if unchanged, so we now treat these leaked error codes as > errors. No, the sparc 'ret_sys_call' returns abs(errno) for syscall failure, not the value in the range of the expected Linux failure values. So, if kernel returns a value large than ERESTART_RESTARTBLOCK *without* set the carry condition code set current syscall code results in: o0 = abs (errno) g1 = 0 And then the variable defined by INTERNAL_SYSCALL_DECL holds '0' and INTERNAL_SYSCALL_ERROR_P evaluates to false. With this change: o0 = abs (errno) And INTERNAL_SYSCALL_ERROR_P, which now uses the expected Linux kABI, will evaluate to 0 as well. > > But I don't think this should block your changes. >