mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
xics: setup cpu at realize time
Until recently, spapr used to allocate ICPState objects for the lifetime of the machine. They would only be associated to vCPUs in xics_cpu_setup() when plugging a CPU core. Now that ICPState objects have the same lifecycle as vCPUs, it is possible to associate them during realization. This patch hence open-codes xics_cpu_setup() in icp_realize(). The vCPU is passed as a property. Note that vCPU now needs to be realized first for the IRQs to be allocated. It also needs to resetted before ICPState realization in order to synchronize with KVM. Since ICPState objects are freed when unrealized, xics_cpu_destroy() isn't needed anymore and can be safely dropped. Signed-off-by: Greg Kurz <groug@kaod.org> 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
100f738850
commit
9ed656631d
4 changed files with 53 additions and 71 deletions
|
@ -87,6 +87,7 @@ struct ICPState {
|
|||
};
|
||||
|
||||
#define ICP_PROP_XICS "xics"
|
||||
#define ICP_PROP_CPU "cpu"
|
||||
|
||||
struct PnvICPState {
|
||||
ICPState parent_obj;
|
||||
|
@ -187,8 +188,6 @@ void spapr_dt_xics(int nr_servers, void *fdt, uint32_t phandle);
|
|||
|
||||
qemu_irq xics_get_qirq(XICSFabric *xi, int irq);
|
||||
ICPState *xics_icp_get(XICSFabric *xi, int server);
|
||||
void xics_cpu_setup(XICSFabric *xi, PowerPCCPU *cpu, ICPState *icp);
|
||||
void xics_cpu_destroy(XICSFabric *xi, PowerPCCPU *cpu);
|
||||
|
||||
/* Internal XICS interfaces */
|
||||
void icp_set_cppr(ICPState *icp, uint8_t cppr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue