Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp738385pxb; Tue, 14 Sep 2021 07:44:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtxXVzYF+52HncIRc9e0JVSYbR8fKmphF6XXy6YP1m09IHJQ5qoKRcneTru7qjsxuIfFPc X-Received: by 2002:a2e:b014:: with SMTP id y20mr15601282ljk.311.1631630663964; Tue, 14 Sep 2021 07:44:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631630663; cv=none; d=google.com; s=arc-20160816; b=brOMaKpIAGtuSCKTA0ttW3H8bn0/SzMG5bCXI9BTA02N6AhoVO1ELTbmo+8mBd9KQ8 g7NrJ0mJUahRKQ/8H0rorNCst5r/fV1gLYqA/yF+O6sfG9uAAd5tNauf0NOUOFJ9MIjw JC4sAbsgSBKZoeJNBU3O4OLRBj5KO4D76I501/ubx0oF9+QjgEZiOOgmP1g6iSgLTAwF vcKGrIqLwDzAcmtzQXMnXI2KnZOwBkkPznitJKhhYObE2F5llCs9RtmfEJh5+gG9soSJ pDGmnPOzw87DMeZVCtmBkwpUcGLUgYlprrEa21q4/JmMWM8ibTU8ojMJ0jSe+0XLBVDA N65w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xeGlHXuQTkPo8sbE6ADa58CYnZbNZMxXibH5s38pzeQ=; b=Pvb6/bSzpmGU7tSLRJEfJ1IABdg7Db3bpAhxqzrMdPDNnUzV7AHxYq1oidqII6gYZw NtvGWZrUgqwHmiWsR58Ah0SY1YE58f4AiDOcp11s6dYERx+AxdMszZ5n7YjRXFrLiaPZ lhZzT9+SRtFIrOKqexMGPQuLxK6gwFaV1CWcyQGd89oMTY55GCS2ffOdS2W+OFKiaSJo Yn/mGjiXBl9rn3rjEOZdQX5MSNwc1THz1P22JT227d3fzthXd2KWkquYTbPX/+lD8hbc u5ppdKz2xodh6dYCiLTP1D2/QmOuaFqJAYAJtoO3kJ9Oj0r9bF97u/48jCdTL9lyKX1G Qwnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="R2/jYfcX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m23si14624780lji.396.2021.09.14.07.43.56; Tue, 14 Sep 2021 07:44:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="R2/jYfcX"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S234819AbhINOng (ORCPT + 99 others); Tue, 14 Sep 2021 10:43:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:36622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234299AbhINOmg (ORCPT ); Tue, 14 Sep 2021 10:42:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 315A761107; Tue, 14 Sep 2021 14:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631630477; bh=ycaasLRNKeb4PrJCUm1tk0Rz6wHrs2EJsJbv1cIxaz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2/jYfcXXtOvHiN1w9cVkLFItB/sxD4wBMXcJ3Rx449BhYcrkBxsEbBJQv++3CwOY Esxv6m0IZ+Zf8lJfPQq16gGK0pLFqu6HtugCvYAH075CR/RqZQh+XJxqc7dllTGtSY /Y14sUOuNP1PN0a5mqqC+0NjXmi9Sobq7ie/UW04qJJn6vhWGD+Plo9NtHGsWzTw5a K5hP5AktYpW9ecur7hNP0jX2AxXyrPm9nM+bBI6yKBZj3mhhAHZ6bet6os+q8xlXJW xgpMfOUGmi6oBoPeHmpuevZjsJC0YRi6a6hYZEIR236nFKvCP1yAG9mi3fs6kxcYaT NGV4csZTMRykQ== From: Masami Hiramatsu To: Steven Rostedt , Josh Poimboeuf , Ingo Molnar Cc: X86 ML , Masami Hiramatsu , Daniel Xu , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, kuba@kernel.org, mingo@redhat.com, ast@kernel.org, Thomas Gleixner , Borislav Petkov , Peter Zijlstra , kernel-team@fb.com, yhs@fb.com, linux-ia64@vger.kernel.org, Abhishek Sagar , Andrii Nakryiko , Paul McKenney Subject: [PATCH -tip v11 17/27] objtool: Add frame-pointer-specific function ignore Date: Tue, 14 Sep 2021 23:41:13 +0900 Message-Id: <163163047364.489837.17377799909553689661.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163163030719.489837.2236069935502195491.stgit@devnote2> References: <163163030719.489837.2236069935502195491.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Poimboeuf Add a CONFIG_FRAME_POINTER-specific version of STACK_FRAME_NON_STANDARD() for the case where a function is intentionally missing frame pointer setup, but otherwise needs objtool/ORC coverage when frame pointers are disabled. Signed-off-by: Josh Poimboeuf Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Masami Hiramatsu --- Changes in v10: - Fixes error in CONFIG_STACK_VALIDATION=n case. --- include/linux/objtool.h | 12 ++++++++++++ tools/include/linux/objtool.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/linux/objtool.h b/include/linux/objtool.h index 7e72d975cb76..aca52db2f3f3 100644 --- a/include/linux/objtool.h +++ b/include/linux/objtool.h @@ -66,6 +66,17 @@ struct unwind_hint { static void __used __section(".discard.func_stack_frame_non_standard") \ *__func_stack_frame_non_standard_##func = func +/* + * STACK_FRAME_NON_STANDARD_FP() is a frame-pointer-specific function ignore + * for the case where a function is intentionally missing frame pointer setup, + * but otherwise needs objtool/ORC coverage when frame pointers are disabled. + */ +#ifdef CONFIG_FRAME_POINTER +#define STACK_FRAME_NON_STANDARD_FP(func) STACK_FRAME_NON_STANDARD(func) +#else +#define STACK_FRAME_NON_STANDARD_FP(func) +#endif + #else /* __ASSEMBLY__ */ /* @@ -127,6 +138,7 @@ struct unwind_hint { #define UNWIND_HINT(sp_reg, sp_offset, type, end) \ "\n\t" #define STACK_FRAME_NON_STANDARD(func) +#define STACK_FRAME_NON_STANDARD_FP(func) #else #define ANNOTATE_INTRA_FUNCTION_CALL .macro UNWIND_HINT sp_reg:req sp_offset=0 type:req end=0 diff --git a/tools/include/linux/objtool.h b/tools/include/linux/objtool.h index 7e72d975cb76..aca52db2f3f3 100644 --- a/tools/include/linux/objtool.h +++ b/tools/include/linux/objtool.h @@ -66,6 +66,17 @@ struct unwind_hint { static void __used __section(".discard.func_stack_frame_non_standard") \ *__func_stack_frame_non_standard_##func = func +/* + * STACK_FRAME_NON_STANDARD_FP() is a frame-pointer-specific function ignore + * for the case where a function is intentionally missing frame pointer setup, + * but otherwise needs objtool/ORC coverage when frame pointers are disabled. + */ +#ifdef CONFIG_FRAME_POINTER +#define STACK_FRAME_NON_STANDARD_FP(func) STACK_FRAME_NON_STANDARD(func) +#else +#define STACK_FRAME_NON_STANDARD_FP(func) +#endif + #else /* __ASSEMBLY__ */ /* @@ -127,6 +138,7 @@ struct unwind_hint { #define UNWIND_HINT(sp_reg, sp_offset, type, end) \ "\n\t" #define STACK_FRAME_NON_STANDARD(func) +#define STACK_FRAME_NON_STANDARD_FP(func) #else #define ANNOTATE_INTRA_FUNCTION_CALL .macro UNWIND_HINT sp_reg:req sp_offset=0 type:req end=0