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.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,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 3B7911F619 for ; Thu, 27 Feb 2020 18:24:42 +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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; q=dns; s=default; b=H5IS AIDutveKSJL1IqoGpWbjdPOZ/XdgPDw2ABWokQDp/8ock+aEV9cofKGnC/PYgZhg SKrpOWCSRwvVxezFm4JO8zJYaVU8VzmrUCzTzNLdYeLP5LUojUOI0/x1uLEPd8/s 4S/Q6PRHzakb9PKjiulA+SCt51Q3y3Fycjhs4mw= 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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; s=default; bh=XejBzD9c0b ntx0PeQZNeTsSf26I=; b=QPnu8k6E4HMdFgz+m0LI9Iz/lzidr53PCwYBXio3yc DWI5ledoB1AzRJfuUHx9Q25rx6EFSRDfPuCS+976bLXdglQQDn9xR0FZ0dxbSVJy NOKDK1xzJVFrrW0gspLU6X37KWhvumGM8DlLemTBSxga1AHDS0e/YjJHbjZ3mzpc M= Received: (qmail 4097 invoked by alias); 27 Feb 2020 18:24:35 -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 3981 invoked by uid 89); 27 Feb 2020 18:24:21 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-io1-f67.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=A/pP/08xyw4kkuXDPDcoOUBf5fovWryOyHE78I0KLDk=; b=Llv6woJqme3uldv9bA3RkYPZPZwyJTfsOj2qx8J4k5oI5cgNwOd8vuZq22TM000Ud+ VMBqpw0BA5lGukOyLH5G+IwFCNH1X0qYeYfeZ2XQKRX33RfXNO+WUfLspd4c2D/LQYJy mx83ryTsVbH6WWG6rkjlufgJH2DvowuLvkhNMRvwnJK846GaJ+qspa+UDPrUBub7PR0t uRqnPe0OZ4UJPlhRL3B4esnKAB3Kz/OiAmUPtA7gVex6WzuiKs9P7gdZAi5w2LI7axYn Lhm9GsU79XnH/cTi0KwjESgCZ3K07csIEZoo6sSSMHE6aUfMXeyaiyh4g5Dnoh//rsKi pmRw== MIME-Version: 1.0 References: <20200209185729.15896-1-git@xen0n.name> In-Reply-To: From: Matt Turner Date: Thu, 27 Feb 2020 10:23:52 -0800 Message-ID: Subject: Re: [PATCH] mips: Fix argument passing for inlined syscalls on Linux [BZ #25523] To: "Maciej W. Rozycki" Cc: WANG Xuerui , GNU C Library Content-Type: text/plain; charset="UTF-8" On Sat, Feb 22, 2020 at 2:40 PM Maciej W. Rozycki wrote: > > On Mon, 10 Feb 2020, WANG Xuerui wrote: > > > According to [gcc documentation][1], temporary variables must be used for > > the desired content to not be call-clobbered. > > Why does it specifically matter here? > > > diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h > > index beefcf284b..c275d63f67 100644 > > --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h > > +++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h > [...] > > @@ -202,11 +203,13 @@ union __mips_syscall_return > > long _sys_result; \ > > \ > > { \ > > + long _arg1 = (long) (arg1); \ > > + long _arg2 = (long) (arg2); \ > > register long __s0 asm ("$16") __attribute__ ((unused)) \ > > = (number); \ > > register long __v0 asm ("$2"); \ > > - register long __a0 asm ("$4") = (long) (arg1); \ > > - register long __a1 asm ("$5") = (long) (arg2); \ > > + register long __a0 asm ("$4") = _arg1; \ > > + register long __a1 asm ("$5") = _arg2; \ > > register long __a3 asm ("$7"); \ > > __asm__ volatile ( \ > > ".set\tnoreorder\n\t" \ > > Can e.g. `(long) (arg1)' end up as a library call? Do you have a case, > even potential, where such clobbering actually happens? We found that GNU make 4.3 fails to work on MIPS without this patch to glibc. See https://bugs.gentoo.org/708758