From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: David Woodhouse <dwmw@amazon.co.uk>, qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"Paul Durrant" <paul@xen.org>,
qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"David Woodhouse" <dwmw2@infradead.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
xen-devel@lists.xenproject.org, qemu-block@nongnu.org,
"Anthony Perard" <anthony.perard@citrix.com>,
kvm@vger.kernel.org, "Thomas Huth" <thuth@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>
Subject: [PATCH-for-9.0 v2 10/19] hw/xen: Rename 'ram_memory' global variable as 'xen_memory'
Date: Tue, 14 Nov 2023 15:38:06 +0100 [thread overview]
Message-ID: <20231114143816.71079-11-philmd@linaro.org> (raw)
In-Reply-To: <20231114143816.71079-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>
---
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 4e9904f1a6..d3fa5ed29b 100644
--- a/include/hw/xen/xen-hvm-common.h
+++ b/include/hw/xen/xen-hvm-common.h
@@ -16,7 +16,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 a5631529d0..8a185da193 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -111,17 +111,17 @@ 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);
DPRINTF("Initialized region xen.ram.lo: base 0x%llx size 0x%lx\n",
GUEST_RAM0_BASE, ram_size[0]);
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);
DPRINTF("Initialized region xen.ram.hi: base 0x%llx size 0x%lx\n",
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 565dc39c8f..cf4053c9f2 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
next prev parent reply other threads:[~2023-11-14 14:43 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-14 14:37 [PATCH-for-9.0 v2 00/19] hw/xen: Have most of Xen files become target-agnostic Philippe Mathieu-Daudé
2023-11-14 14:37 ` [PATCH-for-9.0 v2 01/19] tests/avocado: Add 'guest:xen' tag to tests running Xen guest Philippe Mathieu-Daudé
2023-11-14 14:50 ` David Woodhouse
2023-11-14 15:00 ` Philippe Mathieu-Daudé
2023-11-14 15:08 ` David Woodhouse
2023-11-14 15:13 ` Philippe Mathieu-Daudé
2023-11-14 15:19 ` David Woodhouse
2023-11-14 15:42 ` Philippe Mathieu-Daudé
2023-11-14 14:37 ` [PATCH-for-9.0 v2 02/19] sysemu/xen: Forbid using Xen headers in user emulation Philippe Mathieu-Daudé
2023-11-14 14:37 ` [PATCH-for-9.0 v2 03/19] sysemu/xen-mapcache: Check Xen availability with CONFIG_XEN_IS_POSSIBLE Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 04/19] system/physmem: Do not include 'hw/xen/xen.h' but 'sysemu/xen.h' Philippe Mathieu-Daudé
2023-11-14 14:59 ` David Woodhouse
2023-11-14 15:14 ` David Hildenbrand
2023-11-14 14:38 ` [PATCH-for-9.0 v2 05/19] hw/display: Restrict xen_register_framebuffer() call to Xen Philippe Mathieu-Daudé
2024-03-27 11:50 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 06/19] hw/pci/msi: Restrict xen_is_pirq_msi() " Philippe Mathieu-Daudé
2023-11-14 15:13 ` David Woodhouse
2023-11-14 15:22 ` Philippe Mathieu-Daudé
2023-11-14 15:44 ` David Woodhouse
2023-11-14 21:18 ` David Woodhouse
2023-11-14 16:17 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 07/19] hw/xen: Remove unnecessary xen_hvm_inject_msi() stub Philippe Mathieu-Daudé
2023-11-14 15:27 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 08/19] hw/xen: Remove unused Xen stubs Philippe Mathieu-Daudé
2024-03-27 11:54 ` Anthony PERARD
2023-11-14 14:38 ` [RFC PATCH-for-9.0 v2 09/19] hw/block/xen_blkif: Align structs with QEMU_ALIGNED() instead of #pragma Philippe Mathieu-Daudé
2023-11-14 15:30 ` David Woodhouse
2024-03-27 13:31 ` Anthony PERARD
2024-03-27 13:34 ` David Woodhouse
2023-11-14 14:38 ` Philippe Mathieu-Daudé [this message]
2023-11-14 15:49 ` [PATCH-for-9.0 v2 10/19] hw/xen: Rename 'ram_memory' global variable as 'xen_memory' David Woodhouse
2024-03-06 17:14 ` Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 11/19] hw/xen/xen_arch_hvm: Rename prototypes using 'xen_arch_' prefix Philippe Mathieu-Daudé
2024-03-27 13:37 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 12/19] hw/xen: Merge 'hw/xen/arch_hvm.h' in 'hw/xen/xen-hvm-common.h' Philippe Mathieu-Daudé
2024-03-27 14:27 ` Anthony PERARD
2023-11-14 14:38 ` [RFC PATCH-for-9.0 v2 13/19] hw/xen: Remove use of 'target_ulong' in handle_ioreq() Philippe Mathieu-Daudé
2024-03-06 17:16 ` Philippe Mathieu-Daudé
2024-03-27 16:45 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 14/19] hw/xen: Use target-agnostic qemu_target_page_bits() Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 15/19] hw/xen: Reduce inclusion of 'cpu.h' to target-specific sources Philippe Mathieu-Daudé
2024-03-27 17:13 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 16/19] hw/xen/xen_pt: Add missing license Philippe Mathieu-Daudé
2023-11-14 15:54 ` David Woodhouse
2024-03-27 17:27 ` Anthony PERARD
2023-11-14 14:38 ` [PATCH-for-9.0 v2 17/19] hw/xen: Extract 'xen_igd.h' from 'xen_pt.h' Philippe Mathieu-Daudé
2023-11-14 14:38 ` [PATCH-for-9.0 v2 18/19] hw/i386/xen: Compile 'xen-hvm.c' with Xen CPPFLAGS Philippe Mathieu-Daudé
2023-11-14 15:56 ` David Woodhouse
2023-11-14 14:38 ` [PATCH-for-9.0 v2 19/19] hw/xen: Have most of Xen files become target-agnostic Philippe Mathieu-Daudé
2024-03-28 15:13 ` Anthony PERARD
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=20231114143816.71079-11-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alex.bennee@linaro.org \
--cc=anthony.perard@citrix.com \
--cc=dwmw2@infradead.org \
--cc=dwmw@amazon.co.uk \
--cc=eduardo@habkost.net \
--cc=kvm@vger.kernel.org \
--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-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sstabellini@kernel.org \
--cc=thuth@redhat.com \
--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 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).