x86/viridian: set shutdown_code in response to CrashNotify
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 10 Aug 2018 15:43:42 +0000 (16:43 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 6 Sep 2018 15:38:11 +0000 (16:38 +0100)
When Windows writes the CrashNotify bit in the CRASH_CTL MSR then we know
it is crashing, so set the domain shutdown code appropriately.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/viridian.c

index e84c4f4ab5732b356f703871033e4ff9603626fc..a23d0876c41f42be26ad422529881820aa026072 100644 (file)
@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_t val)
         if ( !ctl.u.CrashNotify )
             break;
 
+        spin_lock(&d->shutdown_lock);
+        d->shutdown_code = SHUTDOWN_crash;
+        spin_unlock(&d->shutdown_lock);
+
         gprintk(XENLOG_WARNING, "VIRIDIAN CRASH: %lx %lx %lx %lx %lx\n",
                 v->arch.hvm.viridian.crash_param[0],
                 v->arch.hvm.viridian.crash_param[1],