Received: from eggs.gnu.org ([2001:4830:134:3::10]:45898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0ARD-0007DJ-1s for qemu-devel@nongnu.org; Wed, 03 Jun 2015 11:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0AR8-00054p-Q1 for qemu-devel@nongnu.org; Wed, 03 Jun 2015 11:18:38 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:38593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0AR8-00054Q-Ip for qemu-devel@nongnu.org; Wed, 03 Jun 2015 11:18:34 -0400 Date: Wed, 3 Jun 2015 17:18:32 +0200 From: Aurelien Jarno Message-ID: <20150603151832.GB10311@aurel32.net> References: <1433244411-9693-1-git-send-email-aurelien@aurel32.net> <1433244411-9693-4-git-send-email-aurelien@aurel32.net> <20150602201032.GA5379@aurel32.net> <556E18ED.3070409@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <556E18ED.3070409@twiddle.net> Subject: Re: [Qemu-devel] [PATCH RFC 3/5] softmmu: add a tlb_vaddr_to_host_fill function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Peter Maydell , qemu-devel@nongnu.org, Alexander Graf , Yongbok Kim , Paolo Bonzini , Leon Alrae , Andreas =?iso-8859-15?Q?F=E4rber?= On 2015-06-02 13:58, Richard Henderson wrote: > On 06/02/2015 01:10 PM, Aurelien Jarno wrote: > > It looks like we have to go through the MMIO functions to get the > > TLB_NOTDIRTY bit cleaned correctly. This is something we don't want for > > probe_write, so we definitely want two different functions. > > I think that's why target-arm does it's somewhat convoluted loop in which it > stores one byte to the page and then tries again to use tlb_vaddr_to_host. > > If the page isn't in the tlb, we perform a complete store and thus both pull > the page into the tlb as well as mark it dirty. Thus if the page still isn't > present for the second vaddr_to_host, it really is I/O, or is being watched by > the debugger, or something equally unlikely. Unfortunately it seems there is no way to guarantee that the full page can be marked as dirty at the same time, even on s390x without MMIO. I will try to rewrite the code to have a fallback code for the initial TLB filling, that could also be used in the case the whole page can't be marked as dirty. That's relatively easy when it deals with memset like functions, but it becomes more tricky for memcpy or string functions. -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net