Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6262743rwl; Mon, 9 Jan 2023 06:19:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtD4xt33JmV6K0Ui8UKe4wY1JHmpw2sJmkvma5svlAzG2a/D2LiVfSBrW/4c9xddnP3IXoT X-Received: by 2002:a05:6402:454:b0:499:376e:6b2b with SMTP id p20-20020a056402045400b00499376e6b2bmr4863349edw.0.1673273962701; Mon, 09 Jan 2023 06:19:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673273962; cv=none; d=google.com; s=arc-20160816; b=goSUW2/+jXRh2w11F7BBrLtizBO61fNoxFuiAPJ3nLKRMHi3dHmJzRFnGBQgB4BOw9 +DWAP8xtcW/6PsnR4WzAVN1JEFVfX6BPxv25+P1EEe0+cr0tmSWH5jM2vZFLo/AOb6ZA Rwds8FPugtE09KrymI9707CbljlrMXcEHh10lTIBfe6WUHzrTKIXsN2ahzpDTAenugaw A7t2ntNwFdoi3j/q5kKcOBxTJO/3wqimVut59e2k5PXZ7nOg/cuwG387e/BWmhgSvXEG kKZ2pNopiusSpmo0zMd5+1eus1QIjebq0QSmeESl+VGjs/MHAmHFZ9CDw5QdwxPkHdy4 eqBQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9TIHg1TnCtgCXxCOCjEq3lp9b9Ah1KeMTk1kU7HR+Fo=; b=PZC/WF2QHRUHzZJczYYY18ertXdqYnheXyYbguTDCKBqff+rng+IQuCqWmH4R0KXRW A0szEzRR1gd8NNjfdhUrgz1Djv2Yw9OnHMTibI933f6ztM7JqIm+Llfi9RE/9rp4bPv0 bivYqWpX+WeGnN9nrn88ZTijEkvrSrvUIX6qZrcm1PlbBaZSnxv/TIHy4KQdiifEZUhl TCM6f/ONrGyJ3NcZde8mqW227QxjKT0i+mJSAI6Pf71Txr7bpN4y2eLxHHrqCDbX9Hli vUVx7I5QaaqMAuUSjAJrr1ZAysAsbg7dbQBseQhWgcKRRemorcB9JYnodXztCUxBLVOl MuxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a056402521400b00459e1ce80a7si11214107edd.241.2023.01.09.06.19.09; Mon, 09 Jan 2023 06:19:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237247AbjAIOAg (ORCPT + 53 others); Mon, 9 Jan 2023 09:00:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237271AbjAIN6w (ORCPT ); Mon, 9 Jan 2023 08:58:52 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7514FBCC; Mon, 9 Jan 2023 05:58:51 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A8C519F0; Mon, 9 Jan 2023 05:59:33 -0800 (PST) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5B5FC3F23F; Mon, 9 Jan 2023 05:58:49 -0800 (PST) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com, mhiramat@kernel.org, ndesaulniers@google.com, ojeda@kernel.org, peterz@infradead.org, rafael.j.wysocki@intel.com, revest@chromium.org, robert.moore@intel.com, rostedt@goodmis.org, will@kernel.org Subject: [PATCH 5/8] arm64: insn: Add helpers for BTI Date: Mon, 9 Jan 2023 13:58:25 +0000 Message-Id: <20230109135828.879136-6-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109135828.879136-1-mark.rutland@arm.com> References: <20230109135828.879136-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In subsequent patches we'd like to check whether an instruction is a BTI. In preparation for this, add basic instruction helpers for BTI instructions. Per ARM DDI 0487H.a section C6.2.41, BTI is encoded in binary as follows, MSB to LSB: 1101 0101 000 0011 0010 0100 xx01 1111 Where the `xx` bits encode J/C/JC: 00 : (omitted) 01 : C 10 : J 11 : JC Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Florent Revest Cc: Masami Hiramatsu Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Will Deacon --- arch/arm64/include/asm/insn.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h index aaf1f52fbf3e0..139a88e4e8522 100644 --- a/arch/arm64/include/asm/insn.h +++ b/arch/arm64/include/asm/insn.h @@ -420,6 +420,7 @@ __AARCH64_INSN_FUNCS(sb, 0xFFFFFFFF, 0xD50330FF) __AARCH64_INSN_FUNCS(clrex, 0xFFFFF0FF, 0xD503305F) __AARCH64_INSN_FUNCS(ssbb, 0xFFFFFFFF, 0xD503309F) __AARCH64_INSN_FUNCS(pssbb, 0xFFFFFFFF, 0xD503349F) +__AARCH64_INSN_FUNCS(bti, 0xFFFFFF3F, 0xD503241f) #undef __AARCH64_INSN_FUNCS -- 2.30.2