From: Paolo Bonzini Subject: Re: [PATCH] kvm: nVMX: Remove superfluous VMX instruction fault checks Date: Wed, 26 Apr 2017 11:26:54 +0200 Message-ID: References: <20170421165340.92716-1-jmattson@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Jim Mattson , kvm@vger.kernel.org Return-path: Received: from mail-wm0-f45.google.com ([74.125.82.45]:36387 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2997113AbdDZJ1E (ORCPT ); Wed, 26 Apr 2017 05:27:04 -0400 Received: by mail-wm0-f45.google.com with SMTP id u65so44429773wmu.1 for ; Wed, 26 Apr 2017 02:27:04 -0700 (PDT) In-Reply-To: <20170421165340.92716-1-jmattson@google.com> Sender: kvm-owner@vger.kernel.org List-ID: On 21/04/2017 18:53, Jim Mattson wrote: > One of the constraints on the VMX instructions is that they are not > allowed in real-address mode. Though the hardware checks for this > condition as well, when real-address mode is emulated, the faulting > condition does have to be checked in software. Emulated real mode is virtual-8086 mode, so that should be checked by the processor too, right? VMX instructions are never called from the emulator, so they cannot be reached from the emulate_invalid_guest_state path. And if they could, you'd have to keep the CPL checks and all the others. So I think that you can remove the checks for CR0.PE as well. Paolo