All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL v2 0/7] MIPS queue for Jan 24th, 2020
@ 2020-01-24 18:07 Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 1/7] target/mips: Rectify documentation on deprecating r4k machine Aleksandar Markovic
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

The following changes since commit ba2ed84fe6a78f64b2da441750fc6e925d94106a:

  Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-5.0-sf1' into staging (2020-01-24 12:34:04 +0000)

are available in the git repository at:

  https://github.com/AMarkovic/qemu tags/mips-queue-jan-24-2020

for you to fetch changes up to 6e128a2e792b316281f6f1409fe9ffaf522a5a38:

  mips/mips_r4k: use memdev for RAM (2020-01-24 19:01:19 +0100)

----------------------------------------------------------------

MIPS queue for Jan 24th, 2020

  History:

    - v2: Inserted one missing "Signed-off-by:"

  Content:

    - correct a detail on r4k deprecation
    - style cleanup in helper_do_semihosting()
    - improving passing data to disassembler
    - refactoring of memdev usage for RAM for four MIPS machines

----------------------------------------------------------------

Aleksandar Markovic (2):
  target/mips: Rectify documentation on deprecating r4k machine
  disas: Add a field for target-dependant data

Daniel Henrique Barboza (1):
  mips-semi.c: remove 'uhi_done' label in helper_do_semihosting()

Igor Mammedov (4):
  mips/mips_jazz: use memdev for RAM
  mips/mips_malta: use memdev for RAM
  mips/mips_mipssim: use memdev for RAM
  mips/mips_r4k: use memdev for RAM

 hw/mips/mips_jazz.c     |  7 +++----
 hw/mips/mips_malta.c    | 10 ++++------
 hw/mips/mips_mipssim.c  |  9 +++------
 hw/mips/mips_r4k.c      | 12 ++++--------
 include/disas/dis-asm.h |  3 +++
 qemu-deprecated.texi    |  2 +-
 target/mips/mips-semi.c | 15 +++++++--------
 7 files changed, 25 insertions(+), 33 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PULL v2 1/7] target/mips: Rectify documentation on deprecating r4k machine
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 2/7] disas: Add a field for target-dependant data Aleksandar Markovic
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

Change the documented (in file qemu-deprecated.texi) release since
r4k machine is deprecated from 4.2 to 5.0.

Fixes: d32dc61421b

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Message-Id: <1579883929-1517-2-git-send-email-aleksandar.markovic@rt-rk.com>
---
 qemu-deprecated.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 0968d37..3d2a8ff 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -260,7 +260,7 @@ The 'scsi-disk' device is deprecated. Users should use 'scsi-hd' or
 
 @section System emulator machines
 
-@subsection mips r4k platform (since 4.2)
+@subsection mips r4k platform (since 5.0)
 
 This machine type is very old and unmaintained. Users should use the 'malta'
 machine type instead.
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL v2 2/7] disas: Add a field for target-dependant data
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 1/7] target/mips: Rectify documentation on deprecating r4k machine Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 3/7] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting() Aleksandar Markovic
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Aleksandar Markovic <amarkovic@wavecomp.com>

This patch adds a field "target_info" to the structure
disassemble_info. The purpose of this field is to enable targets
to pass to disassembler code any additional data thet deem suitable.

Reviewed-by: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Message-Id: <1579883929-1517-6-git-send-email-aleksandar.markovic@rt-rk.com>
---
 include/disas/dis-asm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
index e9c7dd8..f87f468 100644
--- a/include/disas/dis-asm.h
+++ b/include/disas/dis-asm.h
@@ -372,6 +372,9 @@ typedef struct disassemble_info {
   /* Command line options specific to the target disassembler.  */
   char * disassembler_options;
 
+  /* Field intended to be used by targets in any way they deem suitable.  */
+  int64_t target_info;
+
   /* Options for Capstone disassembly.  */
   int cap_arch;
   int cap_mode;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL v2 3/7] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting()
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 1/7] target/mips: Rectify documentation on deprecating r4k machine Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 2/7] disas: Add a field for target-dependant data Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 4/7] mips/mips_jazz: use memdev for RAM Aleksandar Markovic
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Daniel Henrique Barboza <danielhb413@gmail.com>

The label 'uhi_done' is a simple 'return' call and can
be removed for a bit more clarity in the code.

CC: Aurelien Jarno <aurelien@aurel32.net>
CC: Aleksandar Markovic <amarkovic@wavecomp.com>
CC: Aleksandar Rikalo <aleksandar.rikalo@rt-rk.com>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200106182425.20312-7-danielhb413@gmail.com>
---
 target/mips/mips-semi.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c
