xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
@ 2018-08-10 15:43 Paul Durrant
  2018-08-10 15:56 ` Andrew Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Durrant @ 2018-08-10 15:43 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Paul Durrant, Jan Beulich

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>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/viridian.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
index 486065182c..294cf486cc 100644
--- a/xen/arch/x86/hvm/viridian.c
+++ b/xen/arch/x86/hvm/viridian.c
@@ -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],
-- 
2.11.0


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

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-08-10 15:43 [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify Paul Durrant
@ 2018-08-10 15:56 ` Andrew Cooper
  2018-08-10 15:59   ` Paul Durrant
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2018-08-10 15:56 UTC (permalink / raw)
  To: Paul Durrant, xen-devel; +Cc: Jan Beulich

On 10/08/18 16:43, Paul Durrant wrote:
> 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>
> ---
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>  xen/arch/x86/hvm/viridian.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
> index 486065182c..294cf486cc 100644
> --- a/xen/arch/x86/hvm/viridian.c
> +++ b/xen/arch/x86/hvm/viridian.c
> @@ -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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-08-10 15:56 ` Andrew Cooper
@ 2018-08-10 15:59   ` Paul Durrant
  2018-08-16  9:39     ` Andrew Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Durrant @ 2018-08-10 15:59 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel@lists.xenproject.org; +Cc: Jan Beulich

> -----Original Message-----
> From: Andrew Cooper
> Sent: 10 August 2018 16:57
> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-devel@lists.xenproject.org
> Cc: Jan Beulich <jbeulich@suse.com>
> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to
> CrashNotify
> 
> On 10/08/18 16:43, Paul Durrant wrote:
> > 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>
> > ---
> > Cc: Jan Beulich <jbeulich@suse.com>
> > Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> > ---
> >  xen/arch/x86/hvm/viridian.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
> > index 486065182c..294cf486cc 100644
> > --- a/xen/arch/x86/hvm/viridian.c
> > +++ b/xen/arch/x86/hvm/viridian.c
> > @@ -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?

I assume it shuts down when the guest writes to the PIIX.

>  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

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

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-08-10 15:59   ` Paul Durrant
@ 2018-08-16  9:39     ` Andrew Cooper
  2018-08-23  8:38       ` Paul Durrant
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2018-08-16  9:39 UTC (permalink / raw)
  To: Paul Durrant, xen-devel@lists.xenproject.org; +Cc: Jan Beulich

On 10/08/18 16:59, Paul Durrant wrote:
>> -----Original Message-----
>> From: Andrew Cooper
>> Sent: 10 August 2018 16:57
>> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-devel@lists.xenproject.org
>> Cc: Jan Beulich <jbeulich@suse.com>
>> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to
>> CrashNotify
>>
>> On 10/08/18 16:43, Paul Durrant wrote:
>>> 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>
>>> ---
>>> Cc: Jan Beulich <jbeulich@suse.com>
>>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>>> ---
>>>  xen/arch/x86/hvm/viridian.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
>>> index 486065182c..294cf486cc 100644
>>> --- a/xen/arch/x86/hvm/viridian.c
>>> +++ b/xen/arch/x86/hvm/viridian.c
>>> @@ -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?
> I assume it shuts down when the guest writes to the PIIX.
>
>>   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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-08-16  9:39     ` Andrew Cooper
@ 2018-08-23  8:38       ` Paul Durrant
  2018-09-06 15:32         ` Paul Durrant
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Durrant @ 2018-08-23  8:38 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel@lists.xenproject.org; +Cc: Jan Beulich

