Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10524205ybi; Thu, 11 Jul 2019 06:42:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNWQSA9ZcC6RiNctJXq0zqWFAgzm3IgCkN4ErRE13gHpgt2FQ4KW1iHaAJWAj3tKycD+UL X-Received: by 2002:a17:902:b196:: with SMTP id s22mr4828197plr.245.1562852561788; Thu, 11 Jul 2019 06:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562852561; cv=none; d=google.com; s=arc-20160816; b=xjstwwqHixSxXkKM7NorGg4boYJTxh/rgRFHSGFNAPrsPMnQ1VPV6nVnhVKZQnKftG iTtf/+Jj0JdpFXZ4G9GR4l/3C21gI8Ck5qYcaGVjC11d+Ek1kqEG+tSaENSndfYNwXl6 D6lP2DQ1XBpiP7t0h/GmwdEFcYDmY8ndX8kR7vEo0C1CsUS8yK9x6diQVgtbGvazpwYp weh8tEoEPFG0FNtsnhCftSxINF6bNsG8erKpea8Myul/iJKrucJB0UxqvtKcEf7fuY1k 1eYQiAFNiVCjLcFcz6Gp18OgXtcDfwemTLtBPHEcdodHMXiT/sPxzuofPQlRw1f1BJtf p9yw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NiPzgCya2hoSH4eKrxi8qdW5Qk89gH2cnlBBWoaa/xg=; b=HvsXBZxaJwUGj0vvyr1RL+Au2jatoQeOXvsyFME0J1aL43eOLgK0F13MuH8PEWK3ec MNuMXXbtn50wtDLOJpqLcpAphXk49+TKCZGMiIN1V6LeclvaGATkAqj3OHdK2xpDUxC4 P/gE+EUeuJ7XdGDVecc67yXDjB+Nm1tD49F8pUjPB9o+zF0/sd/uVUGGoLMXXTwa7Jsc m+Xc96V+K328k7AGVbiaONQWbK8bC6NdsNLGyb0zaLtChyYHyXcwgrc9lpuYK8AmxfZP YWuCfZLLD1m8j/rkm4W9qtu7De1pS2E+IRNWYHdk/B5A6ad6VS5v+ukHbGQRt/G1CE0Z Bc0Q== 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 u3si4993448plz.201.2019.07.11.06.42.26; Thu, 11 Jul 2019 06:42:41 -0700 (PDT) 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 S1728469AbfGKNZR (ORCPT + 99 others); Thu, 11 Jul 2019 09:25:17 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37110 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728182AbfGKNZQ (ORCPT ); Thu, 11 Jul 2019 09:25:16 -0400 Received: by mail-wr1-f68.google.com with SMTP id n9so6313383wrr.4 for ; Thu, 11 Jul 2019 06:25:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NiPzgCya2hoSH4eKrxi8qdW5Qk89gH2cnlBBWoaa/xg=; b=osrgwGnO4szyykoqbn4E2A6cpNgH45EIW+eW78tBF5fTMm9lU8jdY3Y0p/XiJ3iROM rvl8HT88hWGAWH0UlAL0szQuFyrtsHBs51JrBoiYquc65DFMWcbpVsByninNLG/GaeXi Iz3r5LY4fHJe56Tp5fzoYL6jP3UA3yaykpRMfeDQubJ+jEVeRbKYH2zC0HNkWOqcFIHD nLV8NBGSJxRnJBkGEC6xrj7AzLAMR+2EJ9QCzU0iEhQ32YdAQNd252GS7jidT77F0zrt JAxw9DrPJTzRjjK9O/+eOe1Xr26+WiB6qyqphyjsUjox0YLkVxp6Xk+QCcmz3K3UdIut P7Bw== X-Gm-Message-State: APjAAAUyzLZiC+SnrfzJeWw7YpQs/XwWe0Rv9eqc/1dcMeKz1YZTSzPm FWTMYrNP3GWkoeOuTe/DTFqbiQ== X-Received: by 2002:adf:b1cb:: with SMTP id r11mr5074310wra.328.1562851514545; Thu, 11 Jul 2019 06:25:14 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:d066:6881:ec69:75ab? ([2001:b07:6468:f312:d066:6881:ec69:75ab]) by smtp.gmail.com with ESMTPSA id t1sm7823335wra.74.2019.07.11.06.25.13 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jul 2019 06:25:13 -0700 (PDT) Subject: Re: [PATCH v6 2/3] KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL To: Tao Xu , rkrcmar@redhat.com, corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, sean.j.christopherson@intel.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, fenghua.yu@intel.com, xiaoyao.li@linux.intel.com, jingqi.liu@intel.com References: <20190621055747.17060-1-tao3.xu@intel.com> <20190621055747.17060-3-tao3.xu@intel.com> From: Paolo Bonzini Message-ID: <43814a5e-12bf-ceb5-e4fb-12bbb32cd4cb@redhat.com> Date: Thu, 11 Jul 2019 15:25:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190621055747.17060-3-tao3.xu@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/19 07:57, Tao Xu wrote: > + if (guest_cpuid_has(vcpu, X86_FEATURE_WAITPKG)) > + atomic_switch_umwait_control_msr(vmx); > + guest_cpuid_has is slow. Please replace it with a test on secondary_exec_controls_get(vmx). Are you going to look into nested virtualization support? This should include only 1) allowing setting the enable bit in secondary execution controls, and passing it through in prepare_vmcs02_early; 2) reflecting the vmexit in nested_vmx_exit_reflected. Thanks, Paolo