From patchwork Mon Jan 9 13:58:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 40885 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2170950wrt; Mon, 9 Jan 2023 06:01:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvFuMczKdU6yrC8MT8+65R+BkwPpZBwiZIA65XFvcJKuMKIK3XYwZEzjPhTY7eAgZI1Wguh X-Received: by 2002:a62:3081:0:b0:578:5e94:22d0 with SMTP id w123-20020a623081000000b005785e9422d0mr65352589pfw.19.1673272887276; Mon, 09 Jan 2023 06:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673272887; cv=none; d=google.com; s=arc-20160816; b=tLnQvUq5XYnJluSk5OUi8Q41HBf4/BWiI4ZG2hTJN2Z/jeYxcN5obitbLQifbSOc3m kZJOg5/g8CpBgI+XIWZoXJP9hHqIOFEcU+eEdAA1ANvgcorHxO9gXox3FUWQh2cD0QIx xLcsZnxsCWzAPzW3JzmHUtERtJTPrRmXhoOaKcjrzg8GJS8pyBjoPx6wTUOQY5/Y3/14 vN+OlxHexirqWUHwYUEXi731ByiBJIf/MSZqnBl5H2AXO59jdFqz/lRyAG4BE7mB5tH9 Z0wkWZnbQhRl45E1K4iwe8QtqOfRs3oYYssa38oHLk44ChvjfhIrClP1DmijNnXJkz23 zwsQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n8-20020a654888000000b004707dd3280asi10401906pgs.204.2023.01.09.06.01.12; Mon, 09 Jan 2023 06:01:27 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754553790890842728?= X-GMAIL-MSGID: =?utf-8?q?1754553790890842728?= 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