Skip to contentSkip to conversation

pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration

PATCH Applied Bharata B Rao 4 participants 7 messages Jul 17, 2015 – Sep 24, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration

pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.

---
 hw/mem/pc-dimm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/mem/pc-dimm.c +3 -2
index bb04862..099025e 100644
@@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
         return;
     }
-    if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) {
+    if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) ||
+        (!nb_numa_nodes && dimm->node)) {
         error_setg(errp, "'DIMM property " PC_DIMM_NODE_PROP " has value %"
                    PRIu32 "' which exceeds the number of numa nodes: %d",
-                   dimm->node, nb_numa_nodes);
+                   dimm->node, nb_numa_nodes ? nb_numa_nodes : 1);
         return;
     }
 }
Signature · 1 line
2.1.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Bharata B Rao

pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Reviewed-by on v1 1/1
#2 lore raw
In reply to Bharata B Rao
Quoted 5 lines · On Fri, 17 Jul 2015 18:19:40 +0530 Bharata B Rao <[email protected]>…

pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.

Quoted 22 lines
---
 hw/mem/pc-dimm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/mem/pc-dimm.c +3 -2
index bb04862..099025e 100644
@@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
         return;
     }
-    if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) {
+    if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) ||
+        (!nb_numa_nodes && dimm->node)) {
         error_setg(errp, "'DIMM property " PC_DIMM_NODE_PROP " has value %"
                    PRIu32 "' which exceeds the number of numa nodes: %d",
-                   dimm->node, nb_numa_nodes);
+                   dimm->node, nb_numa_nodes ? nb_numa_nodes : 1);
         return;
     }
 }
#3 lore raw
Quoted 24 lines · Igor Mammedov
Quoted 5 lines · On Fri, 17 Jul 2015 18:19:40 +0530 Bharata B Rao <[email protected]>…

pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.

Quoted 14 lines
---
 hw/mem/pc-dimm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/mem/pc-dimm.c +1 -1
index bb04862..099025e 100644
@@ -414,10 +414,11 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
         return;
     }
-    if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) {
+    if (((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) ||
Quoted 8 lines

hw/mem/pc-dimm.c static void pc_dimm_realize(DeviceState *dev, Error **errp) · line 424

Quoted 8 lines
hw/mem/pc-dimm.c +2 -1
+        (!nb_numa_nodes && dimm->node)) {
         error_setg(errp, "'DIMM property " PC_DIMM_NODE_PROP " has value %"
                    PRIu32 "' which exceeds the number of numa nodes: %d",
-                   dimm->node, nb_numa_nodes);
+                   dimm->node, nb_numa_nodes ? nb_numa_nodes : 1);
         return;
     }
 }

Eduardo - Will this go via your tree ?

Regards,
Bharata.

#4 lore raw
In reply to Bharata B Rao

Applied to the numa tree, with the following changes in the commit message:

Subject was changed to:
pc-dimm: Fail realization for invalid nodes in non-NUMA config
to make it shorter.

Quoted 3 lines · Bharata B Rao

pc_dimm_realize() validates the NUMA node to which memory hotplug is being performed only in case of NUMA configuration. Include a check to fail invalid nodes in case of non-NUMA configuration too.

Changed to "to fail for invalid nodes".

Quoted 2 lines

Thanks!

Signature · 1 line
Eduardo
#5 lore raw
Quoted 6 lines · Eduardo Habkost

Applied to the numa tree, with the following changes in the commit message:

Subject was changed to:
pc-dimm: Fail realization for invalid nodes in non-NUMA config
to make it shorter.

Hmm I don't see it here:
https://github.com/ehabkost/qemu/commits/numa

Regards,
Bharata.

#6 lore raw
Quoted 10 lines · Bharata B Rao
Quoted 6 lines · Eduardo Habkost

Applied to the numa tree, with the following changes in the commit message:

Subject was changed to:
pc-dimm: Fail realization for invalid nodes in non-NUMA config
to make it shorter.

Hmm I don't see it here:
https://github.com/ehabkost/qemu/commits/numa

Sorry, forgot to push it. It should be there, now.

Signature · 1 line
Eduardo