mirror of
https://github.com/qemu/qemu.git
synced 2025-01-24 14:34:00 +08:00
xics: Handle KVM ICP realize from the common code
The realization of KVM ICP currently follows the parent_realize logic, which is a bit overkill here. Also we want to get rid of the KVM ICP class. Explicitely call icp_kvm_realize() from the base ICP realize function. Note that ICPStateClass::parent_realize is retained because powernv needs it. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <155023080049.1011724.15423463482790260696.stgit@bahia.lan> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
d82f397183
commit
8e6e6efef7
@ -349,6 +349,14 @@ static void icp_realize(DeviceState *dev, Error **errp)
|
||||
return;
|
||||
}
|
||||
|
||||
if (kvm_irqchip_in_kernel()) {
|
||||
icp_kvm_realize(dev, &err);
|
||||
if (err) {
|
||||
error_propagate(errp, err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
qemu_register_reset(icp_reset_handler, dev);
|
||||
vmstate_register(NULL, icp->cs->cpu_index, &vmstate_icp_server, icp);
|
||||
}
|
||||
|
@ -115,11 +115,9 @@ int icp_set_kvm_state(ICPState *icp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void icp_kvm_realize(DeviceState *dev, Error **errp)
|
||||
void icp_kvm_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
ICPState *icp = ICP(dev);
|
||||
ICPStateClass *icpc = ICP_GET_CLASS(icp);
|
||||
Error *local_err = NULL;
|
||||
CPUState *cs;
|
||||
KVMEnabledICP *enabled_icp;
|
||||
unsigned long vcpu_id;
|
||||
@ -129,12 +127,6 @@ static void icp_kvm_realize(DeviceState *dev, Error **errp)
|
||||
abort();
|
||||
}
|
||||
|
||||
icpc->parent_realize(dev, &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
|
||||
cs = icp->cs;
|
||||
vcpu_id = kvm_arch_vcpu_id(cs);
|
||||
|
||||
|
@ -202,5 +202,6 @@ Object *icp_create(Object *cpu, const char *type, XICSFabric *xi,
|
||||
void icp_get_kvm_state(ICPState *icp);
|
||||
int icp_set_kvm_state(ICPState *icp);
|
||||
void icp_synchronize_state(ICPState *icp);
|
||||
void icp_kvm_realize(DeviceState *dev, Error **errp);
|
||||
|
||||
#endif /* XICS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user