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

Re: [Xen-devel] [PATCH 13/22] vixen: Use SCHEDOP_shutdown to shutdown the machine



On Sat, Jan 06, 2018 at 02:54:28PM -0800, Anthony Liguori wrote:
> From: Jan H. Schönherr <jschoenh@xxxxxxxxx>
> 
> While the hwdom_shutdown() is able to reboot the system, it fails to
> properly power it off. With SCHEDOP_shutdown, we delegate the problem.
> 
> Signed-off-by: Jan H. Schönherr <jschoenh@xxxxxxxxx>
> Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>
> ---
>  xen/common/domain.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/xen/common/domain.c b/xen/common/domain.c
> index b4d679e..ede377c 100644
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -42,6 +42,7 @@
>  #include <xen/trace.h>
>  #include <xen/tmem.h>
>  #include <asm/setup.h>
> +#include <asm/guest/vixen.h>
>  
>  /* Linux config option: propageted to domain0 */
>  /* xen_processor_pmbits: xen control Cx, Px, ... */
> @@ -693,6 +694,17 @@ void __domain_crash_synchronous(void)
>  }
>  
>  
> +static void vixen_shutdown(u8 reason)
> +{
> +    struct sched_shutdown sched_shutdown = { .reason = reason };
> +
> +    if (!opt_noreboot)
> +        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
> +
> +    /* Fallback, in case the hypercall fails */
> +    hwdom_shutdown(reason);
> +}
> + 
>  void domain_shutdown(struct domain *d, u8 reason)
>  {
>      struct vcpu *v;
> @@ -703,6 +715,8 @@ void domain_shutdown(struct domain *d, u8 reason)
>          d->shutdown_code = reason;
>      reason = d->shutdown_code;
>  
> +    if ( is_vixen() )
> +        vixen_shutdown(reason);

What happens with hypervisor triggered shutdowns? For pv-shim we
translated all hypervisor initiated shutdowns to crash requests, since
AFAICT they can only come from panics/BUGs/ASSERTs...

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.