[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC qom-cpu 03/41] cpu: Turn cpu_get_tb_cpu_state() in
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC qom-cpu 03/41] cpu: Turn cpu_get_tb_cpu_state() into a CPUClass hook |
Date: |
Wed, 04 Sep 2013 12:26:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8 |
Il 04/09/2013 11:04, Andreas Färber ha scritto:
> static inline TranslationBlock *tb_find_fast(CPUArchState *env)
> {
> + CPUState *cpu = ENV_GET_CPU(env);
> + CPUClass *cc = CPU_GET_CLASS(cpu);
> TranslationBlock *tb;
> - target_ulong cs_base, pc;
> + vaddr cs_base, pc;
> int flags;
>
> /* we record a subset of the CPU state. It will
> always be the same before a given translated block
> is executed. */
> - cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
> + cc->get_tb_cpu_state(cpu, &pc, &cs_base, &flags);
I'm afraid you cannot turn inline functions into indirect calls like
this in hot paths.
One alternative would be to hoist the function call to the beginning of
cpu_exec, and ensure that any place that modifies the result calls
cpu_exit. It may be a problem for SPARC's npc stuff, for which I have
no idea how it works.
Another is to change cpu-exec.c into a file that is #included by
target-*/helper.c or something like that. This way cpu-exec.c can still
use the inline functions.
Paolo
- [Qemu-devel] [RFC qom-cpu 00/41] QOM CPUState, part 13: Emptying CPU_COMMON, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 01/41] cpu: Turn cpu_has_work() into a CPUClass hook, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 04/41] cpu: Turn cpu_handle_mmu_fault() into a CPUClass hook, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 05/41] cpu: Move mem_io_{pc, vaddr} fields from CPU_COMMON to CPUState, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 03/41] cpu: Turn cpu_get_tb_cpu_state() into a CPUClass hook, Andreas Färber, 2013/09/04
- Re: [Qemu-devel] [RFC qom-cpu 03/41] cpu: Turn cpu_get_tb_cpu_state() into a CPUClass hook,
Paolo Bonzini <=
- [Qemu-devel] [RFC qom-cpu 08/41] cpu: Move icount_decr field from CPU_COMMON to CPUState, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 02/41] cpu: Turn cpu_mmu_index() into a CPUClass hook, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 06/41] cpu: Move can_do_io field from CPU_COMMON to CPUState, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 07/41] cpu: Move icount_extra field from CPU_COMMON to CPUState, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 10/41] cpu: Move jmp_env field from CPU_COMMON to CPUState, Andreas Färber, 2013/09/04
- [Qemu-devel] [RFC qom-cpu 09/41] cpu: Move tb_jmp_cache field from CPU_COMMON to CPUState, Andreas Färber, 2013/09/04