From patchwork Mon Jan 23 13:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 47157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1617687wrn; Mon, 23 Jan 2023 05:48:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtOBkNBU2uvE7ncbk+OO4gw3K7elNDgdc/0cRBs3puCoSVO2Cixs4NqvkYAhFE/Gj8eKBNL X-Received: by 2002:a17:907:6c16:b0:86f:3dfa:4016 with SMTP id rl22-20020a1709076c1600b0086f3dfa4016mr28897036ejc.7.1674481712617; Mon, 23 Jan 2023 05:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674481712; cv=none; d=google.com; s=arc-20160816; b=HK4/ku4j0J+TFPeLrq84CJVMh0PzXytOlFUWYnMtrpDXN728PGaCmRg/aPaHTZZgAA GBIUfn+ZdQupzMGJqxni4kbsYSUhh9YunEtm6gObhJvz47YwhzlbSw7IYtaBH3WyKWAv cjhjR/G9z1udxaLg64/K9gPHLikNK/EwM5hUVLvpSeoSax21/NDmGD+HhimoDvw8he5v lGNJa8i/zev3tpO4WyfYgy8COFKgIARMu6CMIymXpJNavKaYxkMRkjSibqjjruJdBaOj +Qq2JsIRH6DjejIxvj5+7Ms48VovuJOISuEBVI/Ew+10vI42CMNU06HFhp9JLmWtmYYO hrdQ== 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=LdilEI3yihaJMDSEgw9Qb7ALq0zXPxi0eXUW+SH4JxsUCKrNLiIHVLYiFjv3x/u293 INoRylsjkP6/YGL5CcHdLQlmw4B7Q3IJ+bwMDWF3ggUkNIPXDIlWRN16SSoYhUNRAUPn koyEOUYfWitgb8X1hy2xOa5AnIds60wnXU76hn09LYibZn7aJ/72s5MwSqN9zKg2x0kw q5GHRMIW6/ThNvsLCLSki+V5ogLwgsK4Q9NTZA/mELiRE9dXih6TxKvgtPmUUFdb6nNz 0IffR1BH6I0feiWXwWOgd+IfTnUGYTeSygPppfoTh9MTBvoQvlU9dnDhzuJjjnoliTKH N/fg== 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 du4-20020a17090772c400b007b889a69895si59216133ejc.589.2023.01.23.05.48.09; Mon, 23 Jan 2023 05:48:32 -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 S231974AbjAWNqp (ORCPT + 99 others); Mon, 23 Jan 2023 08:46:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231849AbjAWNqg (ORCPT ); Mon, 23 Jan 2023 08:46:36 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5BB8426586; Mon, 23 Jan 2023 05:46:25 -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 C92BE1655; Mon, 23 Jan 2023 05:47:06 -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 35B5A3F64C; Mon, 23 Jan 2023 05:46:23 -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 v3 5/8] arm64: insn: Add helpers for BTI Date: Mon, 23 Jan 2023 13:46:00 +0000 Message-Id: <20230123134603.1064407-6-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230123134603.1064407-1-mark.rutland@arm.com> References: <20230123134603.1064407-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?1755821335890676908?= X-GMAIL-MSGID: =?utf-8?q?1755821335890676908?= 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