Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp667756ybz; Wed, 22 Apr 2020 05:52:40 -0700 (PDT) X-Google-Smtp-Source: APiQypIJ0BwJRXy2QDlIw6bvlvu4DxDaIBrlkeomW4k6xnTXcnn1V/ye632N520uFlboErimMkPp X-Received: by 2002:a17:906:68cf:: with SMTP id y15mr24891355ejr.260.1587559960288; Wed, 22 Apr 2020 05:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587559960; cv=none; d=google.com; s=arc-20160816; b=YeTRpeBVyKdEFisEXyeZDihD0czR/K8MI+8Mu6AKGuMy+JpfXw8dQZD44isCqMYR5R 08oerVv3FTrD4xAIIhHVitKOGzmgC0CRgvqX+s7Gu5/NvjbkWFJDDnRK10ySNCqBlcp0 L1wZX/8O3swXuNIVuRKZ9GPpZi8ilFgfnqNkU6AatMUgI1+LPEDVBB7LlqJ5OGCRcJOW VmhcgRJGUwaNTR1y9e+e4lTbu4wBEHJWrsSRsrfJfNmjrdLpjzXPRSJf9W8hK1pO6zme ng3m3AYOov2ScA7kWo/uPkry8eMhTcYFOZyw89bI7E8suCYRcqxiAA9wQXDVkIuW6rar Fuig== 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=a3u8ENpURNWWbtjoYcE73CVPlYc/OwaEj6KcdNXbEdU=; b=FYRJ13GZLE/CL9jZKdIg00zowJYC+8tGdsuCYXpfy3anJvijILdBUw1mr3+8g4YcpW OcXwtCyDi8SbV39yocCcmw9zTaybePT5ZInv3BRhk6LI450kervIorkBFu6A6ZVlLyPs wonkElLvXQ3Wo8gD+fKbUk77BfqIPM9VQs8V581bgDLL2SIhRBn1VQqxK1v9DHHkzOM2 nj91R8oSG+wolQCM7XvQhc1QZRtmVCwFxljaKRiTrxkvLih+u3SpbAKIKTb07EVV0CGK h56Jes/bK9j4jqO6GBTbvQ6szlGkfoEaBjwrZ6THJTQR83koNJnhuonJCijPv7Kx+ESt WoJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=C7VKlygt; 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 d9si879670ejh.303.2020.04.22.05.52.17; Wed, 22 Apr 2020 05:52:40 -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=C7VKlygt; 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 S1731913AbgDVKqe (ORCPT + 99 others); Wed, 22 Apr 2020 06:46:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:52836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729785AbgDVKQx (ORCPT ); Wed, 22 Apr 2020 06:16:53 -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 D02062076E; Wed, 22 Apr 2020 10:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587550613; bh=CZgZG+rKEREoHAtxAe5bzj7Vxs8nuKcRagnJnrkCH1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C7VKlygtfp7BoEfObNaX3dY/mwZIJCzyqlM8LE/bZnjM6R4eXqJ4B8fC4SdJ1Fcfq nvTumntxGkrSb909LUlkeZwogOTDbk2uLQODax+cmLzzZdN4B4Q4VFQR5WJ6n7eZkz fGPYUsOUX1KT6KD3izPd8JAhPJ0xMoEv0xz+rhJc= 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 022/118] x86/Hyper-V: Report crash register data when sysctl_record_panic_msg is not set Date: Wed, 22 Apr 2020 11:56:23 +0200 Message-Id: <20200422095035.366179385@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 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 040026df7088c56ccbad28f7042308f67bde63df upstream. When sysctl_record_panic_msg is not set, the panic will not be reported to Hyper-V via hyperv_report_panic_msg(). So the crash should be reported via hyperv_report_panic(). 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-6-Tianyu.Lan@microsoft.com Signed-off-by: Wei Liu Signed-off-by: Greg Kroah-Hartman --- drivers/hv/vmbus_drv.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -48,6 +48,18 @@ static int hyperv_cpuhp_online; static void *hv_panic_page; +/* + * Boolean to control whether to report panic messages over Hyper-V. + * + * It can be set via /proc/sys/kernel/hyperv/record_panic_msg + */ +static int sysctl_record_panic_msg = 1; + +static int hyperv_report_reg(void) +{ + return !sysctl_record_panic_msg || !hv_panic_page; +} + static int hyperv_panic_event(struct notifier_block *nb, unsigned long val, void *args) { @@ -61,7 +73,7 @@ static int hyperv_panic_event(struct not * the notification here. */ if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE - && !hv_panic_page) { + && hyperv_report_reg()) { regs = current_pt_regs(); hyperv_report_panic(regs, val); } @@ -79,7 +91,7 @@ static int hyperv_die_event(struct notif * doing hyperv_report_panic_msg() later with kmsg data, don't do * the notification here. */ - if (!hv_panic_page) + if (hyperv_report_reg()) hyperv_report_panic(regs, val); return NOTIFY_DONE; } @@ -1262,13 +1274,6 @@ static void vmbus_isr(void) } /* - * Boolean to control whether to report panic messages over Hyper-V. - * - * It can be set via /proc/sys/kernel/hyperv/record_panic_msg - */ -static int sysctl_record_panic_msg = 1; - -/* * Callback from kmsg_dump. Grab as much as possible from the end of the kmsg * buffer and call into Hyper-V to transfer the data. */