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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5740C3DA71 for ; Sat, 17 Dec 2022 00:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbiLQAM5 (ORCPT ); Fri, 16 Dec 2022 19:12:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbiLQAL6 (ORCPT ); Fri, 16 Dec 2022 19:11:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C281F1144C; Fri, 16 Dec 2022 16:10:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4EEF4622CA; Sat, 17 Dec 2022 00:10:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2812AC433D2; Sat, 17 Dec 2022 00:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671235854; bh=iv68qWuwZhSAhJiol+KNif9+UsN3ck260qQGw6e9kYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QiT+rQNp8WARPCnJ6+H7i1hVY7nUPj8pEAVgl+yFBwWnJY3rbk6J8gxe8l7l3A9sY RRGc56haChEvAXLaP8t1eKl28BhqXJg65p2WrpRtrttv5siHYIkWukVUiB/UL98EzB x7Im9WsiAdO7Z0ysJKn/JYQGq1u+LFBoLJBJsr3Vd8/XhueKSvPQEmLWn4DfSEsyyj kCINZKuNCCsAIMM5tdgVUOyveiiBl/jNUidfug2dq0F7CDO5mKgxZDl8ps4Co2LZGH 0l/hC8idqPez6wiq+slH13EIKGTr04exRSF7MMmFeiOGFcvyzLN+oipAbR342OYHPb rZ3/ellPfo25A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gaurav Kohli , Michael Kelley , Wei Liu , Sasha Levin , kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 4/5] x86/hyperv: Remove unregister syscore call from Hyper-V cleanup Date: Fri, 16 Dec 2022 19:10:37 -0500 Message-Id: <20221217001038.41355-4-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221217001038.41355-1-sashal@kernel.org> References: <20221217001038.41355-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org From: Gaurav Kohli [ Upstream commit 32c97d980e2eef25465d453f2956a9ca68926a3c ] Hyper-V cleanup code comes under panic path where preemption and irq is already disabled. So calling of unregister_syscore_ops might schedule out the thread even for the case where mutex lock is free. hyperv_cleanup unregister_syscore_ops mutex_lock(&syscore_ops_lock) might_sleep Here might_sleep might schedule out this thread, where voluntary preemption config is on and this thread will never comes back. And also this was added earlier to maintain the symmetry which is not required as this can comes during crash shutdown path only. To prevent the same, removing unregister_syscore_ops function call. Signed-off-by: Gaurav Kohli Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1669443291-2575-1-git-send-email-gauravkohli@linux.microsoft.com Signed-off-by: Wei Liu Signed-off-by: Sasha Levin --- arch/x86/hyperv/hv_init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c index 762f10cdfb7a..95f98af74fdc 100644 --- a/arch/x86/hyperv/hv_init.c +++ b/arch/x86/hyperv/hv_init.c @@ -469,8 +469,6 @@ void hyperv_cleanup(void) { union hv_x64_msr_hypercall_contents hypercall_msr; - unregister_syscore_ops(&hv_syscore_ops); - /* Reset our OS id */ wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0); -- 2.35.1