From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmADF-0007ey-Rp for qemu-devel@nongnu.org; Mon, 10 Jun 2013 18:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmADB-00060Z-6t for qemu-devel@nongnu.org; Mon, 10 Jun 2013 18:05:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46392 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmADA-00060R-TT for qemu-devel@nongnu.org; Mon, 10 Jun 2013 18:05:13 -0400 Message-ID: <51B64D94.5070404@suse.de> Date: Tue, 11 Jun 2013 00:05:08 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1370805206-26574-1-git-send-email-afaerber@suse.de> <1370805206-26574-28-git-send-email-afaerber@suse.de> In-Reply-To: <1370805206-26574-28-git-send-email-afaerber@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu 27/59] cpu: Turn cpu_unassigned_access() into a CPUState hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini , Paolo Bonzini Cc: Blue Swirl , "Edgar E. Iglesias" , qemu-devel@nongnu.org, Aurelien Jarno , Richard Henderson Am 09.06.2013 21:12, schrieb Andreas F=C3=A4rber: > diff --git a/include/qom/cpu.h b/include/qom/cpu.h > index a69c09c..814d067 100644 > --- a/include/qom/cpu.h > +++ b/include/qom/cpu.h [...] > @@ -383,6 +401,21 @@ void cpu_interrupt(CPUState *cpu, int mask); > =20 > #endif /* USER_ONLY */ > =20 > +#ifndef CONFIG_USER_ONLY > + > +static inline void cpu_unassigned_access(CPUState *cpu, hwaddr addr, > + bool is_write, bool is_exec, > + int opaque, unsigned size) > +{ > + CPUClass *cc =3D CPU_GET_CLASS(cpu); > + > + if (cc->do_unassigned_access) { > + cc->do_unassigned_access(cpu, addr, is_write, is_exec, opaque,= size); > + } > +} > + > +#endif > + > /** > * cpu_reset_interrupt: > * @cpu: The CPU to clear the interrupt on. > diff --git a/memory.c b/memory.c > index 5cb8f4a..74daf03 100644 > --- a/memory.c > +++ b/memory.c > @@ -857,9 +857,8 @@ static uint64_t unassigned_mem_read(void *opaque, h= waddr addr, > #ifdef DEBUG_UNASSIGNED > printf("Unassigned mem read " TARGET_FMT_plx "\n", addr); > #endif > -#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_M= ICROBLAZE) > - cpu_unassigned_access(cpu_single_env, addr, 0, 0, 0, size); > -#endif > + cpu_unassigned_access(ENV_GET_CPU(cpu_single_env), addr, false, fa= lse, 0, > + size); > return 0; > } > =20 > @@ -869,9 +868,8 @@ static void unassigned_mem_write(void *opaque, hwad= dr addr, > #ifdef DEBUG_UNASSIGNED > printf("Unassigned mem write " TARGET_FMT_plx " =3D 0x%"PRIx64"\n"= , addr, val); > #endif > -#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_M= ICROBLAZE) > - cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size); > -#endif > + cpu_unassigned_access(ENV_GET_CPU(cpu_single_env), addr, true, fal= se, 0, > + size); > } > =20 > static bool unassigned_mem_accepts(void *opaque, hwaddr addr, Taking a wild guess here, could it be that cpu_single_env is NULL in the Xen case, and we're tripping over cpu_unassigned_access() trying CPU_GET_CLASS(ENV_GET_CPU(NULL)) and asserting? Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg