Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp583481ybm; Wed, 27 May 2020 03:00:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO/eQq1JJ7KTqNv9TSP2fHroDVBSs3ycWciecZ4kYoy7Vx0tnZQfuUsq4YhfBpj4wJ7Z/g X-Received: by 2002:a17:906:68c6:: with SMTP id y6mr5291410ejr.437.1590573651579; Wed, 27 May 2020 03:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590573651; cv=none; d=google.com; s=arc-20160816; b=oxMHe0E1Y/J3BXMx/7nkxwzQbmqYazSY2EybY0jeJPF6Aj07PPzAn947euWrUVZyTo 85f0/MfTKIPN28woQWe7xkZFrsLZqtgEvWstn8q22pvWh3cW7cw8g07mZwr7GFihnmns dSN5/ORU/Jok+RNpK2XOtcD8hlpLhVJNMfzvsNZ+7jfBtfC38uaWoOtnsI6XJIfj9vYU ig8c6uf27U1j0VK4NfTBFdIp+FD4wK2fX2nCb4uQtKW2MFpwAhIY2BDKxbH+9IR2zHr3 pVke0Oc6W323A2ademOg/a5jZRu4rLaI9vuUQ+1Y8meTm+vtTei7IdvE5+V6e0MctT3U scJg== 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:ironport-sdr:ironport-sdr; bh=W2OKUB1IICzMF35pKCFlP8cdAyiv/1oxvd59MaBPgSg=; b=ooq4cWJwZW1br1Oi3j+bSmnUD2Sge0hXffFHdwZu4hJSdRY6rKvPXVweks4AfHrnGT JV5Md6ZgwGqvA2sVSdcIrymCcrFsZ0SzvGdSvU8Y9QjjtUUv7orUKksDH90HUJQquta2 wSKTUSaVpQ+o6zP1Colu/loFXtvZzz3Mjr66ovZKa8ucpmoWWn0RX3FdqtPpmM1xJ8GO EFNnl2cr5WQN8b1jPfYJpyqdjOHoLssmM3Ik8OLuivnHcjJUkacNQithSWPrbQlfyVb3 Kq0g7caBE6GL0s9XRUJcchjIOUgnVWOzU3HZQLpmIihqos8nOuPdfaBl9yO4ZxEs8cwD mLnw== 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp6si1915750ejc.472.2020.05.27.03.00.27; Wed, 27 May 2020 03:00:51 -0700 (PDT) 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728369AbgE0BWW (ORCPT + 99 others); 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.