* [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC
@ 2013-05-10 15:32 Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 1/2] hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region Igor Mitsyanko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Igor Mitsyanko @ 2013-05-10 15:32 UTC (permalink / raw)
To: qemu-devel; +Cc: Igor Mitsyanko, peter.maydell, paul, pbonzini
Fix issues in exynos4210 code which were blocking proper memory
migration.
V1->V2
PATCH1 now doesn't use memory_region_init_ram_ptr at all. Instead, it
converts chipid memory to an mmio region.
PATCH3 is dropped until hard freeze is over. It better be sent separately
anyway.
Igor Mitsyanko (2):
hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region
exynos4210.c: register rom_mem for memory migration
hw/arm/exynos4210.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
--
1.8.1.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH V2 1/2] hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region
2013-05-10 15:32 [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Igor Mitsyanko
@ 2013-05-10 15:33 ` Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 2/2] exynos4210.c: register rom_mem for memory migration Igor Mitsyanko
2013-06-03 15:05 ` [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Igor Mitsyanko @ 2013-05-10 15:33 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Igor Mitsyanko, paul, pbonzini
From: Igor Mitsyanko <i.mitsyanko@samsung.com>
Exynos SoC was misusing memory_region_init_ram_ptr(): this interface can safely
be used only for memory regions which size is a multiple of target page size.
Change chipid_and_omr memory to an mmio region to fix this.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
---
hw/arm/exynos4210.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index 6c2dca5..c998fbb 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -84,6 +84,28 @@
static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43,
0x09, 0x00, 0x00, 0x00 };
+static uint64_t exynos4210_chipid_and_omr_read(void *opaque, hwaddr offset,
+ unsigned size)
+{
+ assert(offset < sizeof(chipid_and_omr));
+ return chipid_and_omr[offset];
+}
+
+static void exynos4210_chipid_and_omr_write(void *opaque, hwaddr offset,
+ uint64_t value, unsigned size)
+{
+ return;
+}
+
+static const MemoryRegionOps exynos4210_chipid_and_omr_ops = {
+ .read = exynos4210_chipid_and_omr_read,
+ .write = exynos4210_chipid_and_omr_write,
+ .endianness = DEVICE_NATIVE_ENDIAN,
+ .impl = {
+ .max_access_size = 1,
+ }
+};
+
void exynos4210_write_secondary(ARMCPU *cpu,
const struct arm_boot_info *info)
{
@@ -224,9 +246,8 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
/*** Memory ***/
/* Chip-ID and OMR */
- memory_region_init_ram_ptr(&s->chipid_mem, "exynos4210.chipid",
- sizeof(chipid_and_omr), chipid_and_omr);
- memory_region_set_readonly(&s->chipid_mem, true);
+ memory_region_init_io(&s->chipid_mem, &exynos4210_chipid_and_omr_ops,
+ NULL, "exynos4210.chipid", sizeof(chipid_and_omr));
memory_region_add_subregion(system_mem, EXYNOS4210_CHIPID_ADDR,
&s->chipid_mem);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH V2 2/2] exynos4210.c: register rom_mem for memory migration
2013-05-10 15:32 [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 1/2] hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region Igor Mitsyanko
@ 2013-05-10 15:33 ` Igor Mitsyanko
2013-06-03 15:05 ` [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Igor Mitsyanko @ 2013-05-10 15:33 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, Igor Mitsyanko, paul, pbonzini
From: Igor Mitsyanko <i.mitsyanko@samsung.com>
Even if we do not register newly created RAM MemoryRegion for migration with
vmstate_register_ram_global() function, ram_save_setup() still saves this region
to snapshot file with empty idstr=="". Consequently this results in error during
VM loading in ram_load().
Register rom_mem for migration.
Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com>
---
hw/arm/exynos4210.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c
index c998fbb..be597db 100644
--- a/hw/arm/exynos4210.c
+++ b/hw/arm/exynos4210.c
@@ -254,6 +254,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
/* Internal ROM */
memory_region_init_ram(&s->irom_mem, "exynos4210.irom",
EXYNOS4210_IROM_SIZE);
+ vmstate_register_ram_global(&s->irom_mem);
memory_region_set_readonly(&s->irom_mem, true);
memory_region_add_subregion(system_mem, EXYNOS4210_IROM_BASE_ADDR,
&s->irom_mem);
--
1.8.1.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC
2013-05-10 15:32 [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 1/2] hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 2/2] exynos4210.c: register rom_mem for memory migration Igor Mitsyanko
@ 2013-06-03 15:05 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2013-06-03 15:05 UTC (permalink / raw)
To: Igor Mitsyanko; +Cc: pbonzini, qemu-devel, paul
On 10 May 2013 16:32, Igor Mitsyanko <i.mitsyanko@gmail.com> wrote:
> Fix issues in exynos4210 code which were blocking proper memory
> migration.
Thanks, applied to arm-devs.next.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-03 15:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-10 15:32 [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 1/2] hw/arm/exynos4210.c: convert chipid_and_omr to an mmio region Igor Mitsyanko
2013-05-10 15:33 ` [Qemu-devel] [PATCH V2 2/2] exynos4210.c: register rom_mem for memory migration Igor Mitsyanko
2013-06-03 15:05 ` [Qemu-devel] [PATCH V2 0/2] Fix memory migration for exynos 4210 SoC Peter Maydell
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).