aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNadav Amit <namit@vmware.com>2020-06-26 02:23:32 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-06-26 06:42:05 -0400
commit3b9b2d554aeed680ac44daaf13c04a6cdb19c6a8 (patch)
tree4fcce0cff78d6c577df5f505391becf53614137a
parenta529af7c46ad7705663b281b07c6e80a290b0e55 (diff)
downloadkvm-unit-tests-3b9b2d554aeed680ac44daaf13c04a6cdb19c6a8.tar.gz
x86: realmode: hlt loop as fallback on exit
For systems without emulated devices (e.g., bare-metal), use halt-loop when exiting the realmode test. Signed-off-by: Nadav Amit <namit@vmware.com> Message-Id: <20200626092333.2830-3-namit@vmware.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--x86/realmode.c4
1 files changed, 4 insertions, 0 deletions
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 {