diff mbox

[RFC,v3,07/24] cpu: Prepare Socket container type

Message ID 1429858066-12088-8-git-send-email-bharata@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bharata B Rao April 24, 2015, 6:47 a.m. UTC
From: Andreas Färber <afaerber@suse.de>

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 hw/cpu/Makefile.objs    |  2 +-
 hw/cpu/socket.c         | 21 +++++++++++++++++++++
 include/hw/cpu/socket.h | 14 ++++++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 hw/cpu/socket.c
 create mode 100644 include/hw/cpu/socket.h

Comments

David Gibson May 5, 2015, 1:47 a.m. UTC | #1
On Fri, Apr 24, 2015 at 12:17:29PM +0530, Bharata B Rao wrote:
> From: Andreas Färber <afaerber@suse.de>
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

So, how to organize this generically is still under discussion.  For
now, I don't think this generic outline is really worth it.  In any
case I can't really take it through my tree.

What I'd suggest instead is just implementing the POWER core device in
the ppc specific code.  As the generic socket vs. core vs. whatever
stuff clarifies, that POWER core device might become a "virtual
socket" or CM or whatever, but I think we'll be able to keep the
external interface compatible with the right use of aliases.

In the meantime it should at least give us a draft we can experiment
with on Power without requiring new generic infrastructure.
Bharata B Rao May 6, 2015, 4:36 a.m. UTC | #2
On Tue, May 05, 2015 at 11:47:30AM +1000, David Gibson wrote:
> On Fri, Apr 24, 2015 at 12:17:29PM +0530, Bharata B Rao wrote:
> > From: Andreas Färber <afaerber@suse.de>
> > 
> > Signed-off-by: Andreas Färber <afaerber@suse.de>
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> 
> So, how to organize this generically is still under discussion.  For
> now, I don't think this generic outline is really worth it.  In any
> case I can't really take it through my tree.
> 
> What I'd suggest instead is just implementing the POWER core device in
> the ppc specific code.  As the generic socket vs. core vs. whatever
> stuff clarifies, that POWER core device might become a "virtual
> socket" or CM or whatever, but I think we'll be able to keep the
> external interface compatible with the right use of aliases.
> 
> In the meantime it should at least give us a draft we can experiment
> with on Power without requiring new generic infrastructure.

Makes sense, I will switch to the semantics that I had in v1 where
I enabled CPU hotplug for POWER8 using device_add.

(qemu) device_add POWER8-powerpc64-cpu,id=XXX

Regards,
Bharata.
diff mbox

Patch

diff --git a/hw/cpu/Makefile.objs b/hw/cpu/Makefile.objs
index 6381238..e6890cf 100644
--- a/hw/cpu/Makefile.objs
+++ b/hw/cpu/Makefile.objs
@@ -3,4 +3,4 @@  obj-$(CONFIG_REALVIEW) += realview_mpcore.o
 obj-$(CONFIG_A9MPCORE) += a9mpcore.o
 obj-$(CONFIG_A15MPCORE) += a15mpcore.o
 obj-$(CONFIG_ICC_BUS) += icc_bus.o
-
+obj-y += socket.o
diff --git a/hw/cpu/socket.c b/hw/cpu/socket.c
new file mode 100644
index 0000000..5ca47e9
--- /dev/null
+++ b/hw/cpu/socket.c
@@ -0,0 +1,21 @@ 
+/*
+ * CPU socket abstraction
+ *
+ * Copyright (c) 2013-2014 SUSE LINUX Products GmbH
+ * Copyright (c) 2015 SUSE Linux GmbH
+ */
+
+#include "hw/cpu/socket.h"
+
+static const TypeInfo cpu_socket_type_info = {
+    .name = TYPE_CPU_SOCKET,
+    .parent = TYPE_DEVICE,
+    .abstract = true,
+};
+
+static void cpu_socket_register_types(void)
+{
+    type_register_static(&cpu_socket_type_info);
+}
+
+type_init(cpu_socket_register_types)
diff --git a/include/hw/cpu/socket.h b/include/hw/cpu/socket.h
new file mode 100644
index 0000000..c8e0c18
--- /dev/null
+++ b/include/hw/cpu/socket.h
@@ -0,0 +1,14 @@ 
+/*
+ * CPU socket abstraction
+ *
+ * Copyright (c) 2013-2014 SUSE LINUX Products GmbH
+ * Copyright (c) 2015 SUSE Linux GmbH
+ */
+#ifndef HW_CPU_SOCKET_H
+#define HW_CPU_SOCKET_H
+
+#include "hw/qdev.h"
+
+#define TYPE_CPU_SOCKET "cpu-socket"
+
+#endif