From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: VMX: Trap and invalid MWAIT/MONITOR instruction Date: Tue, 15 Dec 2009 11:23:37 +0200 Message-ID: <4B275599.6050002@redhat.com> References: <1260854994-7661-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Sheng Yang , Marcelo Tosatti , kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbZLOJXl (ORCPT ); Tue, 15 Dec 2009 04:23:41 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 12/15/2009 09:36 AM, Alexander Graf wrote: > On 15.12.2009, at 06:29, Sheng Yang wrote: > > >> We don't support these instructions, but guest can execute them even if the >> feature('monitor') haven't been exposed in CPUID. So we would trap and inject >> a #UD if guest try this way. >> > Wouldn't it be a lot better to emulate them? I actually have emulation of MONITOR/MWAIT on my todo list for some time, since OSX requires it. > > Basically what they do is they guarantee that a MONITOR'ed region is on a page boundary, so all we need to do is not map the monitor'ed page to wake up from the mwait. > You'll need to break up large page mappings for this. -- error compiling committee.c: too many arguments to function