Received: from eggs.gnu.org ([140.186.70.92]:52798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHU95-00057X-45 for qemu-devel@nongnu.org; Wed, 04 May 2011 00:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHU93-0002G8-Pu for qemu-devel@nongnu.org; Wed, 04 May 2011 00:57:07 -0400 Received: from cantor.suse.de ([195.135.220.2]:47337 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHU93-0002Fd-Jz for qemu-devel@nongnu.org; Wed, 04 May 2011 00:57:05 -0400 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20110420103826.GK6388@volta.aurel32.net> Date: Wed, 4 May 2011 06:57:01 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <17178F0D-AF82-4C90-8B38-628F9F346305@suse.de> References: <1302881578-5357-1-git-send-email-agraf@suse.de> <1302881578-5357-12-git-send-email-agraf@suse.de> <20110420103826.GK6388@volta.aurel32.net> Subject: Re: [Qemu-devel] [PATCH 11/17] s390x: helper functions for system emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: peter.maydell@linaro.org, QEMU-devel Developers , Richard Henderson On 20.04.2011, at 12:38, Aurelien Jarno wrote: > On Fri, Apr 15, 2011 at 05:32:52PM +0200, Alexander Graf wrote: >> When running system emulation, we need to transverse through the MMU = and >> deliver interrupts according to the specification. >>=20 >> This patch implements those two pieces and in addition adjusts the = CPU >> initialization code to account for the new fields in CPUState. >>=20 >> Signed-off-by: Alexander Graf >>=20 [...] >>=20 >> +int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong _vaddr, = int rw, >> int mmu_idx, int is_softmmu) >> { >> - target_ulong phys; >> + uint64_t asc =3D env->psw.mask & PSW_MASK_ASC; >> + target_ulong vaddr, raddr; >> int prot; >>=20 >> - /* XXX: implement mmu */ >> + dprintf("%s: address 0x%" PRIx64 " rw %d mmu_idx %d is_softmmu = %d\n", >> + __FUNCTION__, _vaddr, rw, mmu_idx, is_softmmu); >> + >> + _vaddr &=3D TARGET_PAGE_MASK; >> + vaddr =3D _vaddr; >=20 > You don't need to use a second vaddr variable here, you can directly > apply the mast on _vaddr (and probably rename it to vaddr). Unfortunately, it's not that easy. Take a look at the next few lines - = there we're masking vaddr in 31-bit (and 24-bit) mode. We still need to = add the real vaddr that we got into the TLB though, so we somehow need = to keep the non-masked version around. Alex