From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/4] KVM: MMU: Reinstate pte prefetch on invlpg Date: Tue, 16 Feb 2010 10:40:26 +0200 Message-ID: <4B7A59FA.4020908@redhat.com> References: <1266238109-30280-1-git-send-email-avi@redhat.com> <1266238109-30280-5-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Marcelo Tosatti , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47504 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303Ab0BPIk2 (ORCPT ); Tue, 16 Feb 2010 03:40:28 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1G8eRI9028476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Feb 2010 03:40:27 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1G8eQJT005481 for ; Tue, 16 Feb 2010 03:40:27 -0500 In-Reply-To: <1266238109-30280-5-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/15/2010 02:48 PM, Avi Kivity wrote: > Commit fb341f57 removed the pte prefetch on guest invlpg, citing guest races. > However, the SDM is adamant that prefetch is allowed: > > "The processor may create entries in paging-structure caches for > translations required for prefetches and for accesses that are a > result of speculative execution that would never actually occur > in the executed code path." > > And, in fact, there was a race in the prefetch code: we picked up the pte > without the mmu lock held, so an older invlpg could install the pte over > a newer invlpg. > > Reinstate the prefetch logic, but this time note whether another invlpg has > executed using a counter. If a race occured, do not install the pte. > > This patch is broken (UP windows XP won't start), I'm debugging it. -- error compiling committee.c: too many arguments to function