qemu-arm.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, ehabkost@redhat.com, agraf@suse.de,
	pbonzini@redhat.com, dgibson@redhat.com, imammedo@redhat.com,
	david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH RFC 12/16] hw/arm/virt: rename *.smp_cpus to *.cpus
Date: Fri, 10 Jun 2016 19:40:23 +0200	[thread overview]
Message-ID: <1465580427-13596-13-git-send-email-drjones@redhat.com> (raw)
In-Reply-To: <1465580427-13596-1-git-send-email-drjones@redhat.com>

Use the name 'cpus' instead of 'smp_cpus' to be consistent with
MachineState.cpus. This also makes grepping for the global
smp_cpus easier.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 hw/arm/virt-acpi-build.c         | 14 +++++++-------
 hw/arm/virt.c                    | 14 +++++++-------
 include/hw/arm/virt-acpi-build.h |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 735ab864a03dd..95dccb2e0c3fa 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -48,11 +48,11 @@
 #define ARM_SPI_BASE 32
 #define ACPI_POWER_BUTTON_DEVICE "PWRB"
 
-static void acpi_dsdt_add_cpus(Aml *scope, int smp_cpus)
+static void acpi_dsdt_add_cpus(Aml *scope, int nr_cpus)
 {
     uint16_t i;
 
-    for (i = 0; i < smp_cpus; i++) {
+    for (i = 0; i < nr_cpus; i++) {
         Aml *dev = aml_device("C%03x", i);
         aml_append(dev, aml_name_decl("_HID", aml_string("ACPI0007")));
         aml_append(dev, aml_name_decl("_UID", aml_int(i)));
@@ -423,9 +423,9 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info)
     AcpiSratMemoryAffinity *numamem;
     int i, j, srat_start;
     uint64_t mem_base;
-    uint32_t *cpu_node = g_malloc0(guest_info->smp_cpus * sizeof(uint32_t));
+    uint32_t *cpu_node = g_malloc0(guest_info->cpus * sizeof(uint32_t));
 
-    for (i = 0; i < guest_info->smp_cpus; i++) {
+    for (i = 0; i < guest_info->cpus; i++) {
         for (j = 0; j < nb_numa_nodes; j++) {
             if (test_bit(i, numa_info[j].node_cpu)) {
                 cpu_node[i] = j;
@@ -438,7 +438,7 @@ build_srat(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info)
     srat = acpi_data_push(table_data, sizeof(*srat));
     srat->reserved1 = cpu_to_le32(1);
 
-    for (i = 0; i < guest_info->smp_cpus; ++i) {
+    for (i = 0; i < guest_info->cpus; ++i) {
         core = acpi_data_push(table_data, sizeof(*core));
         core->type = ACPI_SRAT_PROCESSOR_GICC;
         core->length = sizeof(*core);
@@ -524,7 +524,7 @@ build_madt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info)
     gicd->length = sizeof(*gicd);
     gicd->base_address = memmap[VIRT_GIC_DIST].base;
 
-    for (i = 0; i < guest_info->smp_cpus; i++) {
+    for (i = 0; i < guest_info->cpus; i++) {
         AcpiMadtGenericInterrupt *gicc = acpi_data_push(table_data,
                                                      sizeof *gicc);
         ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(i));
@@ -606,7 +606,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtGuestInfo *guest_info)
      * the RTC ACPI device at all when using UEFI.
      */
     scope = aml_scope("\\_SB");
-    acpi_dsdt_add_cpus(scope, guest_info->smp_cpus);
+    acpi_dsdt_add_cpus(scope, guest_info->cpus);
     acpi_dsdt_add_uart(scope, &memmap[VIRT_UART],
                        (irqmap[VIRT_UART] + ARM_SPI_BASE));
     acpi_dsdt_add_flash(scope, &memmap[VIRT_FLASH]);
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 73113cfc4d9c9..78d9aa996bafc 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -69,7 +69,7 @@ typedef struct VirtBoardInfo {
     const char *cpu_model;
     const MemMapEntry *memmap;
     const int *irqmap;
-    int smp_cpus;
+    int cpus;
     void *fdt;
     int fdt_size;
     uint32_t clock_phandle;
@@ -304,7 +304,7 @@ static void fdt_add_timer_nodes(const VirtBoardInfo *vbi, int gictype)
     if (gictype == 2) {
         irqflags = deposit32(irqflags, GIC_FDT_IRQ_PPI_CPU_START,
                              GIC_FDT_IRQ_PPI_CPU_WIDTH,
-                             (1 << vbi->smp_cpus) - 1);
+                             (1 << vbi->cpus) - 1);
     }
 
     qemu_fdt_add_subnode(vbi->fdt, "/timer");
@@ -345,7 +345,7 @@ static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi)
      *  The simplest way to go is to examine affinity IDs of all our CPUs. If
      *  at least one of them has Aff3 populated, we set #address-cells to 2.
      */
-    for (cpu = 0; cpu < vbi->smp_cpus; cpu++) {
+    for (cpu = 0; cpu < vbi->cpus; cpu++) {
         ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(cpu));
 
         if (armcpu->mp_affinity & ARM_AFF3_MASK) {
@@ -358,7 +358,7 @@ static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi)
     qemu_fdt_setprop_cell(vbi->fdt, "/cpus", "#address-cells", addr_cells);
     qemu_fdt_setprop_cell(vbi->fdt, "/cpus", "#size-cells", 0x0);
 
-    for (cpu = vbi->smp_cpus - 1; cpu >= 0; cpu--) {
+    for (cpu = vbi->cpus - 1; cpu >= 0; cpu--) {
         char *nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
         ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(cpu));
 
@@ -367,7 +367,7 @@ static void fdt_add_cpu_nodes(const VirtBoardInfo *vbi)
         qemu_fdt_setprop_string(vbi->fdt, nodename, "compatible",
                                     armcpu->dtb_compatible);
 
-        if (vbi->using_psci && vbi->smp_cpus > 1) {
+        if (vbi->using_psci && vbi->cpus > 1) {
             qemu_fdt_setprop_string(vbi->fdt, nodename,
                                         "enable-method", "psci");
         }
@@ -1170,7 +1170,7 @@ static void machvirt_init(MachineState *machine)
         exit(1);
     }
 
-    vbi->smp_cpus = smp_cpus;
+    vbi->cpus = smp_cpus;
 
     if (machine->ram_size > vbi->memmap[VIRT_MEM].size) {
         error_report("mach-virt: cannot model more than %dGB RAM", RAMLIMIT_GB);
@@ -1281,7 +1281,7 @@ static void machvirt_init(MachineState *machine)
     create_fw_cfg(vbi, &address_space_memory);
     rom_set_fw(fw_cfg_find());
 
-    guest_info->smp_cpus = smp_cpus;
+    guest_info->cpus = smp_cpus;
     guest_info->fw_cfg = fw_cfg_find();
     guest_info->memmap = vbi->memmap;
     guest_info->irqmap = vbi->irqmap;
diff --git a/include/hw/arm/virt-acpi-build.h b/include/hw/arm/virt-acpi-build.h
index e43330ad659b0..d6c5982960403 100644
--- a/include/hw/arm/virt-acpi-build.h
+++ b/include/hw/arm/virt-acpi-build.h
@@ -27,7 +27,7 @@
 #define ACPI_GICC_ENABLED 1
 
 typedef struct VirtGuestInfo {
-    int smp_cpus;
+    int cpus;
     FWCfgState *fw_cfg;
     const MemMapEntry *memmap;
     const int *irqmap;
-- 
2.4.11


  parent reply	other threads:[~2016-06-10 17:44 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 17:40 [Qemu-arm] [PATCH RFC 00/16] Rework SMP parameters Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 01/16] vl: smp_parse: cleanups Andrew Jones
2016-06-14  1:15   ` David Gibson
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 02/16] vl: smp: add checks for maxcpus based topologies Andrew Jones
2016-06-14  1:28   ` David Gibson
2016-06-14  6:43     ` [Qemu-arm] [Qemu-devel] " Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 03/16] hw/smbios/smbios: fix number of sockets calculation Andrew Jones
2016-07-11 14:23   ` Igor Mammedov
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 04/16] hw/core/machine: Introduce pre_init Andrew Jones
2016-06-14  1:30   ` David Gibson
2016-06-14  5:58     ` [Qemu-arm] [Qemu-devel] " Andrew Jones
2016-07-14 20:10       ` Eduardo Habkost
2016-07-15  6:26         ` Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 05/16] hw/core/machine: add smp properites Andrew Jones
2016-06-14  2:00   ` David Gibson
2016-06-14  6:08     ` [Qemu-arm] [Qemu-devel] " Andrew Jones
2016-06-15  0:37       ` David Gibson
2016-06-15  7:11         ` Andrew Jones
2016-07-14 20:18           ` Eduardo Habkost
2016-07-15  6:29             ` Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 06/16] vl: move smp parsing to machine pre_init Andrew Jones
2016-06-13 17:04   ` Paolo Bonzini
2016-06-13 20:35     ` [Qemu-arm] [Qemu-devel] " Andrew Jones
2016-06-14  8:17       ` Paolo Bonzini
2016-06-14 11:39         ` [Qemu-arm] " Andrew Jones
2016-06-14 11:53           ` [Qemu-arm] " Paolo Bonzini
2016-06-14 14:03             ` [Qemu-devel] " Andrew Jones
2016-06-14 14:05               ` [Qemu-arm] " Paolo Bonzini
2016-06-15  0:51               ` David Gibson
2016-06-15  7:19                 ` Andrew Jones
2016-06-15  0:43         ` [Qemu-arm] " David Gibson
2016-06-10 17:40 ` [Qemu-devel] [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties Andrew Jones
2016-06-11  6:54   ` [Qemu-arm] " Thomas Huth
2016-06-12 13:48     ` Andrew Jones
2016-06-14  2:12       ` David Gibson
2016-06-14  6:19         ` Andrew Jones
2016-06-15  0:56           ` David Gibson
2016-07-14 20:07             ` Eduardo Habkost
2016-07-15  6:35               ` Andrew Jones
2016-07-15  9:11                 ` Igor Mammedov
2016-07-15 16:10                   ` [Qemu-devel] QOM: best way for parents to pass information to children? (was Re: [PATCH RFC 07/16] qom/cpu: make nr-cores, nr-threads real properties) Eduardo Habkost
2016-07-15 16:10                     ` [Qemu-arm] QOM: best way for parents to pass information to children? (was Re: [Qemu-devel] " Eduardo Habkost
2016-07-15 16:30                     ` [Qemu-devel] QOM: best way for parents to pass information to children? (was " Andreas Färber
2016-07-15 16:30                       ` [Qemu-arm] QOM: best way for parents to pass information to children? (was Re: [Qemu-devel] " Andreas Färber
2016-07-15 17:43                       ` [Qemu-devel] QOM: best way for parents to pass information to children? (was " Eduardo Habkost
2016-07-15 17:43                         ` [Qemu-arm] QOM: best way for parents to pass information to children? (was Re: [Qemu-devel] " Eduardo Habkost
2016-07-15 18:38                         ` [Qemu-arm] [Qemu-devel] QOM: best way for parents to pass information to children? (was " Igor Mammedov
2016-07-15 21:33                           ` Eduardo Habkost
2016-07-16 15:30                             ` Andrew Jones
2016-07-19 11:54                               ` Eduardo Habkost
2016-07-18  7:23                             ` Igor Mammedov
2016-07-19 11:59                               ` Eduardo Habkost
2016-07-19 12:21                                 ` Paolo Bonzini
2016-07-19 13:29                                   ` Igor Mammedov
2016-07-19 13:39                                     ` Paolo Bonzini
2016-06-10 17:40 ` [Qemu-devel] [PATCH RFC 08/16] hw/core/machine: set cpu global nr_cores, nr_threads in pre_init Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 09/16] hw/i386/pc: don't use smp_cores, smp_threads Andrew Jones
2016-07-14 20:33   ` [Qemu-devel] " Eduardo Habkost
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 10/16] hw/ppc/spapr: " Andrew Jones
2016-06-14  3:03   ` David Gibson
2016-06-14  6:23     ` [Qemu-arm] [Qemu-devel] " Andrew Jones
2016-06-15  0:59       ` David Gibson
2016-06-15  7:34         ` Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 11/16] target-ppc: don't use smp_threads Andrew Jones
2016-06-10 17:40 ` Andrew Jones [this message]
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 13/16] hw/arm/virt: don't use smp_cpus, max_cpus Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 14/16] hw/arm/virt: stash cpu topo info in VirtGuestInfo Andrew Jones
2016-07-14 20:43   ` [Qemu-arm] [Qemu-devel] " Eduardo Habkost
2016-07-15  6:40     ` Andrew Jones
2016-06-10 17:40 ` [Qemu-devel] [PATCH RFC 15/16] smbios: don't use smp_cores, smp_threads Andrew Jones
2016-07-14 20:51   ` [Qemu-arm] " Eduardo Habkost
2016-07-15  6:45     ` Andrew Jones
2016-06-10 17:40 ` [Qemu-arm] [PATCH RFC 16/16] sysemu/cpus: bye, bye " Andrew Jones
2016-06-11  6:42 ` [Qemu-arm] [Qemu-devel] [PATCH RFC 00/16] Rework SMP parameters Thomas Huth
2016-06-12 13:58   ` Andrew Jones
2016-06-12 14:03 ` Andrew Jones
2016-07-14  9:16 ` Andrew Jones

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=1465580427-13596-13-git-send-email-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=agraf@suse.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgibson@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).