qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 03/13] target-sh4: Start QOM'ifying CPU init


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v3 03/13] target-sh4: Start QOM'ifying CPU init
Date: Mon, 16 Apr 2012 16:56:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 16.04.2012 16:39, schrieb Peter Maydell:
> On 14 April 2012 23:12, Andreas Färber <address@hidden> wrote:
>> +static void superh_cpu_initfn(Object *obj)
>> +{
>> +    SuperHCPU *cpu = SUPERH_CPU(obj);
>> +    CPUSH4State *env = &cpu->env;
>> +
>> +    cpu_exec_init(env);
>> +
>> +    env->movcal_backup_tail = &(env->movcal_backup);
>> +
>> +    cpu_reset(CPU(cpu));
>> +}
>> +
> 
> Do the other qom conversions do a cpu reset in the instance
> init function? I don't think the ARM one does (and it would
> probably be bad if it did since reset for some ARM cores
> requires loading values from guest memory so it can't happen
> before the whole of the model has been set up.)

This has been a per-target choice, depending on what the reset code
does. In lack of realize, in some cases I have moved it into initfn
since cpu_*_init() does it instantly and works. Not all targets do a
reset in cpu_*_init() at all though, in particular x86.

> We should aim for consistency across targets here I think.

My aim here was to cut down cpu_*_init() as much as possible.

I am hoping that with realize we will be able to move the
qemu_init_vcpu() into a realizefn and do cpu_reset() for all CPUs there
at that point in time. Moves from initfn to realizefn would (in most
cases) be local to cpu.c then.

So, I can move it back to cpu_sh4_init() but I'm hesitant to do more sh4
resends until it becomes clear who, if anyone, will actually apply the
series...

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]