From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 E4CA1C433E0 for ; Wed, 3 Mar 2021 23:58:57 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E55764F4D for ; Wed, 3 Mar 2021 23:58:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E55764F4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=byvXZ4VlYMZirt/kJU2pL0WtRqjmxkpnnUKlGinHi/8=; b=W7EiNsfCyVpmEIznFqxL0ttHz T1wV8t7IoiI1EEffj8XYuthROUmUU/4XI/lgECu0lpmazVmRItUEuZZ5feSuAJQezs6TOvzf+iqbk AqAobMiPLYkGo/O35SOOTlrFcotBEPDHR5HuD6ZXm0HR9eGY9pFd5Twm+zxgwUymcLPtqQ2SMCRiX X9/cGIE5+nP3Os5hS6QYtjHwwyemkTPJuxsnoCPKkpeavohHlHw/CMdDnGWgONZFXMG/FPl4odV3C qOm+tye8DLfk5vmyO7lQITs+EEaWY6C73GW4Vz7scwUEz+sQqPtY7CdywNfnDBV+tNm4ldEa+JcDD tXtbjMzjA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHbKQ-0072XO-Ca; Wed, 03 Mar 2021 23:54:54 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHV0Y-005jtQ-1a for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 17:10:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614791396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4mYRxjaYFimzJkE35k0hSqse9qtwA1S+xm+5PuBe57Q=; b=J0SFLW3dKgwisy/1ure+r5v93uA7lLVJm0gfUlxkOAB5mlpBFElDBBQWUNCXPp+7BKPgiW PERYYk4flLdaCkXmvoZwox+MEUh/iA6IGYulMqwsZd5JNDKYPzWC52LaowZ3ckSMqFzq2a 7ShVCLL0TGSoAMGL2Wi+Uus0zshI5Zk= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-2bosLoRZObyAuN6Maf9HYA-1; Wed, 03 Mar 2021 12:09:55 -0500 X-MC-Unique: 2bosLoRZObyAuN6Maf9HYA-1 Received: by mail-wm1-f69.google.com with SMTP id p8so3268538wmq.7 for ; Wed, 03 Mar 2021 09:09:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4mYRxjaYFimzJkE35k0hSqse9qtwA1S+xm+5PuBe57Q=; b=E7mblEC7uB6dBtobDOIdd1JdHeOw6HDP9Dz3dvZ03s4bzt/LLyFVwOuRurc4s9XOlF v+vHRVcdCP1J2quzGt8843BiWltPvoJcGS31INkS3rq7DHRoHktEFTHRPUgYFDZW0D24 bikJyk2lX5268m3MgyptVJLGbb0DFVHsRUjjki2gylrTylt1+M9Hh9XBpqxkoZogM62P grT5Mr9Gr9Uwgj7WMUuj859Ee+vRqHLWNgs/OkE91GyAFLkIxq94BkqghHR+J/72nMAG BBKQ3iyN7p/gLLR7YbpCMRHCesPiqkXLN/ia63d34n+m0QJ4KRTW5KBXYb0wuvv9SFOd iZvA== X-Gm-Message-State: AOAM533LZYpWSiIQWLsLBvMrw15wjgWL5Nmi48DI19sj935/JlcCfQbB AItBBbB29ujBo/MMN76pCxt4XPPuc3ZvmnrFp9S+iha+GJo+Bl5X6gx8PvYWmo4a6/KW/OP5BV/ WhCrqvJkGqXK8Ummj2maxnVWSa0ZrNC5L3HQ= X-Received: by 2002:adf:ef4c:: with SMTP id c12mr28586345wrp.112.1614791393974; Wed, 03 Mar 2021 09:09:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8q1b30kNoZXF00T55vpdszusbndOu0xEWjI6Fi3a15DamHiY3RwZ/krp7t8t0SFSDVYujEA== X-Received: by 2002:adf:ef4c:: with SMTP id c12mr28586331wrp.112.1614791393855; Wed, 03 Mar 2021 09:09:53 -0800 (PST) Received: from redfedo.redhat.com ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id r7sm33066226wre.25.2021.03.03.09.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 09:09:53 -0800 (PST) From: Julien Thierry To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, ardb@kernel.org, masahiroy@kernel.org, jpoimboe@redhat.com, peterz@infradead.org, ycote@redhat.com, Julien Thierry Subject: [RFC PATCH v2 11/13] objtool: arm64: Handle supported relocations in alternatives Date: Wed, 3 Mar 2021 18:09:30 +0100 Message-Id: <20210303170932.1838634-12-jthierry@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20210303170932.1838634-1-jthierry@redhat.com> References: <20210303170932.1838634-1-jthierry@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jthierry@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Based on get_alt_insn() in arch/arm64/kernel/alternative.c, arm64 alternative code adapts offsets for static branches and adrp instructions. Signed-off-by: Julien Thierry --- tools/objtool/arch/arm64/special.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/objtool/arch/arm64/special.c b/tools/objtool/arch/arm64/special.c index 45f283283091..a70b91e8bd7d 100644 --- a/tools/objtool/arch/arm64/special.c +++ b/tools/objtool/arch/arm64/special.c @@ -10,7 +10,11 @@ bool arch_support_alt_relocation(struct special_alt *special_alt, struct instruction *insn, struct reloc *reloc) { - return false; + u32 opcode = *(u32 *)(insn->sec->data->d_buf + insn->offset); + + return aarch64_insn_is_branch_imm(opcode) || + aarch64_insn_is_adrp(opcode) || + !aarch64_insn_uses_literal(opcode); } -- 2.25.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel