qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH v2 5/5] target-ppc: Add CPU finalizer


From: Andreas Färber
Subject: Re: [Qemu-ppc] [PATCH v2 5/5] target-ppc: Add CPU finalizer
Date: Thu, 12 Apr 2012 23:45:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 11.04.2012 03:06, schrieb David Gibson:
> On Fri, Apr 06, 2012 at 06:17:12PM +0200, Andreas Färber wrote:
>> free() opcode tables. They are being malloc()'ed in create_new_table().
> 
> This doesn't seem right.  Unless I've missed something in the call
> path, create_new_table() is not called from the instance initializer.
> So surely it should not be torn down in the instance finalizer.

We have this call chain:

helper.c:cpu_ppc_init() -> translate_init.c:cpu_ppc_register_internal()
-> create_ppc_opcodes() -> create_ppc_opcodes() -> { fill_new_table()
(filling it with &invalid_handler),
register_insn() -> { register_[dbl]ind_insn() -> register_ind_in_table()
-> create_new_table(), register_direct_insn() -> insert_in_table()
}(each filling it with non-invalid handlers) }

So you are correct that it is not directly called from the initfn. The
reason not to do that yet is that cpu_ppc_register_internal() still uses
ppc_def_t, which my previous RFC patch series replaces through QOM
subclasses.

Since free() works fine with zero'ed memory such as after the
object_new() in cpu_ppc_init() I still think this patch is fully
correct. But we can postpone it if you prefer.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]