Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3234256imb; Tue, 5 Mar 2019 04:29:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwzjmB84Sj0ubzr+TjkxjstQH03yrCm2MpmAxmcBg4HUug9XDgd/ghe2xO25LAjPi2NyrLZ X-Received: by 2002:a62:1382:: with SMTP id 2mr1576085pft.157.1551788960204; Tue, 05 Mar 2019 04:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551788960; cv=none; d=google.com; s=arc-20160816; b=CwcAcVZNBETGCSf7viyrJaSAp4XXg1i2fpIPniXmgMzU6C54oMjerMoTsnilq4oIg7 0rxe5Cto7cMbFiGWJ6EV9gx3DnaV7jwCHzNLfBQyhmNP4K22ZLvxccBF2ZtahFGR2CPv SCeuB3Q/olgIqpgxMk90eNe22TP0DzYkvTEcwInKMfxYRPmB3EA4RHmnVI9XY0JINw+s 5KJexLdIjKohgWu7JptiLn4sXty210GQWhiyRDOFtHKiAHClqlJI5tGgj00knFf4OIQS t/eWS6ssEWc9k2IHGyZw0R/PJqYth7zZNU6UH8XKMW1oMTNoX1nTabF0y5eIaZr8OZAT en0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Dfo+YBvmhGNA0Vn/iIr+M+O2pxNRsMjh1OVoXQ8GwjY=; b=Gw0nKM8N+2lkQC2mXLvX6XZiaE8c/txp2+bEE/Nf7XiJkgk7TaW7RIcniDd7s0nPaU MCOe+QJAeeVLG8p5WApegkAWXyzVq7/LOZSlLExxCwjiBYxm2XoWCS+lW6d5X3vUPGlq nPTTvWU9mipw4Q6fa8DazmwIJhk80McBNiUggkmGMCyjx62TV7NJnr2K8f9Jdnz1Q00i vCDysN7INTuLaRqF2rIaZZgV1n/hNhFc1OL+mzFFpBg4Uq8nv+cZTp9rVpuaXsEPYUm3 k6vPlpVZ3d1a1qCJCunS1Uo0SCyMfVFaNTH7xHaPgfW74F/4B+XpxgitVBZX1CE79N1N 0BcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cPHp3dPE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 136si8708479pfc.170.2019.03.05.04.29.04; Tue, 05 Mar 2019 04:29:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=cPHp3dPE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728150AbfCEM2e (ORCPT + 99 others); Tue, 5 Mar 2019 07:28:34 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:37992 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728085AbfCEM2e (ORCPT ); Tue, 5 Mar 2019 07:28:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dfo+YBvmhGNA0Vn/iIr+M+O2pxNRsMjh1OVoXQ8GwjY=; b=cPHp3dPEP8manSvpW3rGZl2RZ hiJZInS4AcPTKa7Sv77QQaysXfXgXoE1VWdDhIFs0J46OVIaFRnkbpkuY/GvHJaOXuJgO25q4BiNL b3agOxXjyX+ais+b/48c2JE2E0dOiSBW898hZQURg+Y0bbOiWJrrwP2hlgwTjlQ4DHTIAfLGrzdhG XrPpkLslB9voI4k6HzaESzRLlNS7iI/LGJDyFznwaMvQybtik+YeJvPbhinxhUtHBCzfVTPLhKwez b/LwujeCFozdNcsOxDbHFrk54f4LWaS1xOesGRaLq12oCSZee4TIXo4ioh44tpIXd/6jO8bW95sbt glWh5GMoQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1h19BM-0001TX-TF; Tue, 05 Mar 2019 12:28:29 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 475CF29B18E38; Tue, 5 Mar 2019 13:28:27 +0100 (CET) Date: Tue, 5 Mar 2019 13:28:27 +0100 From: Peter Zijlstra To: Kairui Song Cc: Linux Kernel Mailing List , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Sasha Levin , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Vitaly Kuznetsov , Dave Young , the arch/x86 maintainers , devel@linuxdriverproject.org Subject: Re: [RFC PATCH] x86, hyperv: fix kernel panic when kexec on HyperV VM Message-ID: <20190305122827.GJ32477@hirez.programming.kicks-ass.net> References: <20190226155615.16724-1-kasong@redhat.com> <20190227120141.GN32494@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 27, 2019 at 10:55:46PM +0800, Kairui Song wrote: > On Wed, Feb 27, 2019 at 8:02 PM Peter Zijlstra wrote: > > > > On Tue, Feb 26, 2019 at 11:56:15PM +0800, Kairui Song wrote: > > > arch/x86/hyperv/hv_init.c | 4 ++++ > > > 1 file changed, 4 insertions(+) > > > > > > diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c > > > index 7abb09e2eeb8..92291c18d716 100644 > > > --- a/arch/x86/hyperv/hv_init.c > > > +++ b/arch/x86/hyperv/hv_init.c > > > @@ -406,6 +406,10 @@ void hyperv_cleanup(void) > > > /* Reset our OS id */ > > > wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0); > > > > > > + /* Cleanup page reference before reset the page */ > > > + hv_hypercall_pg = NULL; > > > + wmb(); > > > > What do we need that SFENCE for? Any why does it lack a comment? > > Hi, that's for ensuring the hv_hypercall_pg is reset to NULL before > the following wrmsr call. The wrmsr call will make the pointer address > invalid. WRMSR is a serializing instruction (except for TSC_DEADLINE and the X2APIC). > I can add some comment in V2 if this is OK. Barriers must always have a comment.