[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 03/21] hw/i386/pc: Remove PCMachineClass::broken_reserved_end fie
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 03/21] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field |
Date: |
Thu, 16 Jan 2025 00:22:29 +0100 |
The PCMachineClass::broken_reserved_end field was only used
by the pc-q35-2.4 and pc-i440fx-2.4 machines, which got removed.
Remove it and simplify pc_memory_init().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/i386/pc.h | 1 -
hw/i386/pc.c | 13 +++++--------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 103b54301f8..7fc34bb4a34 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -107,7 +107,6 @@ struct PCMachineClass {
/* RAM / address space compat: */
bool gigabyte_align;
bool has_reserved_memory;
- bool broken_reserved_end;
bool enforce_amd_1tb_hole;
bool isa_bios_alias;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 9334b033f65..bf5308160e4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -994,14 +994,13 @@ void pc_memory_init(PCMachineState *pcms,
if (machine->device_memory) {
uint64_t *val = g_malloc(sizeof(*val));
- uint64_t res_mem_end = machine->device_memory->base;
-
- if (!pcmc->broken_reserved_end) {
- res_mem_end += memory_region_size(&machine->device_memory->mr);
- }
+ uint64_t res_mem_end;
if (pcms->cxl_devices_state.is_enabled) {
res_mem_end = cxl_resv_end;
+ } else {
+ res_mem_end = machine->device_memory->base
+ + memory_region_size(&machine->device_memory->mr);
}
*val = cpu_to_le64(ROUND_UP(res_mem_end, 1 * GiB));
fw_cfg_add_file(fw_cfg, "etc/reserved-memory-end", val, sizeof(*val));
@@ -1039,9 +1038,7 @@ uint64_t pc_pci_hole64_start(void)
hole64_start = pc_get_cxl_range_end(pcms);
} else if (pcmc->has_reserved_memory && (ms->ram_size < ms->maxram_size)) {
pc_get_device_memory_range(pcms, &hole64_start, &size);
- if (!pcmc->broken_reserved_end) {
- hole64_start += size;
- }
+ hole64_start += size;
} else {
hole64_start = pc_above_4g_end(pcms);
}
--
2.47.1
- [PATCH 00/21] hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 01/21] hw/i386/pc: Remove unused pc_compat_2_3 declarations, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 02/21] hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 03/21] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field,
Philippe Mathieu-Daudé <=
- [PATCH 04/21] hw/i386/pc: Remove pc_compat_2_4[] array, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 05/21] target/i386/cpu: Remove X86CPU::check_cpuid field, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 06/21] target/i386/cpu: Pass Error** to x86_cpu_filter_features(), Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 07/21] hw/core/machine: Remove hw_compat_2_4[] array, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 08/21] hw/net/e1000: Remove unused E1000_FLAG_MAC flag, Philippe Mathieu-Daudé, 2025/01/15