[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 5/6] qom/cpu: Add Memory Region Property
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v1 5/6] qom/cpu: Add Memory Region Property |
Date: |
Tue, 26 Aug 2014 15:18:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 |
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 <address@hidden>
> ---
>
> 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)
>
- [Qemu-devel] [PATCH v1 0/6] PMA phase 2 - per CPU address spaces, Peter Crosthwaite, 2014/08/25
- [Qemu-devel] [PATCH v1 1/6] memory: address_space_init: do nothing if no root region given, Peter Crosthwaite, 2014/08/25
- [Qemu-devel] [PATCH v1 2/6] memory: AddressSpace: Implement ref counting, Peter Crosthwaite, 2014/08/25
- [Qemu-devel] [PATCH v1 4/6] qom: Move cpu.o to obj-y., Peter Crosthwaite, 2014/08/25
- [Qemu-devel] [PATCH v1 5/6] qom/cpu: Add Memory Region Property, Peter Crosthwaite, 2014/08/25
- Re: [Qemu-devel] [PATCH v1 5/6] qom/cpu: Add Memory Region Property,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v1 6/6] cpu: Delay address space init until realize, Peter Crosthwaite, 2014/08/25