From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: problem with vm-exit exit code Date: Tue, 19 Jan 2010 12:46:43 +0200 Message-ID: <4B558D93.4050101@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Matteo Signorini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56570 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846Ab0ASKqq (ORCPT ); Tue, 19 Jan 2010 05:46:46 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 01/19/2010 01:09 AM, Matteo Signorini wrote: > Hi guys, > > I would like to intercept the vm-exit whenever the guest executes a > lidt/sidt instruction. > I know that lidt/sidt instructions cause a vm-exit if and only if > these condition are satisfied: > > -commands are executed in vmx non-root environment > -the "descriptor-table exiting" field of the secondary vm-execution > control structure is enabled > > The first condition is satisfied because the guest OS executes the > lidt/sidt in the boot routine so we are in the vmx non-root > environment. > To satisfy the second condition, I set up the 31th bit in the primary > vm-execution control to 1 to enable the secondary vm-execution > control, > then I set up the 2nd bit of the secondary vm-execution control to 1 > to enable the "descriptor-table exiting". > > The problem is that I never get the exit_code=46 (that should > correspond to the IDTR access as shown in the Intel developer's > manual). > What I get is exit_code=0 and then the VM freezes. > > I wonder why I get 0 as exit reason instead of 46? > > Qemu gives me the following error message: > "kvm: unhandled exit 7 > kvm_run returned -22" > > The unhandled exit code correspond to the 7th vm-instruction error > number referred to: "VM-Entry with invalid control field(s)" > Did you check whether your processor supports descriptor-table exiting? The 'vmxcap' script can help determine that. -- error compiling committee.c: too many arguments to function