Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1581847pxb; Thu, 4 Mar 2021 15:25:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIaAgs4wO9yCPhToARZc7Sep8ImUUPy+KEFVjHGZeEhE+Lkipuev4OxNT1Klj8Ek+a0pl2 X-Received: by 2002:a17:906:6c93:: with SMTP id s19mr6619721ejr.151.1614900332690; Thu, 04 Mar 2021 15:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614900332; cv=none; d=google.com; s=arc-20160816; b=RS0wVXV0qcPypO8DOewCoCX33HqZcqFFsEDJWCPb/y+/Lt2nI13B4xeNU9kNra70Ct DbniDqqezuBO80eb+GVSs7DGfuFBGPKvUT+lrqSo6BxdESd9NsjfVipVMSYeHaQkby/v 6x8KfQO5W0C1Ib4qJ+x3lPLxRBX2/xkAXg3BC3IeLPn50HbIbkdTs3y9XAiZ867YPBlO cafaOuHEN0ll4n+hKtq4tnddQPH5VWOS7e0Ybyi8YuOO2FyMl6qZi5rTfMeRtEpTitNX +IVOXSPUjf2Uz0qK83Zh77F4gOiIn6pAhz0ROKfiRlJIB4SwOtKoNWaHD66pvvuEChMi A9oQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=A7hqiiwpzHCv9dcTIz5ZNKi8QEHjE+ALvxN3oPNlRwk=; b=MeRH2id3imEby/nuqIJtL9LKYhIRr2AtyUqdQWrMeGWVTjanjNNxaKW8gLCRsdWfOc up/bMDIn3bKKkOJNgBcdyryeLDBq07w29o3hRz+blEM+vqKEdU1QZJVhYFaM2I88pv04 eUATElEnHTKoW6GvjwMPYfwd1mdSjeLHoXlkC48ojQLUQucwQKjVq44Od83tpOc6OVbR m3JjAXYG4nSIahxZdsLgdrg8I4gZ8rKJCTsGcWz+57zgDGtwzcX5pC+RLsJHDhMeuPmi WNP0yHb2Vxw0PeEzN3zntVypm4dGNgZrydzmIMixDfxljusbKexyUtzo9F+OA+FydYKN 08VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D9SOTeDu; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si358812ejm.215.2021.03.04.15.25.09; Thu, 04 Mar 2021 15:25:32 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=D9SOTeDu; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1580044AbhCCSdE (ORCPT + 99 others); Wed, 3 Mar 2021 13:33:04 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:20210 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348044AbhCCRHK (ORCPT ); Wed, 3 Mar 2021 12:07:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614791144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=A7hqiiwpzHCv9dcTIz5ZNKi8QEHjE+ALvxN3oPNlRwk=; b=D9SOTeDuuvUZ8r4EHT4ODQLqEAJTZ04tuIkEbQTuvVlM7bFf4WZTaD71ehUZvSrWPJ4qVR gz/99SX4s5T4oTKtntchQjRrUm7aCciuzbQ+vN1kD/Qgns0hyCktAOHVkMSxlMkDXC8w1X y/LzKB3xJHBMsw4HHYRDR08OL+sM6lw= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-EJSuxWi9Pqans2zV125BAw-1; Wed, 03 Mar 2021 12:05:42 -0500 X-MC-Unique: EJSuxWi9Pqans2zV125BAw-1 Received: by mail-wr1-f69.google.com with SMTP id f3so6161622wrt.14 for ; Wed, 03 Mar 2021 09:05:41 -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:mime-version :content-transfer-encoding; bh=A7hqiiwpzHCv9dcTIz5ZNKi8QEHjE+ALvxN3oPNlRwk=; b=rl901fTiGrgU5pXh64ErDc+qbtPydCnJqGEpYo6d9OoDRfMDCWsyjTrXVsezWAJ111 pudyZJp8CdmQ+M+AmeNWmd2yn1jRuBv2wIpocowCyPYFyWE3fm3TT9GXdvtrDtFlo62S BI/HmFstSoeVr68St2TBWC6riyfKTyrnzh/m8FEAfxznxwd8E3L9P5Y6wVLBLbrVmS5V BVtheTmXXbTqgHpGfnmMFiBI8hUMNrI2y82Ws8Jr4eZgGz3CP9iaE2I1QR+SVuowlnR0 w5WkUF9Y0lwR3TyzygBAgjjrE4MdXYAfjwKcXFbEs/CeJf83CBgNPtgwT1l/3wwAzOal n+Gg== X-Gm-Message-State: AOAM533kodu2E+zpFHxtrj1YR1UvlZkSNkLvXtqUjxRkh5iLnxom4Z1X 4sATAlNESvQaVyuQC3sbi2tnlDCrHTkqEQWqvDhFSrYEqEpaU3TKHCmJiHUsCS4VL4yicjzG7z+ Lwdmpkn/rF0hz4OjLtbkXw/JHJWb3O/20FAz6qpMBBPy3Ni5RMOwDFzM1PUNoV/s+bRBM2GXOUD i0 X-Received: by 2002:adf:ed44:: with SMTP id u4mr27999050wro.35.1614791140556; Wed, 03 Mar 2021 09:05:40 -0800 (PST) X-Received: by 2002:adf:ed44:: with SMTP id u4mr27999022wro.35.1614791140291; Wed, 03 Mar 2021 09:05:40 -0800 (PST) Received: from redfedo.redhat.com ([2a01:cb14:499:3d00:cd47:f651:9d80:157a]) by smtp.gmail.com with ESMTPSA id d29sm32957827wra.51.2021.03.03.09.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Mar 2021 09:05:39 -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, broonie@kernel.org, ycote@redhat.com, Julien Thierry Subject: [RFC PATCH v2 0/8] arm64: Prepare instruction decoder for objtool Date: Wed, 3 Mar 2021 18:05:28 +0100 Message-Id: <20210303170536.1838032-1-jthierry@redhat.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To support arm64, objtool will need to be able to decode aarch64 instructions. This patch series adds some instruction definitions needed by objtool and moves out encoding/decoding functionalities that do not rely on kernel code in order. Changes since v1[1]: - Split the isolation of instruction encoder/decoder capabilities in several steps as suggested by Mark R. - Exclude dsb encoding where CRm != 0b0x00 - Support dsb FEAT_XS encoding - Support previously missing barriers [1] https://lkml.org/lkml/2021/1/20/791 Thanks, Julien --> Julien Thierry (8): arm64: Move patching utilities out of instruction encoding/decoding arm64: Move aarch32 condition check functions arm64: insn: Reduce header dependencies of instruction decoder arm64: Move instruction encoder/decoder under lib/ arm64: insn: Add SVE instruction class arm64: insn: Add barrier encodings arm64: insn: Add some opcodes to instruction decoder arm64: insn: Add load/store decoding helpers arch/arm64/include/asm/alternative-macros.h | 3 - arch/arm64/include/asm/insn.h | 70 +++++- arch/arm64/include/asm/patching.h | 13 + arch/arm64/include/asm/probes.h | 2 +- arch/arm64/include/asm/traps.h | 3 + arch/arm64/kernel/Makefile | 4 +- arch/arm64/kernel/ftrace.c | 1 + arch/arm64/kernel/jump_label.c | 1 + arch/arm64/kernel/patching.c | 148 ++++++++++++ arch/arm64/kernel/probes/simulate-insn.c | 1 + arch/arm64/kernel/traps.c | 100 +++++++- arch/arm64/lib/Makefile | 6 +- arch/arm64/{kernel => lib}/insn.c | 249 +------------------- 13 files changed, 338 insertions(+), 263 deletions(-) create mode 100644 arch/arm64/include/asm/patching.h create mode 100644 arch/arm64/kernel/patching.c rename arch/arm64/{kernel => lib}/insn.c (86%) -- 2.25.4