Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934703AbdCVOPz (ORCPT ); Wed, 22 Mar 2017 10:15:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934687AbdCVOP1 (ORCPT ); Wed, 22 Mar 2017 10:15:27 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A7853B716 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8A7853B716 Date: Wed, 22 Mar 2017 16:15:07 +0200 From: "Michael S. Tsirkin" To: "Gabriel L. Somlo" Cc: Nadav Amit , Radim =?utf-8?B?S3LEjW3DocWZ?= , LKML , Paolo Bonzini , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Joerg Roedel , KVM list , linux-doc@vger.kernel.org Subject: Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests Message-ID: <20170322161444-mutt-send-email-mst@kernel.org> References: <20170321225116.GJ2231@HEDWIG.INI.CMU.EDU> <540BB5C2-CEAE-47D2-845B-2DDEF3CDC303@gmail.com> <20170322153431-mutt-send-email-mst@kernel.org> <20170322141004.GA24964@HEDWIG.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170322141004.GA24964@HEDWIG.INI.CMU.EDU> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 22 Mar 2017 14:15:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1668 Lines: 46 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 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 thought that > > > the problem is spurious wake-ups. > > > > > > Since that is not the case, I would just suggest two things that you can > > > freely ignore: > > > > > > 1. According to the SDM, when an interrupt is delivered, the interrupt > > > is only delivered on the following instruction, so you may consider > > > skipping the MWAIT first. > > > > > > 2. Perhaps the CPU changes for some reason GUEST_ACTIVITY_STATE (which > > > is not according to the SDM). > > > > > > That is it. No more BS from me. > > > > > > Nadav > > > > Intersting. I found this errata: > > A REP STOS/MOVS to a MONITOR/MWAIT Address Range May Prevent Triggering of > > the Monitoring Hardware > > Any way to tell if they mean that for L0, or L>=1, or all of them? > > > Could the macbook CPU be affected? > > I ran a grep on the log file I collected when disassembling > AppleIntelCPUPowerManagement.kext (where the MWAIT-based idle > thread lives) a few days ago, and didn't find any "rep stos" or > "rep movs" instances. > Right but that would be on the waking side, not the one that does mwait. -- MST