> -----Original Message-----
> From: Andrew Cooper
> Sent: 16 August 2018 10:40
> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-devel@lists.xenproject.org
> Cc: Jan Beulich <jbeulich@suse.com>
> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to
> CrashNotify
> 
> On 10/08/18 16:59, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Andrew Cooper
> >> Sent: 10 August 2018 16:57
> >> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> devel@lists.xenproject.org
> >> Cc: Jan Beulich <jbeulich@suse.com>
> >> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response
> to
> >> CrashNotify
> >>
> >> On 10/08/18 16:43, Paul Durrant wrote:
> >>> 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>
> >>> ---
> >>> Cc: Jan Beulich <jbeulich@suse.com>
> >>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> >>> ---
> >>>  xen/arch/x86/hvm/viridian.c | 4 ++++
> >>>  1 file changed, 4 insertions(+)
> >>>
> >>> diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
> >>> index 486065182c..294cf486cc 100644
> >>> --- a/xen/arch/x86/hvm/viridian.c
> >>> +++ b/xen/arch/x86/hvm/viridian.c
> >>> @@ -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?
> > I assume it shuts down when the guest writes to the PIIX.
> >
> >>   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

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

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-08-23  8:38       ` Paul Durrant
@ 2018-09-06 15:32         ` Paul Durrant
  2018-09-06 15:32           ` Andrew Cooper
  0 siblings, 1 reply; 8+ messages in thread
From: Paul Durrant @ 2018-09-06 15:32 UTC (permalink / raw)
  To: Paul Durrant, Andrew Cooper, xen-devel@lists.xenproject.org; +Cc: Jan Beulich

> -----Original Message-----
> From: Xen-devel [mailto:xen-devel-bounces@lists.xenproject.org] On Behalf
> Of Paul Durrant
> Sent: 23 August 2018 09:38
> To: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-
> devel@lists.xenproject.org
> Cc: Jan Beulich <jbeulich@suse.com>
> Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: set shutdown_code in
> response to CrashNotify
> 
> > -----Original Message-----
> > From: Andrew Cooper
> > Sent: 16 August 2018 10:40
> > To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> devel@lists.xenproject.org
> > Cc: Jan Beulich <jbeulich@suse.com>
> > Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to
> > CrashNotify
> >
> > On 10/08/18 16:59, Paul Durrant wrote:
> > >> -----Original Message-----
> > >> From: Andrew Cooper
> > >> Sent: 10 August 2018 16:57
> > >> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> > devel@lists.xenproject.org
> > >> Cc: Jan Beulich <jbeulich@suse.com>
> > >> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response
> > to
> > >> CrashNotify
> > >>
> > >> On 10/08/18 16:43, Paul Durrant wrote:
> > >>> 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>
> > >>> ---
> > >>> Cc: Jan Beulich <jbeulich@suse.com>
> > >>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> > >>> ---
> > >>>  xen/arch/x86/hvm/viridian.c | 4 ++++
> > >>>  1 file changed, 4 insertions(+)
> > >>>
> > >>> diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
> > >>> index 486065182c..294cf486cc 100644
> > >>> --- a/xen/arch/x86/hvm/viridian.c
> > >>> +++ b/xen/arch/x86/hvm/viridian.c
> > >>> @@ -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?
> > > I assume it shuts down when the guest writes to the PIIX.
> > >
> > >>   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.
> 

Ping? Are you ok with the patch now?

  Paul

>   Paul
> 
> > ~Andrew
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-09-06 15:32         ` Paul Durrant
@ 2018-09-06 15:32           ` Andrew Cooper
  2018-09-06 15:34             ` Paul Durrant
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Cooper @ 2018-09-06 15:32 UTC (permalink / raw)
  To: Paul Durrant, xen-devel@lists.xenproject.org; +Cc: Jan Beulich

