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 F0CB1CDB465 for ; Mon, 16 Oct 2023 08:06:41 +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=HhmIR2efguhbURrIqlFV5z17YvSqb+Bca3brJ4GISsg=; b=yjUOqRP3uKqeYM KF8D62yWBoGYAopEJdTHBtym+xOPA4A1vhS5SnpKGYL1PdNUeqkaNBDAWU497YUR7L6x9aki1L+iS lXEC7BlTPVQAYtUQokN77bHU7HEJk3TBbmiIuxowFy3xZJv4rPW3noOqqG2sTgOeJYumdAc4KFVg4 7OiNW4ff6QZedGWq4eMMlAj5cTAWnmWiy1rFZBwzGS5CuYPeMTokwiL6Kf9XIjq2ixpTZdjd18Wq5 ekKMWJyB65meDfYjJ6lITNY3+VA1d5ebg7a8guhWWUpNWIWDffJlNIxxr/8Fc+3PxOFbYAS+uFbwk 5jb616sOx3xp9PosNMdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsIbl-008m4V-2t; Mon, 16 Oct 2023 08:05:49 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qsIaV-008lK4-0D for linux-arm-kernel@lists.infradead.org; Mon, 16 Oct 2023 08:04:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id B9789B810A9; Mon, 16 Oct 2023 08:04:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2B3EC433CA; Mon, 16 Oct 2023 08:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697443469; bh=tYAbMUo47hzBO0k9Sh1axJ+kEYt4ZGkxSjftJDzGMYg=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=MbPY0abhJW69Vir9ZjHBz31gDKIVWsSqUMMiPNW9y9sr+Zu4W3ER7+tvylAsgJFCp BWhFf3t0mA25rRwTJDLAw8aegQgCoWUzZnkCt84CG3Y6nerBBQ0b/nTnnRMDd6VyUn VQI72QQXH9YFd5NSLCvrAKAK2Qaa+ccbk1HKELL0= Subject: Patch "arm64: armv8_deprecated: move aarch32 helper earlier" has been added to the 5.15-stable tree To: alexandru.elisei@arm.com,anshuman.khandual@arm.com,broonie@kernel.org,catalin.marinas@arm.com,ebiederm@xmission.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,maz@kernel.org,pcc@google.com,peterz@infradead.org,ruanjinjie@huawei.com,sashal@kernel.org,scott@os.amperecomputing.com,stable@kernel.org,will@kernel.org Cc: From: Date: Mon, 16 Oct 2023 10:03:56 +0200 In-Reply-To: <20231011100655.979626-14-ruanjinjie@huawei.com> Message-ID: <2023101655-upright-daytime-be96@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_010431_392728_B87BEC4B 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.15-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.15 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:51 2023 From: Jinjie Ruan Date: Wed, 11 Oct 2023 10:06:53 +0000 Subject: arm64: armv8_deprecated: move aarch32 helper earlier To: , , , , , , , , , , , , , , , , , Cc: Message-ID: <20231011100655.979626-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.15/arm64-factor-insn-read-out-of-call_undef_hook.patch queue-5.15/arm64-rework-el0-mrs-emulation.patch queue-5.15/arm64-die-pass-err-as-long.patch queue-5.15/arm64-armv8_deprecated-rework-deprected-instruction-handling.patch queue-5.15/arm64-armv8_deprecated-fix-unused-function-error.patch queue-5.15/arm64-armv8_deprecated-move-aarch32-helper-earlier.patch queue-5.15/arm64-consistently-pass-esr_elx-to-die.patch queue-5.15/arm64-factor-out-el1-ssbs-emulation-hook.patch queue-5.15/arm64-report-el1-undefs-better.patch queue-5.15/arm64-armv8_deprecated-fold-ops-into-insn_emulation.patch queue-5.15/arm64-rework-bti-exception-handling.patch queue-5.15/arm64-rework-fpac-exception-handling.patch queue-5.15/arm64-split-el0-el1-undef-handlers.patch queue-5.15/arm64-allow-kprobes-on-el0-handlers.patch queue-5.15/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