Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp227786imu; Tue, 27 Nov 2018 11:27:37 -0800 (PST) X-Google-Smtp-Source: AJdET5cy5MWww6hfRNauKBT6d/f1V53qrQ/01cB+UkDM2X95sTn7ZKud08euF16SkQFqds6+qEu8 X-Received: by 2002:a62:c21c:: with SMTP id l28mr33897547pfg.74.1543346857455; Tue, 27 Nov 2018 11:27:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543346857; cv=none; d=google.com; s=arc-20160816; b=EgLNQlo2VtOXU9DO76gr3gi/sqH7B7T5gkGN73iap7CvnHz2o63bk26VXNO8YOi+jp VTIx684QJFJ5A56nRv2eR7mwi7kRyW6+cUq7fCnCV3OmeGsu65zYgPF25hbL8zVdVyaw oP+CxgUChhzkExMTqcggNgCIcSY6EzH47Ceu1+l9Y9FGNaqhXq5TLAYfuuDvCa/RUDmj C7xVYkt6pbZ4AwyF+rTUsCYF/dDOEghvB6G+5Wvj3Kw2GhgaT2oIvAEXjhJGP+1sADrb wG4g4D0q7qk2/1Hx+nONy4P3pFz+0zmtbMvZk99EXg4fUPOTgCj2Po4ht5t2vAw/TXlV yXoA== 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:mime-version :user-agent:references:in-reply-to:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=xrBunFGuQg7ejpjv7jMcC94n+woMpzdBgikom3/sxNg=; b=a8ip5Kc4iAgoifzAUw7U3LikHgV9n8c7013CwKHgAZ/gngdaAeIu+0C0oWFHIsV3cu jq9Uo8aDfYe63fEMUtj5l1BN8l/mBVO1ci4UlSp6hNGRY69OEKLoxttheWaIiBJmPCnl iEHaTfdrP/kho88KSsx/lWK6SUD8Nt/QQwS7xzvfi4OF4dXIlm4AkaMjPl3/idY6rf+t /X6tta3GKwe7EISIop/mN33YtWk6yWyG9V7N+GQm3EWD4JhgUXKHIhVxZJYUaXpBqO4z 1XmQql/rwH1pS3JnUvW89eMRUfaZ70JhzK7Fx7tqfEqt/EaQM/4grg3k8WB3LzqpvTKS 5Y0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q2j6WMyP; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si4603927pgm.420.2018.11.27.11.27.22; Tue, 27 Nov 2018 11:27:37 -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=@kernel.org header.s=default header.b=Q2j6WMyP; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731172AbeK1D2f (ORCPT + 99 others); Tue, 27 Nov 2018 22:28:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:52166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731160AbeK1D2f (ORCPT ); Tue, 27 Nov 2018 22:28:35 -0500 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 485402086B; Tue, 27 Nov 2018 16:30:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543336208; bh=5pIDoNeCp+J91aQi1o2Eg311Dc06d02HsfLnNhAisuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References:From; b=Q2j6WMyP03KHw7MhR8QUIvsbPTz7PokVRFRtSrJmgVwylUygBph3eDt6S8VqQYxf6 S9N9B8WXcMHIsgBtTAIkRbY+6bVNM9S+FUUdkBrE8Vu+M7I0iHLqXT/1EQ+p3tGpsi /s/RLkXj5HC9kIM/K2zSuWJmUXkJTwCNHgkrAWJg= From: Masami Hiramatsu To: Steven Rostedt , Catalin Marinas Cc: Naresh Kamboju , Will Deacon , Mark Rutland , Ingo Molnar , Masami Hiramatsu , Masami Hiramatsu , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64 Date: Wed, 28 Nov 2018 01:29:45 +0900 Message-Id: <154333618522.27355.8094935453351562295.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 4378a7d4be30 ("arm64: implement syscall wrappers") introduced "__arm64_" prefix to all syscall wrapper symbols in sys_call_table, syscall tracer can not find corresponding metadata from syscall name. In the result, we have no syscall ftrace events on arm64 kernel, and some bpf testcases are failed on arm64. To fix this issue, this introduces custom arch_syscall_match_sym_name() which skips first 8 bytes when comparing the syscall and symbol names. Fixes: 4378a7d4be30 ("arm64: implement syscall wrappers") Reported-by: Naresh Kamboju Signed-off-by: Masami Hiramatsu Cc: stable@vger.kernel.org --- arch/arm64/include/asm/ftrace.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/include/asm/ftrace.h b/arch/arm64/include/asm/ftrace.h index caa955f10e19..a710f79db442 100644 --- a/arch/arm64/include/asm/ftrace.h +++ b/arch/arm64/include/asm/ftrace.h @@ -56,6 +56,15 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) { return is_compat_task(); } + +#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME + +static inline bool arch_syscall_match_sym_name(const char *sym, + const char *name) +{ + /* Since all syscall functions have __arm64_ prefix, we must skip it */ + return !strcmp(sym + 8, name); +} #endif /* ifndef __ASSEMBLY__ */ #endif /* __ASM_FTRACE_H */