All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Nadav Amit <nadav.amit@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] x86: Halt on exit
Date: Mon, 13 May 2019 15:50:56 +0200	[thread overview]
Message-ID: <20190513135055.GA8697@flask> (raw)
In-Reply-To: <20190509195023.11933-1-nadav.amit@gmail.com>

2019-05-09 12:50-0700, Nadav Amit:
> In some cases, shutdown through the test device and Bochs might fail.
> Just hang in a loop that executes halt in such cases.
> 
> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
> ---
>  lib/x86/io.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/x86/io.c b/lib/x86/io.c
> @@ -99,6 +99,10 @@ void exit(int code)
>  #else
>          asm volatile("out %0, %1" : : "a"(code), "d"((short)0xf4));
>  #endif
> +	/* Fallback */
> +	while (1) {
> +		asm volatile ("hlt" ::: "memory");
> +	}
>  	__builtin_unreachable();

Looks good, we can also drop the __builtin_unreachable() now.

      parent reply	other threads:[~2019-05-13 13:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09 19:50 [PATCH] x86: Halt on exit Nadav Amit
2019-05-10  3:34 ` Nadav Amit
2019-05-13  6:05   ` Xiaoyao Li
2019-05-13  6:13     ` Nadav Amit
2019-05-13 13:50 ` Radim Krčmář [this message]

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=20190513135055.GA8697@flask \
    --to=rkrcmar@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=nadav.amit@gmail.com \
    --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.