From patchwork Tue Apr 28 17:24:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 11515211 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B05A613B2 for ; Tue, 28 Apr 2020 17:25:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8EA592082E for ; Tue, 28 Apr 2020 17:25:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gggiyyyf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="XEr2thpb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EA592082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OrjY6ty8zOBmduN10OPGTg0rTaaY+MsY6Eok3iZyrNk=; b=gggiyyyfnHiq+/ Z0p9opHApvPelYf6GaMfxVom00AbfCVEo+uCXlfdLpGsIez/gg5lhiCg/kThGIUWpgesr4DtnR5EP kvAv2yHGzeKmV2O8mQVO6TRJcxY+XdkxASFmQzt52WQ+DlmfnOupwPff5xogf5wLcLC2Qldn/so8n vrMfh1oNeQOYjeQkOk8CIOk9SNnX18jYRpJK+G2DcLz0ReIWlNjW501gCI7orutf0LCj4UPvi4pyb yovp0TwhtP9Cj+ppMyKZCHkIs93LS5IJAnLriHLzokCJOpJDA/TParcwCHglNqbCTE6j7XA49jRbE BFrS6Kc6RjuspGA0cTyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTTz4-0000Ks-I0; Tue, 28 Apr 2020 17:25:26 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTTyM-0005so-IA for linux-arm-kernel@lists.infradead.org; Tue, 28 Apr 2020 17:24:44 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5EF90208E0; Tue, 28 Apr 2020 17:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588094681; bh=PxzVwDQSxz91y669CDllRzV9oc10BYU/GB6IQFwvqB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEr2thpbtCnBg/TTm84AtqisvRQEE91Owavo3n/ysqCQ3AIJOaE74Nf+bMwJZRbd0 zC5ZxyvgQxMyaEmCd0up2N/F3uGM6ajtHrHKFF7BpD690jhJ1ZSTzN7B5kyweZD8w/ OeIqVBmEQEkcHzgAKgvNd3LUhGJpm18A3Wg9457E= From: Mark Brown To: Will Deacon , Catalin Marinas Subject: [PATCH v2 1/3] arm64: insn: Don't assume unrecognized HINTs are NOPs Date: Tue, 28 Apr 2020 18:24:31 +0100 Message-Id: <20200428172433.48830-2-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428172433.48830-1-broonie@kernel.org> References: <20200428172433.48830-1-broonie@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_102442_763171_3C7FFEF2 X-CRM114-Status: GOOD ( 11.68 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Brown , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Currently the kernel assumes that any HINT which it does not explicitly recognise is a NOP. This is not robust as new instructions may be added which need special handling, including recent extensions like PAC, and in any case software should only be using explicit NOP instructions for deliberate NOPs. This has the effect of rendering PAC and BTI instructions unprobeable which means that probes can't be inserted on the first instruction of functions built with those features. Signed-off-by: Mark Brown Acked-by: Catalin Marinas --- arch/arm64/kernel/insn.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index 4a9e773a177f..535a3a7a053e 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -58,14 +58,10 @@ bool __kprobes aarch64_insn_is_nop(u32 insn) return false; switch (insn & 0xFE0) { - case AARCH64_INSN_HINT_YIELD: - case AARCH64_INSN_HINT_WFE: - case AARCH64_INSN_HINT_WFI: - case AARCH64_INSN_HINT_SEV: - case AARCH64_INSN_HINT_SEVL: - return false; - default: + case AARCH64_INSN_HINT_NOP: return true; + default: + return false; } } From patchwork Tue Apr 28 17:24:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 11515213 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E0AB61392 for ; Tue, 28 Apr 2020 17:25:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6746208E0 for ; Tue, 28 Apr 2020 17:25:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="f8D4qkLu"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="IgCmugG7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6746208E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MRd/3sya2SM9r+ulhqiFQqyDvvSjPYwPvnWEKG+WC20=; b=f8D4qkLuCzxWs1 SO7z3QjUoHqStu1LkB2et0LovXr+klD+1b+nh7Sq5op+8kCFF8VPmrKeoKMT/jdsR0yM+j3bKfR8C vZEONNPZn7C0NQ1c5TtRv18u3Ff4YtNddTrYQF6kRD1kv0aUrWFeK9drxvpurf0s0bcpPyUd8dkLY 71E+4rra6L+KZR1yfaYxIFIhEKygh7DDklY2vYqwGS8d5bimP8hCn21XZJwbz9ovbu9Oc3D43qu7X tUGsnstMhVxKzT4xYfxXq3clXJNnnj4ORxeDt6VWaJqUF9dNI0MWp3P8ubKQSm0RD5ssDa2GS2WWR 1LE/vGtecRcBANrvA/qA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTTzH-0000Yb-MJ; Tue, 28 Apr 2020 17:25:40 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTTyR-0005w8-DS for linux-arm-kernel@lists.infradead.org; Tue, 28 Apr 2020 17:24:50 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6590C2082E; Tue, 28 Apr 2020 17:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588094684; bh=BTBvxvnYPmjX7jnrlowd5PXeLqXklOHbG19nzzE8a1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IgCmugG7Pkbt841g5YB71nl2Q+QmAO+aGtTD/op+8FG+dA2PAYA8FENAaMNrpnQG9 sk5Lh7gTmg+qKtLou4u4C3XQmYOrNa/8dZZsLlehBPt+M8dW6GCosTIsBcKxBCS+JQ KQ7UovOxLC6MyWRxmENUXWvbbBYFwqOXgtbDZYiQ= From: Mark Brown To: Will Deacon , Catalin Marinas Subject: [PATCH v2 2/3] arm64: insn: Add constants for PAC and BTI instruction decode Date: Tue, 28 Apr 2020 18:24:32 +0100 Message-Id: <20200428172433.48830-3-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428172433.48830-1-broonie@kernel.org> References: <20200428172433.48830-1-broonie@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_102447_876107_BBCE9833 X-CRM114-Status: GOOD ( 10.45 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Brown , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add constants for decoding the various PAC and BTI instructions defined in the HINT space. Since we are now decoding both the op2 and CRm fields rename the enum as well; this is compatible with what the existing users are doing. Signed-off-by: Mark Brown Acked-by: Catalin Marinas --- arch/arm64/include/asm/insn.h | 22 ++++++++++++++++++++-- arch/arm64/kernel/insn.c | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h index bb313dde58a4..e5a87f98a548 100644 --- a/arch/arm64/include/asm/insn.h +++ b/arch/arm64/include/asm/insn.h @@ -39,13 +39,31 @@ enum aarch64_insn_encoding_class { * system instructions */ }; -enum aarch64_insn_hint_op { +enum aarch64_insn_hint_cr_op { AARCH64_INSN_HINT_NOP = 0x0 << 5, AARCH64_INSN_HINT_YIELD = 0x1 << 5, AARCH64_INSN_HINT_WFE = 0x2 << 5, AARCH64_INSN_HINT_WFI = 0x3 << 5, AARCH64_INSN_HINT_SEV = 0x4 << 5, AARCH64_INSN_HINT_SEVL = 0x5 << 5, + + AARCH64_INSN_HINT_PACIA_1716 = 0x08 << 5, + AARCH64_INSN_HINT_PACIB_1716 = 0x0A << 5, + AARCH64_INSN_HINT_AUTIA_1716 = 0x0B << 5, + AARCH64_INSN_HINT_AUTIB_1716 = 0x0C << 5, + AARCH64_INSN_HINT_PACIAZ = 0x18 << 5, + AARCH64_INSN_HINT_PACIASP = 0x19 << 5, + AARCH64_INSN_HINT_PACIBZ = 0x1A << 5, + AARCH64_INSN_HINT_PACIBSP = 0x1B << 5, + AARCH64_INSN_HINT_AUTIAZ = 0x1C << 5, + AARCH64_INSN_HINT_AUTIASP = 0x1D << 5, + AARCH64_INSN_HINT_AUTIBZ = 0x1E << 5, + AARCH64_INSN_HINT_AUTIBSP = 0x1F << 5, + + AARCH64_INSN_HINT_BTI = 0x20 << 5, + AARCH64_INSN_HINT_BTIC = 0x22 << 5, + AARCH64_INSN_HINT_BTIJ = 0x24 << 5, + AARCH64_INSN_HINT_BTIJC = 0x2C << 5, }; enum aarch64_insn_imm_type { @@ -370,7 +388,7 @@ u32 aarch64_insn_gen_comp_branch_imm(unsigned long pc, unsigned long addr, enum aarch64_insn_branch_type type); u32 aarch64_insn_gen_cond_branch_imm(unsigned long pc, unsigned long addr, enum aarch64_insn_condition cond); -u32 aarch64_insn_gen_hint(enum aarch64_insn_hint_op op); +u32 aarch64_insn_gen_hint(enum aarch64_insn_hint_cr_op op); u32 aarch64_insn_gen_nop(void); u32 aarch64_insn_gen_branch_reg(enum aarch64_insn_register reg, enum aarch64_insn_branch_type type); diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index 535a3a7a053e..fd77cdd87c47 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -570,7 +570,7 @@ u32 aarch64_insn_gen_cond_branch_imm(unsigned long pc, unsigned long addr, offset >> 2); } -u32 __kprobes aarch64_insn_gen_hint(enum aarch64_insn_hint_op op) +u32 __kprobes aarch64_insn_gen_hint(enum aarch64_insn_hint_cr_op op) { return aarch64_insn_get_hint_value() | op; } From patchwork Tue Apr 28 17:24:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 11515215 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 294CB13B2 for ; Tue, 28 Apr 2020 17:25:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 07FEF2082E for ; Tue, 28 Apr 2020 17:25:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oaLABVcG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="D8lQ9R1b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 07FEF2082E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qfDHk+nmYAX9XLn09ubdz9c4FNrFbaAYTQCCwxUkXMU=; b=oaLABVcGN13mMr 7SBRLm5jn58NZ9OYO60JtlTOGEkm63N7RSZlNhj2dJpqbI6ajY9rdOlvYADXlbyW9RfD3OC0OZDCi URFtxHoiJYdTju/Z+TCt5PWWIgds9ldAWU5UwF0fnzz7WRp/xyQ9hvRXOROgZlNG/O6QcgcfVq8W/ Ylw5mMrYxiaDMnvpjJDQpT/BJtCGlNNq3BnXKA61F8LjjPdoQCe6VK/1QyHgdKNSaisorCcavpzmr wDIsdv5bms3TnMYeYzRhtdQqmGvWU6Aua2keSus+vMv7/aGVp45EzguDDKK9CPm7Y4sIERRa0Crdr vn0NLWVmqaKuzAqRrdBQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTTzW-0000no-Tt; Tue, 28 Apr 2020 17:25:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jTTyS-0005y1-JJ for linux-arm-kernel@lists.infradead.org; Tue, 28 Apr 2020 17:24:50 +0000 Received: from localhost (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D14A208FE; Tue, 28 Apr 2020 17:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588094687; bh=CsAfCQM9YW9smMQnQOFLHxVQTJeTOI7TuNeVh2H8D2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8lQ9R1b2aZntAy+cMnyCJ/S36ozav6OifDuaCrt47cQPUImBX65fwliBedwHeMGq Hho/4iK0rlc+1ifExHTYzdYx4PO5HH3MTb3VgMNtzNA0Fh8pFNVjYlraQTbcqHvU47 ADSVxR9K9h8ay48/8tOue2AX0jHSRvtUKDl1t/OU= From: Mark Brown To: Will Deacon , Catalin Marinas Subject: [PATCH v2 3/3] arm64: insn: Report PAC and BTI instructions as NOPs Date: Tue, 28 Apr 2020 18:24:33 +0100 Message-Id: <20200428172433.48830-4-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200428172433.48830-1-broonie@kernel.org> References: <20200428172433.48830-1-broonie@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200428_102448_700835_D4D5CAD5 X-CRM114-Status: UNSURE ( 8.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at https://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Brown , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In order to allow probing of PAC and BTI instructions without more specialized support recognize them as NOPs. Signed-off-by: Mark Brown Acked-by: Catalin Marinas --- arch/arm64/kernel/insn.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/kernel/insn.c b/arch/arm64/kernel/insn.c index fd77cdd87c47..82afc582d29a 100644 --- a/arch/arm64/kernel/insn.c +++ b/arch/arm64/kernel/insn.c @@ -57,7 +57,27 @@ bool __kprobes aarch64_insn_is_nop(u32 insn) if (!aarch64_insn_is_hint(insn)) return false; + /* + * The PAC and BTI instructons are not strictly NOPs but until + * better support is added we can treat them as such. + */ switch (insn & 0xFE0) { + case AARCH64_INSN_HINT_PACIA_1716: + case AARCH64_INSN_HINT_PACIB_1716: + case AARCH64_INSN_HINT_AUTIA_1716: + case AARCH64_INSN_HINT_AUTIB_1716: + case AARCH64_INSN_HINT_PACIAZ: + case AARCH64_INSN_HINT_PACIASP: + case AARCH64_INSN_HINT_PACIBZ: + case AARCH64_INSN_HINT_PACIBSP: + case AARCH64_INSN_HINT_AUTIAZ: + case AARCH64_INSN_HINT_AUTIASP: + case AARCH64_INSN_HINT_AUTIBZ: + case AARCH64_INSN_HINT_AUTIBSP: + case AARCH64_INSN_HINT_BTI: + case AARCH64_INSN_HINT_BTIC: + case AARCH64_INSN_HINT_BTIJ: + case AARCH64_INSN_HINT_BTIJC: case AARCH64_INSN_HINT_NOP: return true; default: