All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: <kvm@vger.kernel.org>, Nadav Amit <namit@vmware.com>
Subject: [kvm-unit-tests PATCH 2/3] x86: realmode: hlt loop as fallback on exit
Date: Fri, 26 Jun 2020 02:23:32 -0700	[thread overview]
Message-ID: <20200626092333.2830-3-namit@vmware.com> (raw)
In-Reply-To: <20200626092333.2830-1-namit@vmware.com>

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>
---
 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


  parent reply	other threads:[~2020-06-26  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26  9:23 [kvm-unit-tests PATCH 0/3] x86: realmode: fixes Nadav Amit
2020-06-26  9:23 ` [kvm-unit-tests PATCH 1/3] x86: realmode: initialize idtr Nadav Amit
2020-06-26 10:41   ` Paolo Bonzini
2020-06-26  9:23 ` Nadav Amit [this message]
2020-06-26  9:23 ` [kvm-unit-tests PATCH 3/3] x86: realmode: fix lss test Nadav Amit
2020-06-26 10:43 ` [kvm-unit-tests PATCH 0/3] x86: realmode: fixes Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200626092333.2830-3-namit@vmware.com \
    --to=namit@vmware.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.