[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 03/12] hw/hppa: Implement proper SeaBIOS version check
From: |
Helge Deller |
Subject: |
[PULL v2 03/12] hw/hppa: Implement proper SeaBIOS version check |
Date: |
Mon, 10 Aug 2020 15:24:32 +0200 |
It's important that the SeaBIOS hppa firmware is at least at a minimal
level to ensure proper interaction between qemu and firmware.
Implement a proper firmware version check by telling SeaBIOS via the
fw_cfg interface which minimal SeaBIOS version is required by this
running qemu instance. If the firmware detects that it's too old, it
will stop.
Signed-off-by: Helge Deller <deller@gmx.de>
---
hw/hppa/machine.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 49155537cd..90aeefe2a4 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -25,6 +25,8 @@
#define MAX_IDE_BUS 2
+#define MIN_SEABIOS_HPPA_VERSION 1 /* require at least this fw version */
+
static ISABus *hppa_isa_bus(void)
{
ISABus *isa_bus;
@@ -56,6 +58,23 @@ static uint64_t cpu_hppa_to_phys(void *opaque, uint64_t addr)
static HPPACPU *cpu[HPPA_MAX_CPUS];
static uint64_t firmware_entry;
+static FWCfgState *create_fw_cfg(MachineState *ms)
+{
+ FWCfgState *fw_cfg;
+ uint64_t val;
+
+ fw_cfg = fw_cfg_init_mem(QEMU_FW_CFG_IO_BASE, QEMU_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);
+
+ val = cpu_to_le64(MIN_SEABIOS_HPPA_VERSION);
+ fw_cfg_add_file(fw_cfg, "/etc/firmware-min-version",
+ g_memdup(&val, sizeof(val)), sizeof(val));
+
+ return fw_cfg;
+}
+
static void machine_hppa_init(MachineState *machine)
{
const char *kernel_filename = machine->kernel_filename;
@@ -118,6 +137,9 @@ static void machine_hppa_init(MachineState *machine)
115200, serial_hd(0), DEVICE_BIG_ENDIAN);
}
+ /* fw_cfg configuration interface */
+ create_fw_cfg(machine);
+
/* SCSI disk setup. */
dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
lsi53c8xx_handle_legacy_cmdline(dev);
--
2.21.3
- [PULL v2 04/12] hw/display/artist.c: fix out of bounds check, (continued)
- [PULL v2 04/12] hw/display/artist.c: fix out of bounds check, Helge Deller, 2020/08/10
- [PULL v2 12/12] hw/display/artist: Fix invalidation of lines near screen border, Helge Deller, 2020/08/10
- [PULL v2 11/12] hw/display/artist: Fix invalidation of lines in artist_draw_line(), Helge Deller, 2020/08/10
- [PULL v2 05/12] hw/hppa/lasi: Don't abort on invalid IMR value, Helge Deller, 2020/08/10
- [PULL v2 02/12] seabios-hppa: Update to SeaBIOS hppa version 1, Helge Deller, 2020/08/10
- [PULL v2 06/12] hw/display/artist: Check offset in draw_line to avoid buffer over-run, Helge Deller, 2020/08/10
- [PULL v2 10/12] hw/display/artist: Unbreak size mismatch memory accesses, Helge Deller, 2020/08/10
- [PULL v2 08/12] Revert "hw/display/artist: Avoid drawing line when nothing to display", Helge Deller, 2020/08/10
- [PULL v2 07/12] hw/display/artist: Refactor artist_rop8() to avoid buffer over-run, Helge Deller, 2020/08/10
- [PULL v2 09/12] hw/display/artist: Prevent out of VRAM buffer accesses, Helge Deller, 2020/08/10
- [PULL v2 03/12] hw/hppa: Implement proper SeaBIOS version check,
Helge Deller <=
- Re: [PULL v2 00/12] target-hppa fixes pull request v2, Peter Maydell, 2020/08/10
- Re: [PULL v2 00/12] target-hppa fixes pull request v2, Peter Maydell, 2020/08/26