All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"David Woodhouse" <dwmw@amazon.co.uk>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Anthony Perard" <anthony.perard@citrix.com>,
	"Paul Durrant" <paul@xen.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	xen-devel@lists.xenproject.org
Subject: [PULL 07/43] hw/xen: Rename 'ram_memory' global variable as 'xen_memory'
Date: Sat,  9 Mar 2024 20:21:34 +0100	[thread overview]
Message-ID: <20240309192213.23420-8-philmd@linaro.org> (raw)
In-Reply-To: <20240309192213.23420-1-philmd@linaro.org>

To avoid a potential global variable shadow in
hw/i386/pc_piix.c::pc_init1(), rename Xen's
"ram_memory" as "xen_memory".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20231114143816.71079-11-philmd@linaro.org>
---
 include/hw/xen/xen-hvm-common.h |  2 +-
 hw/arm/xen_arm.c                |  6 +++---
 hw/i386/xen/xen-hvm.c           | 10 +++++-----
 hw/xen/xen-hvm-common.c         |  6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/hw/xen/xen-hvm-common.h b/include/hw/xen/xen-hvm-common.h
index 4b1d728f35..65a51aac2e 100644
--- a/include/hw/xen/xen-hvm-common.h
+++ b/include/hw/xen/xen-hvm-common.h
@@ -15,7 +15,7 @@
 #include "qemu/error-report.h"
 #include <xen/hvm/ioreq.h>
 
-extern MemoryRegion ram_memory;
+extern MemoryRegion xen_memory;
 extern MemoryListener xen_io_listener;
 extern DeviceListener xen_device_listener;
 
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 32776d94df..15fa7dfa84 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -114,14 +114,14 @@ static void xen_init_ram(MachineState *machine)
         block_len = GUEST_RAM1_BASE + ram_size[1];
     }
 
-    memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len,
+    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
                            &error_fatal);
 
-    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &ram_memory,
+    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory,
                              GUEST_RAM0_BASE, ram_size[0]);
     memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo);
     if (ram_size[1] > 0) {
-        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &ram_memory,
+        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory,
                                  GUEST_RAM1_BASE, ram_size[1]);
         memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi);
     }
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index f42621e674..1ae943370b 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -149,12 +149,12 @@ static void xen_ram_init(PCMachineState *pcms,
          */
         block_len = (4 * GiB) + x86ms->above_4g_mem_size;
     }
-    memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len,
+    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
                            &error_fatal);
-    *ram_memory_p = &ram_memory;
+    *ram_memory_p = &xen_memory;
 
     memory_region_init_alias(&ram_640k, NULL, "xen.ram.640k",
-                             &ram_memory, 0, 0xa0000);
+                             &xen_memory, 0, 0xa0000);
     memory_region_add_subregion(sysmem, 0, &ram_640k);
     /* Skip of the VGA IO memory space, it will be registered later by the VGA
      * emulated device.
@@ -163,12 +163,12 @@ static void xen_ram_init(PCMachineState *pcms,
      * the Options ROM, so it is registered here as RAM.
      */
     memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo",
-                             &ram_memory, 0xc0000,
+                             &xen_memory, 0xc0000,
                              x86ms->below_4g_mem_size - 0xc0000);
     memory_region_add_subregion(sysmem, 0xc0000, &ram_lo);
     if (x86ms->above_4g_mem_size > 0) {
         memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi",
-                                 &ram_memory, 0x100000000ULL,
+                                 &xen_memory, 0x100000000ULL,
                                  x86ms->above_4g_mem_size);
         memory_region_add_subregion(sysmem, 0x100000000ULL, &ram_hi);
     }
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index baa1adb9f2..dc69cada57 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -9,7 +9,7 @@
 #include "hw/boards.h"
 #include "hw/xen/arch_hvm.h"
 
-MemoryRegion ram_memory;
+MemoryRegion xen_memory;
 
 void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
                    Error **errp)
@@ -26,7 +26,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr,
         return;
     }
 
