[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/32] bugfix: vm halt when in reset looping
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 01/32] bugfix: vm halt when in reset looping |
Date: |
Mon, 16 Jan 2017 17:58:45 +0100 |
From: hangaohuai <address@hidden>
reset mc146818rtc device when RESET event happens.
Fix the problem:
1. Guest boot the second cpu, set CMOS_RESET_CODE 0x0a to protect selfboot;
2. VM being reset by others, hmp_system_reset;
3. seabios resume check the CMOS_RESET_CODE, if 0x0a, jump to the BDA
resume execution by jump via 40h:0067h;
4. Guest halt;
Signed-off-by: hangaohuai <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/timer/mc146818rtc.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index da209d0..637f872 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -946,11 +946,23 @@ static Property mc146818rtc_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
+static void rtc_resetdev(DeviceState *d)
+{
+ RTCState *s = MC146818_RTC(d);
+
+ /* Reason: VM do suspend self will set 0xfe
+ * Reset any values other than 0xfe(Guest suspend case) */
+ if (s->cmos_data[0x0f] != 0xfe) {
+ s->cmos_data[0x0f] = 0x00;
+ }
+}
+
static void rtc_class_initfn(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = rtc_realizefn;
+ dc->reset = rtc_resetdev;
dc->vmsd = &vmstate_rtc;
dc->props = mc146818rtc_properties;
/* Reason: needs to be wired up by rtc_init() */
--
2.9.3
- [Qemu-devel] [PULL v2 00/32] Misc patches for 2017-01-11, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 01/32] bugfix: vm halt when in reset looping,
Paolo Bonzini <=
- [Qemu-devel] [PULL 02/32] megasas: fix guest-triggered memory leak, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 03/32] qom: Make all interface types abstract, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 05/32] stubs: merge all monitor stubs in one file, remove monitor_cur_is_qmp stub, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 04/32] smbios: filter based on CONFIG_SMBIOS rather than TARGET, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 06/32] stubs: move smbios stubs to hw/smbios, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 07/32] stubs: move acpi stubs to hw/acpi, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 08/32] stubs: remove unused stub for serial_hd, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 11/32] stubs: group all monitor_fdset_* functions in a single file, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 12/32] stubs: move vhost stubs to stubs/vhost.o, Paolo Bonzini, 2017/01/16
- [Qemu-devel] [PULL 10/32] stubs: group stubs for user-mode emulation, Paolo Bonzini, 2017/01/16