Hppa reboot fix patches
The following changes since commit c5ffd16ba4c8fd3601742cc9d2b3cff03995dd5d:
Revert "cputlb: Restrict SavedIOTLB to system emulation" (2023-06-21 07:19:46 +0200)
are available in the Git repository at:
https://github.com/hdeller/qemu-hppa.git tags/hppa-reboot-fix-pull-request
for you to fetch changes up to b9bed0896e8352a340188e32bee69988209e4f72:
target/hppa: Update to SeaBIOS-hppa version 8 (2023-06-24 11:45:52 +0200)
----------------------------------------------------------------
target/hppa: Fix boot and reboot for SMP machines
Fix some SMP-related boot and reboot issues with HP-UX and Linux by correctly initializing the CPU PSW bits, disabling data and instruction translations and unhalting the CPU in the qemu hppa_machine_reset() function.
To work correctly some fixes are needed in the SeaBIOS-hppa firmware too, which is why this series updates it to version 8 which includes those fixes and enhancements:
Fixes
- boot of HP-UX with SMP, and
- reboot of Linux and HP-UX with SMP
Enhancements:
- show qemu version in boot menu
- adds exit menu entry in boot menu to quit emulation
- allow to trace PCD_CHASSIS codes more specifically
----------------------------------------------------------------
Helge Deller (3):
target/hppa: Fix OS reboot issues
target/hppa: Provide qemu version via fw_cfg to firmware target/hppa: Update to SeaBIOS-hppa version 8
hw/hppa/machine.c | 15 +++++++++++++-- pc-bios/hppa-firmware.img | Bin 719376 -> 720216 bytes roms/seabios-hppa | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-)
--
2.38.1
[PULL 1/3] target/hppa: Fix OS reboot issues
When the OS triggers a reboot, the reset helper function sends a qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET) together with an EXCP_HLT exception to halt the CPUs.
So, at reboot when initializing the CPUs again, make sure to set all instruction pointers to the firmware entry point, disable any interrupts, disable data and instruction translations, enable PSW_Q bit and tell qemu to unhalt (halted=0) the CPUs again.
This fixes the various reboot issues which were seen when rebooting a Linux VM, including the case where even the monarch CPU has been virtually halted from the OS (e.g. via "chcpu -d 0" inside the Linux VM).
--- hw/hppa/machine.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
hw/hppa/machine.c +8 -2
@@ -418,10 +418,16 @@ static void hppa_machine_reset(MachineState *ms, ShutdownCause reason)/* Start all CPUs at the firmware entry point. * Monarch CPU will initialize firmware, secondary CPUs -* will enter a small idle look and wait for rendevouz. */ +* will enter a small idle loop and wait for rendevouz. */ for (i =0 ; i < smp_cpus; i++) { -cpu_set_pc (CPU (cpu[i]), firmware_entry); +CPUState *cs =CPU (cpu[i]); + +cpu_set_pc (cs, firmware_entry); + cpu[i]->env.psw =PSW_Q ; cpu[i]->env.gr[5 ] =CPU_HPA + i *0x1000 ; + + cs->exception_index =-1 ; + cs->halted =0 ; }/* already initialized by machine_hppa_init()? */
--
2.38.1
[PULL 3/3] target/hppa: Update to SeaBIOS-hppa version 8
In reply to Helge DellerUpdate SeaBIOS-hppa to version 8.
Fixes:
- boot of HP-UX with SMP, and
- reboot of Linux and HP-UX with SMP
Enhancements:
- show qemu version in boot menu
- adds exit menu entry in boot menu to quit emulation
- allow to trace PCD_CHASSIS codes & machine run status
--- pc-bios/hppa-firmware.img | Bin 719376 -> 720216 bytes roms/seabios-hppa | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-)
pc-bios/hppa-firmware.img binary +0 -0
roms/seabios-hppa +1 -1
@@ -1 +1 @@ -Subproject commit 1cfbe76ff625fce9ed5991f7e13d80ffec900f40 +Subproject commit 673d2595d4f773cc266cbf8dbaf2f475a6adb949
--
2.38.1
[PULL 2/3] target/hppa: Provide qemu version via fw_cfg to firmware
In reply to Helge DellerGive current QEMU version string to SeaBIOS-hppa via fw_cfg interface so that the firmware can show the QEMU version in the boot menu info.
--- hw/hppa/machine.c | 5 +++++ 1 file changed, 5 insertions(+)
hw/hppa/machine.c +5 -0
@@ -122,6 +122,7 @@ static FWCfgState *create_fw_cfg(MachineState *ms) {FWCfgState *fw_cfg;uint64_t val; +const char qemu_version[] =QEMU_VERSION ; 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);
@@ -147,6 +148,10 @@ static FWCfgState *create_fw_cfg(MachineState *ms)fw_cfg_add_i16 (fw_cfg,FW_CFG_BOOT_DEVICE , ms->boot_config.order[0 ]);qemu_register_boot_set (fw_cfg_boot_set, fw_cfg); +fw_cfg_add_file (fw_cfg,"/etc/qemu-version" , +g_memdup (qemu_version,sizeof (qemu_version)), +sizeof (qemu_version)); +return fw_cfg; }
--
2.38.1
Quoted 6 lines · Helge Deller
The following changes since commit
c5ffd16ba4c8fd3601742cc9d2b3cff03995dd5d:Revert "cputlb: Restrict SavedIOTLB to system emulation" (2023-06-21 07:19:46 +0200)
are available in the Git repository at:
Quoted 8 lines
https://github.com/hdeller/qemu-hppa.git tags/hppa-reboot-fix-pull-request
for you to fetch changes up to
b9bed0896e8352a340188e32bee69988209e4f72:target/hppa: Update to SeaBIOS-hppa version 8 (2023-06-24 11:45:52 +0200)----------------------------------------------------------------
target/hppa: Fix boot and reboot for SMP machines
Please ignore this pull request, as it is based on a wrong base commit.
I'll resend a new pull request.
Thanks,
Helge