-    if (mr == &ram_memory) {
+    if (mr == &xen_memory) {
         return;
     }
 
@@ -53,7 +53,7 @@ static void xen_set_memory(struct MemoryListener *listener,
 {
     XenIOState *state = container_of(listener, XenIOState, memory_listener);
 
-    if (section->mr == &ram_memory) {
+    if (section->mr == &xen_memory) {
         return;
     } else {
         if (add) {
-- 
2.41.0



  parent reply	other threads:[~2024-03-09 19:26 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 19:21 [PULL 00/43] Misc HW patches for 2024-03-09 Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 01/43] hw/i386: Rename kvmvapic.c -> vapic.c Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 02/43] sysemu/xen: Forbid using Xen headers in user emulation Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 03/43] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 04/43] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h' Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 05/43] hw/pci/msi: Restrict xen_is_pirq_msi() call to Xen Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 06/43] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub Philippe Mathieu-Daudé
2024-03-09 19:21 ` Philippe Mathieu-Daudé [this message]
2024-03-09 19:21 ` [PULL 08/43] hw/xen: Use target-agnostic qemu_target_page_bits() Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 09/43] hw/xen/xen_pt: Add missing license Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 10/43] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 11/43] hw/i386/xen: Compile 'xen-hvm.c' with Xen CPPFLAGS Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 12/43] hw/xen/hvm: Inline TARGET_PAGE_ALIGN() macro Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 13/43] hw/xen/hvm: Propagate page_mask to a pair of functions Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 14/43] hw/xen/hvm: Get target page size at runtime Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 15/43] hw/char/xen_console: Fix missing ERRP_GUARD() for error_prepend() Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 16/43] hw/net/xen_nic: " Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 17/43] hw/remote/remote-obj: hw/misc/ivshmem: " Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 18/43] target/i386/sev: " Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 19/43] hw/i386/pc: Remove pc_compat_1_4..1.7[] left over declarations Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 20/43] hw/i386/pc: Use generated NotifyVmexitOption_str() Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 21/43] hw/i386/pc: Remove 'host_type' argument from pc_init1() Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 22/43] hw/i386/pc: Have pc_init_isa() pass a NULL pci_type argument Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 23/43] hw/intc/apic: fix memory leak Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 24/43] qdev: Add a granule_mode property Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 25/43] hmp: Add option to info qtree to omit details Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 26/43] mac_newworld: change timebase frequency from 100MHz to 25MHz for mac99 machine Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 27/43] hw/intc/grlib_irqmp: abort realize when ncpus value is out of range Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 28/43] docs/interop/firmware.json: Align examples Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 29/43] docs/interop/firmware.json: Fix doc for FirmwareFlashMode Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 30/43] hw/core/machine-smp: Remove deprecated "parameter=0" SMP configurations Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 31/43] hw/core/machine-smp: Deprecate unsupported "parameter=1" " Philippe Mathieu-Daudé
2024-03-09 19:21 ` [PULL 32/43] hw/core/machine-smp: Calculate total CPUs once in machine_parse_smp_config() Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 33/43] tests/unit/test-smp-parse: Drop the unsupported "dies=1" case Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 34/43] tests/unit/test-smp-parse: Use CPU number macros in invalid topology case Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 35/43] tests/unit/test-smp-parse: Bump max_cpus to 4096 Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 36/43] tests/unit/test-smp-parse: Make test cases aware of the book/drawer Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 37/43] tests/unit/test-smp-parse: Test "books" parameter in -smp Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 38/43] tests/unit/test-smp-parse: Test "drawers" " Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 39/43] tests/unit/test-smp-parse: Test "drawers" and "books" combination case Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 40/43] tests/unit/test-smp-parse: Test the full 7-levels topology hierarchy Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 41/43] tests/unit/test-smp-parse: Test smp_props.has_clusters Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 42/43] tests/unit/test-smp-parse: Test "parameter=0" SMP configurations Philippe Mathieu-Daudé
2024-03-09 19:22 ` [PULL 43/43] hw/m68k/mcf5208: add support for reset Philippe Mathieu-Daudé
2024-03-10 14:18 ` [PULL 00/43] Misc HW patches for 2024-03-09 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=20240309192213.23420-8-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=anthony.perard@citrix.com \
    --cc=dwmw@amazon.co.uk \
    --cc=eduardo@habkost.net \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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 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.