[Top][All Lists]
[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
- [Qemu-devel] [PATCH v3 00/13] QOM'ify SuperH CPU, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 04/13] target-sh4: Do not reset CPU feature flags on reset, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 03/13] target-sh4: Start QOM'ifying CPU init, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 01/13] target-sh4: QOM'ify CPU, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 02/13] target-sh4: QOM'ify CPU reset, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 05/13] hw/sh7750: Use SuperHCPU, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 08/13] target-sh4: Make find_*tlb_entry() take SuperHCPU, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 06/13] target-sh4: Make cpu_sh4_invalidate_tlb() take SuperHCPU, Andreas Färber, 2012/04/14
- [Qemu-devel] [PATCH v3 07/13] target-sh4: Make increment_urc() take SuperHCPU, Andreas Färber, 2012/04/14