xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] hvm: Allow triple fault to imply crash rather than reboot
@ 2013-02-04 14:25 Andrew Cooper
  2013-02-04 14:46 ` Jan Beulich
  2013-02-04 15:26 ` Ian Campbell
  0 siblings, 2 replies; 10+ messages in thread
From: Andrew Cooper @ 2013-02-04 14:25 UTC (permalink / raw)
  To: xen-devel; +Cc: Keir Fraser, Jan Beulich

While the triple fault action on native hardware will result in a system
reset, any modern operating system can and will make use of less violent
reboot methods.  As a result, the most likely cause of a triple fault is a
fatal software bug.

This patch allows the toolstack to indicate that a triple fault should mean a
crash rather than a reboot.  The default of reboot still remains the same.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

diff -r 5af4f2ab06f3 -r 6f8c532df545 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1233,9 +1233,14 @@ void hvm_hlt(unsigned long rflags)
 void hvm_triple_fault(void)
 {
     struct vcpu *v = current;
+    struct domain * d = v->domain;
+    u8 reason = d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_CRASH]
+        ? SHUTDOWN_crash : SHUTDOWN_reboot;
+
     gdprintk(XENLOG_INFO, "Triple fault on VCPU%d - "
-             "invoking HVM system reset.\n", v->vcpu_id);
-    domain_shutdown(v->domain, SHUTDOWN_reboot);
+             "invoking HVM system %s.\n", v->vcpu_id,
+             reason == SHUTDOWN_crash ? "crash" : "reboot");
+    domain_shutdown(v->domain, reason);
 }
 
 void hvm_inject_trap(struct hvm_trap *trap)
diff -r 5af4f2ab06f3 -r 6f8c532df545 xen/include/public/hvm/params.h
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -142,6 +142,9 @@
 #define HVM_PARAM_ACCESS_RING_PFN   28
 #define HVM_PARAM_SHARING_RING_PFN  29
 
-#define HVM_NR_PARAMS          31
+/* Boolean: Should a triple fault imply crash rather than reboot? */
+#define HVM_PARAM_TRIPLE_FAULT_CRASH 31
+
+#define HVM_NR_PARAMS          32
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: [PATCH RFC] hvm: Allow triple fault to imply crash rather than reboot
@ 2016-11-07 12:56 Xuquan (Quan Xu)
  2016-11-07 13:12 ` Andrew Cooper
  0 siblings, 1 reply; 10+ messages in thread
From: Xuquan (Quan Xu) @ 2016-11-07 12:56 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: JBeulich@suse.com, xen-devel@lists.xen.org

On Feb 4, 2013, 6:25 AM, <andrew.cooper3@citrix> wrote:
> While the triple fault action on native hardware will result in a system
> reset, any modern operating system can and will make use of less violent
> reboot methods. As a result, the most likely cause of a triple fault is a
> fatal software bug.
>
> This patch allows the toolstack to indicate that a triple fault should mean a
> crash rather than a reboot. The default of reboot still remains the same.
>

hi, Andrew

this email has been ages ago. I am working for a triple fault related issues, and I have some doubts:

1)  as you mentioned here, 'fatal software bug', is it to xen hypervisor or guest os?
2)  why introduce 'crash'?  would the 'reboot' lead to a fatal problem ( i.e, xen hypervisor panic) ?
3)  are there any differences between __'crash the guest, destroy the guest , create the guest again'__
    And __'reboot guest'__ ?
4)  any ideas to reproduce triple fault?

Thanks
Quan



> Signed-off-by: Andrew Cooper <andrew.cooper3 [at] citrix>
>
> diff -r 5af4f2ab06f3 -r 6f8c532df545 xen/arch/x86/hvm/hvm.c
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1233,9 +1233,14 @@ void hvm_hlt(unsigned long rflags)
> void hvm_triple_fault(void)
> {
> struct vcpu *v = current;
> + struct domain * d = v->domain;
> + u8 reason = d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_CRASH]
> + ? SHUTDOWN_crash : SHUTDOWN_reboot;
> +
> gdprintk(XENLOG_INFO, "Triple fault on VCPU%d - "
> - "invoking HVM system reset.\n", v->vcpu_id);
> - domain_shutdown(v->domain, SHUTDOWN_reboot);
> + "invoking HVM system %s.\n", v->vcpu_id,
> + reason == SHUTDOWN_crash ? "crash" : "reboot");
> + domain_shutdown(v->domain, reason);
> }
>
> void hvm_inject_trap(struct hvm_trap *trap)
> diff -r 5af4f2ab06f3 -r 6f8c532df545 xen/include/public/hvm/params.h
> --- a/xen/include/public/hvm/params.h
> +++ b/xen/include/public/hvm/params.h
> @@ -142,6 +142,9 @@
> #define HVM_PARAM_ACCESS_RING_PFN 28
> #define HVM_PARAM_SHARING_RING_PFN 29
>
> -#define HVM_NR_PARAMS 31
> +/* Boolean: Should a triple fault imply crash rather than reboot? */
> +#define HVM_PARAM_TRIPLE_FAULT_CRASH 31
> +
> +#define HVM_NR_PARAMS 32
>
> #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-11-07 13:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-04 14:25 [PATCH RFC] hvm: Allow triple fault to imply crash rather than reboot Andrew Cooper
2013-02-04 14:46 ` Jan Beulich
2013-02-04 14:50   ` Andrew Cooper
2013-02-04 15:26 ` Ian Campbell
2013-02-04 16:46   ` Keir Fraser
2013-02-04 17:12     ` Andrew Cooper
2013-02-04 17:55       ` Keir Fraser
  -- strict thread matches above, loose matches on Subject: below --
2016-11-07 12:56 Xuquan (Quan Xu)
2016-11-07 13:12 ` Andrew Cooper
2016-11-07 13:18   ` Xuquan (Quan Xu)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).