From patchwork Wed Apr 22 09:56:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 227132 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 876A6C5518F for ; Wed, 22 Apr 2020 10:46:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5C3DD20882 for ; Wed, 22 Apr 2020 10:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587552392; bh=dAFfcstJg00S/Bt0ciKcvKr/afc1DBg6KrevEqRtYpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BWCgkN2GtM/pdBJj/kFvhgvSiuvCw4xJsN9FLiB/+q86vgAs+JkCe4r44yaDkVhRe DZCaV7N/35pGvg/fPmG5fSfSCocJKpj1y9Hcm24dF/GmCvzoCht89HEIfezFqPnvf2 lhAwwYsELBLiCny5e4S8SkKCBhiRfczma1eWkxXs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731915AbgDVKqb (ORCPT ); Wed, 22 Apr 2020 06:46:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:52764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729783AbgDVKQv (ORCPT ); Wed, 22 Apr 2020 06:16:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 3F8EA2076B; Wed, 22 Apr 2020 10:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587550610; bh=dAFfcstJg00S/Bt0ciKcvKr/afc1DBg6KrevEqRtYpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R+1foNRFX5/ZKI9y9c///eTa6MjkwTxQIcT6nzuS6o8+QtaCwsKkHAIjbGn+n7wz+ 8zDf5SZrTIK2sU9a8XIK/PkHKXAocdQoDKODj3PnTovIIcjvYyZT+GVGdF+TxOrdO3 c8ke/QU39UYyav0OrPinm4FHs2MA4G2pW85u0j3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Kelley , Tianyu Lan , Wei Liu Subject: [PATCH 5.4 021/118] x86/Hyper-V: Report crash register data or kmsg before running crash kernel Date: Wed, 22 Apr 2020 11:56:22 +0200 Message-Id: <20200422095035.165390638@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095031.522502705@linuxfoundation.org> References: <20200422095031.522502705@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tianyu Lan commit a11589563e96bf262767294b89b25a9d44e7303b upstream. We want to notify Hyper-V when a Linux guest VM crash occurs, so there is a record of the crash even when kdump is enabled. But crash_kexec_post_notifiers defaults to "false", so the kdump kernel runs before the notifiers and Hyper-V never gets notified. Fix this by always setting crash_kexec_post_notifiers to be true for Hyper-V VMs. Fixes: 81b18bce48af ("Drivers: HV: Send one page worth of kmsg dump over Hyper-V during panic") Reviewed-by: Michael Kelley Signed-off-by: Tianyu Lan Link: https://lore.kernel.org/r/20200406155331.2105-5-Tianyu.Lan@microsoft.com Signed-off-by: Wei Liu Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/mshyperv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -263,6 +263,16 @@ static void __init ms_hyperv_init_platfo cpuid_eax(HYPERV_CPUID_NESTED_FEATURES); } + /* + * Hyper-V expects to get crash register data or kmsg when + * crash enlightment is available and system crashes. Set + * crash_kexec_post_notifiers to be true to make sure that + * calling crash enlightment interface before running kdump + * kernel. + */ + if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) + crash_kexec_post_notifiers = true; + #ifdef CONFIG_X86_LOCAL_APIC if (ms_hyperv.features & HV_X64_ACCESS_FREQUENCY_MSRS && ms_hyperv.misc_features & HV_FEATURE_FREQUENCY_MSRS_AVAILABLE) {