From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47541 invoked by alias); 11 Feb 2020 08:43:00 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 47533 invoked by uid 89); 11 Feb 2020 08:42:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Feb 2020 08:42:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581410576; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=Z/ZqwE+pBCqD43ntnI+RwOxdgem2+Sxm35Lpf+yLzhs=; b=R9UsXRHrF3M3/i3jATtbYsJswoVao3wxsxaS8O2ddY1y96KInoX6kpLeHTTb8ZT/nXRgM2 lU9/sBAblkTgOrIV3V7//kl8DTlOLrDkykzC8xffnnYGGUS9gXrfEf+2uJVEjRRqlBuid4 WLv9DJcVB1bo5L9pRs9BKSoTI6LSAg4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-69-pZKBSSA7OdCFaVeiLCHkLw-1; Tue, 11 Feb 2020 03:42:54 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 974CC18A5505; Tue, 11 Feb 2020 08:42:53 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-116-66.ams2.redhat.com [10.36.116.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6232660BF1; Tue, 11 Feb 2020 08:42:53 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id ADC37A80CFA; Tue, 11 Feb 2020 09:42:51 +0100 (CET) Date: Tue, 11 Feb 2020 08:43:00 -0000 From: Corinna Vinschen To: Georg Sauthoff Cc: newlib@sourceware.org Subject: Re: [PATCH 0/1] Only pass the minimum number of syscall arguments (RISC-V) Message-ID: <20200211084251.GG4442@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: Georg Sauthoff , newlib@sourceware.org References: <20200210201958.352384-1-mail@gms.tf> MIME-Version: 1.0 In-Reply-To: <20200210201958.352384-1-mail@gms.tf> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="AGZzQgpsuUlWC1xT" Content-Disposition: inline X-SW-Source: 2020/txt/msg00083.txt --AGZzQgpsuUlWC1xT Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1778 On Feb 10 21:19, Georg Sauthoff wrote: > As is, the RISC-V syscall code unconditionally sets all possible syscall > arguments even if the syscall requires fewer. >=20 > For example, the instruction sequence for a exit syscall looked like > this: >=20 > li a0, 1 # in ther caller of exit() > # ... # in newlib: > li a1, 0 # unused arguments > li a2, 0 > li a3, 0 > li a4, 0 > li a5, 0 > li a7, 93 # exit syscall number >=20 > (i.e. the binary contains then 5 superfluous instructions for this > one argument syscall) >=20 > This patch changes the RISC-V syscall code such that only the required > syscall argument registers are set. >=20 > Georg Sauthoff (1): > Only pass the minimum number of syscall arguments >=20 > libgloss/riscv/internal_syscall.h | 41 ++++++++++++++++++++++--------- > libgloss/riscv/sys_access.c | 2 +- > libgloss/riscv/sys_close.c | 2 +- > libgloss/riscv/sys_exit.c | 2 +- > libgloss/riscv/sys_faccessat.c | 2 +- > libgloss/riscv/sys_fstat.c | 2 +- > libgloss/riscv/sys_fstatat.c | 2 +- > libgloss/riscv/sys_gettimeofday.c | 2 +- > libgloss/riscv/sys_link.c | 2 +- > libgloss/riscv/sys_lseek.c | 2 +- > libgloss/riscv/sys_lstat.c | 2 +- > libgloss/riscv/sys_open.c | 2 +- > libgloss/riscv/sys_openat.c | 2 +- > libgloss/riscv/sys_read.c | 2 +- > libgloss/riscv/sys_sbrk.c | 4 +-- > libgloss/riscv/sys_stat.c | 2 +- > libgloss/riscv/sys_unlink.c | 2 +- > libgloss/riscv/sys_write.c | 2 +- > 18 files changed, 48 insertions(+), 29 deletions(-) >=20 > --=20 > 2.24.1 Pushed. Thanks, Corinna --=20 Corinna Vinschen Cygwin Maintainer Red Hat --AGZzQgpsuUlWC1xT Content-Type: application/pgp-signature; name="signature.asc" Content-length: 833 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl5CaQsACgkQ9TYGna5E T6AZxA//WMNb+yNmYRBRdmZrNp9ztzFWnaOlErskiuzpkgPoQKLKvXUX/GWrymrS f52e8oqH1IhqMrs8fIpfget36Jzfy64JFRhPLTPcUSKpJJOZKyzCiCrsnxbFC6z3 8YgfDMF0ExXvSBd93CSlIW9wY5BxuEqbDis8puRYcw5VNdtVctc1OWM7YXA5TiXl 9pPFGPsZ9BYJcMDxP9psihTuYc6Bcrgm1WEdy/1IXv12GSx4L4RwSh/Y4C5x+2h7 59eVy8mpw5x1aghYvTXudiEtxfyJBF3IO8e6woZC2sIcWqaR3WPJXhByZa7XUOOi XCrc4gQU/2RPEH7vFoQncojQw3vV62N1j3TuoNUEpZVBmKLudiWezRB56gsOdfmc YquxN9GCXhD5vABshTRI4RAi120cQuEDkZBdfybuL/wlwrLmApj0qm1eGFEJpTXd H91CoJHx1LlfejypoeDLsowRk+3WkkpWbPvY3/yp7qAFQ4HFmVyL+/F3o9zJwlpT cejPV6sjPdUyIr5tCG7j44qxgLRiXkklgUxGtALlKufhmUI6VoGWn6nbaZR5+37X Hp98mTll7dWTHikqstOVTQzeRlO/ayEh1VDglMf1UlTNbI6Q3/nlVIVjS1eq9ZfJ x9w5arSzo2rgt3oIgBzYh9T2Bxm2F/ShiP23/C+TDMzzH1//sYM= =XHUP -----END PGP SIGNATURE----- --AGZzQgpsuUlWC1xT--