Skip to content

Commit 23efb5a

Browse files
fyin1jren1
authored andcommitted
DM: reboot: clear the data of 0xcf9 if cold reboot
Linux kernel CF9 reboot is doing things like: - read value from 0xcf9 - mask out the value according to the reboot type (warm vs cold) - BIT OR the value with reboot code - write the value to 0xcf9 If there are two reboot event and the first one is cold reboot and the second one is warm reboot, vsbl query reboot type after the second one and will get code reboot instead of warm reboot. We should clear the data of 0xcf9 if guest request cold reboot. Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
1 parent 66ddb67 commit 23efb5a

File tree

1 file changed

+5
-0
lines changed
  • devicemodel/hw/platform

1 file changed

+5
-0
lines changed

devicemodel/hw/platform/pm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ reset_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
7171
error = vm_suspend(ctx, VM_SUSPEND_RESET);
7272
assert(error == 0 || errno == EALREADY);
7373
}
74+
75+
/* cold reset should clear the value in 0xcf9 */
76+
if (reset_control & 0x8) {
77+
reset_control = 0;
78+
}
7479
}
7580
return 0;
7681
}

0 commit comments

Comments
 (0)