Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3329931imb; Tue, 5 Mar 2019 06:49:43 -0800 (PST) X-Google-Smtp-Source: APXvYqylPoKNaPt5axI/UVplKOOZh45025/fAmxFGf+CRGvqJR0cjTwnDAB5DDuYxHaqZUdt0b87 X-Received: by 2002:a17:902:d698:: with SMTP id v24mr1569422ply.331.1551797383148; Tue, 05 Mar 2019 06:49:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551797383; cv=none; d=google.com; s=arc-20160816; b=Gglldai/7mGCGoGRrGq/pg8ISLNGnOcWUp5g2d+kcCI3One1bcrMfcpPoxhi7ZUFeF L78C4gi26iVuLyedHzxCpvUWZU9WWzye9zcW5gBN+XhxZenqvQC+lj0VW5m9WVypqYIb 4ckT49oLX5pyXkRAXueh0ilhC6A870vAP/0jccxL1Wa7+liW6MO3BJvQiuHy49l4dpMP VQGD8tQHMvRj7yNJDSo66dVWpCWh0qH3k3nwEyr0ttCaouEKc+GYyvigJjimqxLzpqfE poyojp3NFeiDmB6IqsSSkOJKIjNShTgTcEJYeVLDblgWEQ1AQpnj2pGIjN5RTI902hSu W4Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=fPL+mFcnFk2fiGgyvGc6vDBsgRlRRz/RaTsBeOLEc94=; b=K0mijttFgBWDfL6LOU4fQiEE5PThp73JzMxyuRk1UwVRlHrEtx7ctnH1DHZyAQGO4F Vj4v3LLc4v1ycmZxc+qwQp4SetmX1bwmvIV194dYM/Iq+aw+64IgQ/ud4eS5bXsB3FlX jn4zCd60oZ35BHMhtVIer6yQ0t9idzigeBRzOVwHrA8TaCRi+mva3uITKBuKz4ZznuaN ntRHWREAi30/c5p1kNvgv2zRT4Z3A9DLJAuCaIuVvEFA9y+hSLfwkREo2gEe57WlepmX n7Qt5hL+hLjMFrtPcSNw7t5MHxM/j5ijSlp6w1LkgS7aZ2Pv0t8g4fTDSIcWBggUmzrO 2V5g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc9si9174710plb.59.2019.03.05.06.49.27; Tue, 05 Mar 2019 06:49:43 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728399AbfCENcR (ORCPT + 99 others); Tue, 5 Mar 2019 08:32:17 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:46612 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726098AbfCENcQ (ORCPT ); Tue, 5 Mar 2019 08:32:16 -0500 Received: by mail-io1-f66.google.com with SMTP id k21so7015494ior.13 for ; Tue, 05 Mar 2019 05:32:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fPL+mFcnFk2fiGgyvGc6vDBsgRlRRz/RaTsBeOLEc94=; b=mYVsaz4NYoeFolbK1/2Y+/yKwEUALM6gUxMCgzKEEfCHttCMOSY/Wzq4W/K91tVzr7 G6Lzg+PqzP98nXxUSxPEhZniRPhM5Jy+/X1nrtrQqsvFA91kvNKHqcpPpgtTas/3T1Uw Yzuwu9o4z39ZvOuwxA3mOlYRr0SEOxi4d+1Yh2etdewj7QlUuhWA6DaDWSlbvFD3HRgj cZmbWJtSDqpHjPcbxiXpqpmZ3HprgLygqSleykx8U8OS7Zqxh0fB3+UCSrH3/92lDdab bk7FMKBo4kRKaFCVCR8e+Am8Kb3JfE5SiPRhz/I5FS8BKmB/2PVYBLjIpQ89BOulHrpJ nuUQ== X-Gm-Message-State: APjAAAXu/zfDyMzH4Cbx82OFwvduBwz2d9epZin2zqoY4zQmWi7WzoSc SYj1OOIYWpgYp6grrhrAQctiOkek0+zp0JZDOVujFg== X-Received: by 2002:a6b:37d4:: with SMTP id e203mr13072860ioa.137.1551792736186; Tue, 05 Mar 2019 05:32:16 -0800 (PST) MIME-Version: 1.0 References: <20190226155615.16724-1-kasong@redhat.com> <20190227120141.GN32494@hirez.programming.kicks-ass.net> <20190305122827.GJ32477@hirez.programming.kicks-ass.net> In-Reply-To: <20190305122827.GJ32477@hirez.programming.kicks-ass.net> From: Kairui Song Date: Tue, 5 Mar 2019 21:32:05 +0800 Message-ID: Subject: Re: [RFC PATCH] x86, hyperv: fix kernel panic when kexec on HyperV VM To: Peter Zijlstra 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 5, 2019 at 8:28 PM Peter Zijlstra wrote: > > 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). > Many thanks for the info, I'm not aware of the exception condition, V2 is sent, will drop the barrier in V3 then. -- Best Regards, Kairui Song