From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alY9B-0003jP-Gr for qemu-devel@nongnu.org; Thu, 31 Mar 2016 04:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alY94-0001Lb-KQ for qemu-devel@nongnu.org; Thu, 31 Mar 2016 04:40:09 -0400 Received: from e28smtp05.in.ibm.com ([125.16.236.5]:35457) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alY93-0001K9-VK for qemu-devel@nongnu.org; Thu, 31 Mar 2016 04:40:02 -0400 Received: from localhost by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 Mar 2016 14:09:59 +0530 From: Bharata B Rao Date: Thu, 31 Mar 2016 14:09:16 +0530 Message-Id: <1459413561-30745-8-git-send-email-bharata@linux.vnet.ibm.com> In-Reply-To: <1459413561-30745-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1459413561-30745-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v2.1 07/12] spapr: Abstract CPU core device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mjrosato@linux.vnet.ibm.com, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, aik@ozlabs.ru, Bharata B Rao , armbru@redhat.com, agraf@suse.de, borntraeger@de.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com, mdroth@linux.vnet.ibm.com, afaerber@suse.de, david@gibson.dropbear.id.au Add sPAPR specific abastract CPU core device that is based on generic CPU core device. This will serve as base type for all PowerPC CPU specific core devices. Signed-off-by: Bharata B Rao --- hw/ppc/Makefile.objs | 1 + hw/ppc/spapr_cpu_core.c | 30 ++++++++++++++++++++++++++++++ include/hw/ppc/spapr_cpu_core.h | 27 +++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 hw/ppc/spapr_cpu_core.c create mode 100644 include/hw/ppc/spapr_cpu_core.h diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs index c1ffc77..5cc6608 100644 --- a/hw/ppc/Makefile.objs +++ b/hw/ppc/Makefile.objs @@ -4,6 +4,7 @@ obj-y += ppc.o ppc_booke.o obj-$(CONFIG_PSERIES) += spapr.o spapr_vio.o spapr_events.o obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o spapr_rng.o +obj-$(CONFIG_PSERIES) += spapr_cpu_core.o ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy) obj-y += spapr_pci_vfio.o endif diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c new file mode 100644 index 0000000..8cbe2a5 --- /dev/null +++ b/hw/ppc/spapr_cpu_core.c @@ -0,0 +1,30 @@ +/* + * sPAPR CPU core device, acts as container of CPU thread devices. + * + * Copyright (C) 2016 Bharata B Rao + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include "hw/cpu/core.h" +#include "hw/ppc/spapr_cpu_core.h" +#include "hw/ppc/spapr.h" +#include "hw/boards.h" +#include "qemu/error-report.h" +#include "qapi/visitor.h" +#include +#include "target-ppc/kvm_ppc.h" + +static const TypeInfo spapr_cpu_core_type_info = { + .name = TYPE_SPAPR_CPU_CORE, + .parent = TYPE_CPU_CORE, + .abstract = true, + .instance_size = sizeof(sPAPRCPUCore), +}; + +static void spapr_cpu_core_register_types(void) +{ + type_register_static(&spapr_cpu_core_type_info); +} + +type_init(spapr_cpu_core_register_types) diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_core.h new file mode 100644 index 0000000..e3340ea --- /dev/null +++ b/include/hw/ppc/spapr_cpu_core.h @@ -0,0 +1,27 @@ +/* + * sPAPR CPU core device. + * + * Copyright (C) 2016 Bharata B Rao + * + * 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" + +#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 >*/ + PowerPCCPU *threads; +} sPAPRCPUCore; + +#endif -- 2.1.0