From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMGdv-0006In-6g for qemu-devel@nongnu.org; Tue, 26 Aug 2014 09:18:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMGdq-0004Je-45 for qemu-devel@nongnu.org; Tue, 26 Aug 2014 09:18:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMGdp-0004JQ-Rc for qemu-devel@nongnu.org; Tue, 26 Aug 2014 09:18:30 -0400 Message-ID: <53FC8914.9030109@redhat.com> Date: Tue, 26 Aug 2014 15:18:12 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 5/6] qom/cpu: Add Memory Region Property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, afaerber@suse.de Il 26/08/2014 02:59, Peter Crosthwaite ha scritto: > Which is used to construct a per-CPU address space. The Address space > will be created at realize time. > > Signed-off-by: Peter Crosthwaite > --- > > include/qom/cpu.h | 1 + > qom/cpu.c | 11 +++++++++++ > 2 files changed, 12 insertions(+) > > diff --git a/include/qom/cpu.h b/include/qom/cpu.h > index 1aafbf5..192d337 100644 > --- a/include/qom/cpu.h > +++ b/include/qom/cpu.h > @@ -242,6 +242,7 @@ struct CPUState { > int64_t icount_extra; > sigjmp_buf jmp_env; > > + MemoryRegion *mr; > AddressSpace *as; > MemoryListener *tcg_as_listener; > > diff --git a/qom/cpu.c b/qom/cpu.c > index b32dd0a..899071e 100644 > --- a/qom/cpu.c > +++ b/qom/cpu.c > @@ -25,6 +25,10 @@ > #include "qemu/log.h" > #include "qemu/error-report.h" > #include "sysemu/sysemu.h" > +#include "exec/memory.h" > +#include "qapi/visitor.h" > +#include "exec/address-spaces.h" > +#include "hw/qdev-properties.h" > > bool cpu_exists(int64_t id) > { > @@ -314,6 +318,13 @@ static void cpu_common_initfn(Object *obj) > CPUClass *cc = CPU_GET_CLASS(obj); > > cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; > +#ifndef CONFIG_USER_ONLY > + object_property_add_link(obj, "mr", TYPE_MEMORY_REGION, Please use a clearer name such as "memory". Paolo > + (Object **)&cpu->mr, > + qdev_prop_allow_set_link_before_realize, > + OBJ_PROP_LINK_UNREF_ON_RELEASE, > + &error_abort); > +#endif > } > > static int64_t cpu_common_get_arch_id(CPUState *cpu) >