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 01/11] hw/arm/virt: parameter passing cleanups
Date: Tue, 13 Dec 2016 22:45:12 +0100	[thread overview]
Message-ID: <20161213214522.25548-2-drjones@redhat.com> (raw)
In-Reply-To: <20161213214522.25548-1-drjones@redhat.com>

Some simple cleanups made possible by "hw/arm/virt: Merge
VirtBoardInfo and VirtMachineState"

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

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7eec50a82494..d451bc4f6b9b 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -570,10 +570,10 @@ static void create_v2m(VirtMachineState *vms, qemu_irq *pic)
     fdt_add_v2m_gic_node(vms);
 }
 
-static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type,
-                       bool secure, bool no_its)
+static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type)
 {
     /* We create a standalone GIC */
+    VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms);
     DeviceState *gicdev;
     SysBusDevice *gicbusdev;
     const char *gictype;
@@ -589,7 +589,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type,
      */
     qdev_prop_set_uint32(gicdev, "num-irq", NUM_IRQS + 32);
     if (!kvm_irqchip_in_kernel()) {
-        qdev_prop_set_bit(gicdev, "has-security-extensions", secure);
+        qdev_prop_set_bit(gicdev, "has-security-extensions", vms->secure);
     }
     qdev_init_nofail(gicdev);
     gicbusdev = SYS_BUS_DEVICE(gicdev);
@@ -643,7 +643,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic, int type,
 
     fdt_add_gic_node(vms, type);
 
-    if (type == 3 && !no_its) {
+    if (type == 3 && !vmc->no_its) {
         create_its(vms, gicdev);
     } else if (type == 2) {
         create_v2m(vms, pic);
@@ -1005,8 +1005,7 @@ static void create_pcie_irq_map(const VirtMachineState *vms,
                            0x7           /* PCI irq */);
 }
 
-static void create_pcie(const VirtMachineState *vms, qemu_irq *pic,
-                        bool use_highmem)
+static void create_pcie(const VirtMachineState *vms, qemu_irq *pic)
 {
     hwaddr base_mmio = vms->memmap[VIRT_PCIE_MMIO].base;
     hwaddr size_mmio = vms->memmap[VIRT_PCIE_MMIO].size;
@@ -1049,7 +1048,7 @@ static void create_pcie(const VirtMachineState *vms, qemu_irq *pic,
                              mmio_reg, base_mmio, size_mmio);
     memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias);
 
-    if (use_highmem) {
+    if (vms->highmem) {
         /* Map high MMIO space */
         MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1);
 
@@ -1098,7 +1097,7 @@ static void create_pcie(const VirtMachineState *vms, qemu_irq *pic,
     qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg",
                                  2, base_ecam, 2, size_ecam);
 
-    if (use_highmem) {
+    if (vms->highmem) {
         qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges",
                                      1, FDT_PCI_RANGE_IOPORT, 2, 0,
                                      2, base_pio, 2, size_pio,
@@ -1428,7 +1427,7 @@ static void machvirt_init(MachineState *machine)
 
     create_flash(vms, sysmem, secure_sysmem ? secure_sysmem : sysmem);
 
-    create_gic(vms, pic, gic_version, vms->secure, vmc->no_its);
+    create_gic(vms, pic, gic_version);
 
     fdt_add_pmu_nodes(vms, gic_version);
 
@@ -1441,7 +1440,7 @@ static void machvirt_init(MachineState *machine)
 
     create_rtc(vms, pic);
 
-    create_pcie(vms, pic, vms->highmem);
+    create_pcie(vms, pic);
 
     create_gpio(vms, pic);
 
-- 
2.9.3

  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 ` Andrew Jones [this message]
2016-12-15  9:53   ` [Qemu-devel] [PATCH 01/11] hw/arm/virt: parameter passing cleanups 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 ` [Qemu-devel] [PATCH 03/11] hw/arm/virt: use VirtMachineState.smp_cpus Andrew Jones
2016-12-15 10:37   ` 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-2-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.