[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions |
Date: |
Mon, 11 May 2015 12:24:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 11/05/2015 12:18, Andreas Färber wrote:
>> > + int (*cpu_mmu_index)(CPUState *cpu);
>> > + void (*cpu_get_tb_cpu_state)(CPUState *cpu,
>> > + void *pc, /* target_long * */
>> > + void *cs_base, /* target_long */
>> > + int *flags);
>> > + void (*gen_intermediate_code)(void *env, struct TranslationBlock *tb);
>> > + void (*gen_intermediate_code_pc)(void *env, struct TranslationBlock
>> > *tb);
>> > + void (*restore_state_to_opc)(void *env, struct TranslationBlock *tb,
>> > + int pc_pos);
>> > + void (*tlb_fill)(CPUState *cs, uint64_t addr, int is_write, int
>> > mmu_idx,
>> > + uintptr_t retaddr);
>> > } CPUClass;
>> >
>> > #ifdef HOST_WORDS_BIGENDIAN
> [snip]
>
> Paolo had objected to this when I tried it. The counter-suggestion was
> something about reworking how the cputlb code is built per target -
> please check the archives.
Right. My point was that these functions are not polymorphic. Each
call to these should know exactly which function to call.
cputlb.c, cpu-exec.c and parts of translate-all.c should be the moral
equivalent of C++ templates. I wouldn't mind switching to C++, but if
we want to make them polymorphic we should do it at compile time through
multiple compilation and/or inclusion from target-*.
Paolo
- [Qemu-devel] [RFC PATCH 12/34] mb: cpu: Move CPU_COMMON to front of env, (continued)
- [Qemu-devel] [RFC PATCH 12/34] mb: cpu: Move CPU_COMMON to front of env, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 09/34] mb: delete dummy prototypes, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 06/34] mb: rename EXCP macros, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 10/34] HACK: microblaze: rename clz helper, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 05/34] mb: cpu: Delete MMAP_SHIFT definition, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 07/34] mb: Remove ELF_MACHINE from cpu.h, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 03/34] target-multi: Add, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 01/34] cpu-all: Prototype cpu_exec and cpu_signal_handler, Peter Crosthwaite, 2015/05/11
- [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions, Peter Crosthwaite, 2015/05/11
- Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions, Richard Henderson, 2015/05/11
- Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions, Peter Crosthwaite, 2015/05/12
- Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions, Richard Henderson, 2015/05/12
Re: [Qemu-devel] [RFC PATCH 02/34] tcg+qom: QOMify core CPU defintions, Peter Maydell, 2015/05/11
[Qemu-devel] [RFC PATCH 04/34] mb: Change target long to 64b, Peter Crosthwaite, 2015/05/11
Re: [Qemu-devel] [RFC PATCH 00/34] Multi Architecture System Emulation, Peter Maydell, 2015/05/11