Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2832549imm; Thu, 18 Oct 2018 23:57:38 -0700 (PDT) X-Google-Smtp-Source: ACcGV61u095AnOYOgOjHUQEkY6t1Uxbu2IK263lSlihVWiHOWbibwtCbn+POroqyyrMfdcRM94XM X-Received: by 2002:a62:9f11:: with SMTP id g17-v6mr33263781pfe.144.1539932258781; Thu, 18 Oct 2018 23:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539932258; cv=none; d=google.com; s=arc-20160816; b=rpODE5vLdgAFcsc1DT7atlIU3ugw0V7QHu0Aw6bXI9NGEB/L/d363sSOOeVyVWi0ux csjweOIMcRWqevPn54rwjvCFb5WoFoA4gV9V5CsKJedzacOFyo1sQdhNVgtxet80fUQN nHy8GqLaYwBNY//Tccq9Y2BPw/6HGs/iyWx2CDI0B+XqmB/ZL4FJcdbQpsBTxemlfmgz OBV76wUptZwb70X2V4PjZkU5uXuVYjLNHUzT/8gDPVYLDVbu+BTj/53C4kJUM/G3ycdy qDod+nxgSpwQJ/h4gUZKT2fhDMf4EhH0LKViT2ydfV5OOm9/rcO9ijnroudhgKcxnVRK SY0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=lfdf3M6GOam6p72+9ChwNPHqMfXcVbO5vbSH4qXiPUU=; b=fU3CtmBCw76ArYkbt6oAvqNiFOk9PWzKr76/kMi8J7AQh4YXSrQYQklZCrKJMvajot pt50mBcNBS6xT0SjIn9m+ScMxhyt4+oQXylw4XiJw393IjqsBKtsIjwTCq9Dzmx/ACFu X2Mi/MHw2VbKeTb8RpWKQtZMf9w5aPYm9fVqmWD5jYSQ1NNyc75GbSmeuryskuLveKib MxlpPFuVOYkCK9SwXP4+8/X23T+lwf/8Iu9GbvHlLBl7mrstDa5pmExawb3dcrBDWSV2 jaexvMxkrdu/VtMp/aNu61Oua6ivo+Up1SWiDYU95rSba9Ge2FEalerb1zVmDauSJwbo eshQ== 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 p15-v6si23853839pgf.224.2018.10.18.23.57.23; Thu, 18 Oct 2018 23:57:38 -0700 (PDT) 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 S1727284AbeJSO7u (ORCPT + 99 others); Fri, 19 Oct 2018 10:59:50 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:64142 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727205AbeJSO7t (ORCPT ); Fri, 19 Oct 2018 10:59:49 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42bxVv2QFcz9ttFV; Fri, 19 Oct 2018 08:55:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id YqFIZOHu0TZo; Fri, 19 Oct 2018 08:55:03 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42bxVv1ymGz9ttFM; Fri, 19 Oct 2018 08:55:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7B6058B8DF; Fri, 19 Oct 2018 08:55:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id SNmQgHFDqgrS; Fri, 19 Oct 2018 08:55:04 +0200 (CEST) Received: from pc13168vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5D6E48B75B; Fri, 19 Oct 2018 08:55:04 +0200 (CEST) Received: by pc13168vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 466176F496; Fri, 19 Oct 2018 06:55:04 +0000 (UTC) Message-Id: <767ba67010bfd4ec8832bbd43eca9e419e122d7e.1539931702.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v6 06/20] powerpc/code-patching: add a helper to get the address of a patch_site To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 19 Oct 2018 06:55:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds a helper to get the address of a patch_site Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/code-patching.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/include/asm/code-patching.h b/arch/powerpc/include/asm/code-patching.h index 31733a95bbd0..bca48cc1b6ad 100644 --- a/arch/powerpc/include/asm/code-patching.h +++ b/arch/powerpc/include/asm/code-patching.h @@ -36,6 +36,11 @@ int raw_patch_instruction(unsigned int *addr, unsigned int instr); int patch_instruction_site(s32 *addr, unsigned int instr); int patch_branch_site(s32 *site, unsigned long target, int flags); +static inline unsigned long site_addr(s32 *site) +{ + return (unsigned long)site + *site; +} + int instr_is_relative_branch(unsigned int instr); int instr_is_relative_link_branch(unsigned int instr); int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr); -- 2.13.3