Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3594540imu; Mon, 10 Dec 2018 04:57:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xt3yCuCXKM2D4unFDgKTMUpiGayOWt0gEAGF7m2Nz36DC/3pYkpWD4A7ImrxmdX4f/seyX X-Received: by 2002:a17:902:e20b:: with SMTP id ce11mr11623556plb.251.1544446651478; Mon, 10 Dec 2018 04:57:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544446651; cv=none; d=google.com; s=arc-20160816; b=hx0nrY//SIcJrreRJvetg3o4dc12DgaoUJZuJSC+sD/AtJt6knNz7DLR7dAMwDlnLV 7Evj8AcjRgs6khmnsy48OilGWxTm+6UIuz/Z0WjryMzUdXc+9Ss0JlaYKncBCeo+ssAO FwkJqttioYrmh1tRVbv8Xvqo7TBPt7Gq91OXqvMaS5f1npCi3OgBVFcaoBRzPdhkshQ3 v1UwMqWJkJnre//rwMS8nygECkwcwrstdGcdZ6B4mLEmW9LKZBtmRhwxR6XyDbAIN0Ja V0jVyGLUluRaFk3xCHZpgruac4+s/DZU95b+cNycvxsCRndkTkGFQz+3UcBqCOBN2Bqy 3Vbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ohCeomezwtMRYZAABNjBxQp9n+98Hce0dGd73OJBCL4=; b=r9qcA8flScLh/L5h/GS/LYMqBEY9ERa7ZY/Z/kbNdwX/tk6Gf9P9vi4USDhxBMAMGE +4XbSCewyp2Qz0JRUO340n5R+m5WPfQ5Yo9e7Ov7tsVSU/N+/Ugh/CZCdUMnsAkcYLHE IWvLQ+Q3lrhs2kxB9wBNZZPpObtuRBwg5CO6r8TJtV0ad+Dto58NJG+iFXqlTpqPI+hh FTnwOSbFiLizsfFGU5aCUMtSRkuXnSbOI6QGCG2e7AX5NHanXTtxpdm/VQMlQZ4iGZs8 qNN/46hMYjgYZuEZRm9ce4VcJjH/3Dt5JMWIg7w4sZ8U788gbsFyIJKfqfiR2R2Ata2K nfjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si10364289pfb.152.2018.12.10.04.57.16; Mon, 10 Dec 2018 04:57:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727137AbeLJMxS (ORCPT + 99 others); Mon, 10 Dec 2018 07:53:18 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:50630 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbeLJMxS (ORCPT ); Mon, 10 Dec 2018 07:53:18 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 1809472CC66; Mon, 10 Dec 2018 15:53:16 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 082A17CF1D0; Mon, 10 Dec 2018 15:53:15 +0300 (MSK) Date: Mon, 10 Dec 2018 15:53:15 +0300 From: "Dmitry V. Levin" To: Max Filippov Cc: oleg@redhat.com, Andrew Lutomirski , lineprinter@altlinux.org, esyr@redhat.com, Chris Zankel , Paul Moore , eparis@redhat.com, linux-xtensa@linux-xtensa.org, linux-audit@redhat.com, LKML Subject: Re: [PATCH v5 19/25] xtensa: define syscall_get_* functions Message-ID: <20181210125315.GB11942@altlinux.org> References: <20181210042352.GA6092@altlinux.org> <20181210043041.GS6131@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Sun, Dec 09, 2018 at 09:02:50PM -0800, Max Filippov wrote: > Hello, >=20 > On Sun, Dec 9, 2018 at 8:30 PM Dmitry V. Levin wrote: > > syscall_get_* functions are required to be implemented on all > > architectures in order to extend the generic ptrace API with > > PTRACE_GET_SYSCALL_INFO request. > > > > This adds all 5 syscall_get_* functions on xtensa as documented > > in asm-generic/syscall.h: syscall_get_nr, syscall_get_arguments, > > syscall_get_error, syscall_get_return_value, and syscall_get_arch. >=20 > I have this set of functions plus syscall_set_arguments implemented > for syscall tracing here: > https://github.com/jcmvbkbc/linux-xtensa/commit/0023f56298cc92ce47e61b1= b5dd1038f7be4f826 Good, but we also need syscall_get_arch for PTRACE_GET_SYSCALL_INFO. > How should we synchronize our changes? No problem, I can revert to the previous edition of this patch that just adds syscall_get_arch. Alternatively, you can just take that couple of patches (v5 18/25 and v2 15/15) into your tree. > > diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/as= m/syscall.h > > index 3673ff1f1bc5..d529c855a144 100644 > > --- a/arch/xtensa/include/asm/syscall.h > > +++ b/arch/xtensa/include/asm/syscall.h >=20 > [...] >=20 > > +static inline void > > +syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, > > + unsigned int i, unsigned int n, unsigned long *ar= gs) > > +{ > > + switch (i) { > > + case 0: > > + if (!n--) > > + break; > > + *args++ =3D regs->areg[6]; > > + /* fall through */ > > + case 1: > > + if (!n--) > > + break; > > + *args++ =3D regs->areg[3]; > > + /* fall through */ > > + case 2: > > + if (!n--) > > + break; > > + *args++ =3D regs->areg[4]; > > + /* fall through */ > > + case 3: > > + if (!n--) > > + break; > > + *args++ =3D regs->areg[5]; > > + /* fall through */ > > + case 4: > > + if (!n--) > > + break; > > + *args++ =3D regs->areg[8]; > > + /* fall through */ > > + case 5: > > + if (!n--) > > + break; > > + *args++ =3D regs->areg[9]; > > + /* fall through */ > > + case 6: > > + if (!n--) > > + break; > > + /* fall through */ > > + default: > > + BUG(); >=20 > A WARN should be enough. This is what most of other architectures do in syscall_get_arguments, but I agree that a WARN_ON_ONCE should be enough. --=20 ldv --ZfOjI3PrQbgiZnxM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJcDmG7AAoJEAVFT+BVnCUIhGIP/32iKpH8RLMA1WrbXALNOCuh wcxCW0Mzb/aRijNYBqQyOhTeAwcBPWp/+aRgqLsFCRWU7iyDsyD1qUv2hFYemAi1 EqfeOV4DJZLAIlz2ROH8rdaKQQs6L3HPbWDxNsRAk5jgmN/r8nv4+6POW9UQRkOI oFwdUq5YzP3X/tZsG6+rprhQZrGZOr5DHPgz/2C5k3o/TKJdjufbapP149Peaj0W ctY4SreEn5uLTWidJ731ICJDD9qx2zTIOYfUXuMscgDbR4wKzzmIotDorw96txYM JUlQAfNiAUNqbpUfXvlq55Lbz2/rYOaYEuysgSuVpoWmHk1FvE747gKGH8R66d+I ou+oifi9d3B6GF7CidVuNRL62QA+Aa65kA5Wuc0Evmcr6oALd6csL3cnPZQbpnGn ZVPtuRiBO1qVzhCKXJwP0/sTAFaklpI0/HCQmw2xR50QpB/RvACMGX70nLeOKPgb CCw3eomqe4u+ZwrTMfPIjygWhZpbkU/9+5jCkr0LTajco4Wrv8mh4TTCQuSxzVah UKaiwCPKOx9FQbwc9U8it7oOCdIgZhjobEva3H7EO/7s4zz5ZjMFuOV7na2rNsup 7xs/eCWSfg3E747YMgxAmLjg3/2hK8qX7No0YiOzniJasAeLuBnrEQD+UM4I8qVk JTd5EE/RQ6VRdbbyJitp =ILNw -----END PGP SIGNATURE----- --ZfOjI3PrQbgiZnxM--