xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Paul Durrant <Paul.Durrant@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] x86/hvm/viridian: set shutdown_code in response to CrashNotify
Date: Thu, 16 Aug 2018 10:39:37 +0100	[thread overview]
Message-ID: <9560c716-dbfe-72b1-e922-68f99d2be9f8@citrix.com> (raw)
In-Reply-To: <1af7af3a96b94f5f893f7f1ca91e8972@AMSPEX02CL03.citrite.net>

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

  reply	other threads:[~2018-08-16  9:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9560c716-dbfe-72b1-e922-68f99d2be9f8@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Paul.Durrant@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).