qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de,
	qemu-devel@nongnu.org, pbonzini@redhat.com, qemu-ppc@nongnu.org,
	tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com,
	imammedo@redhat.com, afaerber@suse.de,
	david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH v6 01/11] machine: Don't allow CPU toplogies with partially filled cores
Date: Mon, 25 Jan 2016 14:27:25 +0530	[thread overview]
Message-ID: <20160125085725.GA17443@in.ibm.com> (raw)
In-Reply-To: <20160123134722.GI3869@thinpad.lan.raisama.net>

On Sat, Jan 23, 2016 at 11:47:22AM -0200, Eduardo Habkost wrote:
> On Fri, Jan 08, 2016 at 12:25:09PM +0530, Bharata B Rao wrote:
> > Prevent guests from booting with CPU topologies that have partially
> > filled CPU cores or can result in partially filled CPU cores after
> > CPU hotplug like
> > 
> > -smp 15,sockets=1,cores=4,threads=4,maxcpus=16 or
> > -smp 15,sockets=1,cores=4,threads=4,maxcpus=17.
> > 
> > This is enforced by introducing MachineClass::validate_smp_config()
> > that gets called from generic SMP parsing code. Machine type versions
> > that don't want to enforce this can override this method.
> > 
> > TODO: Only sPAPR and PC changes are done in this patch, other archs
> > will be touched after there is agreement on this approach.
> > 
> > Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
> > ---
> >  hw/core/machine.c   | 20 ++++++++++++++++++++
> >  hw/i386/pc_piix.c   |  7 +++++++
> >  hw/i386/pc_q35.c    |  7 +++++++
> >  hw/ppc/spapr.c      |  7 +++++++
> >  include/hw/boards.h |  1 +
> >  vl.c                |  4 ++++
> >  6 files changed, 46 insertions(+)
> > 
> > diff --git a/hw/core/machine.c b/hw/core/machine.c
> > index c46ddc7..b66c101 100644
> > --- a/hw/core/machine.c
> > +++ b/hw/core/machine.c
> > @@ -336,6 +336,25 @@ static void machine_init_notify(Notifier *notifier, void *data)
> >      foreach_dynamic_sysbus_device(error_on_sysbus_device, NULL);
> >  }
> >  
> > +static int validate_smp_config_generic(int smp_cpus, int max_cpus,
> > +                                       int smp_threads)
> 
> Please make it use a Error** parameter to return error
> information, and let the caller decide what to do with the error
> message. One day the mc->validate_smp_config() call may be moved
> inside a function that returns error information using Error**
> and needs to propagate it to the caller.

Sure, will make this change.

I see that not all target archs use machine type versions and even
if they do it will not be a one-line changer (as shown for i386 and sPAPR in
this patch) for them to override mc->validate_smp_config() for older
versions.

So am I expected to change .class_init routine for all these archs by
setting mc->validate_smp_config() to a NOP validate_smp_config()
so that the default validate_smp_config() defined for TYPE_MACHINE
is overridden ? In order to preserve the existing behaviour with
CPU topology for all args, it appears that such a change would be
necessary, but I am not sure how to test all of them. Will just a compile
test do ?

Regards,
Bharata.

  reply	other threads:[~2016-01-25  8:57 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08  6:55 [Qemu-devel] [PATCH v6 00/11] sPAPR CPU hotplug Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 01/11] machine: Don't allow CPU toplogies with partially filled cores Bharata B Rao
2016-01-12  4:03   ` David Gibson
2016-01-12 23:24   ` Alexey Kardashevskiy
2016-01-23 13:47   ` Eduardo Habkost
2016-01-25  8:57     ` Bharata B Rao [this message]
2016-01-26 17:47       ` Eduardo Habkost
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 02/11] exec: Remove cpu from cpus list during cpu_exec_exit() Bharata B Rao
2016-01-12  4:06   ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 03/11] exec: Do vmstate unregistration from cpu_exec_exit() Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 04/11] cpu: Don't realize CPU from cpu_generic_init() Bharata B Rao
2016-01-12  4:09   ` David Gibson
2016-01-23 13:31   ` Eduardo Habkost
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 05/11] cpu: Reclaim vCPU objects Bharata B Rao
2016-01-12  4:13   ` David Gibson
2016-01-27 16:31   ` Matthew Rosato
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 06/11] cpu: Add a sync version of cpu_remove() Bharata B Rao
2016-01-12  4:16   ` David Gibson
2016-01-12  6:53     ` Bharata B Rao
2016-01-13  3:45       ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 07/11] xics, xics_kvm: Handle CPU unplug correctly Bharata B Rao
2016-01-12  4:19   ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 08/11] target-ppc: Introduce PowerPC specific CPU core device Bharata B Rao
2016-01-12  4:24   ` David Gibson
2016-01-12 23:30   ` Alexey Kardashevskiy
2016-01-12 23:44   ` Alexey Kardashevskiy
2016-01-13  4:30     ` Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 09/11] spapr: Enable CPU hotplug for pseries-2.6 and add CPU DRC DT entries Bharata B Rao
2016-01-12  5:41   ` David Gibson
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 10/11] spapr: CPU hotplug support Bharata B Rao
2016-01-12  5:58   ` David Gibson
2016-01-13  3:55     ` Bharata B Rao
2016-01-12 23:58   ` Alexey Kardashevskiy
2016-01-13  4:01     ` Bharata B Rao
2016-01-08  6:55 ` [Qemu-devel] [PATCH v6 11/11] spapr: CPU hot unplug support Bharata B Rao
2016-01-12  6:06   ` David Gibson
2016-01-13  4:10     ` Bharata B Rao
2016-01-13  4:57       ` David Gibson
2016-01-13  7:04         ` Bharata B Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160125085725.GA17443@in.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=tyreld@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).