Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp62140imu; Tue, 27 Nov 2018 09:03:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WHuYXnvpTW23nhdkRZgrv15JbXYQNfSk37t4r58Tnan3b28Pz6OhPfwhwDAjGG9qvxL005 X-Received: by 2002:a62:1112:: with SMTP id z18mr13591805pfi.173.1543338211308; Tue, 27 Nov 2018 09:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543338211; cv=none; d=google.com; s=arc-20160816; b=ZxY128U0ekuAuRXjmMlUm0fcMYum67up3AWBTp4K1hUKCQvaNmIKqTrDN0d+lGBdQ8 hcmvb+Ga9uwQLDris6F43JDY3SvOxIAG5wIbwgPM5xVsIRY2LH42PzGu3KSc/CKYCSwv Ge9h8qXC6NAosB6B+BQ4wO1N+dJYVv3GRGL7DpLcnKjEFxw3oVJFAk9jEJp85YRXkjIE SVGqZZXBNQArwgBOCPSDXGThzzbVx9Qp9jsqzwNWoZCFtvhtiypl0s0aU7fqJC30Phos p1W4+S4XIrR6xDmqjkglbB2qfy98Bu8OlCLkasX9+H8EYKe7/y5JPAvYNuIgWK0FmrlE RiaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yHDovBiKgkY4aXbxkLVVg1j+cnyrUraTUpH7nQCUrP4=; b=ElGTL8/o2pEocOLv1wZKQVWkh/jV98N0iTAlThBxijnUNP70d6KNdE2XUg3o0Ri18h BDE/zHialijf1sCxAy3FqZZYbMAUI1VGREi48CTXmtmdSjKr98RVpoBQgFI1hlbCQSsN 2R2n4Ldphu4BWKfO2oJnpDgr2u/cwD6U2tK+Yb7IsBFq7+PNZcdZOWZGqjL74F/a1NaJ gylf+1Y+pdv2CZGEQdRGhU9PUGw6dOJuKgYCxGDdy/XwDFOkFd+iKFHLH9bjxFQ2xiPL wHE3ZVUO1cxke+pWqvBZocxRijNHBRDnV/6hJYOMz1XEKDZrGOGWTNR3zG+RmC6/5HkK CUmQ== 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 r1-v6si4454007plb.153.2018.11.27.09.02.46; Tue, 27 Nov 2018 09:03:31 -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; 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 S1731941AbeK1D5D (ORCPT + 99 others); Tue, 27 Nov 2018 22:57:03 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42480 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730260AbeK1D5C (ORCPT ); Tue, 27 Nov 2018 22:57:02 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 75A5D32E5; Tue, 27 Nov 2018 08:58:31 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 44C343F59C; Tue, 27 Nov 2018 08:58:31 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 1BA1F1AE0A0D; Tue, 27 Nov 2018 16:58:49 +0000 (GMT) Date: Tue, 27 Nov 2018 16:58:49 +0000 From: Will Deacon To: Masami Hiramatsu Cc: Steven Rostedt , Catalin Marinas , Naresh Kamboju , Mark Rutland , Ingo Molnar , Masami Hiramatsu , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] arm64: ftrace: Fix to enable syscall events on arm64 Message-ID: <20181127165848.GA19569@arm.com> References: <154333618522.27355.8094935453351562295.stgit@devbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <154333618522.27355.8094935453351562295.stgit@devbox> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masami, On Wed, Nov 28, 2018 at 01:29:45AM +0900, Masami Hiramatsu wrote: > 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); > +} This looks fine to me, but I'm curious about whether this is supposed to work with compat syscalls as well, where the prefix is "__arm64_compat_". If we broadly follow the x86 lead, we'd have: return (!strncmp(sym, "__arm64_", 8) && !strcmp(sym + 8, name)) || (!strncmp(sym, "__arm64_compat_", 15) && !strcmp(sym + 15, name)); Do we need to handle compat (i.e. 32-bit) tasks here? Will