index 35bdfd7..10a710c 100644
--- a/target/mips/mips-semi.c
+++ b/target/mips/mips-semi.c
@@ -218,7 +218,7 @@ static int copy_argn_to_target(CPUMIPSState *env, int arg_num,
         if (!p) {                               \
             gpr[2] = -1;                        \
             gpr[3] = EFAULT;                    \
-            goto uhi_done;                      \
+            return;                             \
         }                                       \
     } while (0)
 
@@ -228,14 +228,14 @@ static int copy_argn_to_target(CPUMIPSState *env, int arg_num,
         if (!p) {                                       \
             gpr[2] = -1;                                \
             gpr[3] = EFAULT;                            \
-            goto uhi_done;                              \
+            return;                                     \
         }                                               \
         p2 = lock_user_string(addr2);                   \
         if (!p2) {                                      \
             unlock_user(p, addr, 0);                    \
             gpr[2] = -1;                                \
             gpr[3] = EFAULT;                            \
-            goto uhi_done;                              \
+            return;                                     \
         }                                               \
     } while (0)
 
@@ -272,7 +272,7 @@ void helper_do_semihosting(CPUMIPSState *env)
         if (gpr[4] < 3) {
             /* ignore closing stdin/stdout/stderr */
             gpr[2] = 0;
-            goto uhi_done;
+            return;
         }
         gpr[2] = close(gpr[4]);
         gpr[3] = errno_mips(errno);
@@ -302,7 +302,7 @@ void helper_do_semihosting(CPUMIPSState *env)
             gpr[2] = fstat(gpr[4], &sbuf);
             gpr[3] = errno_mips(errno);
             if (gpr[2]) {
-                goto uhi_done;
+                return;
             }
             gpr[2] = copy_stat_to_target(env, &sbuf, gpr[5]);
             gpr[3] = errno_mips(errno);
@@ -314,14 +314,14 @@ void helper_do_semihosting(CPUMIPSState *env)
     case UHI_argnlen:
         if (gpr[4] >= semihosting_get_argc()) {
             gpr[2] = -1;
-            goto uhi_done;
+            return;
         }
         gpr[2] = strlen(semihosting_get_arg(gpr[4]));
         break;
     case UHI_argn:
         if (gpr[4] >= semihosting_get_argc()) {
             gpr[2] = -1;
-            goto uhi_done;
+            return;
         }
         gpr[2] = copy_argn_to_target(env, gpr[4], gpr[5]);
         break;
@@ -369,6 +369,5 @@ void helper_do_semihosting(CPUMIPSState *env)
         fprintf(stderr, "Unknown UHI operation %d\n", op);
         abort();
     }
-uhi_done:
     return;
 }
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL v2 4/7] mips/mips_jazz: use memdev for RAM
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
                   ` (2 preceding siblings ...)
  2020-01-24 18:07 ` [PULL v2 3/7] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting() Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 5/7] mips/mips_malta: " Aleksandar Markovic
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Igor Mammedov <imammedo@redhat.com>

memory_region_allocate_system_memory() API is going away, so
replace it with memdev allocated MemoryRegion. The later is
initialized by generic code, so board only needs to opt in
to memdev scheme by providing
  MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing
RAM memory region.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1579779525-20065-54-git-send-email-imammedo@redhat.com>
---
 hw/mips/mips_jazz.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c
index 66fd4d8..85d49cf 100644
--- a/hw/mips/mips_jazz.c
+++ b/hw/mips/mips_jazz.c
@@ -159,7 +159,6 @@ static void mips_jazz_init(MachineState *machine,
     ISABus *isa_bus;
     ISADevice *pit;
     DriveInfo *fds[MAX_FD];
-    MemoryRegion *ram = g_new(MemoryRegion, 1);
     MemoryRegion *bios = g_new(MemoryRegion, 1);
     MemoryRegion *bios2 = g_new(MemoryRegion, 1);
     SysBusESPState *sysbus_esp;
@@ -191,9 +190,7 @@ static void mips_jazz_init(MachineState *machine,
     cc->do_transaction_failed = mips_jazz_do_transaction_failed;
 
     /* allocate RAM */
-    memory_region_allocate_system_memory(ram, NULL, "mips_jazz.ram",
-                                         machine->ram_size);
-    memory_region_add_subregion(address_space, 0, ram);
+    memory_region_add_subregion(address_space, 0, machine->ram);
 
     memory_region_init_ram(bios, NULL, "mips_jazz.bios", MAGNUM_BIOS_SIZE,
                            &error_fatal);
@@ -393,6 +390,7 @@ static void mips_magnum_class_init(ObjectClass *oc, void *data)
     mc->init = mips_magnum_init;
     mc->block_default_type = IF_SCSI;
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("R4000");
+    mc->default_ram_id = "mips_jazz.ram";
 }
 
 static const TypeInfo mips_magnum_type = {
@@ -409,6 +407,7 @@ static void mips_pica61_class_init(ObjectClass *oc, void *data)
     mc->init = mips_pica61_init;
     mc->block_default_type = IF_SCSI;
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("R4000");
+    mc->default_ram_id = "mips_jazz.ram";
 }
 
 static const TypeInfo mips_pica61_type = {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL v2 5/7] mips/mips_malta: use memdev for RAM
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
                   ` (3 preceding siblings ...)
  2020-01-24 18:07 ` [PULL v2 4/7] mips/mips_jazz: use memdev for RAM Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 6/7] mips/mips_mipssim: " Aleksandar Markovic
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Igor Mammedov <imammedo@redhat.com>

