Received: by 2002:a25:d80d:0:0:0:0:0 with SMTP id p13csp130394ybg; Sat, 23 May 2020 09:17:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfVL8/3DZX69zqbqzgjng5Q6OmVxi/MqmdZnB9+iG/tuDMZWL4xo4Gk101olMQa9Mivhp3 X-Received: by 2002:a17:906:4442:: with SMTP id i2mr13354578ejp.509.1590250647157; Sat, 23 May 2020 09:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590250647; cv=none; d=google.com; s=arc-20160816; b=z4coS5yIFE7i5ruFuWNVZK5Dsnl6hDKsYkRWPNcvHMAWDNuEcmxYrer9WGvnSyoTPy jyIOpd9KRvgXiG0QP9j/FWeuebtJ+Dr4Ia3xqrWesEMIY33XzWIWyhqgiC4KicjVKiaF lwEVW4R3Cv5NoTICb3mB3mMuzME7+kIyKF5IbuCk4szliI6FfSKlBvaotudfkFRB6/KF zu0vZYaOVL/YAsefWBQFCFqW54TRttCg+WsbATEHuN8xUccz/0MGS1IJSXK49wOiSP6s Owrp4HWBwclTwgHMtA266Z33O39obrjsEzxod0KrBvWVmClyhUlQ4f9Y52J6zsYDbYVX qbrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=L8j7T0o/S5OaFe2c9p53BQS8VJwyJfs8YmL4K/O2KYU=; b=0yxMIY7z9mJsKwqU+Xfotkw/+Z/40zhHQk61J0axxeOUNe8ggwZPiCWsNedAW+00Od l7CYbyaQO7tvbLVCYh61Dry7why7XDEMbAkFHsekR5+5iWMZnTI7vM0phe+xS9rt/wTo qSGA0r1vPBB/IgDrcs3z58xmjhlnNLkjkZjzKXNh982BYnkYb3ib30JlD++JI7X164QW rP7TIGVKCVpMwm+0X5tzCIHp7JNC9doDUBPyxmWgdPZN0GxkQ8M2k653cIU/LRWpNEj6 TyXGW6tnrzMlAINm5D3SsjVcL4xLCeUik20pgqpaTnWeuP8PCpoCYODRwV0RDO/unp4d H63w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gFxkvMFK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si7068450ejc.416.2020.05.23.09.17.03; Sat, 23 May 2020 09:17:27 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gFxkvMFK; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727964AbgEWQPJ (ORCPT + 99 others); Sat, 23 May 2020 12:15:09 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:30585 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726338AbgEWQPI (ORCPT ); Sat, 23 May 2020 12:15:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590250507; 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:content-transfer-encoding; bh=L8j7T0o/S5OaFe2c9p53BQS8VJwyJfs8YmL4K/O2KYU=; b=gFxkvMFKN4kOrEOVZV0oYpyWYpOPTiligUbcM0p8kt5IS3QOMoahyvy/X8mkPh6KGdmDUT MuFC3mC0Xz5jvDzljw21o++9OiJoHVJ/DEO1wEZ3tzRISPcw93IOIjp4tlwGUCFex078kc wjUxfld1D3OmGfvmt7Aunt3Lt+18GCE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-280-WRTp-SYzNFCw-fza1ty5uA-1; Sat, 23 May 2020 12:15:03 -0400 X-MC-Unique: WRTp-SYzNFCw-fza1ty5uA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7AFFB107ACCD; Sat, 23 May 2020 16:15:01 +0000 (UTC) Received: from starship.f32vm (unknown [10.35.206.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC61F6E716; Sat, 23 May 2020 16:14:56 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Paolo Bonzini , "H. Peter Anvin" , Tao Xu , Sean Christopherson , Jim Mattson , linux-kernel@vger.kernel.org, Joerg Roedel , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Wanpeng Li , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Vitaly Kuznetsov , Jingqi Liu , Maxim Levitsky Subject: [PATCH 0/2] Fix issue with not starting nesting guests on my system Date: Sat, 23 May 2020 19:14:53 +0300 Message-Id: <20200523161455.3940-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On my AMD machine I noticed that I can't start any nested guests,=0D because nested KVM (everything from master git branches) complains=0D that it can't find msr MSR_IA32_UMWAIT_CONTROL which my system doesn't supp= ort=0D at all anyway.=0D =0D I traced it to the recently added UMWAIT support to qemu and kvm.=0D The kvm portion exposed the new MSR in KVM_GET_MSR_INDEX_LIST without=0D checking that it the underlying feature is supported in CPUID.=0D It happened to work when non nested because as a precation kvm,=0D tries to read each MSR on host before adding it to that list,=0D and when read gets a #GP it ignores it.=0D =0D When running nested, the L1 hypervisor can be set to ignore unknown=0D msr read/writes (I need this for some other guests), thus this safety=0D check doesn't work anymore.=0D =0D V2: * added a patch to setup correctly the X86_FEATURE_WAITPKG kvm capabili= ty=0D * dropped the cosmetic fix patch as it is now fixed in kvm/queue=0D =0D Best regards,=0D Maxim Levitsky=0D =0D Maxim Levitsky (2):=0D kvm/x86/vmx: enable X86_FEATURE_WAITPKG in KVM capabilities=0D kvm/x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally=0D =0D arch/x86/kvm/vmx/vmx.c | 3 +++=0D arch/x86/kvm/x86.c | 4 ++++=0D 2 files changed, 7 insertions(+)=0D =0D -- =0D 2.26.2=0D =0D