qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Like Xu <like.xu@linux.intel.com>
Cc: qemu-trivial@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>,
	like.xu@intel.com, qemu-devel@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/9] cpu/topology: add struct CpuTopology to MachineState
Date: Thu, 4 Apr 2019 13:37:55 +0200	[thread overview]
Message-ID: <20190404133755.02e3683c@redhat.com> (raw)
In-Reply-To: <1553849325-44201-2-git-send-email-like.xu@linux.intel.com>

On Fri, 29 Mar 2019 16:48:37 +0800
Like Xu <like.xu@linux.intel.com> wrote:

> Signed-off-by: Like Xu <like.xu@linux.intel.com>
> ---
>  include/hw/arm/virt.h   | 2 +-
>  include/hw/boards.h     | 8 ++++++++
>  include/sysemu/sysemu.h | 2 +-
>  vl.c                    | 7 ++++++-
>  4 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h
> index 507517c..724da0c 100644
> --- a/include/hw/arm/virt.h
> +++ b/include/hw/arm/virt.h
> @@ -123,7 +123,7 @@ typedef struct {
>      struct arm_boot_info bootinfo;
>      MemMapEntry *memmap;
>      const int *irqmap;
> -    int smp_cpus;
> +    unsigned int smp_cpus;
As Alex pointed out it's unrelated cleanup
(with other similar hunks in this patch),
it's better to split it out into separate patch

>      void *fdt;
>      int fdt_size;
>      uint32_t clock_phandle;
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index e231860..cbde276 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -231,6 +231,13 @@ typedef struct DeviceMemoryState {
>      MemoryRegion mr;
>  } DeviceMemoryState;
>  
> +typedef struct CpuTopology {
> +    unsigned int smp_cpus;
> +    unsigned int smp_cores;
> +    unsigned int smp_threads;
> +    unsigned int max_cpus;
> +} CpuTopology;
> +
>  /**
>   * MachineState:
>   */
> @@ -273,6 +280,7 @@ struct MachineState {
>      const char *cpu_type;
>      AccelState *accelerator;
>      CPUArchIdList *possible_cpus;
> +    CpuTopology topo;
maybe s/topo/smp/ and drop smp_ prefix inside CpuTopology structure

>      struct NVDIMMState *nvdimms_state;
>  };
>  
> diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
> index 6065d9e..c0d7d7c 100644
> --- a/include/sysemu/sysemu.h
> +++ b/include/sysemu/sysemu.h
> @@ -100,7 +100,7 @@ extern const char *keyboard_layout;
>  extern int win2k_install_hack;
>  extern int alt_grab;
>  extern int ctrl_grab;
> -extern int smp_cpus;
> +extern unsigned int smp_cpus;
>  extern unsigned int max_cpus;
>  extern int cursor_hide;
>  extern int graphic_rotate;
> diff --git a/vl.c b/vl.c
> index d61d560..9089253 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -162,7 +162,7 @@ static Chardev **serial_hds;
>  Chardev *parallel_hds[MAX_PARALLEL_PORTS];
>  int win2k_install_hack = 0;
>  int singlestep = 0;
> -int smp_cpus;
> +unsigned int smp_cpus;
>  unsigned int max_cpus;
>  int smp_cores = 1;
>  int smp_threads = 1;
> @@ -4116,6 +4116,11 @@ int main(int argc, char **argv, char **envp)
>  
>      smp_parse(qemu_opts_find(qemu_find_opts("smp-opts"), NULL));
>  
> +    current_machine->topo.smp_cpus = smp_cpus;
> +    current_machine->topo.max_cpus = max_cpus;
> +    current_machine->topo.smp_cores = smp_cores;
> +    current_machine->topo.smp_threads = smp_threads;
> +
>      /* sanity-check smp_cpus and max_cpus against machine_class */
>      if (smp_cpus < machine_class->min_cpus) {
>          error_report("Invalid SMP CPUs %d. The min CPUs "

  parent reply	other threads:[~2019-04-04 11:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1553849325-44201-1-git-send-email-like.xu@linux.intel.com>
     [not found] ` <20190329112152.0c7ad147@redhat.com>
2019-04-04  3:26   ` [Qemu-devel] [PATCH 0/9] refactor cpu topo into machine properties Like Xu
2019-04-08 13:26     ` Igor Mammedov
2019-04-08 13:26       ` Igor Mammedov
2019-04-08 14:38       ` Like Xu
2019-04-08 14:38         ` Like Xu
     [not found] ` <1553849325-44201-2-git-send-email-like.xu@linux.intel.com>
2019-04-04 11:37   ` Igor Mammedov [this message]
     [not found] ` <1553849325-44201-3-git-send-email-like.xu@linux.intel.com>
2019-04-04 14:25   ` [Qemu-devel] [PATCH 2/9] cpu/topology: add general support for " Igor Mammedov
2019-04-04 16:21     ` Dr. David Alan Gilbert
2019-04-30  7:30     ` Like Xu
2019-04-30  7:30       ` Like Xu
2019-05-02 15:09       ` Igor Mammedov
2019-05-02 15:09         ` Igor Mammedov
2019-05-03  1:08         ` Eduardo Habkost
2019-05-03  1:08           ` Eduardo Habkost
2019-05-03  1:01       ` Eduardo Habkost
2019-05-03  1:01         ` Eduardo Habkost
     [not found] ` <1553849325-44201-4-git-send-email-like.xu@linux.intel.com>
2019-04-08 12:54   ` [Qemu-devel] [PATCH 3/9] cpu/topology: add uncommon arch support for smp " Igor Mammedov
2019-04-08 12:54     ` Igor Mammedov
2019-04-16  8:47     ` Like Xu
2019-04-16  8:47       ` Like Xu
2019-04-16 12:00       ` Igor Mammedov
2019-04-16 12:00         ` Igor Mammedov
     [not found] ` <1553849325-44201-5-git-send-email-like.xu@linux.intel.com>
     [not found]   ` <87h8bmuj2d.fsf@zen.linaroharston>
     [not found]     ` <2546bf3e-2009-5a76-bc63-0ad73d333a78@linux.intel.com>
2019-04-01 23:38       ` [Qemu-devel] [PATCH 4/9] cpu/topology: add ARM " Eduardo Habkost
2019-04-02  2:35         ` Like Xu
2019-04-02  4:45           ` Peter Maydell
2019-04-02  5:20             ` Like Xu
2019-04-02  5:27               ` Peter Maydell
2019-04-08 13:11   ` Igor Mammedov
2019-04-08 13:11     ` Igor Mammedov

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=20190404133755.02e3683c@redhat.com \
    --to=imammedo@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=like.xu@intel.com \
    --cc=like.xu@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.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 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).