Firecracker emulates a PS/2 controller and detects attempted writes to
the CPU reset line.
Co-authored-by: Marco Schlumpp <marco@unikraft.io>
Signed-off-by: Marco Schlumpp <marco@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #760
void system_off(void)
{
+#ifdef CONFIG_KVM_VMM_FIRECRACKER
+ /* Trigger the reset line via the PS/2 controller. On firecracker
+ * this will shutdown the VM.
+ */
+ outb(0x64, 0xFE);
+#endif /* CONFIG_KVM_VMM_FIRECRACKER */
+
/*
* Perform an ACPI shutdown by writing (SLP_TYPa | SLP_EN) to PM1a_CNT.
* Generally speaking, we'd have to jump through a lot of hoops to