diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-02-15 09:38:45 +0100 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-02-15 09:38:45 +0100 |
commit | 63a47721ad3f2bbeedf80850728c9a4aff0224ae (patch) | |
tree | e922f75ef6af8c5c4840d446f05978d7b90d482d /xen/arch/x86/hvm/hvm.c | |
parent | 59a28b5f045331641cbf0c1fc8d5d67afe328939 (diff) | |
download | xen-63a47721ad3f2bbeedf80850728c9a4aff0224ae.tar.gz xen-63a47721ad3f2bbeedf80850728c9a4aff0224ae.tar.bz2 xen-63a47721ad3f2bbeedf80850728c9a4aff0224ae.zip |
hvm: Allow triple fault to imply crash rather than reboot
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>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/hvm/hvm.c')
-rw-r--r-- | xen/arch/x86/hvm/hvm.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index fcea52c737..ac915a1d70 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -540,6 +540,7 @@ int hvm_domain_initialise(struct domain *d) hvm_init_guest_time(d); d->arch.hvm_domain.params[HVM_PARAM_HPET_ENABLED] = 1; + d->arch.hvm_domain.params[HVM_PARAM_TRIPLE_FAULT_REASON] = SHUTDOWN_reboot; hvm_init_cacheattr_region_list(d); @@ -1244,9 +1245,13 @@ 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_REASON]; + gdprintk(XENLOG_INFO, "Triple fault on VCPU%d - " - "invoking HVM system reset.\n", v->vcpu_id); - domain_shutdown(v->domain, SHUTDOWN_reboot); + "invoking HVM shutdown action %"PRIu8".\n", + v->vcpu_id, reason); + domain_shutdown(d, reason); } void hvm_inject_trap(struct hvm_trap *trap) @@ -3929,6 +3934,10 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg) case HVM_PARAM_BUFIOREQ_EVTCHN: rc = -EINVAL; break; + case HVM_PARAM_TRIPLE_FAULT_REASON: + if ( a.value > SHUTDOWN_MAX ) + rc = -EINVAL; + break; } if ( rc == 0 ) |