From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1768360AbcHROru (ORCPT ); Thu, 18 Aug 2016 10:47:50 -0400 Received: from foss.arm.com ([217.140.101.70]:59167 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1767315AbcHROrs (ORCPT ); Thu, 18 Aug 2016 10:47:48 -0400 Subject: Re: [PATCH 4/8] arm64: insn: Add helpers for adrp offsets To: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org References: <1471525832-21209-1-git-send-email-suzuki.poulose@arm.com> <1471525832-21209-5-git-send-email-suzuki.poulose@arm.com> Cc: mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, andre.przywara@arm.com From: Marc Zyngier Organization: ARM Ltd Message-ID: <57B5CA91.1070206@arm.com> Date: Thu, 18 Aug 2016 15:47:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.7.0 MIME-Version: 1.0 In-Reply-To: <1471525832-21209-5-git-send-email-suzuki.poulose@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Suzuki, On 18/08/16 14:10, Suzuki K Poulose wrote: > Adds helpers for decoding/encoding the PC relative addresses for adrp. > This will be used for handling dynamic patching of 'adrp' instructions > in alternative code patching. > > Cc: Mark Rutland > Cc: Will Deacon > Cc: Catalin Marinas > Signed-off-by: Suzuki K Poulose > --- > arch/arm64/include/asm/insn.h | 4 ++++ > arch/arm64/kernel/insn.c | 13 +++++++++++++ > 2 files changed, 17 insertions(+) > > diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h > index 1dbaa90..dffb0364 100644 > --- a/arch/arm64/include/asm/insn.h > +++ b/arch/arm64/include/asm/insn.h > @@ -247,6 +247,7 @@ static __always_inline u32 aarch64_insn_get_##abbr##_value(void) \ > { return (val); } > > __AARCH64_INSN_FUNCS(adr_adrp, 0x1F000000, 0x10000000) > +__AARCH64_INSN_FUNCS(adrp, 0x9F000000, 0x90000000) I'm a bit bothered by this one. We end-up with both aarch64_insn_is_adr_adrp() *and* aarch64_insn_is_adrp() (and their respective getters). How about dropping adr_adrp, and explicitly having adr and adrp? There is only two users in the tree, so that should be easy to address. Thanks, M. -- Jazz is not dead. It just smells funny...