On 06/09/18 16:32, Paul Durrant wrote:
>> -----Original Message-----
>> From: Xen-devel [mailto:xen-devel-bounces@lists.xenproject.org] On Behalf
>> Of Paul Durrant
>> Sent: 23 August 2018 09:38
>> To: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-
>> devel@lists.xenproject.org
>> Cc: Jan Beulich <jbeulich@suse.com>
>> Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: set shutdown_code in
>> response to CrashNotify
>>
>>> -----Original Message-----
>>> From: Andrew Cooper
>>> Sent: 16 August 2018 10:40
>>> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
>> devel@lists.xenproject.org
>>> Cc: Jan Beulich <jbeulich@suse.com>
>>> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to
>>> CrashNotify
>>>
>>> On 10/08/18 16:59, Paul Durrant wrote:
>>>>> -----Original Message-----
>>>>> From: Andrew Cooper
>>>>> Sent: 10 August 2018 16:57
>>>>> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
>>> devel@lists.xenproject.org
>>>>> Cc: Jan Beulich <jbeulich@suse.com>
>>>>> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response
>>> to
>>>>> CrashNotify
>>>>>
>>>>> On 10/08/18 16:43, Paul Durrant wrote:
>>>>>> 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>
>>>>>> ---
>>>>>> Cc: Jan Beulich <jbeulich@suse.com>
>>>>>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
>>>>>> ---
>>>>>>  xen/arch/x86/hvm/viridian.c | 4 ++++
>>>>>>  1 file changed, 4 insertions(+)
>>>>>>
>>>>>> diff --git a/xen/arch/x86/hvm/viridian.c b/xen/arch/x86/hvm/viridian.c
>>>>>> index 486065182c..294cf486cc 100644
>>>>>> --- a/xen/arch/x86/hvm/viridian.c
>>>>>> +++ b/xen/arch/x86/hvm/viridian.c
>>>>>> @@ -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?
>>>> I assume it shuts down when the guest writes to the PIIX.
>>>>
>>>>>   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.
>>
> 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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
  2018-09-06 15:32           ` Andrew Cooper
@ 2018-09-06 15:34             ` Paul Durrant
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Durrant @ 2018-09-06 15:34 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel@lists.xenproject.org; +Cc: Jan Beulich

> -----Original Message-----
> From: Andrew Cooper
> Sent: 06 September 2018 16:33
> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-devel@lists.xenproject.org
> Cc: Jan Beulich <jbeulich@suse.com>
> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to
> CrashNotify
> 
> On 06/09/18 16:32, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Xen-devel [mailto:xen-devel-bounces@lists.xenproject.org] On
> Behalf
> >> Of Paul Durrant
> >> Sent: 23 August 2018 09:38
> >> To: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-
> >> devel@lists.xenproject.org
> >> Cc: Jan Beulich <jbeulich@suse.com>
> >> Subject: Re: [Xen-devel] [PATCH] x86/hvm/viridian: set shutdown_code
> in
> >> response to CrashNotify
> >>
> >>> -----Original Message-----
> >>> From: Andrew Cooper
> >>> Sent: 16 August 2018 10:40
> >>> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> >> devel@lists.xenproject.org
> >>> Cc: Jan Beulich <jbeulich@suse.com>
> >>> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response
> to
> >>> CrashNotify
> >>>
> >>> On 10/08/18 16:59, Paul Durrant wrote:
> >>>>> -----Original Message-----
> >>>>> From: Andrew Cooper
> >>>>> Sent: 10 August 2018 16:57
> >>>>> To: Paul Durrant <Paul.Durrant@citrix.com>; xen-
> >>> devel@lists.xenproject.org
> >>>>> Cc: Jan Beulich <jbeulich@suse.com>
> >>>>> Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in
> response
> >>> to
> >>>>> CrashNotify
> >>>>>
> >>>>> On 10/08/18 16:43, Paul Durrant wrote:
> >>>>>> 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>
> >>>>>> ---
> >>>>>> Cc: Jan Beulich <jbeulich@suse.com>
> >>>>>> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> >>>>>> ---
> >>>>>>  xen/arch/x86/hvm/viridian.c | 4 ++++
> >>>>>>  1 file changed, 4 insertions(+)
> >>>>>>
> >>>>>> diff --git a/xen/arch/x86/hvm/viridian.c
> b/xen/arch/x86/hvm/viridian.c
> >>>>>> index 486065182c..294cf486cc 100644
> >>>>>> --- a/xen/arch/x86/hvm/viridian.c
> >>>>>> +++ b/xen/arch/x86/hvm/viridian.c
> >>>>>> @@ -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?
> >>>> I assume it shuts down when the guest writes to the PIIX.
> >>>>
> >>>>>   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.
> >>
> > 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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-09-06 15:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-10 15:43 [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify Paul Durrant
2018-08-10 15:56 ` Andrew Cooper
2018-08-10 15:59   ` Paul Durrant
2018-08-16  9:39     ` Andrew Cooper
2018-08-23  8:38       ` Paul Durrant
2018-09-06 15:32         ` Paul Durrant
2018-09-06 15:32           ` Andrew Cooper
2018-09-06 15:34             ` Paul Durrant

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).