diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-31 10:36:08 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-10-31 15:00:25 +0100 |
commit | 14e6fe12a705c065fecdfd2a97199728123d4d9a (patch) | |
tree | c78875a95ca8fa9f6bac7dc95a1415f5dbfb7cfc /hw/i386/kvm/apic.c | |
parent | 12e9700d7a926aeb7f97a5d3c368bbe6745be884 (diff) |
*_run_on_cpu: introduce run_on_cpu_data type
This changes the *_run_on_cpu APIs (and helpers) to pass data in a
run_on_cpu_data type instead of a plain void *. This is because we
sometimes want to pass a target address (target_ulong) and this fails on
32 bit hosts emulating 64 bit guests.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20161027151030.20863-24-alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i386/kvm/apic.c')
-rw-r--r-- | hw/i386/kvm/apic.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c index 39b73e7b3d..01cbaa88d2 100644 --- a/hw/i386/kvm/apic.c +++ b/hw/i386/kvm/apic.c @@ -133,9 +133,9 @@ static void kvm_apic_vapic_base_update(APICCommonState *s) } } -static void kvm_apic_put(CPUState *cs, void *data) +static void kvm_apic_put(CPUState *cs, run_on_cpu_data data) { - APICCommonState *s = data; + APICCommonState *s = data.host_ptr; struct kvm_lapic_state kapic; int ret; @@ -151,12 +151,12 @@ static void kvm_apic_put(CPUState *cs, void *data) static void kvm_apic_post_load(APICCommonState *s) { - run_on_cpu(CPU(s->cpu), kvm_apic_put, s); + run_on_cpu(CPU(s->cpu), kvm_apic_put, RUN_ON_CPU_HOST_PTR(s)); } -static void do_inject_external_nmi(CPUState *cpu, void *data) +static void do_inject_external_nmi(CPUState *cpu, run_on_cpu_data data) { - APICCommonState *s = data; + APICCommonState *s = data.host_ptr; uint32_t lvt; int ret; @@ -174,7 +174,7 @@ static void do_inject_external_nmi(CPUState *cpu, void *data) static void kvm_apic_external_nmi(APICCommonState *s) { - run_on_cpu(CPU(s->cpu), do_inject_external_nmi, s); + run_on_cpu(CPU(s->cpu), do_inject_external_nmi, RUN_ON_CPU_HOST_PTR(s)); } static void kvm_send_msi(MSIMessage *msg) @@ -213,7 +213,7 @@ static void kvm_apic_reset(APICCommonState *s) /* Not used by KVM, which uses the CPU mp_state instead. */ s->wait_for_sipi = 0; - run_on_cpu(CPU(s->cpu), kvm_apic_put, s); + run_on_cpu(CPU(s->cpu), kvm_apic_put, RUN_ON_CPU_HOST_PTR(s)); } static void kvm_apic_realize(DeviceState *dev, Error **errp) |