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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 2ECCDC433DF for ; Wed, 27 May 2020 01:22:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 040EA2071A for ; Wed, 27 May 2020 01:22:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728373AbgE0BWW (ORCPT ); Tue, 26 May 2020 21:22:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:31175 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbgE0BWW (ORCPT ); Tue, 26 May 2020 21:22:22 -0400 IronPort-SDR: mQnuGc8LlECincjJ1+OZUQ2f/nb5K2KIzUuKxhCWkyRhvm/a45asmcKwjTZ1GzZmHSKZpU3KiQ /xxZuy/HhL7A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 May 2020 18:22:21 -0700 IronPort-SDR: gCUxA0G7yFZXUpIXPty0nBc+CNACAi2vwP3mxMfn1+fRBJc+Ozg4rCrJq62wlXsH70ZzuG6jbG EC+YLIFh1J2A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,439,1583222400"; d="scan'208";a="442317355" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.152]) by orsmga005.jf.intel.com with ESMTP; 26 May 2020 18:22:21 -0700 Date: Tue, 26 May 2020 18:22:21 -0700 From: Sean Christopherson To: Krish Sadhukhan Cc: Maxim Levitsky , kvm@vger.kernel.org, Paolo Bonzini , "H. Peter Anvin" , Tao Xu , Jim Mattson , linux-kernel@vger.kernel.org, Joerg Roedel , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Wanpeng Li , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Vitaly Kuznetsov , Jingqi Liu Subject: Re: [PATCH 0/2] Fix issue with not starting nesting guests on my system Message-ID: <20200527012221.GE31696@linux.intel.com> References: <20200523161455.3940-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 06:03:32PM -0700, Krish Sadhukhan wrote: > > On 5/23/20 9:14 AM, Maxim Levitsky wrote: > >On my AMD machine I noticed that I can't start any nested guests, > >because nested KVM (everything from master git branches) complains > >that it can't find msr MSR_IA32_UMWAIT_CONTROL which my system doesn't support > >at all anyway. > > > >I traced it to the recently added UMWAIT support to qemu and kvm. > >The kvm portion exposed the new MSR in KVM_GET_MSR_INDEX_LIST without > >checking that it the underlying feature is supported in CPUID. > >It happened to work when non nested because as a precation kvm, > >tries to read each MSR on host before adding it to that list, > >and when read gets a #GP it ignores it. > > > >When running nested, the L1 hypervisor can be set to ignore unknown > >msr read/writes (I need this for some other guests), thus this safety > >check doesn't work anymore. > > > >V2: * added a patch to setup correctly the X86_FEATURE_WAITPKG kvm capability > > * dropped the cosmetic fix patch as it is now fixed in kvm/queue > > > >Best regards, > > Maxim Levitsky > > > >Maxim Levitsky (2): > > kvm/x86/vmx: enable X86_FEATURE_WAITPKG in KVM capabilities > > kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally > > > > arch/x86/kvm/vmx/vmx.c | 3 +++ > > arch/x86/kvm/x86.c | 4 ++++ > > 2 files changed, 7 insertions(+) > > > Nit: The added 'break' statement in patch# 2 is not required. It is unless you want to add a fallthrough annotation.