qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
@ 2015-07-17 12:49 Bharata B Rao
  2015-07-20  3:52 ` David Gibson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Bharata B Rao @ 2015-07-17 12:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: mammedo, Bharata B Rao, david

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.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 hw/mem/pc-dimm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index bb04862..099025e 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -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;
     }
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
  2015-07-17 12:49 [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration Bharata B Rao
@ 2015-07-20  3:52 ` David Gibson
  2015-07-20  7:15 ` Igor Mammedov
  2015-08-26 16:24 ` Eduardo Habkost
  2 siblings, 0 replies; 7+ messages in thread
From: David Gibson @ 2015-07-20  3:52 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: mammedo, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

On Fri, Jul 17, 2015 at 06:19:40PM +0530, Bharata B Rao wrote:
> 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.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

-- 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
  2015-07-17 12:49 [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration Bharata B Rao
  2015-07-20  3:52 ` David Gibson
@ 2015-07-20  7:15 ` Igor Mammedov
  2015-08-03  3:46   ` Bharata B Rao
  2015-08-26 16:24 ` Eduardo Habkost
  2 siblings, 1 reply; 7+ messages in thread
From: Igor Mammedov @ 2015-07-20  7:15 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: imammedo, qemu-devel, david

On Fri, 17 Jul 2015 18:19:40 +0530
Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:

> 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.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/mem/pc-dimm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
> index bb04862..099025e 100644
> --- a/hw/mem/pc-dimm.c
> +++ b/hw/mem/pc-dimm.c
> @@ -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;
>      }
>  }

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
  2015-07-20  7:15 ` Igor Mammedov
@ 2015-08-03  3:46   ` Bharata B Rao
  0 siblings, 0 replies; 7+ messages in thread
From: Bharata B Rao @ 2015-08-03  3:46 UTC (permalink / raw)
  To: Igor Mammedov; +Cc: qemu-devel, david

On Mon, Jul 20, 2015 at 09:15:28AM +0200, Igor Mammedov wrote:
> On Fri, 17 Jul 2015 18:19:40 +0530
> Bharata B Rao <bharata@linux.vnet.ibm.com> wrote:
> 
> > 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.
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> 
> > ---
> >  hw/mem/pc-dimm.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
> > index bb04862..099025e 100644
> > --- a/hw/mem/pc-dimm.c
> > +++ b/hw/mem/pc-dimm.c
> > @@ -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;
> >      }
> >  }

Eduardo - Will this go via your tree ?

Regards,
Bharata.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
  2015-07-17 12:49 [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration Bharata B Rao
  2015-07-20  3:52 ` David Gibson
  2015-07-20  7:15 ` Igor Mammedov
@ 2015-08-26 16:24 ` Eduardo Habkost
  2015-09-24  6:23   ` Bharata B Rao
  2 siblings, 1 reply; 7+ messages in thread
From: Eduardo Habkost @ 2015-08-26 16:24 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: Igor Mammedov, qemu-devel, david

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.

On Fri, Jul 17, 2015 at 06:19:40PM +0530, Bharata B Rao wrote:
> 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".

> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

Thanks!

-- 
Eduardo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
  2015-08-26 16:24 ` Eduardo Habkost
@ 2015-09-24  6:23   ` Bharata B Rao
  2015-09-24 14:50     ` Eduardo Habkost
  0 siblings, 1 reply; 7+ messages in thread
From: Bharata B Rao @ 2015-09-24  6:23 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: Igor Mammedov, qemu-devel, david

On Wed, Aug 26, 2015 at 01:24:08PM -0300, Eduardo Habkost wrote:
> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration
  2015-09-24  6:23   ` Bharata B Rao
@ 2015-09-24 14:50     ` Eduardo Habkost
  0 siblings, 0 replies; 7+ messages in thread
From: Eduardo Habkost @ 2015-09-24 14:50 UTC (permalink / raw)
  To: Bharata B Rao; +Cc: Igor Mammedov, qemu-devel, david

On Thu, Sep 24, 2015 at 11:53:30AM +0530, Bharata B Rao wrote:
> On Wed, Aug 26, 2015 at 01:24:08PM -0300, Eduardo Habkost wrote:
> > 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.

-- 
Eduardo

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-24 14:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17 12:49 [Qemu-devel] [FIX PATCH] pc-dimm: Fail pc-dimm realization for invalid nodes in non-NUMA configuration Bharata B Rao
2015-07-20  3:52 ` David Gibson
2015-07-20  7:15 ` Igor Mammedov
2015-08-03  3:46   ` Bharata B Rao
2015-08-26 16:24 ` Eduardo Habkost
2015-09-24  6:23   ` Bharata B Rao
2015-09-24 14:50     ` Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).