Re: [PATCH] x86: Halt on exit

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

 



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@xxxxxxxxx>
> ---
>  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.



[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