x86/hvm/viridian: set shutdown_code in response to CrashNotify
PATCH 1/1 x86/hvm/viridian: set shutdown_code in response to CrashNotify
When Windows writes the CrashNotify bit in the CRASH_CTL MSR then we know it is crashing, so set the domain shutdown code appropriately.
---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>
--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)
xen/arch/x86/hvm/viridian.c +4 -0
@@ -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_vcpu.viridian.crash_param[0], v->arch.hvm_vcpu.viridian.crash_param[1],
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 16 lines · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSR then we know it is crashing, so set the domain shutdown code appropriately.Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)xen/arch/x86/hvm/viridian.c +0
-0
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t val) · line 650
Quoted 6 lines
xen/arch/x86/hvm/viridian.c +3
-0@@ -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);
How does the domain eventually shut down? It feels slightly odd to have a shutdown code before the domain has finished executing code.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 29 lines
-----Original Message-----
From: Andrew Cooper
Sent: 10 August 2018 16:57
To: Paul Durrant <[email protected]>; [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 1 line · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSR then weknow
Quoted 18 lines
it is crashing, so set the domain shutdown code appropriately.
Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)xen/arch/x86/hvm/viridian.c +0
-0@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_t val)if ( !ctl.u.CrashNotify )break ;
Quoted 5 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t val) · line 650
Quoted 3 lines
xen/arch/x86/hvm/viridian.c +3
-0+spin_lock (&d->shutdown_lock); + d->shutdown_code = SHUTDOWN_crash; +spin_unlock (&d->shutdown_lock);How does the domain eventually shut down?
I assume it shuts down when the guest writes to the PIIX.
Quoted 3 lines
It feels slightly odd to have
a shutdown code before the domain has finished executing code.
That's the norm. The PV drivers (if they are installed) set it via a schedop. This just makes sure it is set even if the PV drivers aren't there.
Paul
Quoted 1 line
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 33 lines · Paul Durrant
Quoted 29 lines
-----Original Message-----
From: Andrew Cooper
Sent: 10 August 2018 16:57
To: Paul Durrant <[email protected]>; [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 1 line · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSR then weknow
Quoted 18 lines
it is crashing, so set the domain shutdown code appropriately.
Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)xen/arch/x86/hvm/viridian.c +0
-0@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_t val)if ( !ctl.u.CrashNotify )break ;Quoted 4 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t val) · line 650
Quoted 3 lines
xen/arch/x86/hvm/viridian.c +3
-0+spin_lock (&d->shutdown_lock); + d->shutdown_code = SHUTDOWN_crash; +spin_unlock (&d->shutdown_lock);How does the domain eventually shut down?
Quoted 6 lines
I assume it shuts down when the guest writes to the PIIX.
Quoted 3 lines
It feels slightly odd to have
a shutdown code before the domain has finished executing code.That's the norm. The PV drivers (if they are installed) set it via a schedop. This just makes sure it is set even if the PV drivers aren't there.
What happens if the user has configured windows to reboot after a crash?
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 48 lines
-----Original Message-----
From: Andrew Cooper
Sent: 16 August 2018 10:40
To: Paul Durrant <[email protected]>; [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 4 lines · Paul Durrant
Quoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 10 August 2018 16:57
To: Paul Durrant <[email protected]>; xen-Quoted 2 lines
Quoted 2 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein responseto
Quoted 4 lines
Quoted 4 lines
CrashNotify
Quoted 1 line · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSR thenwe
Quoted 11 lines
Quoted 11 lines
know
Quoted 10 lines
it is crashing, so set the domain shutdown code appropriately.
Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)Quoted 5 lines
Quoted 5 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t
Quoted 5 lines
xen/arch/x86/hvm/viridian.c +0
-0@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_tval)
Quoted 9 lines
Quoted 7 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t val) · line 650
Quoted 6 lines
xen/arch/x86/hvm/viridian.c +3
-0if ( !ctl.u.CrashNotify )break ; +spin_lock (&d->shutdown_lock); + d->shutdown_code = SHUTDOWN_crash; +spin_unlock (&d->shutdown_lock);How does the domain eventually shut down?
I assume it shuts down when the guest writes to the PIIX.
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
It feels slightly odd to have
a shutdown code before the domain has finished executing code.That's the norm. The PV drivers (if they are installed) set it via a schedop.
This just makes sure it is set even if the PV drivers aren't there.
What happens if the user has configured windows to reboot after a crash?
That's exactly what this is trying to fix. Without the patch a VM without PV drivers will appear to just shut down (because nothing will set the shutdown code to anything else) so the actions-after-crash will not take effect.
Paul
Quoted 1 line
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 63 lines
-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Paul Durrant
Sent: 23 August 2018 09:38
To: Andrew Cooper <[email protected]>; xen- [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 16 August 2018 10:40
To: Paul Durrant <[email protected]>; xen-Quoted 48 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 4 lines · Paul Durrant
Quoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 10 August 2018 16:57
To: Paul Durrant <[email protected]>; xen-Quoted 2 lines
Quoted 2 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein responseto
Quoted 4 lines
Quoted 4 lines
CrashNotify
Quoted 1 line · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSR thenwe
Quoted 11 lines
Quoted 11 lines
know
Quoted 10 lines
it is crashing, so set the domain shutdown code appropriately.
Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)Quoted 5 lines
Quoted 5 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t
Quoted 5 lines
xen/arch/x86/hvm/viridian.c +0
-0@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_tval)
Quoted 13 lines
Quoted 7 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t val) · line 650
Quoted 6 lines
xen/arch/x86/hvm/viridian.c +3
-0if ( !ctl.u.CrashNotify )break ; +spin_lock (&d->shutdown_lock); + d->shutdown_code = SHUTDOWN_crash; +spin_unlock (&d->shutdown_lock);How does the domain eventually shut down?
I assume it shuts down when the guest writes to the PIIX.
Quoted 3 lines
It feels slightly odd to have
a shutdown code before the domain has finished executing code.That's the norm. The PV drivers (if they are installed) set it via a schedop.
Quoted 9 lines
Quoted 4 lines
This just makes sure it is set even if the PV drivers aren't there.
What happens if the user has configured windows to reboot after a crash?
That's exactly what this is trying to fix. Without the patch a VM without PV drivers will appear to just shut down (because nothing will set the shutdown code to anything else) so the actions-after-crash will not take effect.
Ping? Are you ok with the patch now?
Paul
Quoted 7 lines
Paul
Quoted 1 line
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 65 lines · Paul Durrant
Quoted 65 lines
-----Original Message-----
From: Xen-devel [mailto:[email protected]] On Behalf Of Paul Durrant
Sent: 23 August 2018 09:38
To: Andrew Cooper <[email protected]>; xen- [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 16 August 2018 10:40
To: Paul Durrant <[email protected]>; xen-Quoted 50 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 4 lines · Paul Durrant
Quoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 10 August 2018 16:57
To: Paul Durrant <[email protected]>; xen-Quoted 2 lines
Quoted 2 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein responseto
Quoted 4 lines
Quoted 4 lines
CrashNotify
Quoted 1 line · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSR thenwe
Quoted 11 lines
Quoted 11 lines
know
Quoted 10 lines
it is crashing, so set the domain shutdown code appropriately.
Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)Quoted 5 lines
Quoted 5 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx, uint64_t
Quoted 5 lines
xen/arch/x86/hvm/viridian.c +0
-0@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx, uint64_tval)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
xen/arch/x86/hvm/viridian.c +3
-0if ( !ctl.u.CrashNotify )break ; +spin_lock (&d->shutdown_lock); + d->shutdown_code = SHUTDOWN_crash; +spin_unlock (&d->shutdown_lock);Quoted 7 lines
Quoted 1 line
How does the domain eventually shut down?
I assume it shuts down when the guest writes to the PIIX.
Quoted 3 lines
It feels slightly odd to have
a shutdown code before the domain has finished executing code.That's the norm. The PV drivers (if they are installed) set it via a schedop.
This just makes sure it is set even if the PV drivers aren't there.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
What happens if the user has configured windows to reboot after a crash?
That's exactly what this is trying to fix. Without the patch a VM without PV drivers will appear to just shut down (because nothing will set the shutdown code to anything else) so the actions-after-crash will not take effect.
Ping? Are you ok with the patch now?
Lol - I was literally just trying to find it. I'll commit it in a moment.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 85 lines
-----Original Message-----
From: Andrew Cooper
Sent: 06 September 2018 16:33
To: Paul Durrant <[email protected]>; [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein response to CrashNotifyQuoted 2 lines · Paul Durrant
Quoted 2 lines
-----Original Message-----
From: Xen-devel [mailto:[email protected]] OnBehalf
Quoted 6 lines
Quoted 6 lines
Of Paul Durrant
Sent: 23 August 2018 09:38
To: Andrew Cooper <[email protected]>; xen- [email protected]
Cc: Jan Beulich <[email protected]>
Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: setshutdown_codein
Quoted 9 lines
Quoted 9 lines
response to CrashNotify
Quoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 16 August 2018 10:40
To: Paul Durrant <[email protected]>; xen-Quoted 2 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codein responseto
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
CrashNotify
Quoted 4 lines · Paul Durrant
Quoted 4 lines
-----Original Message-----
From: Andrew Cooper
Sent: 10 August 2018 16:57
To: Paul Durrant <[email protected]>; xen-Quoted 2 lines
Quoted 2 lines
Cc: Jan Beulich <[email protected]>
Subject: Re: [PATCH] x86/hvm/viridian: setshutdown_codeinresponse
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
to
Quoted 4 lines
Quoted 4 lines
CrashNotify
Quoted 1 line · Paul Durrant
When Windows writes the CrashNotify bit in the
CRASH_CTLMSRthen
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
we
Quoted 11 lines
Quoted 11 lines
know
Quoted 10 lines
it is crashing, so set the domain shutdown code appropriately.
Signed-off-by Paul Durrant <[email protected]>---
Cc: Jan Beulich <[email protected]>
Cc: Andrew Cooper <[email protected]>--- xen/arch/x86/hvm/viridian.c | 4 ++++ 1 file changed, 4 insertions(+)Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Review
Quoted 1 line
(quoted diff) +0
-0
b/xen/arch/x86/hvm/viridian.cQuoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
xen/arch/x86/hvm/viridian.c int wrmsr_viridian_regs(uint32_t idx,
Quoted 4 lines
index
486065182c..294cf486cc100644xen/arch/x86/hvm/viridian.c +0
-0@@ -645,6 +645,10 @@ int wrmsr_viridian_regs(uint32_t idx,
uint64_tQuoted 7 lines
Quoted 7 lines
Quoted 7 lines
val)
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
xen/arch/x86/hvm/viridian.c +3
-0if ( !ctl.u.CrashNotify )break ; +spin_lock (&d->shutdown_lock); + d->shutdown_code = SHUTDOWN_crash; +spin_unlock (&d->shutdown_lock);Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
How does the domain eventually shut down?
I assume it shuts down when the guest writes to the PIIX.
Quoted 3 lines
It feels slightly odd to have
a shutdown code before the domain has finished executing code.That's the norm. The PV drivers (if they are installed) set it via a
schedop.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
This just makes sure it is set even if the PV drivers aren't there.
What happens if the user has configured windows to reboot after a
crash?
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
That's exactly what this is trying to fix. Without the patch a VM without PV drivers will appear to just shut down (because nothing will set the
shutdown
Quoted 3 lines
Quoted 2 lines
code to anything else) so the actions-after-crash will not take effect.
Ping? Are you ok with the patch now?
Lol - I was literally just trying to find it. I'll commit it in a moment.
:-)
Quoted 1 line
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel