From: Eduardo Habkost <ehabkost@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Peter Maydell <peter.maydell@linaro.org>,
Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: [PULL 4/4] hppa: drop usage of memory_region_allocate_system_memory() for ROM
Date: Wed, 23 Oct 2019 23:46:23 -0300 [thread overview]
Message-ID: <20191024024623.18848-5-ehabkost@redhat.com> (raw)
In-Reply-To: <20191024024623.18848-1-ehabkost@redhat.com>
From: Igor Mammedov <imammedo@redhat.com>
machine_hppa_init() violates memory_region_allocate_system_memory() contract
by calling it multiple times which could break with -mem-path. Replace
the second usage (for 'rom') with memory_region_init_ram() instead.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20191008113318.7012-4-imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
hw/hppa/machine.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 7e23675429..953d454f48 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -161,9 +161,8 @@ static void machine_hppa_init(MachineState *machine)
g_free(firmware_filename);
rom_region = g_new(MemoryRegion, 1);
- memory_region_allocate_system_memory(rom_region, OBJECT(machine),
- "firmware",
- (FIRMWARE_END - FIRMWARE_START));
+ memory_region_init_ram(rom_region, NULL, "firmware",
+ (FIRMWARE_END - FIRMWARE_START), &error_fatal);
memory_region_add_subregion(addr_space, FIRMWARE_START, rom_region);
/* Load kernel */
--
2.21.0
next prev parent reply other threads:[~2019-10-24 2:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 2:46 [PULL 0/4] x86 and machine queue, 2019-10-23 Eduardo Habkost
2019-10-24 2:46 ` [PULL 1/4] target/i386: Introduce Denverton CPU model Eduardo Habkost
2019-10-24 2:46 ` [PULL 2/4] sparc64: use memory_region_allocate_system_memory() only for '-m' specified RAM Eduardo Habkost
2019-10-24 2:46 ` [PULL 3/4] ppc: rs6000_mc: drop usage of memory_region_allocate_system_memory() Eduardo Habkost
2019-10-24 2:46 ` Eduardo Habkost [this message]
2019-10-24 13:54 ` [PULL 0/4] x86 and machine queue, 2019-10-23 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=20191024024623.18848-5-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--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).