Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp866695pxb; Fri, 15 Oct 2021 18:36:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC3U74idlGRI4L12amy04yf28AnVxeCI+UiKsCjED+dir7tj1xMR/EkeSOpKZ9bpagnvQY X-Received: by 2002:a17:90b:3a88:: with SMTP id om8mr17101637pjb.71.1634348167551; Fri, 15 Oct 2021 18:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634348167; cv=none; d=google.com; s=arc-20160816; b=cpUzrtGdVi3wYCS9P4wJEW4ltiw7MkNxrbS2GFoKWcFdEJvrdnWHjrW/RGLK8NPKqN 3XQDkkuLyUGFoPKQTReibBGABYTnv8o9tSzPRshljPCAELSAIDMtmV7AHjv+Oc7EPIWR F4IJsdiOfHH9zki7Pzb2Tgm5n+TEzQ6ukKXWPGbAzh5AMNIjGa6UUjE2A5FmNyAg9Q9F DlkxkKtT5xvkrXLazoDE2VpvKNxnypVfIkOR4KrgNP1DUIbNZ3Ib/+fK6Evla5oVpHFz awhj2pU1Qa2bnsGJe+KH5SCsnWqYCTNu3nZ5qkk4vWGx0ywxKqH2+CRbeifLjiglu22o WJiA== 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=eACe4fqpRVZkqOiBMr5Ic2ubKBH4EBerYadi24EOsic=; b=Rr9kfcWLSvSsF9b72tnq0YeKYtSU3f2eiFxo0w+XwCW0DnDjg5VULhQbaLn0hzQTyW ewr/ipqMbC5YoKZGzf8kgAs3/ibTpnxl7T9HwdZnY64GBJoj5H5tKru54/KGVzmGdrxI hdd2sqKoy0zlHSL5y11O2X2zeEM/GE/DnivoE3iJ1CM80Hl0X/KYE62mUmbjnDBsYB0G GrjybyRpgmwRGkBziT4DNqbq4rrNE+J3hiGIape1sKUAg8mGNckUfMrEZAQCQxjUCfwV c0qk0bGqB20pHGh3sUSM9FXwzEUfrNBrR4nMDpRGhvHqVXEUn+VkQfI113ILZrT/sWFU 2g1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZD+YgR37; 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 b10si3185948pft.208.2021.10.15.18.35.40; Fri, 15 Oct 2021 18:36:07 -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=ZD+YgR37; 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 S239197AbhJOMxp (ORCPT + 99 others); Fri, 15 Oct 2021 08:53:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239248AbhJOMxU (ORCPT ); Fri, 15 Oct 2021 08:53:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 13FCB6108E; Fri, 15 Oct 2021 12:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634302274; bh=/6Ses4iOpFuwfQyjHXNpCu4Cpb2y9TUHV8jz9fN04Nw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZD+YgR37fo5+Ms9i8CZvcGHzzgUehgFm0vKsvUk1RE75cth5o0EyuST2r56ToabsW mlp1cIoYacIoxrMTUkEeWQHCUtejHJBB4/7fIM/qQatgyIX574bYOs9az/dBlojMWB kskLLFI0FBRpXdG7ip2KifRdzrOtH1+jiKRqTEEaaBkJc3WUF15Y7V8C1zQ4hzfLQo 1xuaZkmbLDjidVIJxjsz3kqq/TeZr91Og5U1XZr25KXpp3C63uwegFEPf9Vzx823yj 4MW/G68+B6g7k4VEKGN5tBnfU1K6tP9awnsOsE06Yv0eqlBBfs6ZVNlbm9H5q8tZNg +B9nghvGGPKMQ== From: Masami Hiramatsu To: Steven Rostedt Cc: "Naveen N . Rao" , Ananth N Mavinakayanahalli , Ingo Molnar , linux-kernel@vger.kernel.org, mhiramat@kernel.org, Sven Schnelle , Catalin Marinas , Will Deacon , Russell King , Nathan Chancellor , Nick Desaulniers , linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/10] x86/unwind: Compile kretprobe fixup code only if CONFIG_KRETPROBES=y Date: Fri, 15 Oct 2021 21:51:10 +0900 Message-Id: <163430227030.459050.12754362425825951410.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163430224341.459050.2369208860773018092.stgit@devnote2> References: <163430224341.459050.2369208860773018092.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 Compile kretprobe related stacktrace entry recovery code and unwind_state::kr_cur field only when CONFIG_KRETPROBES=y. Signed-off-by: Masami Hiramatsu --- arch/x86/include/asm/unwind.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h index fca2e783e3ce..2a1f8734416d 100644 --- a/arch/x86/include/asm/unwind.h +++ b/arch/x86/include/asm/unwind.h @@ -16,7 +16,9 @@ struct unwind_state { unsigned long stack_mask; struct task_struct *task; int graph_idx; +#ifdef CONFIG_KRETPROBES struct llist_node *kr_cur; +#endif bool error; #if defined(CONFIG_UNWINDER_ORC) bool signal, full_regs; @@ -105,9 +107,13 @@ static inline unsigned long unwind_recover_kretprobe(struct unwind_state *state, unsigned long addr, unsigned long *addr_p) { +#ifdef CONFIG_KRETPROBES return is_kretprobe_trampoline(addr) ? kretprobe_find_ret_addr(state->task, addr_p, &state->kr_cur) : addr; +#else + return addr; +#endif } /* Recover the return address modified by kretprobe and ftrace_graph. */