From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933866AbcKWWOT (ORCPT ); Wed, 23 Nov 2016 17:14:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6896 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbcKWWOS (ORCPT ); Wed, 23 Nov 2016 17:14:18 -0500 Subject: Re: [PATCH 3/4] KVM: nVMX: accurate emulation of MSR_IA32_CR{0,4}_FIXED1 To: David Matlack References: <1479863680-117511-1-git-send-email-dmatlack@google.com> <1479863680-117511-4-git-send-email-dmatlack@google.com> <1168524783.1374944.1479891977484.JavaMail.zimbra@redhat.com> Cc: kvm list , "linux-kernel@vger.kernel.org" , Jim Mattson , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= From: Paolo Bonzini Message-ID: Date: Wed, 23 Nov 2016 23:11:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 23 Nov 2016 22:11:57 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/11/2016 23:07, David Matlack wrote: > A downside of this scheme is we'd have to remember to update > nested_vmx_cr4_fixed1_update() before giving VMs new CPUID bits. If we > forget, a VM could end up with different values for CR{0,4}_FIXED0 for > the same CPUID depending on which version of KVM you're running on. If userspace doesn't obey KVM_GET_SUPPORTED_CPUID, all bets are off anyway, so I don't think it's a big deal. However, if you want to make it generated by userspace, that would be fine as well! That would simply entail removing this patch, wouldn't it? Paolo > Hm, now I'm thinking you were right in the beginning. Userspace should > generate CR{0,4}_FIXED1, not the kernel. And KVM should allow > userspace to save/restore them.