All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: qemu-devel@nongnu.org, qemu-arm@nongnu.org
Cc: peter.maydell@linaro.org, zhaoshenglong@huawei.com,
	mst@redhat.com, imammedo@redhat.com, ehabkost@redhat.com
Subject: [Qemu-devel] [PATCH 03/11] hw/arm/virt: use VirtMachineState.smp_cpus
Date: Tue, 13 Dec 2016 22:45:14 +0100	[thread overview]
Message-ID: <20161213214522.25548-4-drjones@redhat.com> (raw)
In-Reply-To: <20161213214522.25548-1-drjones@redhat.com>

Most places we need smp_cpus we use vms->smp_cpus already. This
cleanup makes sure we do everywhere, preparing for the removal
of the global smp_cpus someday.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 hw/arm/virt.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 67c0abb30b5b..18aa3672739d 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -583,7 +583,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic)
 
     gicdev = qdev_create(NULL, gictype);
     qdev_prop_set_uint32(gicdev, "revision", type);
-    qdev_prop_set_uint32(gicdev, "num-cpu", smp_cpus);
+    qdev_prop_set_uint32(gicdev, "num-cpu", vms->smp_cpus);
     /* Note that the num-irq property counts both internal and external
      * interrupts; there are always 32 of the former (mandated by GIC spec).
      */
@@ -604,7 +604,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic)
      * maintenance interrupt signal to the appropriate GIC PPI inputs,
      * and the GIC's IRQ/FIQ/VIRQ/VFIQ interrupt outputs to the CPU's inputs.
      */
-    for (i = 0; i < smp_cpus; i++) {
+    for (i = 0; i < vms->smp_cpus; i++) {
         DeviceState *cpudev = DEVICE(qemu_get_cpu(i));
         int ppibase = NUM_IRQS + i * GIC_INTERNAL + GIC_NR_SGIS;
         int irq;
@@ -629,7 +629,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic)
                                                      + ARCH_GICV3_MAINT_IRQ));
 
         sysbus_connect_irq(gicbusdev, i, qdev_get_gpio_in(cpudev, ARM_CPU_IRQ));
-        sysbus_connect_irq(gicbusdev, i + smp_cpus,
+        sysbus_connect_irq(gicbusdev, i + vms->smp_cpus,
                            qdev_get_gpio_in(cpudev, ARM_CPU_FIQ));
         sysbus_connect_irq(gicbusdev, i + 2 * smp_cpus,
                            qdev_get_gpio_in(cpudev, ARM_CPU_VIRQ));
@@ -958,7 +958,7 @@ static void create_fw_cfg(const VirtMachineState *vms, AddressSpace *as)
     char *nodename;
 
     fw_cfg = fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as);
-    fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus);
+    fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)vms->smp_cpus);
 
     nodename = g_strdup_printf("/fw-cfg@%" PRIx64, base);
     qemu_fdt_add_subnode(vms->fdt, nodename);
@@ -1362,7 +1362,7 @@ static void machvirt_init(MachineState *machine)
         exit(1);
     }
 
-    for (n = 0; n < smp_cpus; n++) {
+    for (n = 0; n < vms->smp_cpus; n++) {
         Object *cpuobj = object_new(typename);
         if (!vmc->disallow_affinity_adjustment) {
             /* Adjust MPIDR like 64-bit KVM hosts, which incorporate the
@@ -1452,7 +1452,7 @@ static void machvirt_init(MachineState *machine)
     create_fw_cfg(vms, &address_space_memory);
     rom_set_fw(fw_cfg_find());
 
-    guest_info->smp_cpus = smp_cpus;
+    guest_info->smp_cpus = vms->smp_cpus;
     guest_info->fw_cfg = fw_cfg_find();
     guest_info->memmap = vms->memmap;
     guest_info->irqmap = vms->irqmap;
@@ -1466,7 +1466,7 @@ static void machvirt_init(MachineState *machine)
     vms->bootinfo.kernel_filename = machine->kernel_filename;
     vms->bootinfo.kernel_cmdline = machine->kernel_cmdline;
     vms->bootinfo.initrd_filename = machine->initrd_filename;
-    vms->bootinfo.nb_cpus = smp_cpus;
+    vms->bootinfo.nb_cpus = vms->smp_cpus;
     vms->bootinfo.board_id = -1;
     vms->bootinfo.loader_start = vms->memmap[VIRT_MEM].base;
     vms->bootinfo.get_dtb = machvirt_dtb;
-- 
2.9.3

  parent reply	other threads:[~2016-12-13 21:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 21:45 [Qemu-devel] [PATCH 00/11] Remove VirtGuestInfo Andrew Jones
2016-12-13 21:45 ` [Qemu-devel] [PATCH 01/11] hw/arm/virt: parameter passing cleanups Andrew Jones
2016-12-15  9:53   ` Igor Mammedov
2016-12-13 21:45 ` [Qemu-devel] [PATCH 02/11] hw/arm/virt: use VirtMachineState.gic_version Andrew Jones
2016-12-15 10:22   ` Igor Mammedov
2016-12-13 21:45 ` Andrew Jones [this message]
2016-12-15 10:37   ` [Qemu-devel] [PATCH 03/11] hw/arm/virt: use VirtMachineState.smp_cpus Igor Mammedov
2016-12-15 11:55     ` Andrew Jones
2016-12-13 21:45 ` [Qemu-devel] [PATCH 04/11] hw/arm/virt: eliminate struct VirtGuestInfoState Andrew Jones
2016-12-15 14:13   ` Igor Mammedov
2016-12-13 21:45 ` [Qemu-devel] [PATCH 05/11] hw/arm/virt: remove include/hw/arm/virt-acpi-build.h Andrew Jones
2016-12-15 14:26   ` Igor Mammedov
2016-12-13 21:45 ` [Qemu-devel] [PATCH 06/11] hw/arm/virt: move VirtMachineState/Class to virt.h Andrew Jones
2016-12-15 14:32   ` Igor Mammedov
2016-12-13 21:45 ` [Qemu-devel] [PATCH 07/11] hw/arm/virt: pass VirtMachineState instead of VirtGuestInfo Andrew Jones
2016-12-15 14:45   ` Igor Mammedov
2016-12-15 16:24     ` Andrew Jones
2016-12-16  9:10       ` Igor Mammedov
2016-12-13 21:45 ` [Qemu-devel] [PATCH 08/11] hw/arm/virt-acpi-build: remove redundant members from VirtGuestInfo Andrew Jones
2016-12-15 15:04   ` Igor Mammedov
2016-12-13 21:45 ` [Qemu-devel] [PATCH 09/11] hw/arm/virt-acpi-build: don't save VirtGuestInfo on AcpiBuildState Andrew Jones
2016-12-15 15:08   ` Igor Mammedov
2016-12-15 16:25     ` Andrew Jones
2016-12-13 21:45 ` [Qemu-devel] [PATCH 10/11] hw/arm/virt: remove VirtGuestInfo Andrew Jones
2016-12-15 14:59   ` Igor Mammedov
2016-12-15 16:27     ` Andrew Jones
2016-12-13 21:45 ` [Qemu-devel] [PATCH 11/11] hw/arm/virt-acpi-build: Don't incorrectly claim architectural timer to be edge-triggered Andrew Jones
2016-12-15 16:38 ` [Qemu-devel] [PATCH 00/11] Remove VirtGuestInfo Michael S. Tsirkin

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=20161213214522.25548-4-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhaoshenglong@huawei.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 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.