X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=hw%2Fs390x%2Fs390-virtio.c;h=ca275bd9d7412324711bb1f6b1ce37de80f07584;hb=259186a7d2f7184efc96ae99bc5658e6159f53ad;hp=2a1d9ac2daabdc2813b217916ef8eb41f256dba1;hpb=7cc2a8b14a363777e7d5b7d102176fba0cf27667;p=qemu.git diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c index 2a1d9ac2d..ca275bd9d 100644 --- a/hw/s390x/s390-virtio.c +++ b/hw/s390x/s390-virtio.c @@ -130,21 +130,27 @@ static void s390_virtio_register_hcalls(void) */ static unsigned s390_running_cpus; -void s390_add_running_cpu(CPUS390XState *env) +void s390_add_running_cpu(S390CPU *cpu) { - if (env->halted) { + CPUState *cs = CPU(cpu); + CPUS390XState *env = &cpu->env; + + if (cs->halted) { s390_running_cpus++; - env->halted = 0; + cs->halted = 0; env->exception_index = -1; } } -unsigned s390_del_running_cpu(CPUS390XState *env) +unsigned s390_del_running_cpu(S390CPU *cpu) { - if (env->halted == 0) { + CPUState *cs = CPU(cpu); + CPUS390XState *env = &cpu->env; + + if (cs->halted == 0) { assert(s390_running_cpus >= 1); s390_running_cpus--; - env->halted = 1; + cs->halted = 1; env->exception_index = EXCP_HLT; } return s390_running_cpus; @@ -179,11 +185,13 @@ void s390_init_cpus(const char *cpu_model, uint8_t *storage_keys) for (i = 0; i < smp_cpus; i++) { S390CPU *cpu; + CPUState *cs; cpu = cpu_s390x_init(cpu_model); + cs = CPU(cpu); ipi_states[i] = cpu; - cpu->env.halted = 1; + cs->halted = 1; cpu->env.exception_index = EXCP_HLT; cpu->env.storage_keys = storage_keys; }