From patchwork Fri Jan 13 18:03:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 43539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp416651wrt; Fri, 13 Jan 2023 10:20:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtX2eM+TGPyjEc4oeTMFu5OOc9hPxVC4oNj1VJUC3RCDLdtg3I/pLcA78uenJWTYAuL26ZH X-Received: by 2002:a05:6a21:e388:b0:b6:acf5:d32 with SMTP id cc8-20020a056a21e38800b000b6acf50d32mr3370242pzc.20.1673634021510; Fri, 13 Jan 2023 10:20:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673634021; cv=none; d=google.com; s=arc-20160816; b=lfFW3B+iWI3KZ0cFk7rx0CjsdeULHNs/BCUpn3E7zT3QouNNNr9qqDm5oN9J6eCVU0 7NeXkuUdNtdUk0S0pNsYiMaChCgUlrqQymQY+QRswHC+o7GObFQo+14o91Bn3a89BZKn 7LGWCGuIpvc+XcijY96vV2aKduAvXCpdXFt8HSxVw043NJJ3uK/hHLdF0B35lmucwjjF j4AezC0bpFLjvN+iB2YaoEQU3XOlrOIV9SBBUHtFovXJKyJb1uark59Lmoi6bVPtJirk bzYWHIRCYzj7BmQ1SkYdx0w8CsyBlFCj1Ok7G8L4cfySY6Lgnt0gaUd8VwhUmipzVQuq /QfA== 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=0b1q/66V7OxyZMSUqkK9eOFQSCl2KUbwU3IG4scZKTs=; b=BVBQQaNiYtLHCJk9cYOImHDv1kYuhyRgIUmRdpx0RaMANzPEgPHl7NzNRdR7KxeVb9 +o+e9HjBcwwzG5zt9tvzmSYNP0KAioUKXyjM2SnTJ6rMGW7+7RBsf99cVPLVqug1qSMI lxtsSuACQTEGlmC6sr+e9SlBUhTXTJGBGICGSWQuJVlrSfyjRm8pDavrJ9qm8Ol0mG/J uL4t+SFmBEV+00uaTIBXOrN0tmByaylLd4jIi3LatxSfQuLBhK3xncrI094vo0ABkOIw a9lVpoq6O4B2MtkIi3fZuE3Oe7TWQ+xh78m1AN23QisbgX8jaZjc5Hzt8Duj3aCk1dNR ZXWg== 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 28-20020a630f5c000000b004769f0faab8si20581731pgp.740.2023.01.13.10.20.08; Fri, 13 Jan 2023 10:20:21 -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 S229497AbjAMSN6 (ORCPT + 99 others); Fri, 13 Jan 2023 13:13:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbjAMSNO (ORCPT ); Fri, 13 Jan 2023 13:13:14 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA4CA7F9F8; Fri, 13 Jan 2023 10:05:14 -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 8661A176B; Fri, 13 Jan 2023 10:05:01 -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 769363F67D; Fri, 13 Jan 2023 10:04:17 -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 v2 5/8] arm64: insn: Add helpers for BTI Date: Fri, 13 Jan 2023 18:03:52 +0000 Message-Id: <20230113180355.2930042-6-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230113180355.2930042-1-mark.rutland@arm.com> References: <20230113180355.2930042-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?1754932468060762256?= X-GMAIL-MSGID: =?utf-8?q?1754932468060762256?= 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 aaf1f52fbf3e..139a88e4e852 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