From patchwork Tue Apr 11 04:28:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 749331 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w2Dd32b78z9sNQ for ; Tue, 11 Apr 2017 14:30:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YQuijLRr"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3w2Dd31HXLzDq7h for ; Tue, 11 Apr 2017 14:30:47 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YQuijLRr"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3w2DbB38SNzDq5x for ; Tue, 11 Apr 2017 14:29:10 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YQuijLRr"; dkim-atps=neutral Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by bilbo.ozlabs.org (Postfix) with ESMTP id 3w2DbB21C0z8swW for ; Tue, 11 Apr 2017 14:29:10 +1000 (AEST) Received: by ozlabs.org (Postfix) id 3w2DbB1kp4z9sNS; Tue, 11 Apr 2017 14:29:10 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3w2Db921pWz9sN6 for ; Tue, 11 Apr 2017 14:29:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YQuijLRr"; dkim-atps=neutral Received: by mail-pg0-x244.google.com with SMTP id o123so28206200pga.1 for ; Mon, 10 Apr 2017 21:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=zVrtfz78eFwgn8SX7Rxff/20RJqP/Y5eelc7QiY3Ut8=; b=YQuijLRrgyyVtBBPcozOZuKOUoNgw5WdjlxNS412aM9v6Yl4TeBl+ySG7qsBJzfJMa +aRZ7NeewPLeZ2aGdyGREuMsKfQDqBvKX3PsGmNuEGgl/hC9rP91xXUu1vwC86+6khdK e8Wn/CIlEb5kCs0/LYUEFGOzEIsl4yu6wro7eI6O9lX0miuMiZkzYznfi22Y6J24mDMR ukBPEF3hL0LzR8NmxjUNwIWMVATSxf8JAn/2ps3EX3psq125FFs1tCve6vcD9wPUmj98 XeIUEAT7LOXEUec77m5TsyKEDarbdDcbG6hFF40zJbAsecdKTOIOLEC1sXl9IgMt0xCl O8CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zVrtfz78eFwgn8SX7Rxff/20RJqP/Y5eelc7QiY3Ut8=; b=FlyHkcUpZh+vOIYx5uAGC+Li7eszejTS3q3fA2rtof8Nrg7Tc/og88A1mbwpalDuJH 9MQwsVrRPHbxdR6qkFNEuYC7889IkK9kSsbhtbd4K+VlTGijOof9ZziFUSHfD21sWxP1 SaQ5/vctTKs3upYu2QOGmeyMpLkSdZEyoWkiW9kBv3FX1URz/I2V2c4BGULjQN4bclLU Xj6IUdXORSNL+C6rXYCW7T+uFUo2is0asi60M9HtgLcgxumBhAwSno7cVOljLphaKLpC ojv/b/ZvWjomb0hxsaIzy8EY27LMQtRwTv/Y0i364ybK4gxAzxm8nbWzqTJPAr7F7Zbj J0qg== X-Gm-Message-State: AN3rC/67pSRpilotdXL9QYHD7JCIeKtbyltf69ixlmEpSv0okFew4I6NE7v/mwtQ4/nK+g== X-Received: by 10.98.72.144 with SMTP id q16mr5436699pfi.152.1491884946971; Mon, 10 Apr 2017 21:29:06 -0700 (PDT) Received: from firefly.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id u64sm27308765pfk.113.2017.04.10.21.29.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 21:29:05 -0700 (PDT) From: Balbir Singh To: mpe@ellerman.id.au, linuxppc-dev@ozlabs.org Subject: [RFC][PATCH] powerpc/syscalls/trace: Fix mmap in syscalls_trace Date: Tue, 11 Apr 2017 14:28:37 +1000 Message-Id: <20170411042837.17292-1-bsingharora@gmail.com> X-Mailer: git-send-email 2.9.3 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch uses SYSCALL_DEFINE6 for sys_mmap and sys_mmap2 so that the meta-data associated with these syscalls is visible to the syscall tracer. In the absence of this generic syscalls (defined outside arch) like munmap,etc. are visible in available_events, syscall_enter_mmap and syscall_exit_mmap is not. A side-effect of this change is that the return type has changed from unsigned long to long. Signed-off-by: Balbir Singh --- arch/powerpc/include/asm/syscalls.h | 4 ++-- arch/powerpc/kernel/syscalls.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/include/asm/syscalls.h b/arch/powerpc/include/asm/syscalls.h index 23be8f1..16fab68 100644 --- a/arch/powerpc/include/asm/syscalls.h +++ b/arch/powerpc/include/asm/syscalls.h @@ -8,10 +8,10 @@ struct rtas_args; -asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len, +asmlinkage long sys_mmap(unsigned long addr, size_t len, unsigned long prot, unsigned long flags, unsigned long fd, off_t offset); -asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len, +asmlinkage long sys_mmap2(unsigned long addr, size_t len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff); asmlinkage long ppc64_personality(unsigned long personality); diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c index de04c9f..10b7fe9d 100644 --- a/arch/powerpc/kernel/syscalls.c +++ b/arch/powerpc/kernel/syscalls.c @@ -42,11 +42,11 @@ #include #include -static inline unsigned long do_mmap2(unsigned long addr, size_t len, +static inline long do_mmap2(unsigned long addr, size_t len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long off, int shift) { - unsigned long ret = -EINVAL; + long ret = -EINVAL; if (!arch_validate_prot(prot)) goto out; @@ -62,16 +62,16 @@ static inline unsigned long do_mmap2(unsigned long addr, size_t len, return ret; } -unsigned long sys_mmap2(unsigned long addr, size_t len, - unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long pgoff) +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, + unsigned long, prot, unsigned long, flags, + unsigned long, fd, unsigned long, pgoff) { return do_mmap2(addr, len, prot, flags, fd, pgoff, PAGE_SHIFT-12); } -unsigned long sys_mmap(unsigned long addr, size_t len, - unsigned long prot, unsigned long flags, - unsigned long fd, off_t offset) +SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len, + unsigned long, prot, unsigned long, flags, + unsigned long, fd, off_t, offset) { return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT); }