From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [RFC PATCH 0/4] KVM: Emulate UMIP (or almost do so) Date: Fri, 10 Mar 2017 16:00:06 +0100 Message-ID: References: <1468351223-3250-1-git-send-email-pbonzini@redhat.com> <0543af50-8961-38a7-1acc-aaefd4915dda@redhat.com> <58B68E91.4010400@linux.intel.com> <58C25D7A.7070605@linux.intel.com> <46eca436-0d57-a514-39e4-7c45e25e493e@redhat.com> <58C2728B.3060903@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: qian.ouyang@intel.com, "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" To: Yu Zhang Return-path: In-Reply-To: <58C2728B.3060903@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 10/03/2017 10:31, Yu Zhang wrote: >> We can also add a module parameter to force emulation, so that it will >> be possible to test UMIP emulation on newer processors too. > > Thanks for your reply, Paolo. :-) > > Well, my previous understanding is that there might be a situation on a > machine with UMIP > feature: > 1> when an APP in VM runs instructions such as sgdt addrA, > 2> and the addrA may cause anVM exit(e.g. ept violation), > 3> next, the emulator in hypervisor need to inject a GP fault to the VM. > Is this situation possible? No, the guest will execute the instruction again after the vmexit. > But as to the scenario you described, I do not quit understand. > I mean, on a host which do not support UMIP, although hypervisor may > intercept cpuid and > provide an emulated cr4 to guest, how does it guarantee those > instructions in VM will cause a VM exit? All instructions except SMSW can be trapped using descriptor table vmexits. Paolo