qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of


From: Bharata B Rao
Subject: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores
Date: Thu, 7 Jul 2016 20:20:23 +0530

Conditonally set stable_cpu_id for CPU threads that are created as part
of spapr CPU cores. The use of stable_cpu_id is enabled for pseries-2.7
onwards.

Signed-off-by: Bharata B Rao <address@hidden>
---
 hw/ppc/spapr_cpu_core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index b104778..0ec3513 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -293,8 +293,15 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error 
**errp)
     for (i = 0; i < cc->nr_threads; i++) {
         char id[32];
         obj = sc->threads + i * size;
+        CPUState *cs;
 
         object_initialize(obj, size, typename);
+        cs = CPU(obj);
+
+        /* Use core_id (which is actually cpu_dt_id) as stable CPU id */
+        if (cs->has_stable_cpu_id) {
+            cs->stable_cpu_id = cc->core_id + i;
+        }
         snprintf(id, sizeof(id), "thread[%d]", i);
         object_property_add_child(OBJECT(sc), id, obj, &local_err);
         if (local_err) {
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]