Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3229853imu; Sun, 9 Dec 2018 21:05:02 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vfu+isLuiFFPYG2s+ozrP4tC8qww0PV+GgAZK2K6+NqrvLdUqSgM1oPjN/1V7ErbSrluM0 X-Received: by 2002:a63:fa46:: with SMTP id g6mr9734688pgk.18.1544418302316; Sun, 09 Dec 2018 21:05:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544418302; cv=none; d=google.com; s=arc-20160816; b=QRRAPwU+kwqJ0czgm2q/iZiwMskwQkn7kUuZdozHlKgA8XbED0lF0gLTjfXDsIakZj 2DDVxBTAsVkpVT0qNOqq1cHNJZhfq93HYhOjUuepu14HF+HVxZKovnma611DiGSs3Vzv srB/tT9YgYX/xZf3GaAB5HCKpQ1w5XQr7dh/s/LCeEdFDS+LCMRp7cDz5+389HPSlxVK P+ClK7v0xZuEf50HPen8UEhoDIdkK4gYVJgf3wixABpK1LCgq3KHtz+KQlfvuWuJ9ucK bZxgUVtIF3A/dLTYEAuO8PhtMM8IGerUr4i6zEP9VsrB943XjeKZ8Q7lavgoRug1djfb vJ+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gokXEaayarhxMI6caXM2jwP/JGu2CK/TKpDjM3H/tco=; b=BR7JBcm8uT+0b8CJ+VFvGuYX8seLtWMJw+j9Utd71iNuDsxwbIQmJLvTywE/NDcZ62 T5+yJzVKRXm6VEF1+vHCmAPLxcMcEO4O6H9WPig+wtUm42k8CfnOHfL6KjI6uNZaExyV myFBQbcPCO91fJcPuP5Y3nReLSgdzD/IVotTCgATaV2bECcB1R0e/fyBfT3YPANJMER7 EUcdpARmyQqCBAmSNELcu/Ic6lJlc78+QLmRbKb9ChmRfVbeWOh0gRHDWFYGy/voW0fo weuFWCFbQkYYmZbhGCj+21tFvnFa3h4Bx/m7X1pUsOXbFM587tvjTvQCee+gqULzsyMM J1/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LvAbAhOV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si9364225pld.92.2018.12.09.21.04.46; Sun, 09 Dec 2018 21:05:02 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LvAbAhOV; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726473AbeLJFDD (ORCPT + 99 others); Mon, 10 Dec 2018 00:03:03 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:34292 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726303AbeLJFDD (ORCPT ); Mon, 10 Dec 2018 00:03:03 -0500 Received: by mail-yw1-f68.google.com with SMTP id g75so3471761ywb.1 for ; Sun, 09 Dec 2018 21:03:02 -0800 (PST) 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=gokXEaayarhxMI6caXM2jwP/JGu2CK/TKpDjM3H/tco=; b=LvAbAhOV8bCeoBpUUXP2l+i9cpKf1QSjoxoK3HIz6KAqGW1ybLTd74gICJLXFM+RTY QpDpHhe0A+n6nWoKKITa16a52L0/KDMxqWQ6VIigIXLwNYc0SsCTquFq22HKTQ1whoyF Itr+7BZxj3Ap9BRkfCsJJYaiDcMs9e5u4dTITn2En+mh/YSLLQuoYevtGtNiYKyvKFBk VbBwSRSppu1wdOvl8u5CcFxJpoc5hOwHgqGSKmGhseqZ4oF2fcyFl7d/OWOfVjEBEnRi PbdxeQ09WJ4OWe0y9faBkaw2fma/e2qAe40zJNRrI5RZFW64jn5fQZ3uDlBG7YWZ61Z/ /8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gokXEaayarhxMI6caXM2jwP/JGu2CK/TKpDjM3H/tco=; b=bD2AEKp+QsRuBwxSLJHodhaJ8PWxyGFl610K2C0/Uh6pB+Ad4k57A9QvMruYPmG+ev ehbvsZikUp+4l64tfwK9PfujDBoT8jAFZKaipaTzXTYhrr6sgiIyUsoP/SoVIbnUawGI KxEROBUvLxdPZcXJmdBAtZWI87wefYc8G3TK1KkKRGrKZowEV8AgAItP89+tGCZ4nsTO QnXvNPn7rvQV8l+mVZEIkxF9ik0N6gMPnDI/VLESIaXGo3Q7dGe/xny9iU/6augGF0XO aCUJhnugLY1Sunn8r+f/ZgQ+dQfzxIhd0IliMHBRmxFgTH18/0MIcpW7RO6ZuF9bEs/Z a36A== X-Gm-Message-State: AA+aEWY/D9DJwFltbj25oUMU889gT9zofIdahFafoV+8pNHcoTDHYXF8 xbJ2G6hX2mrxTdGoXqUyJQZODavn7fp1l7YDtDY= X-Received: by 2002:a81:3217:: with SMTP id y23mr10894223ywy.275.1544418182075; Sun, 09 Dec 2018 21:03:02 -0800 (PST) MIME-Version: 1.0 References: <20181210042352.GA6092@altlinux.org> <20181210043041.GS6131@altlinux.org> In-Reply-To: <20181210043041.GS6131@altlinux.org> From: Max Filippov Date: Sun, 9 Dec 2018 21:02:50 -0800 Message-ID: Subject: Re: [PATCH v5 19/25] xtensa: define syscall_get_* functions To: ldv@altlinux.org 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, 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. I have this set of functions plus syscall_set_arguments implemented for syscall tracing here: https://github.com/jcmvbkbc/linux-xtensa/commit/0023f56298cc92ce47e61b1b5dd1038f7be4f826 How should we synchronize our changes? > diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h > index 3673ff1f1bc5..d529c855a144 100644 > --- a/arch/xtensa/include/asm/syscall.h > +++ b/arch/xtensa/include/asm/syscall.h [...] > +static inline void > +syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, > + unsigned int i, unsigned int n, unsigned long *args) > +{ > + switch (i) { > + case 0: > + if (!n--) > + break; > + *args++ = regs->areg[6]; > + /* fall through */ > + case 1: > + if (!n--) > + break; > + *args++ = regs->areg[3]; > + /* fall through */ > + case 2: > + if (!n--) > + break; > + *args++ = regs->areg[4]; > + /* fall through */ > + case 3: > + if (!n--) > + break; > + *args++ = regs->areg[5]; > + /* fall through */ > + case 4: > + if (!n--) > + break; > + *args++ = regs->areg[8]; > + /* fall through */ > + case 5: > + if (!n--) > + break; > + *args++ = regs->areg[9]; > + /* fall through */ > + case 6: > + if (!n--) > + break; > + /* fall through */ > + default: > + BUG(); A WARN should be enough. -- Thanks. -- Max