From: "Andreas Färber" <afaerber@suse.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH next v2 00/74] QOM CPUState, part 3: CPU reset
Date: Mon, 14 May 2012 22:59:53 +0200 [thread overview]
Message-ID: <4FB17249.1070205@suse.de> (raw)
In-Reply-To: <CAAu8pHsde4z_3RxdTWOw2obsQiXA8ZXxc==R0JrBRgs7CbuAXw@mail.gmail.com>
Am 14.05.2012 21:54, schrieb Blue Swirl:
> On Mon, May 14, 2012 at 4:15 PM, Andreas Färber <afaerber@suse.de> wrote:
>> Am 10.05.2012 02:13, schrieb Andreas Färber:
>>> Andreas Färber (74):
>> [...]
>>> target-sparc: Let cpu_sparc_init() return SPARCCPU
>>> sun4m: Use cpu_sparc_init() to obtain SPARCCPU
>>> sun4m: Pass SPARCCPU to {main,secondary}_cpu_reset()
>>> sun4u: Use cpu_sparc_init() to obtain SPARCCPU
>>> sun4u: Let cpu_devinit() return SPARCCPU
>>> sun4u: Store SPARCCPU in ResetData
>>> leon3: Use cpu_sparc_init() to obtain SPARCCPU
>>> leon3: Store SPARCCPU in ResetData
>> [...]
Forgot to mention the bsd-user patch.
>>> Kill off cpu_state_reset()
>>
>> Ping! Blue, can you ack please?
>
> What was again the purpose of all these changes, 00/74 only mentions
> killing cpu_state_reset()?
cpu_reset(CPUState *) was renamed to cpu_state_reset(CPUArchState *) to
make room for a QOM cpu_reset(CPUState *). This we have now but we still
unneededly have cpu_state_reset() and in particular we have one instance
(mips) where cpu_state_reset() does not forward to cpu_reset(). It
should on sparc. So the goal of this series is to eliminate all callers
of cpu_state_reset(). The safest and cleanest way is to remove it
completely.
The upcoming followup series, part 4, then starts moving
CPUArchState-duplicated fields from CPU_COMMON to the one CPUState, for
which reset code needs to be added that requires cpu_reset() - rather
than cpu_state_reset() - to be called in order to be executed, e.g.
halted. A preview of that can be seen on my GitHub qom-cpu branch - I
still need a QOM-safe way of calling tlb_flush() for VMState without too
much code duplication before I'll submit.
> For example two CPU types (SPARCCPU vs.
> CPUSPARCState) doesn't look very useful, is that needed?
That is outside the scope of this series but I can explain again:
CPUSPARCState is the problematic struct I'm trying to fix:
* I introduced a CPUState struct for QOM TYPE_CPU. This is compiled
twice, once for system mode, once for user mode. This struct so far is
empty. Here common fields are supposed to go (part 4), in a way that
code can be shared across targets (e.g., 13x -softmmu, 1x qom/cpu.o).
* I introduced a SPARCCPU struct for QOM TYPE_SPARC_CPU. This is a
target-specific subclass of TYPE_CPU and is what 1.1 already uses to
create the CPU state internally. This embeds CPUSPARCState.
The way QOM and most object-oriented type systems work is by placing
common fields in the front and adding new ones in the back. As pointed
out by rth this is bad for TCG because we want small offsets to
target-specific register fields for immediate load/stores. env points to
the middle of the CPU, cpu to the front, if you will. So we still need
CPUSPARCState, just not for everything.
As common or target-specific fields get moved to or added to CPUState /
SPARCPU, it becomes difficult to "jailbreak" CPUSPARCState -
sparc_env_get_cpu() and generalized ENV_GET_CPU() macro are ways to do
so. To avoid their use and the runtime casts they bring along, I am
first propagating the use of the larger type, SPARCCPU, throughout the
parts of code that will use it. CPUSPARCState can then be cheaply
accessed through cpu->env.
The purpose as before is to speed up compilation, by factoring out
common code (using CPUState) that does not need to be compiled for each
CPUxxxState with their varying field offsets, and to allow for mixing
CPU cores (with some contraints) within one executable, by making
CPUState more self-describing.
Cf. http://wiki.qemu.org/Features/QOM/CPU
CPUSPARCState is what still makes having subclasses of SPARCCPU with
additional fields tricky - they would get added to the end after some of
the large CPU_COMMON fields, so accessing them from TCG gets ugly.
And SPARCCPU is the type that gives access to SPARCCPUClass, where
constant data specific to one type can be obtained from, i.e. what is
now sparc_def_t. There we'll (you'll) need to decide whether you want to
keep it declarative, which will lead to field duplication between
sparc_def_t/SPARCCPUInfo and SPARCCPUClass due to late instantiation, or
make it imperative, which needs closer review to not introduce errors
when rewriting all the type definitions.
HTE,
Andreas
> Otherwise the patches look pretty safe ("if it compiles, it works").
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-05-14 21:00 UTC|newest]
Thread overview: 135+ 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
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 [this message]
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
-- strict thread matches above, loose matches on Subject: below --
2012-05-10 0:10 Andreas Färber
2012-05-10 9:44 ` Andreas Färber
2012-05-10 20:35 ` Peter Maydell
2012-05-10 21:05 ` Andreas Färber
2012-05-10 21:26 ` Peter Maydell
2012-05-10 21:44 ` Andreas Färber
2012-05-14 20:25 ` Max Filippov
2012-05-14 21:49 ` Andreas Färber
2012-05-15 11:24 ` Edgar E. Iglesias
2012-05-15 15:11 ` Andreas Färber
2012-05-15 13:19 ` Edgar E. Iglesias
2012-05-15 15:47 ` Andreas Färber
2012-05-21 13:52 ` Alexander Graf
2012-05-21 22:39 ` 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=4FB17249.1070205@suse.de \
--to=afaerber@suse.de \
--cc=blauwirbel@gmail.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).