From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C961DCDB465 for ; Mon, 16 Oct 2023 08:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:From:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=k74MTpd27/i4gnO6KFdgzkxmCP6JtBGYyu7EQw6c0lE=; b=GtOXQQeMQIKN7n IgDqBwXd6MqDNTdkA80iov0iv9SAU9Ar6qpCIWsdEPJ3KywAtGncibuW1tt5Mag411nCpdmR7c1G3 gaJsQRRH5e2c52tD45i2B+eT28YSuOs/H3XQ7Sm91FEYQYE4a9f0Zea381C/cgSiyKXzudwutTzol 2M2seg3h6YIbaYA9U5rzZi0gjSgJqw5MG3C1xCUYTJ9Rg86jUWSliwNt2oYpHRC1oARLtfN58Y1O7 Zva9ZtEnW96AqpBA7NrUW9y8c0C3xwk3xEC2gfe8DamXJMTUSbUOuglNxSc6CYAY2dYYdrSNdv8sp ugGSNBdkCoXtKclqPn4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsIZ1-008kOY-1i; Mon, 16 Oct 2023 08:02:59 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsIYi-008kCq-2z for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2023 08:02:44 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5C4AC60C08; Mon, 16 Oct 2023 08:02:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BFDEC433C7; Mon, 16 Oct 2023 08:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697443360; bh=PNlP8zpuY3MYAh6fv+EKajbTQWKfNNkg4dOhxsWmi5Y=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=V5IKjBb3e1k+17F2ZhACjieaKruQiT56ePDUejbdjIPdmsPhESWt+TzKe/CMYCdgQ C8uG6IVZYazDwyaU3vjkB9vf9iC24/FjGPo1bq/51+g/CC4aDKcvShudRIhpitPXBB VV5Y4yt5Y7qRmRuEekZogIhYWwv8wGX6z5cJGX3U= Subject: Patch "arm64: armv8_deprecated: move aarch32 helper earlier" has been added to the 5.10-stable tree To: anshuman.khandual@arm.com,ardb@kernel.org,broonie@kernel.org,catalin.marinas@arm.com,ebiederm@xmission.com,f.fainelli@gmail.com,gregkh@linuxfoundation.org,haibinzhang@tencent.com,hewenliang4@huawei.com,james.morse@arm.com,joey.gouly@arm.com,linux-arm-kernel@lists.infradead.org,mark.rutland@arm.com,peterz@infradead.org,ruanjinjie@huawei.com,sashal@kernel.org,scott@os.amperecomputing.com,stable@kernel.org,will@kernel.org,youngmin.nam@samsung.com,yuzenghui@huawei.com Cc: From: Date: Mon, 16 Oct 2023 10:02:23 +0200 In-Reply-To: <20231011100545.979577-14-ruanjinjie@huawei.com> Message-ID: <2023101623-purchase-number-e29f@gregkh> MIME-Version: 1.0 X-stable: commit X-Patchwork-Hint: ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231016_010241_054559_0156C07F X-CRM114-Status: GOOD ( 18.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is a note to let you know that I've just added the patch titled arm64: armv8_deprecated: move aarch32 helper earlier to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm64-armv8_deprecated-move-aarch32-helper-earlier.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From ruanjinjie@huawei.com Wed Oct 11 12:07:12 2023 From: Jinjie Ruan Date: Wed, 11 Oct 2023 10:05:43 +0000 Subject: arm64: armv8_deprecated: move aarch32 helper earlier To: , , , , , , , , , , , , , , , , , , Cc: Message-ID: <20231011100545.979577-14-ruanjinjie@huawei.com> From: Mark Rutland commit 0c5f416219da3795dc8b33e5bb7865a6b3c4e55c upstream. Subsequent patches will rework the logic in armv8_deprecated.c. In preparation for subsequent changes, this patch moves some shared logic earlier in the file. This will make subsequent diffs simpler and easier to read. At the same time, drop the `__kprobes` annotation from aarch32_check_condition(), as this is only used for traps from compat userspace, and has no risk of recursion within kprobes. As this is the last kprobes annotation in armve8_deprecated.c, we no longer need to include . Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: James Morse Cc: Joey Gouly Cc: Peter Zijlstra Cc: Will Deacon Link: https://lore.kernel.org/r/20221019144123.612388-9-mark.rutland@arm.com Signed-off-by: Will Deacon Signed-off-by: Jinjie Ruan Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/armv8_deprecated.c | 39 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 20 deletions(-) --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -17,7 +17,6 @@ #include #include #include -#include #define CREATE_TRACE_POINTS #include "trace-events-emulation.h" @@ -52,6 +51,25 @@ struct insn_emulation { int max; }; +#define ARM_OPCODE_CONDTEST_FAIL 0 +#define ARM_OPCODE_CONDTEST_PASS 1 +#define ARM_OPCODE_CONDTEST_UNCOND 2 + +#define ARM_OPCODE_CONDITION_UNCOND 0xf + +static unsigned int aarch32_check_condition(u32 opcode, u32 psr) +{ + u32 cc_bits = opcode >> 28; + + if (cc_bits != ARM_OPCODE_CONDITION_UNCOND) { + if ((*aarch32_opcode_cond_checks[cc_bits])(psr)) + return ARM_OPCODE_CONDTEST_PASS; + else + return ARM_OPCODE_CONDTEST_FAIL; + } + return ARM_OPCODE_CONDTEST_UNCOND; +} + /* * Implement emulation of the SWP/SWPB instructions using load-exclusive and * store-exclusive. @@ -138,25 +156,6 @@ static int emulate_swpX(unsigned int add return res; } -#define ARM_OPCODE_CONDTEST_FAIL 0 -#define ARM_OPCODE_CONDTEST_PASS 1 -#define ARM_OPCODE_CONDTEST_UNCOND 2 - -#define ARM_OPCODE_CONDITION_UNCOND 0xf - -static unsigned int __kprobes aarch32_check_condition(u32 opcode, u32 psr) -{ - u32 cc_bits = opcode >> 28; - - if (cc_bits != ARM_OPCODE_CONDITION_UNCOND) { - if ((*aarch32_opcode_cond_checks[cc_bits])(psr)) - return ARM_OPCODE_CONDTEST_PASS; - else - return ARM_OPCODE_CONDTEST_FAIL; - } - return ARM_OPCODE_CONDTEST_UNCOND; -} - /* * swp_handler logs the id of calling process, dissects the instruction, sanity * checks the memory location, calls emulate_swpX for the actual operation and Patches currently in stable-queue which might be from ruanjinjie@huawei.com are queue-5.10/arm64-factor-insn-read-out-of-call_undef_hook.patch queue-5.10/arm64-rework-el0-mrs-emulation.patch queue-5.10/arm64-die-pass-err-as-long.patch queue-5.10/arm64-armv8_deprecated-rework-deprected-instruction-handling.patch queue-5.10/arm64-armv8_deprecated-fix-unused-function-error.patch queue-5.10/arm64-armv8_deprecated-move-aarch32-helper-earlier.patch queue-5.10/arm64-consistently-pass-esr_elx-to-die.patch queue-5.10/arm64-factor-out-el1-ssbs-emulation-hook.patch queue-5.10/arm64-report-el1-undefs-better.patch queue-5.10/arm64-armv8_deprecated-fold-ops-into-insn_emulation.patch queue-5.10/arm64-rework-bti-exception-handling.patch queue-5.10/arm64-rework-fpac-exception-handling.patch queue-5.10/arm64-split-el0-el1-undef-handlers.patch queue-5.10/arm64-allow-kprobes-on-el0-handlers.patch queue-5.10/arm64-armv8_deprecated-move-emulation-functions.patch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel