Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-04-04 Thread Radim Krčmář
[Cc qemu-devel as we've gone off-topic] 2017-04-04 15:15+0200, Alexander Graf: > On 04/04/2017 03:13 PM, Radim Krčmář wrote: >> 2017-04-04 14:51+0200, Alexander Graf: >> > Please see my patch to force enable CPUID bits ;). >> Nice. MWAIT could also use setting of arbitrary values for its leaf, >>

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-04-04 Thread Alexander Graf
On 04/04/2017 03:13 PM, Radim Krčmář wrote: 2017-04-04 14:51+0200, Alexander Graf: On 04/04/2017 02:39 PM, Radim Krčmář wrote: 2017-04-03 12:04+0200, Alexander Graf: So coming back to the original patch, is there anything that should keep us from exposing MWAIT straight into the guest at all t

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-04-04 Thread Radim Krčmář
2017-04-04 14:51+0200, Alexander Graf: > On 04/04/2017 02:39 PM, Radim Krčmář wrote: >> 2017-04-03 12:04+0200, Alexander Graf: >> > So coming back to the original patch, is there anything that should keep us >> > from exposing MWAIT straight into the guest at all times? >> Just minor issues: >> *

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-04-04 Thread Alexander Graf
On 04/04/2017 02:39 PM, Radim Krčmář wrote: 2017-04-03 12:04+0200, Alexander Graf: On 03/29/2017 02:11 PM, Radim Krčmář wrote: 2017-03-28 13:35-0700, Jim Mattson: On Tue, Mar 28, 2017 at 7:28 AM, Radim Krčmář wrote: 2017-03-27 15:34+0200, Alexander Graf: On 15/03/2017 22:22, Michael S. Tsir

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-04-04 Thread Radim Krčmář
2017-04-03 12:04+0200, Alexander Graf: > On 03/29/2017 02:11 PM, Radim Krčmář wrote: >> 2017-03-28 13:35-0700, Jim Mattson: >> > On Tue, Mar 28, 2017 at 7:28 AM, Radim Krčmář wrote: >> > > 2017-03-27 15:34+0200, Alexander Graf: >> > > > On 15/03/2017 22:22, Michael S. Tsirkin wrote: >> > > > > Gue

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-04-03 Thread Alexander Graf
On 03/29/2017 02:11 PM, Radim Krčmář wrote: 2017-03-28 13:35-0700, Jim Mattson: On Tue, Mar 28, 2017 at 7:28 AM, Radim Krčmář wrote: 2017-03-27 15:34+0200, Alexander Graf: On 15/03/2017 22:22, Michael S. Tsirkin wrote: Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem:

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-29 Thread Radim Krčmář
2017-03-28 13:35-0700, Jim Mattson: > On Tue, Mar 28, 2017 at 7:28 AM, Radim Krčmář wrote: >> 2017-03-27 15:34+0200, Alexander Graf: >>> On 15/03/2017 22:22, Michael S. Tsirkin wrote: Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: unless explicitly provided with

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-28 Thread Jim Mattson
On Tue, Mar 28, 2017 at 7:28 AM, Radim Krčmář wrote: > 2017-03-27 15:34+0200, Alexander Graf: >> On 15/03/2017 22:22, Michael S. Tsirkin wrote: >>> Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: >>> unless explicitly provided with kernel command line argument >>> "idlehal

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-28 Thread Radim Krčmář
2017-03-27 15:34+0200, Alexander Graf: > On 15/03/2017 22:22, Michael S. Tsirkin wrote: >> Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: >> unless explicitly provided with kernel command line argument >> "idlehalt=0" they'd implicitly assume MONITOR and MWAIT availability

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-27 Thread Alexander Graf
On 15/03/2017 22:22, Michael S. Tsirkin wrote: Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: unless explicitly provided with kernel command line argument "idlehalt=0" they'd implicitly assume MONITOR and MWAIT availability, without checking CPUID. We currently emulat

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-22 Thread Michael S. Tsirkin
On Wed, Mar 22, 2017 at 10:10:05AM -0400, Gabriel L. Somlo wrote: > On Wed, Mar 22, 2017 at 03:35:18PM +0200, Michael S. Tsirkin wrote: > > On Tue, Mar 21, 2017 at 05:02:25PM -0700, Nadav Amit wrote: > > > > > > > On Mar 21, 2017, at 3:51 PM, Gabriel Somlo wrote: > > > > > > > > And I get the ex

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-22 Thread Gabriel L. Somlo
On Wed, Mar 22, 2017 at 03:35:18PM +0200, Michael S. Tsirkin wrote: > On Tue, Mar 21, 2017 at 05:02:25PM -0700, Nadav Amit wrote: > > > > > On Mar 21, 2017, at 3:51 PM, Gabriel Somlo wrote: > > > > > > And I get the exact same results on the MacBookAir4,2 (which exhibits > > > no freezing or ext

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-22 Thread Michael S. Tsirkin
On Tue, Mar 21, 2017 at 05:02:25PM -0700, Nadav Amit wrote: > > > On Mar 21, 2017, at 3:51 PM, Gabriel Somlo wrote: > > > > And I get the exact same results on the MacBookAir4,2 (which exhibits > > no freezing or extreme sluggishness when running OS X 10.7 smp with > > Michael's KVM MWAIT-in-L1

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Nadav Amit
> On Mar 21, 2017, at 3:51 PM, Gabriel Somlo wrote: > > And I get the exact same results on the MacBookAir4,2 (which exhibits > no freezing or extreme sluggishness when running OS X 10.7 smp with > Michael's KVM MWAIT-in-L1 patch)... Sorry for my confusion. I didn’t read the entire thread and t

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Gabriel Somlo
On Tue, Mar 21, 2017 at 08:22:39PM +0100, Radim Krčmář wrote: > 2017-03-21 10:29-0700, Nadav Amit: > > > > > On Mar 21, 2017, at 9:58 AM, Radim Krčmář wrote: > > > > > In '-smp 2', the writing VCPU always does 1 wakeups by writing into > > > monitored memory, but the mwaiting VCPU can be als

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Radim Krčmář
2017-03-21 10:29-0700, Nadav Amit: > > > On Mar 21, 2017, at 9:58 AM, Radim Krčmář wrote: > > > In '-smp 2', the writing VCPU always does 1 wakeups by writing into > > monitored memory, but the mwaiting VCPU can be also woken up by host > > interrupts, which might add a few exits depending o

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Michael S. Tsirkin
On Tue, Mar 21, 2017 at 05:16:32PM +0100, Joerg Roedel wrote: > On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > > index d1efe2c..18e53bc 100644 > > --- a/arch/x86/kvm/svm.c > > +++ b/arch/x86/kvm/svm.c > > @@ -1198,8 +11

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Nadav Amit
> On Mar 21, 2017, at 9:58 AM, Radim Krčmář wrote: > In '-smp 2', the writing VCPU always does 1 wakeups by writing into > monitored memory, but the mwaiting VCPU can be also woken up by host > interrupts, which might add a few exits depending on timing. > > I didn't spend much time in maki

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Radim Krčmář
2017-03-21 05:22+0200, Michael S. Tsirkin: > On Fri, Mar 17, 2017 at 09:23:56AM -0400, Gabriel L. Somlo wrote: >> OK, now on to Radim's test, on the MacPro1,1: >> >> [kvm-unit-tests]$ time TIMEOUT=20 ./x86-run x86/mwait.flat -append '240 1 1' >> timeout -k 1s --foreground 20 qemu-kvm -nodefaults -

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-21 Thread Joerg Roedel
On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index d1efe2c..18e53bc 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -1198,8 +1198,6 @@ static void init_vmcb(struct vcpu_svm *svm) > set_intercept(

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-20 Thread Michael S. Tsirkin
On Fri, Mar 17, 2017 at 09:23:56AM -0400, Gabriel L. Somlo wrote: > OK, now on to Radim's test, on the MacPro1,1: > > [kvm-unit-tests]$ time TIMEOUT=20 ./x86-run x86/mwait.flat -append '240 1 1' > timeout -k 1s --foreground 20 qemu-kvm -nodefaults -enable-kvm -device > pc-testdev -device isa-debu

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-17 Thread Gabriel L. Somlo
On Fri, Mar 17, 2017 at 04:03:59AM +0200, Michael S. Tsirkin wrote: > On Thu, Mar 16, 2017 at 05:14:15PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 04:17:11PM -0400, Gabriel L. Somlo wrote: > > > On Thu, Mar 16, 2017 at 09:27:56PM +0200, Michael S. Tsirkin wrote: > > > > On Thu, Mar

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 05:14:15PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 04:17:11PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 09:27:56PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Mar 16, 2017 at 03:24:41PM -0400, Gabriel L. Somlo wrote: > > > > On Thu, Mar 1

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 04:17:11PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 09:27:56PM +0200, Michael S. Tsirkin wrote: > > On Thu, Mar 16, 2017 at 03:24:41PM -0400, Gabriel L. Somlo wrote: > > > On Thu, Mar 16, 2017 at 08:29:32PM +0200, Michael S. Tsirkin wrote: > > > > Let's take

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 09:27:56PM +0200, Michael S. Tsirkin wrote: > On Thu, Mar 16, 2017 at 03:24:41PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 08:29:32PM +0200, Michael S. Tsirkin wrote: > > > Let's take a step back and try to figure out how is > > > mwait called. How about dum

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 03:24:41PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 08:29:32PM +0200, Michael S. Tsirkin wrote: > > Let's take a step back and try to figure out how is > > mwait called. How about dumping code of VCPUs > > around mwait? gdb disa command will do this. > > St

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 08:29:32PM +0200, Michael S. Tsirkin wrote: > Let's take a step back and try to figure out how is > mwait called. How about dumping code of VCPUs > around mwait? gdb disa command will do this. Started guest with '-s', tried to attach from gdb with "target remote localhost:

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
Let's take a step back and try to figure out how is mwait called. How about dumping code of VCPUs around mwait? gdb disa command will do this. -- MST -- To unsubscribe from this list: send the line "unsubscribe linux-doc" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 07:27:34PM +0200, Michael S. Tsirkin wrote: > On Thu, Mar 16, 2017 at 12:47:50PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 05:01:58PM +0100, Radim Krčmář wrote: > > > 2017-03-16 16:35+0100, Radim Krčmář: > > > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > >

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 06:22:44PM +0100, Radim Krčmář wrote: > 2017-03-16 12:47-0400, Gabriel L. Somlo: > > On Thu, Mar 16, 2017 at 05:01:58PM +0100, Radim Krčmář wrote: > > > 2017-03-16 16:35+0100, Radim Krčmář: > > > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > > >> The intel manual said the s

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Radim Krčmář
2017-03-16 19:14+0200, Michael S. Tsirkin: > On Thu, Mar 16, 2017 at 12:54:50PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 12:52:32PM -0400, Gabriel L. Somlo wrote: > > > On Thu, Mar 16, 2017 at 06:45:02PM +0200, Michael S. Tsirkin wrote: > > > > On Thu, Mar 16, 2017 at 12:16:13PM -

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 12:47:50PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 05:01:58PM +0100, Radim Krčmář wrote: > > 2017-03-16 16:35+0100, Radim Krčmář: > > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > >> The intel manual said the same thing back in 2010 as well. However, > > >>

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Radim Krčmář
2017-03-16 12:47-0400, Gabriel L. Somlo: > On Thu, Mar 16, 2017 at 05:01:58PM +0100, Radim Krčmář wrote: > > 2017-03-16 16:35+0100, Radim Krčmář: > > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > >> The intel manual said the same thing back in 2010 as well. However, > > >> regardless of how any fl

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 12:54:50PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 12:52:32PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 06:45:02PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Mar 16, 2017 at 12:16:13PM -0400, Gabriel L. Somlo wrote: > > > > On Thu, Mar 1

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 12:52:32PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 06:45:02PM +0200, Michael S. Tsirkin wrote: > > On Thu, Mar 16, 2017 at 12:16:13PM -0400, Gabriel L. Somlo wrote: > > > On Thu, Mar 16, 2017 at 04:35:18PM +0100, Radim Krčmář wrote: > > > > 2017-03-16 10:58-

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 06:45:02PM +0200, Michael S. Tsirkin wrote: > On Thu, Mar 16, 2017 at 12:16:13PM -0400, Gabriel L. Somlo wrote: > > On Thu, Mar 16, 2017 at 04:35:18PM +0100, Radim Krčmář wrote: > > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > > > On Thu, Mar 16, 2017 at 04:04:12PM +0200,

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 05:01:58PM +0100, Radim Krčmář wrote: > 2017-03-16 16:35+0100, Radim Krčmář: > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > >> The intel manual said the same thing back in 2010 as well. However, > >> regardless of how any flags were set, interrupt-window exiting or not, > >>

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 12:16:13PM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 04:35:18PM +0100, Radim Krčmář wrote: > > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > > On Thu, Mar 16, 2017 at 04:04:12PM +0200, Michael S. Tsirkin wrote: > > > > On Thu, Mar 16, 2017 at 09:24:27AM -0400,

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 04:54:06PM +0100, Radim Krčmář wrote: > 2017-03-16 11:44-0400, Gabriel L. Somlo: > > On Thu, Mar 16, 2017 at 03:08:07PM +0100, Radim Krčmář wrote: > >> 2017-03-16 09:24-0400, Gabriel L. Somlo: > >> > On Thu, Mar 16, 2017 at 01:41:28AM +0200, Michael S. Tsirkin wrote: > >> >

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 04:35:18PM +0100, Radim Krčmář wrote: > 2017-03-16 10:58-0400, Gabriel L. Somlo: > > On Thu, Mar 16, 2017 at 04:04:12PM +0200, Michael S. Tsirkin wrote: > > > On Thu, Mar 16, 2017 at 09:24:27AM -0400, Gabriel L. Somlo wrote: > > > > After studying your patch a bit more caref

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Radim Krčmář
2017-03-16 16:35+0100, Radim Krčmář: > 2017-03-16 10:58-0400, Gabriel L. Somlo: >> The intel manual said the same thing back in 2010 as well. However, >> regardless of how any flags were set, interrupt-window exiting or not, >> "normal" L1 MWAIT behavior was that it woke up immediately regardless.

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 03:08:07PM +0100, Radim Krčmář wrote: > 2017-03-16 09:24-0400, Gabriel L. Somlo: > > On Thu, Mar 16, 2017 at 01:41:28AM +0200, Michael S. Tsirkin wrote: > > > On Wed, Mar 15, 2017 at 07:35:34PM -0400, Gabriel L. Somlo wrote: > > > > On Wed, Mar 15, 2017 at 11:22:18PM +0200,

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Radim Krčmář
2017-03-16 11:44-0400, Gabriel L. Somlo: > On Thu, Mar 16, 2017 at 03:08:07PM +0100, Radim Krčmář wrote: >> 2017-03-16 09:24-0400, Gabriel L. Somlo: >> > On Thu, Mar 16, 2017 at 01:41:28AM +0200, Michael S. Tsirkin wrote: >> > > On Wed, Mar 15, 2017 at 07:35:34PM -0400, Gabriel L. Somlo wrote: >> >

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Radim Krčmář
2017-03-16 10:58-0400, Gabriel L. Somlo: > On Thu, Mar 16, 2017 at 04:04:12PM +0200, Michael S. Tsirkin wrote: > > On Thu, Mar 16, 2017 at 09:24:27AM -0400, Gabriel L. Somlo wrote: > > > After studying your patch a bit more carefully (sorry, it's crazy > > > around here right now :) ) I realized yo

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 10:58:20AM -0400, Gabriel L. Somlo wrote: > On Thu, Mar 16, 2017 at 04:04:12PM +0200, Michael S. Tsirkin wrote: > > On Thu, Mar 16, 2017 at 09:24:27AM -0400, Gabriel L. Somlo wrote: > > > After studying your patch a bit more carefully (sorry, it's crazy > > > around here rig

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 04:04:12PM +0200, Michael S. Tsirkin wrote: > On Thu, Mar 16, 2017 at 09:24:27AM -0400, Gabriel L. Somlo wrote: > > After studying your patch a bit more carefully (sorry, it's crazy > > around here right now :) ) I realized you're simply trying to > > (selectively) decide wh

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Radim Krčmář
2017-03-16 09:24-0400, Gabriel L. Somlo: > On Thu, Mar 16, 2017 at 01:41:28AM +0200, Michael S. Tsirkin wrote: > > On Wed, Mar 15, 2017 at 07:35:34PM -0400, Gabriel L. Somlo wrote: > > > On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > > > > Guests running Mac OS 5, 6, and 7 (L

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Michael S. Tsirkin
On Thu, Mar 16, 2017 at 09:24:27AM -0400, Gabriel L. Somlo wrote: > After studying your patch a bit more carefully (sorry, it's crazy > around here right now :) ) I realized you're simply trying to > (selectively) decide when to exit L1 and emulate as NOP vs. when to > just allow L1 to execute MONI

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-16 Thread Gabriel L. Somlo
On Thu, Mar 16, 2017 at 01:41:28AM +0200, Michael S. Tsirkin wrote: > On Wed, Mar 15, 2017 at 07:35:34PM -0400, Gabriel L. Somlo wrote: > > On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > > > Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: > > > unless

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-15 Thread Michael S. Tsirkin
On Wed, Mar 15, 2017 at 07:35:34PM -0400, Gabriel L. Somlo wrote: > On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > > Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: > > unless explicitly provided with kernel command line argument > > "idlehalt=0" they

Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-15 Thread Gabriel L. Somlo
On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: > unless explicitly provided with kernel command line argument > "idlehalt=0" they'd implicitly assume MONITOR and MWAIT availability, > without checking CP

[PATCH v5 untested] kvm: better MWAIT emulation for guests

2017-03-15 Thread Michael S. Tsirkin
Guests running Mac OS 5, 6, and 7 (Leopard through Lion) have a problem: unless explicitly provided with kernel command line argument "idlehalt=0" they'd implicitly assume MONITOR and MWAIT availability, without checking CPUID. We currently emulate that as a NOP but on VMX we can do better: let gu