94a94e4c49
Introduce sPAPRMachineClass.dr_cpu_enabled to indicate support for CPU core hotplug. Initialize boot time CPUs as core deivces and prevent topologies that result in partially filled cores. Both of these are done only if CPU core hotplug is supported. Note: An unrelated change in the call to xics_system_init() is done in this patch as it makes sense to use the local variable smt introduced in this patch instead of kvmppc_smt_threads() call here. TODO: We derive sPAPR core type by looking at -cpu <model>. However we don't take care of "compat=" feature yet for boot time as well as hotplug CPUs. Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
33 lines
831 B
C
33 lines
831 B
C
/*
|
|
* sPAPR CPU core device.
|
|
*
|
|
* Copyright (C) 2016 Bharata B Rao <bharata@linux.vnet.ibm.com>
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
#ifndef HW_SPAPR_CPU_CORE_H
|
|
#define HW_SPAPR_CPU_CORE_H
|
|
|
|
#include "hw/qdev.h"
|
|
#include "hw/cpu/core.h"
|
|
#include "target-ppc/cpu-qom.h"
|
|
|
|
#define TYPE_SPAPR_CPU_CORE "spapr-cpu-core"
|
|
#define SPAPR_CPU_CORE(obj) \
|
|
OBJECT_CHECK(sPAPRCPUCore, (obj), TYPE_SPAPR_CPU_CORE)
|
|
|
|
typedef struct sPAPRCPUCore {
|
|
/*< private >*/
|
|
CPUCore parent_obj;
|
|
|
|
/*< public >*/
|
|
void *threads;
|
|
ObjectClass *cpu_class;
|
|
} sPAPRCPUCore;
|
|
|
|
void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
|
|
Error **errp);
|
|
char *spapr_get_cpu_core_type(const char *model);
|
|
#endif
|