From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH next v2 73/74] linux-user: Use cpu_reset() after cpu_init() / cpu_copy()
Date: Wed, 16 May 2012 18:05:35 +0200 [thread overview]
Message-ID: <4FB3D04F.3010605@redhat.com> (raw)
In-Reply-To: <4FB3A51E.7060200@suse.de>
On 05/16/2012 03:01 PM, Andreas Färber wrote:
> Am 16.05.2012 14:36, schrieb Igor Mammedov:
>> On 05/11/2012 01:26 PM, Andreas Färber wrote:
>>> Am 11.05.2012 13:22, schrieb Peter Maydell:
>>>> On 10 May 2012 01:14, Andreas Färber<afaerber@suse.de> wrote:
>>>>> Eliminates cpu_state_reset() usage.
>>>>>
>>>>> Signed-off-by: Andreas Färber<afaerber@suse.de>
>>>>> ---
>>>>> linux-user/main.c | 2 +-
>>>>> linux-user/syscall.c | 2 +-
>>>>> 2 files changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/linux-user/main.c b/linux-user/main.c
>>>>> index 191b750..49108b8 100644
>>>>> --- a/linux-user/main.c
>>>>> +++ b/linux-user/main.c
>>>>> @@ -3405,7 +3405,7 @@ int main(int argc, char **argv, char **envp)
>>>>> exit(1);
>>>>> }
>>>>> #if defined(TARGET_I386) || defined(TARGET_SPARC) ||
>>>>> defined(TARGET_PPC)
>>>>> - cpu_state_reset(env);
>>>>> + cpu_reset(ENV_GET_CPU(env));
>>>>> #endif
>>>>>
>>>>> thread_env = env;
>>>>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>>>>> index 20d2a74..539af3f 100644
>>>>> --- a/linux-user/syscall.c
>>>>> +++ b/linux-user/syscall.c
>>>>> @@ -4262,7 +4262,7 @@ static int do_fork(CPUArchState *env, unsigned
>>>>> int flags, abi_ulong newsp,
>>>>> /* we create a new CPU instance. */
>>>>> new_env = cpu_copy(env);
>>>>> #if defined(TARGET_I386) || defined(TARGET_SPARC) ||
>>>>> defined(TARGET_PPC)
>>>>> - cpu_state_reset(new_env);
>>>>> + cpu_reset(ENV_GET_CPU(new_env));
>>>>> #endif
>>>>> /* Init regs that differ from the parent. */
>>>>> cpu_clone_regs(new_env, newsp);
>>>>> --
>>>>
>>>> Do you have any plans to try to rationalise the handling of reset
>>>> so that we consistently either do or don't reset the cpu here,
>>>> rather than having it done based on a TARGET_* ifdef ?
>>>
>>> Igor had an RFC for x86; sparc and ppc reset I haven't looked into yet.
>>> Cc'ing Alex and Blue.
>> I'll rebase RFC for x86 and post patches today and will remove it from here
>> by the last patch in patchset so that when this patch applied we could
>> remove
>> unnecessary call.
>> So ACK for target-i386 here.
>
> Since back then Peter and I have discussed whether we can rather just
> remove the #ifdef here and reset for all targets.
>
> Unfortunately I'm still not clear about some patches that stand in the
> way of ObjectClass::realize - if cpu_reset() is moved to realizefn for
> all targets then we can just call realize here.
1. I'd like to have cpu_reset in realizefn - which is kind of equivalent
of cpu power-on, after which cpu should be in known state
(i.e. the state after reset, at least for target-i386).
2. cpu_reset in realizefn as well will free us from calling cpu_reset
in device_add when implementing hotplug and will allow to remove it from
hw/pc.c.
3. regarding exec.c:cpu_copy and do_fork on target-i386
cpu_copy first creates cpu then copies all over it CPUArchState of original
cpu perserving only cpu_index. It's beyond my understanding why
anyone would/need do this.
So I'll not touch cpu_reset in do_fork since I haven't a clue what's
going on. Albeit adding cpu_reset in realizefn shouldn't break anything here.
>
> Actually, all we'd need is ObjectClass::realize field, so I'm
> considering extracting the intersection between Paolo and me, stick a
> CPU-specific wrapper method on top as requested by Anthony and then we
> can move ahead here...
>
> Andreas
>
--
-----
Igor
next prev parent reply other threads:[~2012-05-16 16:05 UTC|newest]
Thread overview: 121+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 0:13 [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 01/74] target-arm: Use cpu_reset() in cpu_arm_init() Andreas Färber
2012-05-11 11:24 ` Peter Maydell
2012-05-11 12:33 ` Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 02/74] target-mips: Use cpu_reset() in cpu_mips_init() Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 03/74] target-i386: Pass X86CPU to do_cpu_{init, sipi}() Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 04/74] target-i386: Let cpu_x86_init() return X86CPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 05/74] pc: Use cpu_x86_init() to obtain X86CPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 06/74] pc: Pass X86CPU to pc_cpu_reset() Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 07/74] target-sparc: Let cpu_sparc_init() return SPARCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 08/74] sun4m: Use cpu_sparc_init() to obtain SPARCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 09/74] sun4m: Pass SPARCCPU to {main, secondary}_cpu_reset() Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 10/74] sun4u: Use cpu_sparc_init() to obtain SPARCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 11/74] sun4u: Let cpu_devinit() return SPARCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 12/74] sun4u: Store SPARCCPU in ResetData Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 13/74] leon3: Use cpu_sparc_init() to obtain SPARCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 14/74] leon3: Store SPARCCPU in ResetData Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 15/74] target-ppc: Let cpu_ppc_init() return PowerPCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 16/74] ppce500_mpc8544ds: Pass PowerPCCPU to mpc8544ds_cpu_reset[_sec] Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 17/74] spapr: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 18/74] spapr: Pass PowerPCCPU to spapr_cpu_reset() Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 19/74] ppc440_bamboo: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 20/74] ppc440_bamboo: Pass PowerPCCPU to main_cpu_reset() Andreas Färber
2012-05-10 0:13 ` [Qemu-devel] [PATCH next v2 21/74] ppc4xx_devs: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 22/74] ppc4xx_devs: Pass PowerPCCPU to ppc4xx_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 23/74] ppc_newworld: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 24/74] ppc_newworld: Pass PowerPCCPU to ppc_core99_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 25/74] ppc_oldworld: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 26/74] ppc_oldworld: Pass PowerPCCPU to ppc_heathrow_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 27/74] ppc_prep: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 28/74] ppc_prep: Pass PowerPCCPU to ppc_prep_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 29/74] virtex_ml507: Use cpu_ppc_init() to obtain PowerPCCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 30/74] virtex_ml507: Let ppc440_init_xilinx() return PowerPCCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 31/74] virtex_ml507: Pass PowerPCCPU to main_cpu_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 32/74] cpu-exec: Use cpu_reset() in cpu_exec() for TARGET_PPC Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 33/74] pxa2xx: Use cpu_arm_init() and store ARMCPU Andreas Färber
2012-05-11 11:16 ` Peter Maydell
2012-05-11 11:23 ` Andreas Färber
2012-05-11 12:45 ` Andreas Färber
2012-05-11 20:37 ` andrzej zaborowski
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 34/74] omap: Use cpu_arm_init() to store ARMCPU in omap_mpu_state_s Andreas Färber
2012-05-10 21:38 ` Peter Maydell
2012-05-11 12:52 ` Andreas Färber
2012-05-13 20:30 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 35/74] armv7m: Use cpu_arm_init() to obtain ARMCPU Andreas Färber
2012-05-11 11:18 ` Peter Maydell
2012-05-11 13:34 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 36/74] armv7m: Pass ARMCPU to armv7m_reset() Andreas Färber
2012-05-11 11:19 ` Peter Maydell
2012-05-11 13:36 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 37/74] arm_boot: Pass ARMCPU to do_cpu_reset() Andreas Färber
2012-05-10 21:41 ` Peter Maydell
2012-05-10 22:40 ` Andreas Färber
2012-05-11 7:17 ` Peter Maydell
2012-05-11 13:39 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 38/74] target-sh4: Let cpu_sh4_init() return SuperHCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 39/74] r2d: Use cpu_sh4_init() to obtain SuperHCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 40/74] r2d: Store SuperHCPU in ResetData Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 41/74] target-lm32: Let cpu_lm32_init() return LM32CPU Andreas Färber
2012-05-11 16:28 ` Michael Walle
2012-05-12 0:59 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 42/74] lm32_boards: Use cpu_lm32_init() to obtain LM32CPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 43/74] lm32_boards: Store LM32CPU in ResetInfo Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 44/74] milkymist: Use cpu_lm32_init() to obtain LM32CPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 45/74] milkymist: Store LM32 in ResetInfo Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 46/74] target-xtensa: Let cpu_xtensa_init() return XtensaCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 47/74] xtensa_sim: Use cpu_xtensa_init() to obtain XtensaCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 48/74] xtensa_sim: Pass XtensaCPU to sim_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 49/74] xtensa_lx60: Use cpu_xtensa_init() to obtain XtensaCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 50/74] xtensa_lx60: Pass XtensaCPU to lx60_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 51/74] target-cris: Reindent cpu_cris_init() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 52/74] target-cris: Let cpu_cris_init() return CRISCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 53/74] axis_dev88: Use cpu_cris_init() to obtain CRISCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 54/74] cris-boot: Pass CRISCPU to cris_load_image() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 55/74] cris-boot: Pass CRISCPU to main_cpu_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 56/74] target-microblaze: Let cpu_mb_init() return MicroBlazeCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 57/74] petalogix_ml605: Use cpu_mb_init() to obtain MicroBlazeCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 58/74] petalogix_s3adsp1800_mmu: " Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 59/74] microblaze_boot: Pass MicroBlazeCPU to microblaze_load_kernel() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 60/74] target-mips: Use cpu_reset() in do_interrupt() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 61/74] target-mips: Let cpu_mips_init() return MIPSCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 62/74] mips_fulong2e: Use cpu_mips_cpu() to obtain MIPSCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 63/74] mips_fulong2e: Pass MIPSCPU to main_cpu_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 64/74] mips_jazz: Use cpu_mips_init() to obtain MIPSCPU Andreas Färber
2012-05-11 11:30 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 65/74] mips_jazz: Pass MIPSCPU to main_cpu_reset() Andreas Färber
2012-05-11 11:31 ` Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 66/74] mips_malta: Use cpu_mips_init() to obtain MIPSCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 67/74] mips_malta: Pass MIPSCPU to main_cpu_reset() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 68/74] mips_mipssim: Use cpu_mips_init() to obtain MIPSCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 69/74] mips_mipssim: Store MIPSCPU in ResetData Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 70/74] mips_r4k: Use cpu_mips_init() to obtain MIPSCPU Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 71/74] mips_r4k: Store MIPSCPU in ResetData Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 72/74] bsd-user: Use cpu_reset() in after cpu_init() Andreas Färber
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 73/74] linux-user: Use cpu_reset() after cpu_init() / cpu_copy() Andreas Färber
2012-05-11 11:22 ` Peter Maydell
2012-05-11 11:26 ` Andreas Färber
2012-05-11 11:28 ` Alexander Graf
2012-05-11 11:32 ` Peter Maydell
2012-05-11 11:33 ` Andreas Färber
2012-05-16 12:36 ` Igor Mammedov
2012-05-16 13:01 ` Andreas Färber
2012-05-16 13:06 ` Peter Maydell
2012-05-16 16:05 ` Igor Mammedov [this message]
2012-05-16 16:13 ` Peter Maydell
2012-05-16 20:52 ` Igor Mammedov
2012-05-10 0:14 ` [Qemu-devel] [PATCH next v2 74/74] Kill off cpu_state_reset() Andreas Färber
2012-05-14 16:13 ` [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset Andreas Färber
2012-05-14 16:15 ` Andreas Färber
2012-05-14 19:54 ` Blue Swirl
2012-05-14 20:59 ` Andreas Färber
2012-05-14 21:22 ` Blue Swirl
2012-05-21 9:09 ` Andreas Färber
2012-05-21 18:20 ` Blue Swirl
2012-05-22 0:34 ` Andreas Färber
2012-05-22 8:03 ` Fabien Chouteau
2012-05-23 18:48 ` Blue Swirl
2012-05-15 15:16 ` Igor Mammedov
2012-05-16 9:14 ` Andreas Färber
2012-05-16 22:04 ` Andreas Färber
2012-05-21 13:59 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FB3D04F.3010605@redhat.com \
--to=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).