Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1282583pxb; Sun, 21 Feb 2021 19:30:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBXoy8HqATA2hF7heU49LVa/RNTYiBn9wTZmCigV1mufKwTb2abYnN7P5ARPbfYcnIEPoT X-Received: by 2002:a05:6402:4316:: with SMTP id m22mr20540827edc.64.1613964627194; Sun, 21 Feb 2021 19:30:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613964627; cv=none; d=google.com; s=arc-20160816; b=sHEK8HGHMB9pO/raXC2ieYHTLGiKDRa0Szjr4t9MeTKhiXDYmIVfjCqjGaUjULATpl 5J3PGT/EPn4/mHODijmMyR48QWXOz2VQsHWiULtJ11vg5mhfUxlJIQCXXi6YP9+JkqBu cMUPHdYz1IabE2aQMHaP5xXokJ1rRBnq/Z5TQ/iNQOlDaILNH7JFD7ncs/HTf5jbSi42 dTmKkzh8pRTiO70EbyUS2MCX1zBGk2apOj1+Q5XLqRoVRHSGz4mgyprHZTkcPPT8k+uF A2na3fUARWS0hQ0DM3iM0DoBuCqSyiBPNCTczOskYbvsfh1ayWZlOHCWbHBCxoJ+syI5 9Kvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mbD8hy9Yy3C6SJqlClP5sesBWnkhT/EtrY5hBmv5k5U=; b=KbPoy7IniSrcQ1tmFuOBmbUtiL9Aa23GcaB7pV1e2QAyADSKMTFVsYqJqSYJpXqtp2 S+X/NDM1K3sGmUmHMDUiQrVDx6bQQUTDd0n1LDBl+qVXChlTPnn1RSqoJoth+1riLM39 PDAU2h5x4BgEv+5cpIQhGN6w0CCoXsYeTCGf66l4vR8ceEQbEgTeBtWr1QpPqHWYqX3N n9uzjtV3TLPj+UudVulRsWEMsIrICxZ3MiHOF0MyjxYoKRST2J8GH3zVulCxjAbzcMdC 34paOqza9LojqndAGKFvSkHYpMVQCIh7p6Silk015SS8RyW74fE/S95l+XUVRxfjoO5h Rfyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BVK0gJsP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si11911927edb.204.2021.02.21.19.30.05; Sun, 21 Feb 2021 19:30:27 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=BVK0gJsP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbhBVD2V (ORCPT + 99 others); Sun, 21 Feb 2021 22:28:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbhBVD2U (ORCPT ); Sun, 21 Feb 2021 22:28:20 -0500 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5644CC061574; Sun, 21 Feb 2021 19:27:34 -0800 (PST) Received: by mail-qv1-xf32.google.com with SMTP id 2so5498539qvd.0; Sun, 21 Feb 2021 19:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mbD8hy9Yy3C6SJqlClP5sesBWnkhT/EtrY5hBmv5k5U=; b=BVK0gJsPDQ0o7t/USDBP172E6JLHTpNgdxMLXVuXF/IaH1P+Rw8VktFzl5N4inlZ7U XHw0K+H+/LV76LETngAix65NhegnvgdkIgME5K/FZ3CbVX4hQWa1OplE5F2IhcuUjtin 1o16GdBRapfHYlGjISzJkCRV50HMqJMOy6AZH1cKmhsxD/i9eJUQF4KtnZqXYbZdYTDU zCP67m1+o2rgUYqUkiRrVCxvbaZ3/Z3Kj3y7nc2W9cZyQLByc+hanp/cFSuzPXtzFT+L MJtfpiXXi3TGXgWm10tgX9FuNv1SCVDkIxE2k2kWFjDeUFB2MPEj++Ks99UUrIWUTnjP u0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mbD8hy9Yy3C6SJqlClP5sesBWnkhT/EtrY5hBmv5k5U=; b=FW4Lc03PEa8oSChndFUJy5NV+ggt7i+7LRf79/EvflbfTSpWwX358EmWPbcoPFAZ4a r2bGM8ttW5RlHDyMaf7GbaqRCkKwIgINnhc76y+9xI2Vc5IrWGg53eiqANPuHv300mPr e79GCyaxUhpH7ItOCKi+P0LbuteyoweCHGKY88suJ3AoqPMXAN1/aJHE3MOsgXx0AMZx mxNyOWqhn2/lm8mksl86mRhEzwvpp77DM8/BIVzAzNd6gL9mrdOhp/qJyLboisd6vGDZ fZJUQiug8vKjFR7h6BWmGRMrlUL84s37ffG6Qfet2q2R8m3ERJd+YSfnHCcLur6tKEzS LHHA== X-Gm-Message-State: AOAM530IAUhxqmfEEOErIU5MTt9XMq9dw5U9nbQ7QUvNaHGXImYQb31/ iJpi083fGhe3p3pTZW0qbW4= X-Received: by 2002:a0c:90ae:: with SMTP id p43mr19150256qvp.47.1613964453592; Sun, 21 Feb 2021 19:27:33 -0800 (PST) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id t6sm11398274qkd.127.2021.02.21.19.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Feb 2021 19:27:33 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id AE38F27C0054; Sun, 21 Feb 2021 22:27:32 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 21 Feb 2021 22:27:32 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkedvgdehlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpedvleeigedugfegveejhfejveeuveeiteejieekvdfgjeefudehfefhgfegvdeg jeenucfkphepudefuddruddtjedrudegjedruddvieenucevlhhushhtvghrufhiiigvpe dunecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnodhmvghsmhhtphgruhhthhhp vghrshhonhgrlhhithihqdeiledvgeehtdeigedqudejjeekheehhedvqdgsohhquhhnrd hfvghngheppehgmhgrihhlrdgtohhmsehfihigmhgvrdhnrghmvg X-ME-Proxy: Received: from localhost (unknown [131.107.147.126]) by mail.messagingengine.com (Postfix) with ESMTPA id 5118C1080063; Sun, 21 Feb 2021 22:27:32 -0500 (EST) Date: Mon, 22 Feb 2021 11:27:00 +0800 From: Boqun Feng To: Michael Kelley Cc: sthemmin@microsoft.com, kys@microsoft.com, wei.liu@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, daniel.lezcano@linaro.org, arnd@arndb.de, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH 04/10] Drivers: hv: vmbus: Move hyperv_report_panic_msg to arch neutral code Message-ID: References: <1611779025-21503-1-git-send-email-mikelley@microsoft.com> <1611779025-21503-5-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1611779025-21503-5-git-send-email-mikelley@microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2021 at 12:23:39PM -0800, Michael Kelley wrote: > With the new Hyper-V MSR set function, hyperv_report_panic_msg() can be > architecture neutral, so move it out from under arch/x86 and merge into > hv_kmsg_dump(). This move also avoids needing a separate implementation > under arch/arm64. > > No functional change. > > Signed-off-by: Michael Kelley Reviewed-by: Boqun Feng Regards, Boqun > --- > arch/x86/hyperv/hv_init.c | 27 --------------------------- > drivers/hv/vmbus_drv.c | 24 +++++++++++++++++++----- > include/asm-generic/mshyperv.h | 1 - > 3 files changed, 19 insertions(+), 33 deletions(-) > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > index 9b2cdbe..22e9557 100644 > --- a/arch/x86/hyperv/hv_init.c > +++ b/arch/x86/hyperv/hv_init.c > @@ -452,33 +452,6 @@ void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die) > } > EXPORT_SYMBOL_GPL(hyperv_report_panic); > > -/** > - * hyperv_report_panic_msg - report panic message to Hyper-V > - * @pa: physical address of the panic page containing the message > - * @size: size of the message in the page > - */ > -void hyperv_report_panic_msg(phys_addr_t pa, size_t size) > -{ > - /* > - * P3 to contain the physical address of the panic page & P4 to > - * contain the size of the panic data in that page. Rest of the > - * registers are no-op when the NOTIFY_MSG flag is set. > - */ > - wrmsrl(HV_X64_MSR_CRASH_P0, 0); > - wrmsrl(HV_X64_MSR_CRASH_P1, 0); > - wrmsrl(HV_X64_MSR_CRASH_P2, 0); > - wrmsrl(HV_X64_MSR_CRASH_P3, pa); > - wrmsrl(HV_X64_MSR_CRASH_P4, size); > - > - /* > - * Let Hyper-V know there is crash data available along with > - * the panic message. > - */ > - wrmsrl(HV_X64_MSR_CRASH_CTL, > - (HV_CRASH_CTL_CRASH_NOTIFY | HV_CRASH_CTL_CRASH_NOTIFY_MSG)); > -} > -EXPORT_SYMBOL_GPL(hyperv_report_panic_msg); > - > bool hv_is_hyperv_initialized(void) > { > union hv_x64_msr_hypercall_contents hypercall_msr; > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > index 089f165..8affe68 100644 > --- a/drivers/hv/vmbus_drv.c > +++ b/drivers/hv/vmbus_drv.c > @@ -1365,22 +1365,36 @@ static void hv_kmsg_dump(struct kmsg_dumper *dumper, > enum kmsg_dump_reason reason) > { > size_t bytes_written; > - phys_addr_t panic_pa; > > /* We are only interested in panics. */ > if ((reason != KMSG_DUMP_PANIC) || (!sysctl_record_panic_msg)) > return; > > - panic_pa = virt_to_phys(hv_panic_page); > - > /* > * Write dump contents to the page. No need to synchronize; panic should > * be single-threaded. > */ > kmsg_dump_get_buffer(dumper, false, hv_panic_page, HV_HYP_PAGE_SIZE, > &bytes_written); > - if (bytes_written) > - hyperv_report_panic_msg(panic_pa, bytes_written); > + if (!bytes_written) > + return; > + /* > + * P3 to contain the physical address of the panic page & P4 to > + * contain the size of the panic data in that page. Rest of the > + * registers are no-op when the NOTIFY_MSG flag is set. > + */ > + hv_set_register(HV_REGISTER_CRASH_P0, 0); > + hv_set_register(HV_REGISTER_CRASH_P1, 0); > + hv_set_register(HV_REGISTER_CRASH_P2, 0); > + hv_set_register(HV_REGISTER_CRASH_P3, virt_to_phys(hv_panic_page)); > + hv_set_register(HV_REGISTER_CRASH_P4, bytes_written); > + > + /* > + * Let Hyper-V know there is crash data available along with > + * the panic message. > + */ > + hv_set_register(HV_REGISTER_CRASH_CTL, > + (HV_CRASH_CTL_CRASH_NOTIFY | HV_CRASH_CTL_CRASH_NOTIFY_MSG)); > } > > static struct kmsg_dumper hv_kmsg_dumper = { > diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h > index 10c97a9..6a8072f 100644 > --- a/include/asm-generic/mshyperv.h > +++ b/include/asm-generic/mshyperv.h > @@ -170,7 +170,6 @@ static inline int cpumask_to_vpset(struct hv_vpset *vpset, > } > > void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die); > -void hyperv_report_panic_msg(phys_addr_t pa, size_t size); > bool hv_is_hyperv_initialized(void); > bool hv_is_hibernation_supported(void); > void hyperv_cleanup(void); > -- > 1.8.3.1 >