Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp385059pxu; Tue, 5 Jan 2021 13:59:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJhvSQ/WFoz3XmdWQPiTPJPkPu8u7S+XHqstdANdPg6iHL+IIG1+gEM/LBIxmyFVC/7B6k X-Received: by 2002:a50:e719:: with SMTP id a25mr1849663edn.12.1609883942559; Tue, 05 Jan 2021 13:59:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609883942; cv=none; d=google.com; s=arc-20160816; b=a40PwmhEuuK2Z3kG4MzhSs7vVWNn3EbTnAFEUmHYTMV3Oh2PbwOGd3i2bAF1CVsyE1 oVzEEHSuXNPGSvV6nk5pdm6p5WZyx4xXwS69LPO1S+t7JKJj5xvMdpFufG7hwN7NwtWM 4emcKS8/rcZjFGhz6Ib7glw1LS1oV4UhTGYIhl+HzZKtrnOdJwYr4FJNp2s9LOjl7Mne m1WbuOfkV48eonYbS26vl02yi6pGplwZyzL0X+kAthWBBcgVcZOiFexumqJ4vIXkHTf7 rwWg81PKRo0hDLDa8Kg0xYazlp3bFRgmn2ajYXnopUpKZ0WDTIppwddEyKqOwiR7N3cx HDvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cb/eKs9gfJ+4Q5QjFJ08GTvJMZDgfPltkPQD+Pfflgg=; b=C10u0H7isNJmvb8RRTKlcL5HI13vK08tFzRIUs82PFcgXWPFzP+cIM8NQ0Sm4dY9vE RuiDFQ8ONN7wrW4GiZ091RIWI9zhEnkfavwaqX5g2o/XTqNtmXUHE/DIxh+Fr6OqWcgC SAvFQ0fZ/GQEfAcvsVonY+KzsbkJcMVM3RZcI/TydHle0h07R6Wvho1jEGKFZbgVvVod pNpJ7GzQduptYbqRXZFFvnb+9TaZsva+Sf2+2USTvlZfD8yqoiRGf04ykbDna4CK3cZ+ hg5c1NHSxzYCbAMZrmF70F7G5HbJkrWQ/lDGt5hu+vev9VPilRBwdwE8MO/6hUx3lpYm mrOg== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si151175edx.473.2021.01.05.13.58.39; Tue, 05 Jan 2021 13:59:02 -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; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729536AbhAERyC (ORCPT + 99 others); Tue, 5 Jan 2021 12:54:02 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:36242 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbhAERyB (ORCPT ); Tue, 5 Jan 2021 12:54:01 -0500 Received: by mail-wm1-f49.google.com with SMTP id y23so360022wmi.1; Tue, 05 Jan 2021 09:53:45 -0800 (PST) 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:user-agent; bh=cb/eKs9gfJ+4Q5QjFJ08GTvJMZDgfPltkPQD+Pfflgg=; b=froojAol5AVIKEo/bjq4JHDK3MLBQw2EtKygDps5+H6rk+2pyprBd/DcyXvjyxhpTF nRbrPaPJ8KLCTOF2l0I2BuwsdaRBx/9YncQ6aSikGvDtWqmwx2BiP9Kl4w+Jb6HknD8X cQcUXSqme7mZHWlK9R1XSNusBC9TmfrQoqtZO9JUnBK/KcBcf2/zoN2T8HiB/qh7uGn9 vtCvs9KEhwbvz608YVMLmf7/ytsK92fAK/cp0Yq6PoKuuWdvf+Hdrg0ueLGDp5i8srQY iqDruMgSpH0XIcNnyK/tY9c/IfhD6PtygPKRNX14jIyPnF3iZts9jWHY2grcOVLWNfJs /amA== X-Gm-Message-State: AOAM532+aEQDeCumX5MXjJE/GRkUpzoIaKdXEku/Fx6dodkEqV6j4biq ZziW2drwzy21OsBaF6aotYpxF52Hhjw= X-Received: by 2002:a1c:c254:: with SMTP id s81mr288618wmf.132.1609869199718; Tue, 05 Jan 2021 09:53:19 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id b127sm309665wmc.45.2021.01.05.09.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jan 2021 09:53:19 -0800 (PST) Date: Tue, 5 Jan 2021 17:53:18 +0000 From: Wei Liu To: Michael Kelley Cc: Wei Liu , Dexuan Cui , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "x86@kernel.org" , "hpa@zytor.com" , "linux-hyperv@vger.kernel.org" , vkuznets , "jwiesner@suse.com" , "ohering@suse.com" , "linux-kernel@vger.kernel.org" , Stephen Hemminger , Haiyang Zhang , KY Srinivasan Subject: Re: [PATCH v2] x86/hyperv: Fix kexec panic/hang issues Message-ID: <20210105175317.73njunfp3go5iy3c@liuwe-devbox-debian-v2> References: <20201222065541.24312-1-decui@microsoft.com> <20210105130423.nvxpsdvgn5zier4v@liuwe-devbox-debian-v2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 05, 2021 at 04:39:38PM +0000, Michael Kelley wrote: > From: Wei Liu Sent: Tuesday, January 5, 2021 5:04 AM > > > > On Mon, Dec 21, 2020 at 10:55:41PM -0800, Dexuan Cui wrote: > > > Currently the kexec kernel can panic or hang due to 2 causes: > > > > > > 1) hv_cpu_die() is not called upon kexec, so the hypervisor corrupts the > > > old VP Assist Pages when the kexec kernel runs. The same issue is fixed > > > for hibernation in commit 421f090c819d ("x86/hyperv: Suspend/resume the > > > VP assist page for hibernation"). Now fix it for kexec. > > > > > > 2) hyperv_cleanup() is called too early. In the kexec path, the other CPUs > > > are stopped in hv_machine_shutdown() -> native_machine_shutdown(), so > > > between hv_kexec_handler() and native_machine_shutdown(), the other CPUs > > > can still try to access the hypercall page and cause panic. The workaround > > > "hv_hypercall_pg = NULL;" in hyperv_cleanup() is unreliabe. Move > > > hyperv_cleanup() to a better place. > > > > > > Signed-off-by: Dexuan Cui > > > > The code looks a bit intrusive. On the other hand, this does sound like > > something needs backporting for older stable kernels. > > > > On a more practical note, I need to decide whether to take it via > > hyperv-fixes or hyperv-next. What do you think? > > > > I'd like to see this in hyperv-fixes and backported to older stable kernels. > In its current form, the kexec path in a Hyper-V guest has multiple problems > that make it unreliable, so the downside risk of taking these fixes is minimal > while the upside benefit is considerable. Applied to hyperv-fixes. Wei.