mirror of
https://github.com/qemu/qemu.git
synced 2025-01-20 12:33:26 +08:00
ppc/xics: remove the XICSState classes
The XICSState classes are not used anymore. They have now been fully deprecated by the XICSFabric QOM interface. Do the cleanups. Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
2192a9303d
commit
e6f7e110ee
@ -134,16 +134,6 @@ static void ics_simple_pic_print_info(InterruptStatsProvider *obj,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* XICS Common class - parent for emulated XICS and KVM-XICS
|
||||
*/
|
||||
static const TypeInfo xics_common_info = {
|
||||
.name = TYPE_XICS_COMMON,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(XICSState),
|
||||
.class_size = sizeof(XICSStateClass),
|
||||
};
|
||||
|
||||
/*
|
||||
* ICP: Presentation layer
|
||||
*/
|
||||
@ -752,7 +742,6 @@ void ics_set_irq_type(ICSState *ics, int srcno, bool lsi)
|
||||
|
||||
static void xics_register_types(void)
|
||||
{
|
||||
type_register_static(&xics_common_info);
|
||||
type_register_static(&ics_simple_info);
|
||||
type_register_static(&ics_base_info);
|
||||
type_register_static(&icp_info);
|
||||
|
@ -42,12 +42,6 @@
|
||||
|
||||
static int kernel_xics_fd = -1;
|
||||
|
||||
typedef struct KVMXICSState {
|
||||
XICSState parent_obj;
|
||||
|
||||
int kernel_xics_fd;
|
||||
} KVMXICSState;
|
||||
|
||||
/*
|
||||
* ICP-KVM
|
||||
*/
|
||||
@ -429,15 +423,8 @@ fail:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const TypeInfo xics_spapr_kvm_info = {
|
||||
.name = TYPE_XICS_SPAPR_KVM,
|
||||
.parent = TYPE_XICS_COMMON,
|
||||
.instance_size = sizeof(KVMXICSState),
|
||||
};
|
||||
|
||||
static void xics_kvm_register_types(void)
|
||||
{
|
||||
type_register_static(&xics_spapr_kvm_info);
|
||||
type_register_static(&ics_kvm_info);
|
||||
type_register_static(&icp_kvm_info);
|
||||
}
|
||||
|
@ -257,13 +257,6 @@ int xics_spapr_init(sPAPRMachineState *spapr, Error **errp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const TypeInfo xics_spapr_info = {
|
||||
.name = TYPE_XICS_SPAPR,
|
||||
.parent = TYPE_XICS_COMMON,
|
||||
.instance_size = sizeof(XICSState),
|
||||
.class_size = sizeof(XICSStateClass),
|
||||
};
|
||||
|
||||
#define ICS_IRQ_FREE(ics, srcno) \
|
||||
(!((ics)->irqs[(srcno)].flags & (XICS_FLAGS_IRQ_MASK)))
|
||||
|
||||
@ -400,10 +393,3 @@ void spapr_dt_xics(int nr_servers, void *fdt, uint32_t phandle)
|
||||
_FDT(fdt_setprop_cell(fdt, node, "linux,phandle", phandle));
|
||||
_FDT(fdt_setprop_cell(fdt, node, "phandle", phandle));
|
||||
}
|
||||
|
||||
static void xics_spapr_register_types(void)
|
||||
{
|
||||
type_register_static(&xics_spapr_info);
|
||||
}
|
||||
|
||||
type_init(xics_spapr_register_types)
|
||||
|
@ -95,24 +95,15 @@
|
||||
|
||||
#define HTAB_SIZE(spapr) (1ULL << ((spapr)->htab_shift))
|
||||
|
||||
static XICSState *try_create_xics(sPAPRMachineState *spapr,
|
||||
const char *type, const char *type_ics,
|
||||
static int try_create_xics(sPAPRMachineState *spapr, const char *type_ics,
|
||||
const char *type_icp, int nr_servers,
|
||||
int nr_irqs, Error **errp)
|
||||
{
|
||||
XICSFabric *xi = XICS_FABRIC(spapr);
|
||||
Error *err = NULL, *local_err = NULL;
|
||||
XICSState *xics;
|
||||
ICSState *ics = NULL;
|
||||
int i;
|
||||
|
||||
xics = XICS_COMMON(object_new(type));
|
||||
qdev_set_parent_bus(DEVICE(xics), sysbus_get_default());
|
||||
object_property_set_bool(OBJECT(xics), true, "realized", &err);
|
||||
if (err) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
ics = ICS_SIMPLE(object_new(type_ics));
|
||||
qdev_set_parent_bus(DEVICE(ics), sysbus_get_default());
|
||||
object_property_add_child(OBJECT(spapr), "ics", OBJECT(ics), NULL);
|
||||
@ -142,32 +133,30 @@ static XICSState *try_create_xics(sPAPRMachineState *spapr,
|
||||
}
|
||||
|
||||
spapr->ics = ics;
|
||||
return xics;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
error_propagate(errp, err);
|
||||
if (ics) {
|
||||
object_unparent(OBJECT(ics));
|
||||
}
|
||||
object_unparent(OBJECT(xics));
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static XICSState *xics_system_init(MachineState *machine,
|
||||
static int xics_system_init(MachineState *machine,
|
||||
int nr_servers, int nr_irqs, Error **errp)
|
||||
{
|
||||
XICSState *xics = NULL;
|
||||
int rc = -1;
|
||||
|
||||
if (kvm_enabled()) {
|
||||
Error *err = NULL;
|
||||
|
||||
if (machine_kernel_irqchip_allowed(machine) &&
|
||||
!xics_kvm_init(SPAPR_MACHINE(machine), errp)) {
|
||||
xics = try_create_xics(SPAPR_MACHINE(machine),
|
||||
TYPE_XICS_SPAPR_KVM, TYPE_ICS_KVM,
|
||||
rc = try_create_xics(SPAPR_MACHINE(machine), TYPE_ICS_KVM,
|
||||
TYPE_KVM_ICP, nr_servers, nr_irqs, &err);
|
||||
}
|
||||
if (machine_kernel_irqchip_required(machine) && !xics) {
|
||||
if (machine_kernel_irqchip_required(machine) && rc < 0) {
|
||||
error_reportf_err(err,
|
||||
"kernel_irqchip requested but unavailable: ");
|
||||
} else {
|
||||
@ -175,14 +164,13 @@ static XICSState *xics_system_init(MachineState *machine,
|
||||
}
|
||||
}
|
||||
|
||||
if (!xics) {
|
||||
if (rc < 0) {
|
||||
xics_spapr_init(SPAPR_MACHINE(machine), errp);
|
||||
xics = try_create_xics(SPAPR_MACHINE(machine),
|
||||
TYPE_XICS_SPAPR, TYPE_ICS_SIMPLE,
|
||||
rc = try_create_xics(SPAPR_MACHINE(machine), TYPE_ICS_SIMPLE,
|
||||
TYPE_ICP, nr_servers, nr_irqs, errp);
|
||||
}
|
||||
|
||||
return xics;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int spapr_fixup_cpu_smt_dt(void *fdt, int offset, PowerPCCPU *cpu,
|
||||
@ -2003,8 +1991,7 @@ static void ppc_spapr_init(MachineState *machine)
|
||||
load_limit = MIN(spapr->rma_size, RTAS_MAX_ADDR) - FW_OVERHEAD;
|
||||
|
||||
/* Set up Interrupt Controller before we create the VCPUs */
|
||||
spapr->xics = xics_system_init(machine,
|
||||
DIV_ROUND_UP(max_cpus * smt, smp_threads),
|
||||
xics_system_init(machine, DIV_ROUND_UP(max_cpus * smt, smp_threads),
|
||||
XICS_IRQS_SPAPR, &error_fatal);
|
||||
|
||||
/* Set up containers for ibm,client-set-architecture negotiated options */
|
||||
|
@ -58,7 +58,6 @@ struct sPAPRMachineState {
|
||||
struct VIOsPAPRBus *vio_bus;
|
||||
QLIST_HEAD(, sPAPRPHBState) phbs;
|
||||
struct sPAPRNVRAM *nvram;
|
||||
XICSState *xics;
|
||||
ICSState *ics;
|
||||
DeviceState *rtc;
|
||||
|
||||
|
@ -30,29 +30,6 @@
|
||||
|
||||
#include "hw/sysbus.h"
|
||||
|
||||
#define TYPE_XICS_COMMON "xics-common"
|
||||
#define XICS_COMMON(obj) OBJECT_CHECK(XICSState, (obj), TYPE_XICS_COMMON)
|
||||
|
||||
/*
|
||||
* Retain xics as the type name to be compatible for migration. Rest all the
|
||||
* functions, class and variables are renamed as xics_spapr.
|
||||
*/
|
||||
#define TYPE_XICS_SPAPR "xics"
|
||||
#define XICS_SPAPR(obj) OBJECT_CHECK(XICSState, (obj), TYPE_XICS_SPAPR)
|
||||
|
||||
#define TYPE_XICS_SPAPR_KVM "xics-spapr-kvm"
|
||||
#define XICS_SPAPR_KVM(obj) \
|
||||
OBJECT_CHECK(KVMXICSState, (obj), TYPE_XICS_SPAPR_KVM)
|
||||
|
||||
#define XICS_COMMON_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(XICSStateClass, (klass), TYPE_XICS_COMMON)
|
||||
#define XICS_SPAPR_CLASS(klass) \
|
||||
OBJECT_CLASS_CHECK(XICSStateClass, (klass), TYPE_XICS_SPAPR)
|
||||
#define XICS_COMMON_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(XICSStateClass, (obj), TYPE_XICS_COMMON)
|
||||
#define XICS_SPAPR_GET_CLASS(obj) \
|
||||
OBJECT_GET_CLASS(XICSStateClass, (obj), TYPE_XICS_SPAPR)
|
||||
|
||||
#define XICS_IPI 0x2
|
||||
#define XICS_BUID 0x1
|
||||
#define XICS_IRQ_BASE (XICS_BUID << 12)
|
||||
@ -62,8 +39,6 @@
|
||||
* (the kernel implementation supports more but we don't exploit
|
||||
* that yet)
|
||||
*/
|
||||
typedef struct XICSStateClass XICSStateClass;
|
||||
typedef struct XICSState XICSState;
|
||||
typedef struct ICPStateClass ICPStateClass;
|
||||
typedef struct ICPState ICPState;
|
||||
typedef struct ICSStateClass ICSStateClass;
|
||||
@ -71,16 +46,6 @@ typedef struct ICSState ICSState;
|
||||
typedef struct ICSIRQState ICSIRQState;
|
||||
typedef struct XICSFabric XICSFabric;
|
||||
|
||||
struct XICSStateClass {
|
||||
DeviceClass parent_class;
|
||||
};
|
||||
|
||||
struct XICSState {
|
||||
/*< private >*/
|
||||
DeviceState parent_obj;
|
||||
/*< public >*/
|
||||
};
|
||||
|
||||
#define TYPE_ICP "icp"
|
||||
#define ICP(obj) OBJECT_CHECK(ICPState, (obj), TYPE_ICP)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user