From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH v2] kvm: x86: emulate monitor and mwait instructions as nop Date: Wed, 4 Jun 2014 22:40:10 +0300 Message-ID: <20140604194010.GB744@redhat.com> References: <20140507205210.GA30030@ERROL.INI.CMU.EDU> <20140602192530.GC1653@ERROL.INI.CMU.EDU> <538D92BC.4060203@redhat.com> <20140604143941.GF1653@ERROL.INI.CMU.EDU> <538F30BD.5000501@suse.de> <538F4A7C.7070202@redhat.com> <20140604190812.GG11756@redhat.com> <20140604193337.GJ1653@ERROL.INI.CMU.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Bonzini , Alexander Graf , kvm@vger.kernel.org, Borislav Petkov To: "Gabriel L. Somlo" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51699 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbaFDTj6 (ORCPT ); Wed, 4 Jun 2014 15:39:58 -0400 Content-Disposition: inline In-Reply-To: <20140604193337.GJ1653@ERROL.INI.CMU.EDU> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jun 04, 2014 at 03:33:38PM -0400, Gabriel L. Somlo wrote: > On Wed, Jun 04, 2014 at 10:08:12PM +0300, Michael S. Tsirkin wrote: > > On Wed, Jun 04, 2014 at 06:34:04PM +0200, Paolo Bonzini wrote: > > > Il 04/06/2014 16:44, Alexander Graf ha scritto: > > > > > > > > > > > >>Obviously, if you really like the current behavior better you can > > > >>always reject whatever patch I'll come up with, but I'd like to at > > > >>least try and see what it would look like :) > > > > > > > >I think it's perfectly fine to leave mwait always implemented as NOP - > > > >it's valid behavior. > > > > > > > >As for the CPUID exposure, that should be a pure QEMU thing. If > > > >overriding CPUID bits the kernel mask tells us doesn't work today, we > > > >should just make it possible :). > > > > > > That should be the purpose of KVM_GET_EMULATED_CPUID, so MWAIT could be > > > added in __do_cpuid_ent_emulated. However, the corresponding QEMU patches > > > were never included. Borislav, can you refresh them? > > > > > > Paolo > > > > I don't understand why would we want mwait bit set in CPUID. > > The only reason we want the nop is because of broken guests which > > don't check CPUID. > > E.g., OS X 10.5 *does* check CPUID, and panics if it doesn't find it. > It needs the MONITOR cpuid flag to be on, *and* the actual > instructions to work. Aha. I didn't realize this. I thought it used mwait without checking CPUID. > HOWEVER: I really do NOT want us to bend over backwards to support it, > I think having 10.6 and up working is good enough. Besides, there are > other problems we'd run into with 10.5 if we got the mwait situation > taken care of, so even more reason to leave well enough alone. > > Thanks, > --Gabriel > > PS. Thanks again for everyone's patience while I wrapped my head > around the fine details :) It's up to you of course. If some guests refuse to run without the CPUID bit, then of course an option to set it might be useful. Sorry about misunderstanding and making noise. -- MST