memory_region_allocate_system_memory() API is going away, so
replace it with memdev allocated MemoryRegion. The later is
initialized by generic code, so board only needs to opt in
to memdev scheme by providing
  MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing
RAM memory region.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1579779525-20065-55-git-send-email-imammedo@redhat.com>
---
 hw/mips/mips_malta.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index 5aaeaa8..77995a5 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -1223,7 +1223,6 @@ void mips_malta_init(MachineState *machine)
     char *filename;
     PFlashCFI01 *fl;
     MemoryRegion *system_memory = get_system_memory();
-    MemoryRegion *ram_high = g_new(MemoryRegion, 1);
     MemoryRegion *ram_low_preio = g_new(MemoryRegion, 1);
     MemoryRegion *ram_low_postio;
     MemoryRegion *bios, *bios_copy = g_new(MemoryRegion, 1);
@@ -1261,13 +1260,11 @@ void mips_malta_init(MachineState *machine)
     }
 
     /* register RAM at high address where it is undisturbed by IO */
-    memory_region_allocate_system_memory(ram_high, NULL, "mips_malta.ram",
-                                         ram_size);
-    memory_region_add_subregion(system_memory, 0x80000000, ram_high);
+    memory_region_add_subregion(system_memory, 0x80000000, machine->ram);
 
     /* alias for pre IO hole access */
     memory_region_init_alias(ram_low_preio, NULL, "mips_malta_low_preio.ram",
-                             ram_high, 0, MIN(ram_size, 256 * MiB));
+                             machine->ram, 0, MIN(ram_size, 256 * MiB));
     memory_region_add_subregion(system_memory, 0, ram_low_preio);
 
     /* alias for post IO hole access, if there is enough RAM */
@@ -1275,7 +1272,7 @@ void mips_malta_init(MachineState *machine)
         ram_low_postio = g_new(MemoryRegion, 1);
         memory_region_init_alias(ram_low_postio, NULL,
                                  "mips_malta_low_postio.ram",
-                                 ram_high, 512 * MiB,
+                                 machine->ram, 512 * MiB,
                                  ram_size - 512 * MiB);
         memory_region_add_subregion(system_memory, 512 * MiB,
                                     ram_low_postio);
@@ -1447,6 +1444,7 @@ static void mips_malta_machine_init(MachineClass *mc)
 #else
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf");
 #endif
