mirror of
https://github.com/qemu/qemu.git
synced 2024-12-12 21:23:36 +08:00
xics: Handle KVM ICP reset from the common code
The KVM ICP reset handler simply writes the ICP state to KVM. This doesn't need the overkill parent_reset logic we have today. Call icp_set_kvm_state() from the base ICP reset function instead. Since there are no other users for ICPStateClass::parent_reset, and it isn't currently expected to change, drop it as well. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <155023079461.1011724.12644984391500635645.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
0e5c7fad9c
commit
d82f397183
@ -289,7 +289,7 @@ static const VMStateDescription vmstate_icp_server = {
|
||||
},
|
||||
};
|
||||
|
||||
static void icp_reset(DeviceState *dev)
|
||||
static void icp_reset_handler(void *dev)
|
||||
{
|
||||
ICPState *icp = ICP(dev);
|
||||
|
||||
@ -299,13 +299,10 @@ static void icp_reset(DeviceState *dev)
|
||||
|
||||
/* Make all outputs are deasserted */
|
||||
qemu_set_irq(icp->output, 0);
|
||||
}
|
||||
|
||||
static void icp_reset_handler(void *dev)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_GET_CLASS(dev);
|
||||
|
||||
dc->reset(dev);
|
||||
if (kvm_irqchip_in_kernel()) {
|
||||
icp_set_kvm_state(ICP(dev));
|
||||
}
|
||||
}
|
||||
|
||||
static void icp_realize(DeviceState *dev, Error **errp)
|
||||
@ -370,7 +367,6 @@ static void icp_class_init(ObjectClass *klass, void *data)
|
||||
|
||||
dc->realize = icp_realize;
|
||||
dc->unrealize = icp_unrealize;
|
||||
dc->reset = icp_reset;
|
||||
}
|
||||
|
||||
static const TypeInfo icp_info = {
|
||||
|
@ -115,15 +115,6 @@ int icp_set_kvm_state(ICPState *icp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void icp_kvm_reset(DeviceState *dev)
|
||||
{
|
||||
ICPStateClass *icpc = ICP_GET_CLASS(dev);
|
||||
|
||||
icpc->parent_reset(dev);
|
||||
|
||||
icp_set_kvm_state(ICP(dev));
|
||||
}
|
||||
|
||||
static void icp_kvm_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
ICPState *icp = ICP(dev);
|
||||
@ -176,8 +167,6 @@ static void icp_kvm_class_init(ObjectClass *klass, void *data)
|
||||
|
||||
device_class_set_parent_realize(dc, icp_kvm_realize,
|
||||
&icpc->parent_realize);
|
||||
device_class_set_parent_reset(dc, icp_kvm_reset,
|
||||
&icpc->parent_reset);
|
||||
}
|
||||
|
||||
static const TypeInfo icp_kvm_info = {
|
||||
|
@ -65,7 +65,6 @@ struct ICPStateClass {
|
||||
DeviceClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceReset parent_reset;
|
||||
};
|
||||
|
||||
struct ICPState {
|
||||
|
Loading…
Reference in New Issue
Block a user