From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Mattson Subject: Re: [PATCH v4] kvm: nVMX: Remove superfluous VMX instruction fault checks Date: Thu, 27 Apr 2017 10:29:15 -0700 Message-ID: References: <20170426155346.116970-1-jmattson@google.com> <1a3babfa-4f45-0bb9-349c-de47824170f2@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: David Hildenbrand , kvm list To: Paolo Bonzini Return-path: Received: from mail-wm0-f51.google.com ([74.125.82.51]:36777 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752540AbdD0R3R (ORCPT ); Thu, 27 Apr 2017 13:29:17 -0400 Received: by mail-wm0-f51.google.com with SMTP id u65so22971320wmu.1 for ; Thu, 27 Apr 2017 10:29:17 -0700 (PDT) In-Reply-To: <1a3babfa-4f45-0bb9-349c-de47824170f2@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: What about CR0.NE, which, like CR4.VMXE, will always be set while running the guest, but which may not be set in the vCPU? On Thu, Apr 27, 2017 at 8:49 AM, Paolo Bonzini wrote: > > > On 27/04/2017 17:32, Jim Mattson wrote: >> Also, the allowed/required CR0/CR4 bits may not be the same for the >> vCPU as for the physical hardware, so more than just CR4.VMXE may have >> to be checked. > > I think we can pass on that. For CR0 we know the two cases are > fundamentally unrestricted guest and !unrestricted guest, and they both > are covered (via CR0.PE and EFLAGS.VM respectively). > > For CR4, we also pretty much know the only FIXED1 bit is VMXE, and > FIXED0 bits match the values that are checked by MOV to CR4. > > Paolo