+    mc->default_ram_id = "mips_malta.ram";
 }
 
 DEFINE_MACHINE("malta", mips_malta_machine_init)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL v2 6/7] mips/mips_mipssim: use memdev for RAM
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
                   ` (4 preceding siblings ...)
  2020-01-24 18:07 ` [PULL v2 5/7] mips/mips_malta: " Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:07 ` [PULL v2 7/7] mips/mips_r4k: " Aleksandar Markovic
  2020-01-24 18:33 ` [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Peter Maydell
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Igor Mammedov <imammedo@redhat.com>

memory_region_allocate_system_memory() API is going away, so
replace it with memdev allocated MemoryRegion. The later is
initialized by generic code, so board only needs to opt in
to memdev scheme by providing
  MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing
RAM memory region.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1579779525-20065-56-git-send-email-imammedo@redhat.com>
---
 hw/mips/mips_mipssim.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c
index 84c03dd..8df16d8 100644
--- a/hw/mips/mips_mipssim.c
+++ b/hw/mips/mips_mipssim.c
@@ -143,14 +143,12 @@ static void mipsnet_init(int base, qemu_irq irq, NICInfo *nd)
 static void
 mips_mipssim_init(MachineState *machine)
 {
-    ram_addr_t ram_size = machine->ram_size;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
     char *filename;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *isa = g_new(MemoryRegion, 1);
-    MemoryRegion *ram = g_new(MemoryRegion, 1);
     MemoryRegion *bios = g_new(MemoryRegion, 1);
     MIPSCPU *cpu;
     CPUMIPSState *env;
@@ -167,13 +165,11 @@ mips_mipssim_init(MachineState *machine)
     qemu_register_reset(main_cpu_reset, reset_info);
 
     /* Allocate RAM. */
-    memory_region_allocate_system_memory(ram, NULL, "mips_mipssim.ram",
-                                         ram_size);
     memory_region_init_ram(bios, NULL, "mips_mipssim.bios", BIOS_SIZE,
                            &error_fatal);
     memory_region_set_readonly(bios, true);
 
-    memory_region_add_subregion(address_space_mem, 0, ram);
+    memory_region_add_subregion(address_space_mem, 0, machine->ram);
 
     /* Map the BIOS / boot exception handler. */
     memory_region_add_subregion(address_space_mem, 0x1fc00000LL, bios);
@@ -200,7 +196,7 @@ mips_mipssim_init(MachineState *machine)
     }
 
     if (kernel_filename) {
-        loaderparams.ram_size = ram_size;
+        loaderparams.ram_size = machine->ram_size;
         loaderparams.kernel_filename = kernel_filename;
         loaderparams.kernel_cmdline = kernel_cmdline;
         loaderparams.initrd_filename = initrd_filename;
@@ -245,6 +241,7 @@ static void mips_mipssim_machine_init(MachineClass *mc)
 #else
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf");
 #endif
+    mc->default_ram_id = "mips_mipssim.ram";
 }
 
 DEFINE_MACHINE("mipssim", mips_mipssim_machine_init)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PULL v2 7/7] mips/mips_r4k: use memdev for RAM
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
                   ` (5 preceding siblings ...)
  2020-01-24 18:07 ` [PULL v2 6/7] mips/mips_mipssim: " Aleksandar Markovic
@ 2020-01-24 18:07 ` Aleksandar Markovic
  2020-01-24 18:33 ` [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Peter Maydell
  7 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, amarkovic

From: Igor Mammedov <imammedo@redhat.com>

memory_region_allocate_system_memory() API is going away, so
replace it with memdev allocated MemoryRegion. The later is
initialized by generic code, so board only needs to opt in
to memdev scheme by providing
  MachineClass::default_ram_id
and using MachineState::ram instead of manually initializing
RAM memory region.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <1579779525-20065-57-git-send-email-imammedo@redhat.com>
---
 hw/mips/mips_r4k.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c
index fd926a3..69b6549 100644
--- a/hw/mips/mips_r4k.c
+++ b/hw/mips/mips_r4k.c
@@ -171,13 +171,11 @@ static const int sector_len = 32 * KiB;
 static
 void mips_r4k_init(MachineState *machine)
 {
-    ram_addr_t ram_size = machine->ram_size;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
     char *filename;
     MemoryRegion *address_space_mem = get_system_memory();
-    MemoryRegion *ram = g_new(MemoryRegion, 1);
     MemoryRegion *bios;
     MemoryRegion *iomem = g_new(MemoryRegion, 1);
     MemoryRegion *isa_io = g_new(MemoryRegion, 1);
@@ -203,14 +201,12 @@ void mips_r4k_init(MachineState *machine)
     qemu_register_reset(main_cpu_reset, reset_info);
 
     /* allocate RAM */
-    if (ram_size > 256 * MiB) {
+    if (machine->ram_size > 256 * MiB) {
         error_report("Too much memory for this machine: %" PRId64 "MB,"
                      " maximum 256MB", ram_size / MiB);
         exit(1);
     }
-    memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_size);
-
-    memory_region_add_subregion(address_space_mem, 0, ram);
+    memory_region_add_subregion(address_space_mem, 0, machine->ram);
 
     memory_region_init_io(iomem, NULL, &mips_qemu_ops,
                           NULL, "mips-qemu", 0x10000);
@@ -261,7 +257,7 @@ void mips_r4k_init(MachineState *machine)
     g_free(filename);
 
     if (kernel_filename) {
-        loaderparams.ram_size = ram_size;
+        loaderparams.ram_size = machine->ram_size;
         loaderparams.kernel_filename = kernel_filename;
         loaderparams.kernel_cmdline = kernel_cmdline;
         loaderparams.initrd_filename = initrd_filename;
@@ -316,7 +312,7 @@ static void mips_machine_init(MachineClass *mc)
 #else
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf");
 #endif
-
+    mc->default_ram_id = "mips_r4k.ram";
 }
 
 DEFINE_MACHINE("mips", mips_machine_init)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PULL v2 0/7] MIPS queue for Jan 24th, 2020
  2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
                   ` (6 preceding siblings ...)
  2020-01-24 18:07 ` [PULL v2 7/7] mips/mips_r4k: " Aleksandar Markovic
@ 2020-01-24 18:33 ` Peter Maydell
  2020-01-24 18:39   ` [EXTERNAL]Re: " Aleksandar Markovic
  7 siblings, 1 reply; 10+ messages in thread
From: Peter Maydell @ 2020-01-24 18:33 UTC (permalink / raw)
  To: Aleksandar Markovic; +Cc: QEMU Developers, Aleksandar Markovic

On Fri, 24 Jan 2020 at 18:07, Aleksandar Markovic
<aleksandar.markovic@rt-rk.com> wrote:
>
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
>
> The following changes since commit ba2ed84fe6a78f64b2da441750fc6e925d94106a:
>
>   Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-5.0-sf1' into staging (2020-01-24 12:34:04 +0000)
>
> are available in the git repository at:
>
>   https://github.com/AMarkovic/qemu tags/mips-queue-jan-24-2020
>
> for you to fetch changes up to 6e128a2e792b316281f6f1409fe9ffaf522a5a38:
>
>   mips/mips_r4k: use memdev for RAM (2020-01-24 19:01:19 +0100)
>
> ----------------------------------------------------------------
>
> MIPS queue for Jan 24th, 2020
>
>   History:
>
>     - v2: Inserted one missing "Signed-off-by:"
>
>   Content:
>
>     - correct a detail on r4k deprecation
>     - style cleanup in helper_do_semihosting()
>     - improving passing data to disassembler
>     - refactoring of memdev usage for RAM for four MIPS machines
>

Hi; this fails to compile for me:

/home/petmay01/linaro/qemu-for-merges/hw/mips/mips_r4k.c: In function
‘mips_r4k_init’:
/home/petmay01/linaro/qemu-for-merges/hw/mips/mips_r4k.c:209:62:
error: ‘MachineState {aka struct MachineState}’ has no member named
‘ram’
     memory_region_add_subregion(address_space_mem, 0, machine->ram);
                                                              ^~
/home/petmay01/linaro/qemu-for-merges/hw/mips/mips_r4k.c: In function
‘mips_machine_init’:
/home/petmay01/linaro/qemu-for-merges/hw/mips/mips_r4k.c:315:9: error:
‘MachineClass {aka struct MachineClass}’ has no member named
‘default_ram_id’; did you mean ‘default_ram_size’?
     mc->default_ram_id = "mips_r4k.ram";
         ^~~~~~~~~~~~~~
         default_ram_size
/home/petmay01/linaro/qemu-for-merges/rules.mak:69: recipe for target
'hw/mips/mips_r4k.o' failed

(similar sorts of errors for mips_malta and mips_mipssim)

I don't think the patches from Igor are suitable for cherry-picking
into your tree, because they depend on earlier patches from the
start of his series which haven't yet gone into master.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [EXTERNAL]Re: [PULL v2 0/7] MIPS queue for Jan 24th, 2020
  2020-01-24 18:33 ` [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Peter Maydell
@ 2020-01-24 18:39   ` Aleksandar Markovic
  0 siblings, 0 replies; 10+ messages in thread
From: Aleksandar Markovic @ 2020-01-24 18:39 UTC (permalink / raw)
  To: Peter Maydell, Aleksandar Markovic; +Cc: QEMU Developers

> I don't think the patches from Igor are suitable for cherry-picking
> into your tree, because they depend on earlier patches from the
> start of his series which haven't yet gone into master.

Auch. Sorry. In that case, please ignore this pull request. I will send a new
one hopefully next week.

> thanks
> -- PMM


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-01-24 18:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 18:07 [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 1/7] target/mips: Rectify documentation on deprecating r4k machine Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 2/7] disas: Add a field for target-dependant data Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 3/7] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting() Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 4/7] mips/mips_jazz: use memdev for RAM Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 5/7] mips/mips_malta: " Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 6/7] mips/mips_mipssim: " Aleksandar Markovic
2020-01-24 18:07 ` [PULL v2 7/7] mips/mips_r4k: " Aleksandar Markovic
2020-01-24 18:33 ` [PULL v2 0/7] MIPS queue for Jan 24th, 2020 Peter Maydell
2020-01-24 18:39   ` [EXTERNAL]Re: " Aleksandar Markovic

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.