From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965513AbdCJJia (ORCPT ); Fri, 10 Mar 2017 04:38:30 -0500 Received: from mga04.intel.com ([192.55.52.120]:35137 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965213AbdCJJi1 (ORCPT ); Fri, 10 Mar 2017 04:38:27 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,140,1486454400"; d="scan'208";a="833086146" Subject: Re: [RFC PATCH 0/4] KVM: Emulate UMIP (or almost do so) To: Paolo Bonzini 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> Cc: qian.ouyang@intel.com, "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" From: Yu Zhang Message-ID: <58C2728B.3060903@linux.intel.com> Date: Fri, 10 Mar 2017 17:31:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <46eca436-0d57-a514-39e4-7c45e25e493e@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/10/2017 4:36 PM, Paolo Bonzini wrote: > > On 10/03/2017 09:02, Yu Zhang wrote: >>> Besides, is this all the test for UMIP unit test? I.e. do we need to >>> construct a scenario in the test to trigger vm exit and let hypervisor >>> inject a GP fault? - I did not see this scenario in this patch. Or any >>> other suggestions? :-) >> Hi Paolo, any suggestions? >> Sorry for the disturb. :) > Hi, you get the scenario where a vmexit is triggered by the hypervisor > if you run the unit test on a machine that lacks UMIP support. > > 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? This is the case I'd like to test, yet do not know to construct the scenario. 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? Yu > Paolo >