qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Paul Burton" <pburton@wavecomp.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Andrew Baumann" <Andrew.Baumann@microsoft.com>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	qemu-arm@nongnu.org, "Joel Stanley" <joel@jms.id.au>,
	"Aleksandar Markovic" <amarkovic@wavecomp.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Aleksandar Rikalo" <aleksandar.rikalo@rt-rk.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [PATCH 8/8] target/i386/cpu: Use 'mr' for MemoryRegion variables
Date: Sat, 14 Dec 2019 16:56:14 +0100	[thread overview]
Message-ID: <20191214155614.19004-9-philmd@redhat.com> (raw)
In-Reply-To: <20191214155614.19004-1-philmd@redhat.com>

The codebase use 'as' in variable names for AddressSpace objects,
and 'mr' for MemoryRegion objects. Since these variables are
MemoryRegion objects, rename them as 'mr' to avoid confusion with
AddressSpace objects.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/i386/cpu.h |  2 +-
 target/i386/cpu.c | 18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index cde2a16b94..1e5ded6e84 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1713,7 +1713,7 @@ struct X86CPU {
     /* in order to simplify APIC support, we leave this pointer to the
        user */
     struct DeviceState *apic_state;
-    struct MemoryRegion *cpu_as_root, *cpu_as_mem, *smram;
+    MemoryRegion *cpu_mr_root, *cpu_mr_mem, *smram;
     Notifier machine_done;
 
     struct kvm_msrs *kvm_msr_buf;
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 6131c62f9d..b5d22740b8 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5983,7 +5983,7 @@ static void x86_cpu_machine_done(Notifier *n, void *unused)
         memory_region_init_alias(cpu->smram, OBJECT(cpu), "smram",
                                  smram, 0, 1ull << 32);
         memory_region_set_enabled(cpu->smram, true);
-        memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->smram, 1);
+        memory_region_add_subregion_overlap(cpu->cpu_mr_root, 0, cpu->smram, 1);
     }
 }
 #else
@@ -6471,24 +6471,24 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
 
 #ifndef CONFIG_USER_ONLY
     if (tcg_enabled()) {
-        cpu->cpu_as_mem = g_new(MemoryRegion, 1);
-        cpu->cpu_as_root = g_new(MemoryRegion, 1);
+        cpu->cpu_mr_mem = g_new(MemoryRegion, 1);
+        cpu->cpu_mr_root = g_new(MemoryRegion, 1);
 
         /* Outer container... */
-        memory_region_init(cpu->cpu_as_root, OBJECT(cpu), "memory", ~0ull);
-        memory_region_set_enabled(cpu->cpu_as_root, true);
+        memory_region_init(cpu->cpu_mr_root, OBJECT(cpu), "memory", ~0ull);
+        memory_region_set_enabled(cpu->cpu_mr_root, true);
 
         /* ... with two regions inside: normal system memory with low
          * priority, and...
          */
-        memory_region_init_alias(cpu->cpu_as_mem, OBJECT(cpu), "memory",
+        memory_region_init_alias(cpu->cpu_mr_mem, OBJECT(cpu), "memory",
                                  get_system_memory(), 0, ~0ull);
-        memory_region_add_subregion(cpu->cpu_as_root, 0, cpu->cpu_as_mem);
-        memory_region_set_enabled(cpu->cpu_as_mem, true);
+        memory_region_add_subregion(cpu->cpu_mr_root, 0, cpu->cpu_mr_mem);
+        memory_region_set_enabled(cpu->cpu_mr_mem, true);
 
         cs->num_ases = 2;
         cpu_address_space_init(cs, 0, "cpu-memory", cs->memory);
-        cpu_address_space_init(cs, 1, "cpu-smm", cpu->cpu_as_root);
+        cpu_address_space_init(cs, 1, "cpu-smm", cpu->cpu_mr_root);
 
         /* ... SMRAM with higher priority, linked from /machine/smram.  */
         cpu->machine_done.notify = x86_cpu_machine_done;
-- 
2.21.0



  parent reply	other threads:[~2019-12-14 21:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 15:56 [PATCH 0/8] Simplify memory_region_add_subregion_overlap(..., priority=0) Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 1/8] hw/arm/nrf51_soc: Use memory_region_add_subregion() when priority is 0 Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 2/8] hw/arm/raspi: " Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 3/8] hw/arm/xlnx-versal: " Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 4/8] hw/i386/intel_iommu: Use memory_region_add_subregion " Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 5/8] hw/mips/boston: Use memory_region_add_subregion() " Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 6/8] hw/vfio/pci: " Philippe Mathieu-Daudé
2019-12-14 15:56 ` [PATCH 7/8] target/i386: " Philippe Mathieu-Daudé
2019-12-14 15:56 ` Philippe Mathieu-Daudé [this message]
2019-12-14 16:28 ` [PATCH 0/8] Simplify memory_region_add_subregion_overlap(..., priority=0) Peter Maydell
2019-12-14 18:17   ` Philippe Mathieu-Daudé
2019-12-14 20:01     ` Peter Maydell
2019-12-15  9:54       ` Michael S. Tsirkin
2019-12-15  9:51   ` Michael S. Tsirkin
2019-12-15 15:27     ` Peter Maydell
2019-12-16 11:39       ` Michael S. Tsirkin
2019-12-16 11:46         ` 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=20191214155614.19004-9-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=Andrew.Baumann@microsoft.com \
    --cc=aleksandar.rikalo@rt-rk.com \
    --cc=alex.williamson@redhat.com \
    --cc=alistair@alistair23.me \
    --cc=amarkovic@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=joel@jms.id.au \
    --cc=kvm@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pburton@wavecomp.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).