[kvm-unit-tests PATCH 2/3] x86: realmode: hlt loop as fallback on exit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For systems without emulated devices (e.g., bare-metal), use halt-loop
when exiting the realmode test.

Signed-off-by: Nadav Amit <namit@xxxxxxxxxx>
---
 x86/realmode.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/x86/realmode.c b/x86/realmode.c
index ef79f7e..301b013 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -115,6 +115,10 @@ static int failed;
 static void exit(int code)
 {
 	outb(code, 0xf4);
+
+	while (1) {
+		asm volatile("hlt" ::: "memory");
+	}
 }
 
 struct regs {
-- 
2.20.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux