From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A0C2C433E0 for ; Mon, 15 Jun 2020 12:15:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 44E51206B7 for ; Mon, 15 Jun 2020 12:15:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="plcRE/HT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730035AbgFOMPk (ORCPT ); Mon, 15 Jun 2020 08:15:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729642AbgFOMPi (ORCPT ); Mon, 15 Jun 2020 08:15:38 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D457C061A0E; Mon, 15 Jun 2020 05:15:38 -0700 (PDT) Received: from zn.tnic (p200300ec2f063c0085fbd8d4455f52fc.dip0.t-ipconnect.de [IPv6:2003:ec:2f06:3c00:85fb:d8d4:455f:52fc]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E7BB41EC0299; Mon, 15 Jun 2020 14:15:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1592223336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=IvLplpOzdVR3pvv87mkIgy3s3a9HTre37RLfwpBuQDk=; b=plcRE/HT8GZ7mDZeXigYxsn/J0PdLHE1t9di7d6lkuXvUjT1Zof0zG7KP6SR3Uf+cE0Wjk l3L4tt5jYOsrc+gkBhllMZbwzxaGLpqY/tkVRGFNbVQdfyJTtWZOL1+0huSI5i62Hg7vzW CkJLUbF2zDsZnIDh3W8rolEcZRq2V8s= Date: Mon, 15 Jun 2020 14:15:24 +0200 From: Borislav Petkov To: Sean Christopherson , Greg KH , Sasha Levin Cc: Liam Merwick , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "Rafael J. Wysocki" , Pavel Machek , "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Brad Campbell , Maxim Levitsky , Paolo Bonzini , kvm@vger.kernel.org Subject: Re: [PATCH] x86/cpu: Reinitialize IA32_FEAT_CTL MSR on BSP during wakeup Message-ID: <20200615121524.GH14668@zn.tnic> References: <20200605200728.10145-1-sean.j.christopherson@intel.com> <20200608172921.GC8223@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200608172921.GC8223@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 08, 2020 at 10:29:21AM -0700, Sean Christopherson wrote: > On Mon, Jun 08, 2020 at 11:12:35AM +0100, Liam Merwick wrote: > > On 05/06/2020 21:07, Sean Christopherson wrote: > > >Reinitialize IA32_FEAT_CTL on the BSP during wakeup to handle the case > > >where firmware doesn't initialize or save/restore across S3. This fixes > > >a bug where IA32_FEAT_CTL is left uninitialized and results in VMXON > > >taking a #GP due to VMX not being fully enabled, i.e. breaks KVM. > > > > > >Use init_ia32_feat_ctl() to "restore" IA32_FEAT_CTL as it already deals > > >with the case where the MSR is locked, and because APs already redo > > >init_ia32_feat_ctl() during suspend by virtue of the SMP boot flow being > > >used to reinitialize APs upon wakeup. Do the call in the early wakeup > > >flow to avoid dependencies in the syscore_ops chain, e.g. simply adding > > >a resume hook is not guaranteed to work, as KVM does VMXON in its own > > >resume hook, kvm_resume(), when KVM has active guests. > > > > > >Reported-by: Brad Campbell > > >Cc: Maxim Levitsky > > >Cc: Paolo Bonzini > > >Cc: kvm@vger.kernel.org > > > > Should it have the following tag since it fixes a commit introduced in 5.6? > > Cc: stable@vger.kernel.org # v5.6 > > It definitely warrants a backport to v5.6. I didn't include a Cc to stable > because I swear I had seen an email fly by that stated an explicit Cc is > unnecessary/unwanted for tip-tree patches, but per a recent statement from > Boris it looks like I'm simply confused[*]. I'll add the Cc in v2. > > [*] https://lkml.kernel.org/r/20200417164752.GF7322@zn.tnic Yeah, I was simply parroting what Greg has told me. Maybe he should finally do that script. :-P Also, I believe Sasha's Skynet machine already does that... CCed both. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette