Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp118506pxb; Wed, 20 Oct 2021 17:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTxtCqXDlbd4ZkinbVkVzM+98VSrh6MazdZSB7R8W/MHbRfAD5JUxRqto0Q3ptVlPjBk31 X-Received: by 2002:a17:906:c1da:: with SMTP id bw26mr3482882ejb.253.1634777896116; Wed, 20 Oct 2021 17:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634777896; cv=none; d=google.com; s=arc-20160816; b=UhjvuDNZ/73yhWeODcIt6eH3NkKALK8H3q/KVVilzMvShqNbmwUjmTeVwfe5Sfiy70 Rj0ThrVz6bF67NeUnY2OWcnjWEL+AvfwHxxt3cLMBkb9B1Wx9qRQRE+LtE3g98rzdUBJ t/yNEPSkETDE3H9WcvkCkernOFmcsguv6hvY0x7v/Z8PSrV78DOAoQ45cVefBuPkj3WM N0j0fQfp1T9JvQh7Dn7hLK6HXsFkcUCShhrH7M6EoEJYqdxCwqC7GufsXXTSYcXtAbTI IE+vn+KcPDfKVW4sbSh+0fANAYn3jamux4Fm+3dgrf3cMWL5cT0eml8u5texpv4fgX7X bpyQ== 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=CGYbaMA1XDe7cOb9HUNs3aO7pcIVcotmSfdC5r9GGCWOkFrmTuGOylSq9K5XadjsmJ Mp+p7MOZIyCY2bD+dU5I5mra9nRR87CFoqy+PmEwzGFA4EikvchK5IYtcKDk08V+robF gdWLzeX+NqkdZLQpm029/eATI2oY4IsRJoeV3mdiJ1CxSSmL8MvZ1dr602t/abAJTw3x S93Ipy3AzUY3hkNctAKgTbE+KprFQnmKnQmbBoGIMJfxF0dibzeN2S4ZNfDHrpOFpdjv GI1zr36YWvtzhgTlQP8YJa/NeM6hRzaoO2hqd4TW8BO9CydtHinbDJeX51e/aa2Vg2KJ lOxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UGba/T9n"; 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 s4si7366827edd.155.2021.10.20.17.57.53; Wed, 20 Oct 2021 17:58:16 -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="UGba/T9n"; 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 S231375AbhJUA5G (ORCPT + 99 others); Wed, 20 Oct 2021 20:57:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:51316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231428AbhJUA5A (ORCPT ); Wed, 20 Oct 2021 20:57:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C7F9610A1; Thu, 21 Oct 2021 00:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634777685; bh=/6Ses4iOpFuwfQyjHXNpCu4Cpb2y9TUHV8jz9fN04Nw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UGba/T9nv9XcVTyQ1ZY6+S7JA1Ucv6GR6g1kJbkXLvFWgkt94SyjRhvCtIN+7fbMP JX+NonR/s9ZrPDONB1oIcyT1p5NqpjDrHRidigDV5frWYTKEnnlm8JXEhaAL+HGARm qFu2QmAV345H36PD0xxYvwhFLdcMuF10+VshvcKeDEZ1HI22GhE4sn7sdfNdWNg7CY RinCT89jSzw8UPbF+T/q9+VULr0SVcXdWWNkEtGgDytWsoLKrv+xdKjucV7es9nVIr X4IcgUTNXIgRlCwPuDdSdzIITukKojfGhOrLhciyBQ6qNO8y+4CPMjFCtOkkUK86KX tegcYVOPFunew== 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 v3 3/9] x86/unwind: Compile kretprobe fixup code only if CONFIG_KRETPROBES=y Date: Thu, 21 Oct 2021 09:54:42 +0900 Message-Id: <163477768249.264901.5797532967197120056.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <163477765570.264901.3851692300287671122.stgit@devnote2> References: <163477765570.264901.3851692300287671122.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. */