Received: by 10.213.65.68 with SMTP id h4csp1660961imn; Mon, 26 Mar 2018 11:57:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELu++1xBlS9vGDFm2UEW0USnIkEbtUSspNDUJ+Tav01xZl1uNdHDF+3oes5FPR8yZhkrQkkj X-Received: by 10.98.155.137 with SMTP id e9mr24575780pfk.109.1522090667696; Mon, 26 Mar 2018 11:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522090667; cv=none; d=google.com; s=arc-20160816; b=lZDfy6I4934EFBzy948XZ4/HtW0DOKyRixvBdyGYCmQRW4Aqen2//hLFF6KEDt/NGq ThvOmfAImPMy6X2ckafTmNKC5AhgXIp+cGv/Rmw6f5znjL2lwUxZWj9Ofy8d3G5r+dQJ wQPMmmDm3lgB2iGKtZL1/0pqVk479MGzDv9tFXStBxqTx8/IRS/ilDbF2876YB2ygn7H MSqhfVXWjYTeuh1wq2LktaIs8sCDAI8gjAfPFoQTrOagJwIE1q5SVZsMvkeUHAxM+/LS HbWV0R3mKq07J2WkFbp72AkIwZsf3Sx0Sq6m03dVIBwQmwllmOe+VDweK1N/2KhK0w8Y PUIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=YYUUyJUamPDeoNZvyUo7c6qhvAerQdimT9lBrs7QGsA=; b=CVyGh4wbSP+R/puR7MzMk+Qwf4iXyyms2f75Lb85GmsmHG27ZfWlrUIc6Trk7a2BSq uAum3YqjH9vjhgmqu8XQTur2lPzBO8pqq+Z5a6SJ/KkyX2fNgEoBIz9hvxQyHS08XLMt 4YTY56jaq8QqtsfD8oiSu9Q389jQPK6BRZ5QhcpLqmgLknWPdwdLydXDO/KpMJO18yAt +K0cqm69LLznNQ58U97t609uuCJ/lzYODmqdCuTUb7S7OoJwX13ONz5KeEPJ8oxT90wL Sy4OWiYffeOgTHzHUUJ83a3vrnepIWVhKCbPy5WvYSPhz2AuSPEWLRDCVPh78i82s+ye hnnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rvHfqrtS; 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 s64si2671764pfi.75.2018.03.26.11.57.31; Mon, 26 Mar 2018 11:57:47 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=rvHfqrtS; 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 S1752644AbeCZS4f (ORCPT + 99 others); Mon, 26 Mar 2018 14:56:35 -0400 Received: from mail-oi0-f66.google.com ([209.85.218.66]:43529 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbeCZS4d (ORCPT ); Mon, 26 Mar 2018 14:56:33 -0400 Received: by mail-oi0-f66.google.com with SMTP id u84-v6so7770054oie.10 for ; Mon, 26 Mar 2018 11:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=YYUUyJUamPDeoNZvyUo7c6qhvAerQdimT9lBrs7QGsA=; b=rvHfqrtSQRKaNcM1yB99In0nMxPUBqniFv/7uiyhB5yfbL+JmwnRKm6BIvBrrYLzxH wGFrsHMgVlqtlTchkE9TnOzvTRbzL6Zq7XTXGiZAtLxbse4NBLH2cXMcD6/lsLPBvK/Q l+uC5a5EjPJPzEuJqm0NwEdlD93kzxa6fuyQfLDhQWab1nBAEBHcRA5S+HSztQw6gMEv bpPtjsg0dGsFEHO7wcWIab+NwXzfkHkR38Exkht+Fl5SAzZTy89qEyLRdKXjrFcgsV85 idfOMqJ5/gHFcNZ6+RF6LYBqfB8Q29BCg3TRB9Hxa3Wy7R5rJ/8eDDQ0XSFDUkrEXh9A Dd0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=YYUUyJUamPDeoNZvyUo7c6qhvAerQdimT9lBrs7QGsA=; b=naMdME5u2kTHQbgqMR+rAMxEu9KhSZhMounIPY7ut2tNOSdS7UaRKJxNip3MOy/fYt V3LteB6AZ0HRQ80nJAogqAQw7h31xBDtQ8dcPKqY2lHs4zR74xpme7pDxelmeGYzGJrM LmukC7iFfIzWVe/6ODPUZDA92vTlGXbsTPFV7Qzl0VBilZahVqbroWWfN9G5D0zSFfL6 G792dh1cVhLiNBSoQsc3KlNWhi7WMSARscX8qbFDBWVnyUHNJofy5kbnzUXLbcQx6wYI f7/5M9RCvpYai7MPOnp7KHN+473Tn+o5oVp1I5rlsCm4dsmLOA4GlNqbUgr93XyqFbRm iugg== X-Gm-Message-State: AElRT7ElEMd6+9CDqlm6cKkNRUpvh8JaHHDhJHZGrIMY+29XTgiLB/Oz FoYBNcoJwobitv/FFhvbBXztjoCyEfouosYCbeE= X-Received: by 10.202.166.143 with SMTP id t15mr23874953oij.48.1522090593035; Mon, 26 Mar 2018 11:56:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.138.3.76 with HTTP; Mon, 26 Mar 2018 11:56:12 -0700 (PDT) In-Reply-To: <878tb2etva.fsf@concordia.ellerman.id.au> References: <20180225172236.29650-1-malat@debian.org> <20180225172236.29650-18-malat@debian.org> <87muzoglga.fsf@concordia.ellerman.id.au> <878tb2etva.fsf@concordia.ellerman.id.au> From: Mathieu Malaterre Date: Mon, 26 Mar 2018 20:56:12 +0200 X-Google-Sender-Auth: DmXUiLH4I65AZZAGjg-QUhVX60A Message-ID: Subject: Re: [PATCH 17/21] powerpc: Add missing prototype for sys_debug_setcontext To: Michael Ellerman Cc: Benjamin Herrenschmidt , Paul Mackerras , Jiri Slaby , linuxppc-dev , LKML , Al Viro Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Michael, On Thu, Mar 8, 2018 at 11:36 AM, Michael Ellerman wrot= e: > Mathieu Malaterre writes: > >> On Sun, Mar 4, 2018 at 11:54 AM, Michael Ellerman w= rote: >>> Mathieu Malaterre writes: >>> >>>> In commit 81e7009ea46c ("powerpc: merge ppc signal.c and ppc64 signal3= 2.c") >>>> the function sys_debug_setcontext was added without a prototype. >>>> >>>> Fix compilation warning (treated as error in W=3D1): >>>> >>>> CC arch/powerpc/kernel/signal_32.o >>>> arch/powerpc/kernel/signal_32.c:1227:5: error: no previous prototype f= or =E2=80=98sys_debug_setcontext=E2=80=99 [-Werror=3Dmissing-prototypes] >>>> int sys_debug_setcontext(struct ucontext __user *ctx, >>>> ^~~~~~~~~~~~~~~~~~~~ >>>> cc1: all warnings being treated as errors >>> >>> This one should actually be using the SYSCALL_DEFINE syntax, so that it >>> can be used with CONFIG_FTRACE_SYSCALLS. >>> >>> See eg. our mmap: >>> >>> SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len, >>> unsigned long, prot, unsigned long, flags, >>> unsigned long, fd, off_t, offset) >>> { >>> return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT)= ; >>> } >>> >>> >>> We probably still need this patch, but I'm not entirely sure because th= e >>> SYSCALL_DEFINE macro does all sorts of shenanigans. >> >> I see. Could you please drop this patch then. The patch does not look >> that trivial anymore. I'll need to dig a bit more on how to do the >> syscall stuff with a 7 params function. > > Ergh, yuck, seems we're the first suckers to need do that. > > I think I'll take this patch for now, it's still good for now at least, > and then the SYSCALL_DEFINE stuff can be an addition. Just to close the loop (for later reference). Here is what Al Viro told me about this function [begin quote] int sys_debug_setcontext(struct ucontext __user *ctx, int ndbg, struct sig_dbg_op __user *dbg, int r6, int r7, int r8, struct pt_regs *regs) can't be converted to SYSCALL_DEFINE... not because it's a 7-argument syscall (it isn't); the problem is that the last argument here does *not* come from userland. What it really is trying to be is 3-argument syscall: SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, int, ndbg, struct sig_dbg_op __user *, dbg) with no dummy r6/r7/r8. The thing is, ppc dispatcher combines the "pass 6 arguments" and "pass pt_regs *" by passing both. debug_setcontext(), swapcontext(), sigreturn() and rt_sigreturn() are, AFAICS, the only ppc syscalls that make use of that argument. All of those are relying upon regs =3D=3D current_pt_regs() =3D=3D current->thread= .regs, [...] But in any case, these are not 7-argument syscalls - debug_setcontext(2) and swapcontext(2) are 3-argument and sigreturn()/rt_sigreturn() have no arguments at all. [end quote] Sorry about the wrong analysis in the number of arguments count. I believe commit 0d60619e1c0ca (powerpc/next) should be just fine for now. 2cts