From patchwork Fri Mar 26 12:29:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 12166515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0C03C433E0 for ; Fri, 26 Mar 2021 12:30:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 75CB461A0F for ; Fri, 26 Mar 2021 12:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbhCZMaI (ORCPT ); Fri, 26 Mar 2021 08:30:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:53046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhCZM3z (ORCPT ); Fri, 26 Mar 2021 08:29:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5591161920; Fri, 26 Mar 2021 12:29:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616761794; bh=iAB/GP1lxiYjZ/XD65VZRhooNarxkQDlN/p7JzDFc8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TaJ06ZH2+VfDA2+TdOsX/oFiisDnIT84bn5EixOvG63PicGlhUvKLipK7pNtAeTtr GgO044oRWm8ry/sNAMb0WlShUwB2Cm7BoH38gYMbcs+HaEskU1WSRpgDAXL5U/96vH cl1PaMyO92MHl3knbB7hEP3xyu3u8p78riia62Y+mW4EuyLYZ3FckJQWsL3q/8Chc0 mycG8UTBucPdb4p2zVzjR4Jim/Mbtf4CtSUJVw5Y6JV8Ih5zobnOJL1sz7jwkaa5sD FNxBliQgRQ5p3t21d685m+sz1/1uFrUHR9Pfx0MRM1ShLtm0nCYKlUiaLNidkF8HCQ kheIqdhW9WRhg== From: Masami Hiramatsu To: Steven Rostedt , 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, tglx@linutronix.de, kernel-team@fb.com, yhs@fb.com, Josh Poimboeuf , linux-ia64@vger.kernel.org, Abhishek Sagar Subject: [PATCH -tip v5 07/12] ia64: Add instruction_pointer_set() API Date: Fri, 26 Mar 2021 21:29:49 +0900 Message-Id: <161676178902.330141.11229722762957487993.stgit@devnote2> X-Mailer: git-send-email 2.25.1 In-Reply-To: <161676170650.330141.6214727134265514123.stgit@devnote2> References: <161676170650.330141.6214727134265514123.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Add instruction_pointer_set() API for ia64. Signed-off-by: Masami Hiramatsu --- Changes in v4: - Make the API macro for avoiding a build error. --- arch/ia64/include/asm/ptrace.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/ia64/include/asm/ptrace.h b/arch/ia64/include/asm/ptrace.h index b3aa46090101..4c2f838b2e77 100644 --- a/arch/ia64/include/asm/ptrace.h +++ b/arch/ia64/include/asm/ptrace.h @@ -51,6 +51,11 @@ * the canonical representation by adding to instruction pointer. */ # define instruction_pointer(regs) ((regs)->cr_iip + ia64_psr(regs)->ri) +# define instruction_pointer_set(regs, val) \ + ({ \ + ia64_psr(regs)->ri = (val & 0xf); \ + regs->cr_iip = (val & ~0xfULL); \ + }) static inline unsigned long user_stack_pointer(struct pt_regs *regs) {