From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH] KVM: VMX: Trap and invalid MWAIT/MONITOR instruction Date: Tue, 15 Dec 2009 10:36:53 +0100 Message-ID: <4B2758B5.3040105@suse.de> References: <1260854994-7661-1-git-send-email-sheng@linux.intel.com> <4B275599.6050002@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Sheng Yang , Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from cantor.suse.de ([195.135.220.2]:51485 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbZLOJg4 (ORCPT ); Tue, 15 Dec 2009 04:36:56 -0500 In-Reply-To: <4B275599.6050002@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > 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. Right. Same for PCI device assignment. Breaking up large page mappings should be a fairly normal operation. Alex