* [PATCH v2 001/122] vl: remove bios_name
@ 2020-11-13 10:15 Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 002/122] arm: do not use ram_size global Paolo Bonzini
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-arm, Alex Bennée
bios_name was a legacy variable used by machine code, but it is
no more.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20201026143028.3034018-16-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/sysemu/sysemu.h | 1 -
softmmu/vl.c | 2 --
2 files changed, 3 deletions(-)
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 817ff4cf75..1336b4264a 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -8,7 +8,6 @@
/* vl.c */
-extern const char *bios_name;
extern int only_migratable;
extern const char *qemu_name;
extern QemuUUID qemu_uuid;
diff --git a/softmmu/vl.c b/softmmu/vl.c
index e6e0ad5a92..ab79c361b9 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -119,7 +119,6 @@
static const char *data_dir[16];
static int data_dir_idx;
-const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
int display_opengl;
const char* keyboard_layout = NULL;
@@ -4208,7 +4207,6 @@ void qemu_init(int argc, char **argv, char **envp)
kernel_filename = qemu_opt_get(machine_opts, "kernel");
initrd_filename = qemu_opt_get(machine_opts, "initrd");
kernel_cmdline = qemu_opt_get(machine_opts, "append");
- bios_name = qemu_opt_get(machine_opts, "firmware");
opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
if (opts) {
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 002/122] arm: do not use ram_size global
2020-11-13 10:15 [PATCH v2 001/122] vl: remove bios_name Paolo Bonzini
@ 2020-11-13 10:15 ` Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 003/122] cris: " Paolo Bonzini
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-arm, qemu-ppc
Use the machine properties instead.
Cc: qemu-ppc@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/arm/aspeed.c | 8 ++++----
hw/display/pxa2xx_lcd.c | 5 +++--
target/arm/arm-semi.c | 3 ++-
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index 0ef3f6b412..cc8ed6ec9c 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -295,7 +295,7 @@ static void aspeed_machine_init(MachineState *machine)
/*
* This will error out if isize is not supported by memory controller.
*/
- object_property_set_uint(OBJECT(&bmc->soc), "ram-size", ram_size,
+ object_property_set_uint(OBJECT(&bmc->soc), "ram-size", machine->ram_size,
&error_fatal);
for (i = 0; i < sc->macs_num; i++) {
@@ -332,8 +332,8 @@ static void aspeed_machine_init(MachineState *machine)
max_ram_size = object_property_get_uint(OBJECT(&bmc->soc), "max-ram-size",
&error_abort);
memory_region_init_io(&bmc->max_ram, NULL, &max_ram_ops, NULL,
- "max_ram", max_ram_size - ram_size);
- memory_region_add_subregion(&bmc->ram_container, ram_size, &bmc->max_ram);
+ "max_ram", max_ram_size - machine->ram_size);
+ memory_region_add_subregion(&bmc->ram_container, machine->ram_size, &bmc->max_ram);
aspeed_board_init_flashes(&bmc->soc.fmc, bmc->fmc_model ?
bmc->fmc_model : amc->fmc_model);
@@ -378,7 +378,7 @@ static void aspeed_machine_init(MachineState *machine)
aspeed_board_binfo.smp_loader_start = AST_SMP_MBOX_CODE;
}
- aspeed_board_binfo.ram_size = ram_size;
+ aspeed_board_binfo.ram_size = machine->ram_size;
aspeed_board_binfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
aspeed_board_binfo.nb_cpus = sc->num_cpus;
diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
index ff90104b80..dfff994962 100644
--- a/hw/display/pxa2xx_lcd.c
+++ b/hw/display/pxa2xx_lcd.c
@@ -17,6 +17,7 @@
#include "ui/console.h"
#include "hw/arm/pxa.h"
#include "ui/pixel_ops.h"
+#include "hw/boards.h"
/* FIXME: For graphic_rotate. Should probably be done in common code. */
#include "sysemu/sysemu.h"
#include "framebuffer.h"
@@ -305,7 +306,7 @@ static void pxa2xx_descriptor_load(PXA2xxLCDState *s)
descptr = s->dma_ch[i].descriptor;
if (!((descptr >= PXA2XX_SDRAM_BASE && descptr +
- sizeof(desc) <= PXA2XX_SDRAM_BASE + ram_size) ||
+ sizeof(desc) <= PXA2XX_SDRAM_BASE + current_machine->ram_size) ||
(descptr >= PXA2XX_INTERNAL_BASE && descptr + sizeof(desc) <=
PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) {
continue;
@@ -850,7 +851,7 @@ static void pxa2xx_update_display(void *opaque)
}
fbptr = s->dma_ch[ch].source;
if (!((fbptr >= PXA2XX_SDRAM_BASE &&
- fbptr <= PXA2XX_SDRAM_BASE + ram_size) ||
+ fbptr <= PXA2XX_SDRAM_BASE + current_machine->ram_size) ||
(fbptr >= PXA2XX_INTERNAL_BASE &&
fbptr <= PXA2XX_INTERNAL_BASE + PXA2XX_INTERNAL_SIZE))) {
pxa2xx_dma_ber_set(s, ch);
diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c
index c1df664f7e..8a5cd49df5 100644
--- a/target/arm/arm-semi.c
+++ b/target/arm/arm-semi.c
@@ -36,6 +36,7 @@
#else
#include "exec/gdbstub.h"
#include "qemu/cutils.h"
+#include "hw/boards.h"
#endif
#define TARGET_SYS_OPEN 0x01
@@ -1044,7 +1045,7 @@ target_ulong do_arm_semihosting(CPUARMState *env)
retvals[2] = ts->stack_base;
retvals[3] = 0; /* Stack limit. */
#else
- limit = ram_size;
+ limit = current_machine->ram_size;
/* TODO: Make this use the limit of the loaded application. */
retvals[0] = limit / 2;
retvals[1] = limit;
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 003/122] cris: do not use ram_size global
2020-11-13 10:15 [PATCH v2 001/122] vl: remove bios_name Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 002/122] arm: do not use ram_size global Paolo Bonzini
@ 2020-11-13 10:15 ` Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 004/122] hppa: " Paolo Bonzini
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-arm
Use the machine properties instead.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/cris/axis_dev88.c | 1 +
hw/cris/boot.c | 2 +-
hw/cris/boot.h | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c
index dab7423c73..b0cb6d84af 100644
--- a/hw/cris/axis_dev88.c
+++ b/hw/cris/axis_dev88.c
@@ -333,6 +333,7 @@ void axisdev88_init(MachineState *machine)
if (kernel_filename) {
li.image_filename = kernel_filename;
li.cmdline = kernel_cmdline;
+ li.ram_size = machine->ram_size;
cris_load_image(cpu, &li);
} else if (!qtest_enabled()) {
fprintf(stderr, "Kernel image must be specified\n");
diff --git a/hw/cris/boot.c b/hw/cris/boot.c
index aa8d2756d6..9fa09cfd83 100644
--- a/hw/cris/boot.c
+++ b/hw/cris/boot.c
@@ -81,7 +81,7 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li)
if (image_size < 0) {
/* Takes a kimage from the axis devboard SDK. */
image_size = load_image_targphys(li->image_filename, 0x40004000,
- ram_size);
+ li->ram_size);
li->entry = 0x40004000;
}
diff --git a/hw/cris/boot.h b/hw/cris/boot.h
index 218854e5d1..9f1e0e340c 100644
--- a/hw/cris/boot.h
+++ b/hw/cris/boot.h
@@ -6,6 +6,7 @@ struct cris_load_info
const char *image_filename;
const char *cmdline;
int image_size;
+ ram_addr_t ram_size;
hwaddr entry;
};
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 004/122] hppa: do not use ram_size global
2020-11-13 10:15 [PATCH v2 001/122] vl: remove bios_name Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 002/122] arm: do not use ram_size global Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 003/122] cris: " Paolo Bonzini
@ 2020-11-13 10:15 ` Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 005/122] i386: " Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 006/122] m68k: " Paolo Bonzini
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-arm, Richard Henderson
Use the machine properties instead.
Cc: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/hppa/machine.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 5e745d5ea9..7e41cb2462 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -97,7 +97,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms)
fw_cfg = fw_cfg_init_mem(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4);
fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, ms->smp.cpus);
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, HPPA_MAX_CPUS);
- fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ram_size);
+ fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
val = cpu_to_le64(MIN_SEABIOS_HPPA_VERSION);
fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version",
@@ -288,7 +288,7 @@ static void machine_hppa_init(MachineState *machine)
(1) Due to sign-extension problems and PDC,
put the initrd no higher than 1G.
(2) Reserve 64k for stack. */
- initrd_base = MIN(ram_size, 1 * GiB);
+ initrd_base = MIN(machine->ram_size, 1 * GiB);
initrd_base = initrd_base - 64 * KiB;
initrd_base = (initrd_base - initrd_size) & TARGET_PAGE_MASK;
@@ -316,7 +316,7 @@ static void machine_hppa_init(MachineState *machine)
* various parameters in registers. After firmware initialization,
* firmware will start the Linux kernel with ramdisk and cmdline.
*/
- cpu[0]->env.gr[26] = ram_size;
+ cpu[0]->env.gr[26] = machine->ram_size;
cpu[0]->env.gr[25] = kernel_entry;
/* tell firmware how many SMP CPUs to present in inventory table */
@@ -342,11 +342,11 @@ static void hppa_machine_reset(MachineState *ms)
}
/* already initialized by machine_hppa_init()? */
- if (cpu[0]->env.gr[26] == ram_size) {
+ if (cpu[0]->env.gr[26] == ms->ram_size) {
return;
}
- cpu[0]->env.gr[26] = ram_size;
+ cpu[0]->env.gr[26] = ms->ram_size;
cpu[0]->env.gr[25] = 0; /* no firmware boot menu */
cpu[0]->env.gr[24] = 'c';
/* gr22/gr23 unused, no initrd while reboot. */
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 005/122] i386: do not use ram_size global
2020-11-13 10:15 [PATCH v2 001/122] vl: remove bios_name Paolo Bonzini
` (2 preceding siblings ...)
2020-11-13 10:15 ` [PATCH v2 004/122] hppa: " Paolo Bonzini
@ 2020-11-13 10:15 ` Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 006/122] m68k: " Paolo Bonzini
4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-arm
Use the loader parameters instead.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/i386/fw_cfg.c | 2 +-
hw/i386/vmport.c | 3 ++-
hw/i386/xen/xen-hvm.c | 2 +-
hw/intc/apic_common.c | 3 ++-
hw/smbios/smbios.c | 8 ++++----
5 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index e06579490c..b87f0e5070 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -118,7 +118,7 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms,
* "etc/max-cpus" actually being apic_id_limit
*/
fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, apic_id_limit);
- fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size);
+ fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, ms->ram_size);
#ifdef CONFIG_ACPI
fw_cfg_add_bytes(fw_cfg, FW_CFG_ACPI_TABLES,
acpi_tables, acpi_tables_len);
diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
index 20d605506b..490a57f52c 100644
--- a/hw/i386/vmport.c
+++ b/hw/i386/vmport.c
@@ -32,6 +32,7 @@
#include "hw/isa/isa.h"
#include "hw/i386/vmport.h"
#include "hw/qdev-properties.h"
+#include "hw/boards.h"
#include "sysemu/sysemu.h"
#include "sysemu/hw_accel.h"
#include "sysemu/qtest.h"
@@ -188,7 +189,7 @@ static uint32_t vmport_cmd_ram_size(void *opaque, uint32_t addr)
return -1;
}
cpu->env.regs[R_EBX] = 0x1177;
- return ram_size;
+ return current_machine->ram_size;
}
static uint32_t vmport_cmd_get_hz(void *opaque, uint32_t addr)
diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c
index 9519c33c09..096c46fef1 100644
--- a/hw/i386/xen/xen-hvm.c
+++ b/hw/i386/xen/xen-hvm.c
@@ -1493,7 +1493,7 @@ void xen_hvm_init_pc(PCMachineState *pcms, MemoryRegion **ram_memory)
#else
xen_map_cache_init(NULL, state);
#endif
- xen_ram_init(pcms, ram_size, ram_memory);
+ xen_ram_init(pcms, ms->ram_size, ram_memory);
qemu_add_vm_change_state_handler(xen_hvm_change_state_handler, state);
diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c
index 81addd6390..67c24238b0 100644
--- a/hw/intc/apic_common.c
+++ b/hw/intc/apic_common.c
@@ -27,6 +27,7 @@
#include "hw/i386/apic.h"
#include "hw/i386/apic_internal.h"
#include "trace.h"
+#include "hw/boards.h"
#include "sysemu/hax.h"
#include "sysemu/kvm.h"
#include "hw/qdev-properties.h"
@@ -297,7 +298,7 @@ static void apic_common_realize(DeviceState *dev, Error **errp)
/* Note: We need at least 1M to map the VAPIC option ROM */
if (!vapic && s->vapic_control & VAPIC_ENABLE_MASK &&
- !hax_enabled() && ram_size >= 1024 * 1024) {
+ !hax_enabled() && current_machine->ram_size >= 1024 * 1024) {
vapic = sysbus_create_simple("kvmvapic", -1, NULL);
}
s->vapic = vapic;
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 6a3d39793b..f22c4f5b73 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -678,13 +678,13 @@ static void smbios_build_type_16_table(unsigned dimm_cnt)
t->location = 0x01; /* Other */
t->use = 0x03; /* System memory */
t->error_correction = 0x06; /* Multi-bit ECC (for Microsoft, per SeaBIOS) */
- size_kb = QEMU_ALIGN_UP(ram_size, KiB) / KiB;
+ size_kb = QEMU_ALIGN_UP(current_machine->ram_size, KiB) / KiB;
if (size_kb < MAX_T16_STD_SZ) {
t->maximum_capacity = cpu_to_le32(size_kb);
t->extended_maximum_capacity = cpu_to_le64(0);
} else {
t->maximum_capacity = cpu_to_le32(MAX_T16_STD_SZ);
- t->extended_maximum_capacity = cpu_to_le64(ram_size);
+ t->extended_maximum_capacity = cpu_to_le64(current_machine->ram_size);
}
t->memory_error_information_handle = cpu_to_le16(0xFFFE); /* Not provided */
t->number_of_memory_devices = cpu_to_le16(dimm_cnt);
@@ -911,9 +911,9 @@ void smbios_get_tables(MachineState *ms,
#define MAX_DIMM_SZ (16 * GiB)
#define GET_DIMM_SZ ((i < dimm_cnt - 1) ? MAX_DIMM_SZ \
- : ((ram_size - 1) % MAX_DIMM_SZ) + 1)
+ : ((current_machine->ram_size - 1) % MAX_DIMM_SZ) + 1)
- dimm_cnt = QEMU_ALIGN_UP(ram_size, MAX_DIMM_SZ) / MAX_DIMM_SZ;
+ dimm_cnt = QEMU_ALIGN_UP(current_machine->ram_size, MAX_DIMM_SZ) / MAX_DIMM_SZ;
smbios_build_type_16_table(dimm_cnt);
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 006/122] m68k: do not use ram_size global
2020-11-13 10:15 [PATCH v2 001/122] vl: remove bios_name Paolo Bonzini
` (3 preceding siblings ...)
2020-11-13 10:15 ` [PATCH v2 005/122] i386: " Paolo Bonzini
@ 2020-11-13 10:15 ` Paolo Bonzini
2020-11-13 10:44 ` Thomas Huth
4 siblings, 1 reply; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 10:15 UTC (permalink / raw)
To: qemu-devel; +Cc: Laurent Vivier, peter.maydell, qemu-arm
Use the machine properties instead.
Cc: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/m68k/mcf5206.c | 4 +++-
hw/m68k/mcf5208.c | 3 ++-
target/m68k/m68k-semi.c | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
index 51d2e0da1c..8708aa4480 100644
--- a/hw/m68k/mcf5206.c
+++ b/hw/m68k/mcf5206.c
@@ -10,6 +10,7 @@
#include "qemu/error-report.h"
#include "qemu/log.h"
#include "cpu.h"
+#include "hw/boards.h"
#include "hw/irq.h"
#include "hw/m68k/mcf.h"
#include "qemu/timer.h"
@@ -311,8 +312,9 @@ static uint64_t m5206_mbar_read(m5206_mbar_state *s,
/* FIXME: currently hardcoded to 128Mb. */
{
uint32_t mask = ~0;
- while (mask > ram_size)
+ while (mask > current_machine->ram_size) {
mask >>= 1;
+ }
return mask & 0x0ffe0000;
}
case 0x5c: return 1; /* DRAM bank 1 empty. */
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 7c8ca5ddf6..2205145ecc 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -157,8 +157,9 @@ static uint64_t m5208_sys_read(void *opaque, hwaddr addr,
{
int n;
for (n = 0; n < 32; n++) {
- if (ram_size < (2u << n))
+ if (current_machine->ram_size < (2u << n)) {
break;
+ }
}
return (n - 1) | 0x40000000;
}
diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
index 8e5fbfc8fa..27600e0cc0 100644
--- a/target/m68k/m68k-semi.c
+++ b/target/m68k/m68k-semi.c
@@ -26,6 +26,7 @@
#else
#include "exec/gdbstub.h"
#include "exec/softmmu-semi.h"
+#include "hw/boards.h"
#endif
#include "qemu/log.h"
@@ -455,8 +456,8 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
* FIXME: This is wrong for boards where RAM does not start at
* address zero.
*/
- env->dregs[1] = ram_size;
- env->aregs[7] = ram_size;
+ env->dregs[1] = current_machine->ram_size;
+ env->aregs[7] = current_machine->ram_size;
#endif
return;
default:
--
2.26.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 006/122] m68k: do not use ram_size global
2020-11-13 10:15 ` [PATCH v2 006/122] m68k: " Paolo Bonzini
@ 2020-11-13 10:44 ` Thomas Huth
2020-11-13 11:17 ` Paolo Bonzini
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Huth @ 2020-11-13 10:44 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Laurent Vivier, peter.maydell, qemu-arm
On 13/11/2020 11.15, Paolo Bonzini wrote:
> Use the machine properties instead.
>
> Cc: Laurent Vivier <lvivier@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> hw/m68k/mcf5206.c | 4 +++-
> hw/m68k/mcf5208.c | 3 ++-
> target/m68k/m68k-semi.c | 5 +++--
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
> index 51d2e0da1c..8708aa4480 100644
> --- a/hw/m68k/mcf5206.c
> +++ b/hw/m68k/mcf5206.c
> @@ -10,6 +10,7 @@
> #include "qemu/error-report.h"
> #include "qemu/log.h"
> #include "cpu.h"
> +#include "hw/boards.h"
> #include "hw/irq.h"
> #include "hw/m68k/mcf.h"
> #include "qemu/timer.h"
> @@ -311,8 +312,9 @@ static uint64_t m5206_mbar_read(m5206_mbar_state *s,
> /* FIXME: currently hardcoded to 128Mb. */
> {
> uint32_t mask = ~0;
> - while (mask > ram_size)
> + while (mask > current_machine->ram_size) {
> mask >>= 1;
> + }
> return mask & 0x0ffe0000;
> }
> case 0x5c: return 1; /* DRAM bank 1 empty. */
> diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
> index 7c8ca5ddf6..2205145ecc 100644
> --- a/hw/m68k/mcf5208.c
> +++ b/hw/m68k/mcf5208.c
> @@ -157,8 +157,9 @@ static uint64_t m5208_sys_read(void *opaque, hwaddr addr,
> {
> int n;
> for (n = 0; n < 32; n++) {
> - if (ram_size < (2u << n))
> + if (current_machine->ram_size < (2u << n)) {
> break;
> + }
> }
> return (n - 1) | 0x40000000;
> }
> diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c
> index 8e5fbfc8fa..27600e0cc0 100644
> --- a/target/m68k/m68k-semi.c
> +++ b/target/m68k/m68k-semi.c
> @@ -26,6 +26,7 @@
> #else
> #include "exec/gdbstub.h"
> #include "exec/softmmu-semi.h"
> +#include "hw/boards.h"
> #endif
> #include "qemu/log.h"
>
> @@ -455,8 +456,8 @@ void do_m68k_semihosting(CPUM68KState *env, int nr)
> * FIXME: This is wrong for boards where RAM does not start at
> * address zero.
> */
> - env->dregs[1] = ram_size;
> - env->aregs[7] = ram_size;
> + env->dregs[1] = current_machine->ram_size;
> + env->aregs[7] = current_machine->ram_size;
> #endif
> return;
> default:
>
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 006/122] m68k: do not use ram_size global
2020-11-13 10:44 ` Thomas Huth
@ 2020-11-13 11:17 ` Paolo Bonzini
0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2020-11-13 11:17 UTC (permalink / raw)
To: Thomas Huth, qemu-devel; +Cc: Laurent Vivier, peter.maydell, qemu-arm
On 13/11/20 11:44, Thomas Huth wrote:
> On 13/11/2020 11.15, Paolo Bonzini wrote:
>> Use the machine properties instead.
>>
>> Cc: Laurent Vivier <lvivier@redhat.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Thanks -- of course this was just an unintentional send, but I'll note
your Reviewed-by nevertheless.
Paolo
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-11-13 11:19 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 10:15 [PATCH v2 001/122] vl: remove bios_name Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 002/122] arm: do not use ram_size global Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 003/122] cris: " Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 004/122] hppa: " Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 005/122] i386: " Paolo Bonzini
2020-11-13 10:15 ` [PATCH v2 006/122] m68k: " Paolo Bonzini
2020-11-13 10:44 ` Thomas Huth
2020-11-13 11:17 ` Paolo Bonzini
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.