From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9dGu-0003rU-Si for qemu-devel@nongnu.org; Mon, 19 Mar 2012 10:09:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9dGV-0003hg-5k for qemu-devel@nongnu.org; Mon, 19 Mar 2012 10:09:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51754) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9dGU-0003hD-UJ for qemu-devel@nongnu.org; Mon, 19 Mar 2012 10:08:51 -0400 Message-ID: <4F673DEE.3040508@redhat.com> Date: Mon, 19 Mar 2012 16:08:46 +0200 From: Avi Kivity MIME-Version: 1.0 References: <4F671F55.4050004@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Xtensa misuse of tb_invalidate_phys_page_range()? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Filippov Cc: Jan Kiszka , qemu-devel On 03/19/2012 03:51 PM, Max Filippov wrote: > > void HELPER(wsr_ibreaka)(uint32_t i, uint32_t v) > > { > > if (env->sregs[IBREAKENABLE] & (1 << i) && env->sregs[IBREAKA + i] > > != v) { > > tb_invalidate_phys_page_range( > > env->sregs[IBREAKA + i], env->sregs[IBREAKA + i] + 1, 0); > > tb_invalidate_phys_page_range(v, v + 1, 0); > > } > > env->sregs[IBREAKA + i] = v; > > } > > > > tb_invalidate_phys_page_range() expects a virtual address in user mode, > > and a ram_addr_t in system mode. I'm guessing that v is a virtual address? > > Yes, it's a virtual address here, as well as in wsr_lbeg/wsr_lend helpers. > I made a test for it and it actually fails. I wonder how could it stay unnoticed > that long :() There are many silent breakages like that, don't worry. > > This needs to be fixed for system mode if so (and in any case - even if > > it's a physical address, it needs to be translated to a ram_addr_t). > > Sure. Will try to fix it, though it's completely unclear to me now > how to do it efficiently. Since I'm rewriting this area, don't worry about efficiency. Let's get it correct and after the rewrite we can reexamine efficiency. I imagine you'll need something like breakpoint_invalidate(). -- error compiling committee.c: too many arguments to function