All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Andrew Jones <drjones@redhat.com>, <qemu-devel@nongnu.org>,
	<qemu-arm@nongnu.org>
Cc: peter.maydell@linaro.org, shannon.zhao@linaro.org
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH] hw/arm/virt: fix max-cpus check
Date: Thu, 4 Feb 2016 09:54:45 +0800	[thread overview]
Message-ID: <56B2AF65.3080402@huawei.com> (raw)
In-Reply-To: <1454511578-24863-1-git-send-email-drjones@redhat.com>



On 2016/2/3 22:59, Andrew Jones wrote:
> mach-virt doesn't yet support hotplug, but command lines specifying
> -smp <num>,maxcpus=<bigger-num> don't fail. Of course specifying
> bigger-num as something bigger than the machine supports, e.g. > 8
> on a gicv2 machine, should fail though. This fix also makes mach-
> virt's max-cpus check truly consistent with the one in vl.c:main,
> as the one there was already correctly checking max-cpus instead
> of smp-cpus.
> 
> Reported-by: Shannon Zhao <shannon.zhao@linaro.org>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  hw/arm/virt.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 15658f49c4e06..44bbbea92b1cf 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1013,7 +1013,7 @@ static void machvirt_init(MachineState *machine)
>      MemoryRegion *sysmem = get_system_memory();
>      MemoryRegion *secure_sysmem = NULL;
>      int gic_version = vms->gic_version;
> -    int n, max_cpus;
> +    int n, virt_max_cpus;
>      MemoryRegion *ram = g_new(MemoryRegion, 1);
>      const char *cpu_model = machine->cpu_model;
>      VirtBoardInfo *vbi;
> @@ -1051,15 +1051,15 @@ static void machvirt_init(MachineState *machine)
>       * many redistributors we can fit into the memory map.
>       */
>      if (gic_version == 3) {
> -        max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
> +        virt_max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
>      } else {
> -        max_cpus = GIC_NCPU;
> +        virt_max_cpus = GIC_NCPU;
>      }
>  
> -    if (smp_cpus > max_cpus) {
> +    if (max_cpus > virt_max_cpus) {
>          error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
Does it need to change the SMP?    ^~~~

>                       "supported by machine 'mach-virt' (%d)",
> -                     smp_cpus, max_cpus);
> +                     max_cpus, virt_max_cpus);
>          exit(1);
>      }

-- 
Shannon


WARNING: multiple messages have this Message-ID (diff)
From: Shannon Zhao <zhaoshenglong@huawei.com>
To: Andrew Jones <drjones@redhat.com>,
	qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, shannon.zhao@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/arm/virt: fix max-cpus check
Date: Thu, 4 Feb 2016 09:54:45 +0800	[thread overview]
Message-ID: <56B2AF65.3080402@huawei.com> (raw)
In-Reply-To: <1454511578-24863-1-git-send-email-drjones@redhat.com>



On 2016/2/3 22:59, Andrew Jones wrote:
> mach-virt doesn't yet support hotplug, but command lines specifying
> -smp <num>,maxcpus=<bigger-num> don't fail. Of course specifying
> bigger-num as something bigger than the machine supports, e.g. > 8
> on a gicv2 machine, should fail though. This fix also makes mach-
> virt's max-cpus check truly consistent with the one in vl.c:main,
> as the one there was already correctly checking max-cpus instead
> of smp-cpus.
> 
> Reported-by: Shannon Zhao <shannon.zhao@linaro.org>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  hw/arm/virt.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 15658f49c4e06..44bbbea92b1cf 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1013,7 +1013,7 @@ static void machvirt_init(MachineState *machine)
>      MemoryRegion *sysmem = get_system_memory();
>      MemoryRegion *secure_sysmem = NULL;
>      int gic_version = vms->gic_version;
> -    int n, max_cpus;
> +    int n, virt_max_cpus;
>      MemoryRegion *ram = g_new(MemoryRegion, 1);
>      const char *cpu_model = machine->cpu_model;
>      VirtBoardInfo *vbi;
> @@ -1051,15 +1051,15 @@ static void machvirt_init(MachineState *machine)
>       * many redistributors we can fit into the memory map.
>       */
>      if (gic_version == 3) {
> -        max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
> +        virt_max_cpus = vbi->memmap[VIRT_GIC_REDIST].size / 0x20000;
>      } else {
> -        max_cpus = GIC_NCPU;
> +        virt_max_cpus = GIC_NCPU;
>      }
>  
> -    if (smp_cpus > max_cpus) {
> +    if (max_cpus > virt_max_cpus) {
>          error_report("Number of SMP CPUs requested (%d) exceeds max CPUs "
Does it need to change the SMP?    ^~~~

>                       "supported by machine 'mach-virt' (%d)",
> -                     smp_cpus, max_cpus);
> +                     max_cpus, virt_max_cpus);
>          exit(1);
>      }

-- 
Shannon

  reply	other threads:[~2016-02-04  1:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-03 14:59 [Qemu-arm] [PATCH] hw/arm/virt: fix max-cpus check Andrew Jones
2016-02-03 14:59 ` [Qemu-devel] " Andrew Jones
2016-02-04  1:54 ` Shannon Zhao [this message]
2016-02-04  1:54   ` Shannon Zhao
2016-02-04  9:18   ` [Qemu-arm] " Andrew Jones
2016-02-04  9:18     ` Andrew Jones
2016-02-05 12:45 ` Shannon Zhao
2016-02-09 17:07   ` [Qemu-arm] " Peter Maydell
2016-02-09 17:07     ` [Qemu-devel] " Peter Maydell

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=56B2AF65.3080402@huawei.com \
    --to=zhaoshenglong@huawei.com \
    --cc=drjones@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shannon.zhao@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.