Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp666900ybz; Wed, 22 Apr 2020 05:51:35 -0700 (PDT) X-Google-Smtp-Source: APiQypI3rzsR6XAIPAu5ejF3vT5Agc2DEw7faY6aNGagUT13w73EnpXQ79njQcx/qZXlZRM77sux X-Received: by 2002:a17:906:e01:: with SMTP id l1mr25196125eji.76.1587559895176; Wed, 22 Apr 2020 05:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587559895; cv=none; d=google.com; s=arc-20160816; b=bqog4MddRhaUAVyaD834nz8sZdjK7OKTKG/eV0DX7qlP540+R+RsPjb2i91RRzW9d1 zc8M4+LNwKu3fCIjqkh7+uV9wDTbVmkuQUcxgDjTounMKAp5Exvk0AWxBl3CdSBt8Mev DGYtkU/h0A0emOyy7sV3Xw5W6DmEYgsoX0P6RTMPUfB2C849AJ4CoJZXkxCKMZEEZ5HF mEpmHE1L9NiRQvVuQX5eDFSH2IrXfqpNvp8ZCnyKalHGz6fZnvZpmLZKhSUTdWLMwLtd amyBbWRID9NVG5JEgRZ+PenDapW++axVkYNgQrds0dAJsQjPK0nLz5zErW4cV3KgIITu NYqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QxPWrh+ar/NqVpI+luvflYfsHekOwNZW9CEzy51mUlY=; b=UWIXVuTZdkNtiGl/N5k29dQZxTidQiUtxlOFozdHOGqcyXAM6MeGI4+ERjBHhI5Gzq 5cB4qEf3g286KBAK/0CTGOb6RcbLdzX2P9aRGtHXALLnrO5MByHqetxo1DC4DC02H/Oa 4o3AXcpUudZFOnxxsnvKke7JaaTzU784QJ0bi7w/+mtreb0pLKhMbnGFXh3JBDH//3FZ nDAA6fSfrho8yhncltQG1bN6n4bPIYzEDsm49nrUUw46o0ax8TlAUP2i+GgDxC8Gr0Gw Qm1xZbt1cnSerKx1GfNZIYAV3J6FO8EaTpDNaE1CfN+04Ar8CZLR4xloj888Hcm0teN+ zJMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TMz72UTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si3835991edo.348.2020.04.22.05.51.12; Wed, 22 Apr 2020 05:51:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=TMz72UTy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731324AbgDVKfG (ORCPT + 99 others); Wed, 22 Apr 2020 06:35:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730378AbgDVKXr (ORCPT ); Wed, 22 Apr 2020 06:23:47 -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 B5D682076B; Wed, 22 Apr 2020 10:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587551027; bh=dAFfcstJg00S/Bt0ciKcvKr/afc1DBg6KrevEqRtYpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TMz72UTyUfRnVEq6syS7ChY4mc1NI56XK7hHFoUZ+mWABp1QblhfU075BaRrPHpkl 9j4LybvS9LAaIK+Dyl/unL+rvMzSV5NsdqPENc0yrT9FBjTttkNH2tBpYNxwa9A6Qt alNENw02yy4So3K/e/5v8eaiMXxZ+G5254LFeyPs= 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.6 028/166] x86/Hyper-V: Report crash register data or kmsg before running crash kernel Date: Wed, 22 Apr 2020 11:55:55 +0200 Message-Id: <20200422095051.698755510@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095047.669225321@linuxfoundation.org> References: <20200422095047.669225321@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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) {