Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3703338imm; Mon, 18 Jun 2018 02:37:11 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLPIPFCMkXERH7nW0v0tth2nye+oS42mElIhMOT41k8jnrf+NUiM3BPM1MexFTuBLhxJqEv X-Received: by 2002:a62:211a:: with SMTP id h26-v6mr12677166pfh.133.1529314631755; Mon, 18 Jun 2018 02:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529314631; cv=none; d=google.com; s=arc-20160816; b=pEFmxhdS1tAolvaVht9iLiJdegRAm7YspY9Cyx2+CZepuCRakbpNN82OEw0uhSQMVD fVMoF1FdJmRbSDdnUQz9ulrPFRHRo09XW/xWRjXEp2HgjH6tc3EhEln18l+XLufSfFm5 x/BVziq1Qh1gPL7e4kMNj08dZF+xYiYyZinwCmAolbH+HYi8z7PUE/1dExqQ+IzXbNao +mX8SeLG9j+xjx9urzdgM7arV3QfLCPJn/N24plF99prc4iKbc5L3Bk8HX/qC+V7xBhZ xwNYE+d7ko8sR6CiFq7zNkrUJfGP6bVkWeD5HhMSdJIza6SNmefiqg6sX6JgDS4nGNhR M6Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1u3vrnDZ4+GkLBZ0oaXv6M7EK8mWVycAc0a6VB7d1wI=; b=Vhu9skUVC2phGmicixg5ShX98WYbY539CdyiUOcAflyZGVw+gPNv2Cv5RjnfSSMI6Z q2UDVtxoWx+pJjAxXvX1ndRwfVEQptvWCH3rG6Pyw/G1LmS4vqQt3v59XUrwisD4SRs+ qqSIHyeyD5r2sJS7O+NuoS2aI/o5oDyafDd58TpXTGqUhJw5L6dp697/uuWxHFOAkwbY Al7SBEKdeRUmqx5HdYagJWM07c9flwKOg64PIeQR28JuXJinuECOh3didzX4s9H5c7ag kRZ/LbB1ysn2L2Su0kqIgE8hHJsOiCx188DPPUMLtn0gqMZuxFoN9v0wRQ1OOS51MNwB 65tA== 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 s72-v6si13897397pfa.367.2018.06.18.02.36.58; Mon, 18 Jun 2018 02:37:11 -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; 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 S936000AbeFRIYD (ORCPT + 99 others); Mon, 18 Jun 2018 04:24:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55922 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935974AbeFRIX7 (ORCPT ); Mon, 18 Jun 2018 04:23:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 693DAC5C; Mon, 18 Jun 2018 08:23:58 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , "Naveen N. Rao" , Sasha Levin Subject: [PATCH 4.16 188/279] powerpc/trace/syscalls: Update syscall name matching logic Date: Mon, 18 Jun 2018 10:12:53 +0200 Message-Id: <20180618080616.710967415@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Naveen N. Rao" [ Upstream commit 0b7758aaf6543b9a10c8671db559e9d374a3fd95 ] On powerpc64 ABIv1, we are enabling syscall tracing for only ~20 syscalls. This is due to commit e145242ea0df6 ("syscalls/core, syscalls/x86: Clean up syscall stub naming convention") which has changed the syscall entry wrapper prefix from "SyS" to "__se_sys". Update the logic for ABIv1 to not just skip the initial dot, but also the "__se_sys" prefix. Fixes: commit e145242ea0df6 ("syscalls/core, syscalls/x86: Clean up syscall stub naming convention") Reported-by: Michael Ellerman Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/ftrace.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) --- a/arch/powerpc/include/asm/ftrace.h +++ b/arch/powerpc/include/asm/ftrace.h @@ -73,13 +73,9 @@ struct dyn_arch_ftrace { #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME static inline bool arch_syscall_match_sym_name(const char *sym, const char *name) { - /* - * Compare the symbol name with the system call name. Skip the .sys or .SyS - * prefix from the symbol name and the sys prefix from the system call name and - * just match the rest. This is only needed on ppc64 since symbol names on - * 32bit do not start with a period so the generic function will work. - */ - return !strcmp(sym + 4, name + 3); + /* We need to skip past the initial dot, and the __se_sys alias */ + return !strcmp(sym + 1, name) || + (!strncmp(sym, ".__se_sys", 9) && !strcmp(sym + 6, name)); } #endif #endif /* CONFIG_FTRACE_SYSCALLS && !__ASSEMBLY__ */