summaryrefslogtreecommitdiff
path: root/hw/kvm/apic.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-10-31 06:06:49 +0100
committerAndreas Färber <afaerber@suse.de>2012-12-19 14:09:31 +0100
commit1bc22652d62f862a5def54f939e87fdb7a5593ae (patch)
tree007c4c834f580f81989b94c5c5489a57ff2b2263 /hw/kvm/apic.c
parent20d695a9254c1b086a456d3b79a3c311236643ba (diff)
downloadqemu-1bc22652d62f862a5def54f939e87fdb7a5593ae.tar.gz
qemu-1bc22652d62f862a5def54f939e87fdb7a5593ae.tar.bz2
qemu-1bc22652d62f862a5def54f939e87fdb7a5593ae.zip
kvm: Pass CPUState to kvm_vcpu_ioctl()
Adapt helper functions to pass X86CPU / PowerPCCPU / S390CPU. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/kvm/apic.c')
-rw-r--r--hw/kvm/apic.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c
index 8b65d513db..c4d74ee1aa 100644
--- a/hw/kvm/apic.c
+++ b/hw/kvm/apic.c
@@ -104,7 +104,7 @@ static void kvm_apic_enable_tpr_reporting(APICCommonState *s, bool enable)
.enabled = enable
};
- kvm_vcpu_ioctl(&s->cpu->env, KVM_TPR_ACCESS_REPORTING, &ctl);
+ kvm_vcpu_ioctl(CPU(s->cpu), KVM_TPR_ACCESS_REPORTING, &ctl);
}
static void kvm_apic_vapic_base_update(APICCommonState *s)
@@ -114,7 +114,7 @@ static void kvm_apic_vapic_base_update(APICCommonState *s)
};
int ret;
- ret = kvm_vcpu_ioctl(&s->cpu->env, KVM_SET_VAPIC_ADDR, &vapid_addr);
+ ret = kvm_vcpu_ioctl(CPU(s->cpu), KVM_SET_VAPIC_ADDR, &vapid_addr);
if (ret < 0) {
fprintf(stderr, "KVM: setting VAPIC address failed (%s)\n",
strerror(-ret));
@@ -125,15 +125,15 @@ static void kvm_apic_vapic_base_update(APICCommonState *s)
static void do_inject_external_nmi(void *data)
{
APICCommonState *s = data;
- CPUX86State *env = &s->cpu->env;
+ CPUState *cpu = CPU(s->cpu);
uint32_t lvt;
int ret;
- cpu_synchronize_state(env);
+ cpu_synchronize_state(&s->cpu->env);
lvt = s->lvt[APIC_LVT_LINT1];
if (!(lvt & APIC_LVT_MASKED) && ((lvt >> 8) & 7) == APIC_DM_NMI) {
- ret = kvm_vcpu_ioctl(env, KVM_NMI);
+ ret = kvm_vcpu_ioctl(cpu, KVM_NMI);
if (ret < 0) {
fprintf(stderr, "KVM: injection failed, NMI lost (%s)\n",
strerror(-ret));