[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env wi
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env with CPUState cpu_single_cpu |
Date: |
Tue, 18 Jun 2013 18:52:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 |
Am 16.06.2013 22:49, schrieb Blue Swirl:
> On Sun, Jun 16, 2013 at 3:57 PM, Andreas Färber <address@hidden> wrote:
>> Move it to qom/cpu.h.
>
> While renaming, perhaps a more descriptive name could be used instead
> of 'cpu_single_cpu', something like cpu_loop_current_cpu?
There were some local variables named cpu_single_cpu (blame me :)) that
this way simply fall away, but I can certainly rename it, adding just a
few lines to the patch.
However, cpu_loop_current_cpu seems to codify that we have a sequential
loop of vCPUs, which Xen and IIUC KVM do not have and occasionally
people have looked into changing for TCG.
current_cpu is already used in a few places:
include/sysemu/kvm.h:int kvm_arch_insert_sw_breakpoint(CPUState
*current_cpu,
include/sysemu/kvm.h:int kvm_arch_remove_sw_breakpoint(CPUState
*current_cpu,
kvm-all.c: CPUState *current_cpu = ENV_GET_CPU(current_env);
kvm-all.c: bp = kvm_find_sw_breakpoint(current_cpu, addr);
kvm-all.c: err = kvm_arch_insert_sw_breakpoint(current_cpu, bp);
kvm-all.c:
QTAILQ_INSERT_HEAD(¤t_cpu->kvm_state->kvm_sw_breakpoints,
kvm-all.c: CPUState *current_cpu = ENV_GET_CPU(current_env);
kvm-all.c: bp = kvm_find_sw_breakpoint(current_cpu, addr);
kvm-all.c: err = kvm_arch_remove_sw_breakpoint(current_cpu, bp);
kvm-all.c:
QTAILQ_REMOVE(¤t_cpu->kvm_state->kvm_sw_breakpoints, bp, entry);
kvm-all.c: CPUState *current_cpu = ENV_GET_CPU(current_env);
kvm-all.c: KVMState *s = current_cpu->kvm_state;
kvm-all.c: if (kvm_arch_remove_sw_breakpoint(current_cpu, bp) != 0) {
but we could probably ignore these variable shadowings.
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 qom-cpu v2 09/29] cpu: Turn cpu_dump_{state, statistics}() into CPUState hooks, (continued)
- [Qemu-devel] [PATCH qom-cpu v2 09/29] cpu: Turn cpu_dump_{state, statistics}() into CPUState hooks, Andreas Färber, 2013/06/16
- [Qemu-devel] [PATCH qom-cpu v2 18/29] cpu: Turn cpu_unassigned_access() into a CPUState hook, Andreas Färber, 2013/06/16
- [Qemu-devel] [PATCH qom-cpu v2 20/29] kvm: Change kvm_remove_all_breakpoints() argument to CPUState, Andreas Färber, 2013/06/16
- [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env with CPUState cpu_single_cpu, Andreas Färber, 2013/06/16
- Re: [Qemu-devel] [PATCH qom-cpu v2 19/29] cpu: Replace cpu_single_env with CPUState cpu_single_cpu, Richard Henderson, 2013/06/17
- [Qemu-devel] [PATCH qom-cpu v2 23/29] bsd-user: Change thread_env to CPUState, Andreas Färber, 2013/06/16
- [Qemu-devel] [PATCH qom-cpu v2 22/29] linux-user: Change thread_env to CPUState, Andreas Färber, 2013/06/16
- [Qemu-devel] [PATCH qom-cpu v2 24/29] cpu: Drop qemu_for_each_cpu(), Andreas Färber, 2013/06/16