提交 d3c2bbb1 编写于 作者: P Peter Maydell

Merge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-rc1' into staging

A Single RISC-V Patch for 3.1-rc1

This tag contains a single patch that I'd like to target for rc1: a fix
for a memory leak that was detected by static code analysis.

There are still three patch sets that I'd like to try to get up for 3.1:

* The patch set Basian just published that contains fixes for a pair of
  issues he found when converting our port to decodetree.
* An as-of-yet-unwritten fix to the third issue that Basian pointed out.
* A fix to our fflags bug, which is currently coupled to some CSR
  refactoring that I don't think is OK for 3.1.

I'm at Plumbers next week (and I think Alistair is there too?), but I'll
try to find a way to squeeze in as much as possible.

# gpg: Signature made Thu 08 Nov 2018 16:50:27 GMT
# gpg:                using RSA key EF4CA1502CCBAB41
# gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>"
# gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41

* remotes/riscv/tags/riscv-for-master-3.1-rc1:
  riscv: spike: Fix memory leak in the board init
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
...@@ -316,9 +316,7 @@ static void spike_v1_09_1_board_init(MachineState *machine) ...@@ -316,9 +316,7 @@ static void spike_v1_09_1_board_init(MachineState *machine)
/* build config string with supplied memory size */ /* build config string with supplied memory size */
char *isa = riscv_isa_string(&s->soc.harts[0]); char *isa = riscv_isa_string(&s->soc.harts[0]);
size_t config_string_size = strlen(config_string_tmpl) + 48; char *config_string = g_strdup_printf(config_string_tmpl,
char *config_string = malloc(config_string_size);
snprintf(config_string, config_string_size, config_string_tmpl,
(uint64_t)memmap[SPIKE_CLINT].base + SIFIVE_TIME_BASE, (uint64_t)memmap[SPIKE_CLINT].base + SIFIVE_TIME_BASE,
(uint64_t)memmap[SPIKE_DRAM].base, (uint64_t)memmap[SPIKE_DRAM].base,
(uint64_t)ram_size, isa, (uint64_t)ram_size, isa,
...@@ -345,6 +343,8 @@ static void spike_v1_09_1_board_init(MachineState *machine) ...@@ -345,6 +343,8 @@ static void spike_v1_09_1_board_init(MachineState *machine)
/* Core Local Interruptor (timer and IPI) */ /* Core Local Interruptor (timer and IPI) */
sifive_clint_create(memmap[SPIKE_CLINT].base, memmap[SPIKE_CLINT].size, sifive_clint_create(memmap[SPIKE_CLINT].base, memmap[SPIKE_CLINT].size,
smp_cpus, SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE); smp_cpus, SIFIVE_SIP_BASE, SIFIVE_TIMECMP_BASE, SIFIVE_TIME_BASE);
g_free(config_string);
} }
static void spike_v1_09_1_machine_init(MachineClass *mc) static void spike_v1_09_1_machine_init(MachineClass *mc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册