From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] mask out clflush Date: Thu, 10 Jul 2008 08:37:41 -0500 Message-ID: <487610A5.9030903@codemonkey.ws> References: <1215541784-26539-1-git-send-email-gcosta@redhat.com> <200807101843.57902.sheng.yang@intel.com> <48760EE6.1070303@codemonkey.ws> <48760FDA.80401@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "Yang, Sheng" , kvm@vger.kernel.org, Glauber Costa , glommer@gmail.com To: Avi Kivity Return-path: Received: from py-out-1112.google.com ([64.233.166.182]:41501 "EHLO py-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbYGJNiK (ORCPT ); Thu, 10 Jul 2008 09:38:10 -0400 Received: by py-out-1112.google.com with SMTP id p76so1828300pyb.10 for ; Thu, 10 Jul 2008 06:38:08 -0700 (PDT) In-Reply-To: <48760FDA.80401@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > Anthony Liguori wrote: >> Yang, Sheng wrote: >>> On Wednesday 09 July 2008 02:29:44 Glauber Costa wrote: >>> >>>> clflush is a non-privileged instruction that flushes the cacheline >>>> given by its parameter, in terms of linear address. As it is >>>> non-privileged, it is quite tricky, because a guest doing clflush >>>> will actually be trying to flush a host kernel address. >>>> >>> >>> The linear address was convert to host physical address, then cache >>> line was flushed. Of course the host physical address was used by >>> guest at the time. I don't understand why we need to prevent guest >>> from flushing cache line related to itself... >>> >> >> The problem turned out to be that we aren't emulating clflush in >> x86_emulate. >> > > Why would clflush trap? Is it called from real mode? It's equivalent to a read from a VT perspective so if the read would trap, the clflush instruction will trap. Regards, Anthony Liguori