Skip to contentSkip to conversation

Exynos4210: license and RAM vmstate fixes

PATCH RESEND New Igor Mitsyanko 1 participant 4 messages Aug 10, 2012 Arm Samsung Exynos

lore
Share & tools
lore
#0 lore raw

cover Exynos4210: license and RAM vmstate fixes

PATCH1 drops "All rights reserved" from all exynos-related file's licenses.

PATCH2 registers RO MemoryRegions for live migration. This is needed because ram_save_live saves all MemoryRegions no matter if they were registered or not. This is probably a bug in QEMU because It's not written anywhere that vmstate_register_ram_global() is mandatory for every created MemoryRegion.

PATCH3 sets chipid_and_omr static array size to TARGET_PAGE_SIZE because memory_region_init_ram_ptr() implicitly assumes that its size argument is a multiple of TARGET_PAGE_SIZE. This is probably a bug too, but still..

Igor Mitsyanko (3):
exynos4210: drop "All rights reserved" line from files license exynos4210.c: register chipid_mem and rom_mem with vmstate hw/exynos4210.c: set chipid_and_omr array size to TARGET_PAGE_SIZE

 hw/exynos4210.c          |    6 ++++--
 hw/exynos4210.h          |    2 +-
 hw/exynos4210_combiner.c |    3 +--
 hw/exynos4210_fimd.c     |    3 +--
 hw/exynos4210_gic.c      |    3 +--
 hw/exynos4210_mct.c      |    3 +--
 hw/exynos4210_pwm.c      |    3 +--
 hw/exynos4_boards.c      |    2 +-
 8 files changed, 11 insertions(+), 14 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/3 exynos4210: drop "All rights reserved" line from files license

It has been noted that "All rights reserved" statement conflicts with GPL, remove it.

---
 hw/exynos4210.c          |    2 +-
 hw/exynos4210.h          |    2 +-
 hw/exynos4210_combiner.c |    3 +--
 hw/exynos4210_fimd.c     |    3 +--
 hw/exynos4210_gic.c      |    3 +--
 hw/exynos4210_mct.c      |    3 +--
 hw/exynos4210_pwm.c      |    3 +--
 hw/exynos4_boards.c      |    2 +-
 8 files changed, 8 insertions(+), 13 deletions(-)
hw/exynos4210.c +1 -1
index afc4bdc..a3a06f7 100644
@@ -1,7 +1,7 @@
 /*
  *  Samsung exynos4210 SoC emulation
  *
- *  Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *  Copyright (c) 2011 Samsung Electronics Co., Ltd.
  *    Maksim Kozlov <[email protected]>
  *    Evgeny Voevodin <[email protected]>
  *    Igor Mitsyanko  <[email protected]>
hw/exynos4210.h +1 -1
index f7c7027..79c1b78 100644
@@ -1,7 +1,7 @@
 /*
  *  Samsung exynos4210 SoC emulation
  *
- *  Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *  Copyright (c) 2011 Samsung Electronics Co., Ltd.
  *    Maksim Kozlov <[email protected]>
  *    Evgeny Voevodin <[email protected]>
  *    Igor Mitsyanko <[email protected]>
hw/exynos4210_combiner.c +1 -2
index 80af22c..a4a159a 100644
@@ -1,8 +1,7 @@
 /*
  * Samsung exynos4210 Interrupt Combiner
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * All rights reserved.
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  *
  * Evgeny Voevodin <[email protected]>
  *
hw/exynos4210_fimd.c +1 -2
index 3313f00..0cedf6b 100644
@@ -1,8 +1,7 @@
 /*
  * Samsung exynos4210 Display Controller (FIMD)
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * All rights reserved.
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  * Based on LCD controller for Samsung S5PC1xx-based board emulation
  * by Kirill Batuzov <[email protected]>
  *
hw/exynos4210_gic.c +1 -2
index e1b215e..3bd4f3e 100644
@@ -1,8 +1,7 @@
 /*
  * Samsung exynos4210 GIC implementation. Based on hw/arm_gic.c
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * All rights reserved.
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  *
  * Evgeny Voevodin <[email protected]>
  *
hw/exynos4210_mct.c +1 -2
index 7474fcf..8838126 100644
@@ -1,8 +1,7 @@
 /*
  * Samsung exynos4210 Multi Core timer
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * All rights reserved.
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  *
  * Evgeny Voevodin <[email protected]>
  *
hw/exynos4210_pwm.c +1 -2
index 6243e59..98227e5 100644
@@ -1,8 +1,7 @@
 /*
  * Samsung exynos4210 Pulse Width Modulation Timer
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * All rights reserved.
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  *
  * Evgeny Voevodin <[email protected]>
  *
hw/exynos4_boards.c +1 -1
index ea32c51..b794fa8 100644
@@ -1,7 +1,7 @@
 /*
  *  Samsung exynos4 SoC based boards emulation
  *
- *  Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *  Copyright (c) 2011 Samsung Electronics Co.
  *    Maksim Kozlov <[email protected]>
  *    Evgeny Voevodin <[email protected]>
  *    Igor Mitsyanko  <[email protected]>
Signature · 1 line
1.7.4.1
#2 lore raw

PATCH 2/3 exynos4210.c: register chipid_mem and rom_mem with vmstate

In reply to Igor Mitsyanko

Even if we do not register newly created RAM MemoryRegion for migration with vmstate_register_ram_global() function, ram_save_live() still saves this region to snapshot file with empty idstr=="". Consequently this results in error during VM restoration in ram_load().
Register chipid_mem and rom_mem for migration to avoid this problem.

---
 hw/exynos4210.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/exynos4210.c +2 -0
index a3a06f7..94d2e41 100644
@@ -201,6 +201,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
     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);
+    vmstate_register_ram_global(&s->chipid_mem);
     memory_region_add_subregion(system_mem, EXYNOS4210_CHIPID_ADDR,
                                 &s->chipid_mem);
 
@@ -208,6 +209,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,
     memory_region_init_ram(&s->irom_mem, "exynos4210.irom",
                            EXYNOS4210_IROM_SIZE);
     memory_region_set_readonly(&s->irom_mem, true);
+    vmstate_register_ram_global(&s->irom_mem);
     memory_region_add_subregion(system_mem, EXYNOS4210_IROM_BASE_ADDR,
                                 &s->irom_mem);
     /* mirror of iROM */
Signature · 1 line
1.7.4.1
#3 lore raw

PATCH 3/3 hw/exynos4210.c: set chipid_and_omr array size to TARGET_PAGE_SIZE

In reply to Igor Mitsyanko

chipid_mem is initialized with memory_region_init_ram_ptr() function with chipid_and_omr array as buffer argument. During initialization memory region size is aligned to page size, but size of static array chipid_and_omr is less then TARGET_PAGE_SIZE. This could result in errors in some cases, specifically, it could cause segfault during VM saving. Setting chipid_and_omr aray size to TARGET_PAGE_SIZE helps us to avoid any problems.

---
 hw/exynos4210.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/exynos4210.c +1 -1
index 94d2e41..3568ada 100644
@@ -62,7 +62,7 @@
 /* Display controllers (FIMD) */
 #define EXYNOS4210_FIMD0_BASE_ADDR          0x11C00000
 
-static uint8_t chipid_and_omr[] = { 0x11, 0x02, 0x21, 0x43,
+static uint8_t chipid_and_omr[TARGET_PAGE_SIZE] = { 0x11, 0x02, 0x21, 0x43,
                                     0x09, 0x00, 0x00, 0x00 };
 
 void exynos4210_write_secondary(ARMCPU *cpu,
Signature · 1 line
1.7.4.1