qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Thomas Huth <thuth@redhat.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v1] s390x/tod: properly stop the KVM TOD while the guest is not running
Date: Tue, 27 Nov 2018 13:59:59 +0100	[thread overview]
Message-ID: <2a028560-064c-b397-a318-0ec279d03a9d@redhat.com> (raw)
In-Reply-To: <f31fb9d1-d1dd-7d06-7993-08e44bb77632@de.ibm.com>

On 27.11.18 13:43, Christian Borntraeger wrote:
> On 27.11.2018 12:41, David Hildenbrand wrote:
>> Just like on other architectures, we should stop the clock while the guest
>> is not running. This is already properly done for TCG. Right now, doing an
>> offline migration (stop, migrate, cont) can easily trigger stalls in the
>> guest.
>>
>> Even doing a
>>     (hmp) stop
>>     ... wait 2 minutes ...
>>     (hmp) cont
>> will already trigger stalls.
>>
>> So whenever the guest stops, backup the KVM TOD. When continuning to run
>> the guest, restore the KVM TOD.
> 
> We do a similar thing for managedsave so it probably makes sense to solve
> the stall warnings. Now: At the same time, we actually want to have the guest
> see the real time and maybe even share the TOD clock with the host in some
> way, while at the same time avoid the stall warnings.

managedsave works right now because we save/restore the TOD. Making the
guest TOD jump is never a good idea. At least not blindly (as you
mention below, special SCLP signals eventually).

> 
> One idea is to signal the guest on migration (and stop start events) and let
> the guest do a time sync with the host.

Doing so on stop events will most likely kill the ability to debug (e.g.
single step) your guest. You will trap into the SCLP signal handler in
the guest all the time. I don't think this is a good idea for the
general case. It might be for migration. We might instead want to handle
this in KVM directly and not in QEMU.

> In fact, it seems that by architecture we need to signal a special sclp signal 
> anyway if stsi information would change (e.g. on migration). Maybe we can 
> piggyback on that and do some time sync interface in the future.

I like the idea but I rather consider it an addon feature and that
shouldn't be the default.

As SCLP documentation is (as far as I know, please correct me if I am
wrong) not publicly available, I suggest going ahead with what I propose
here (what other architectures do) and implementing what you describe on
top later.

Thanks!

-- 

Thanks,

David / dhildenb

  parent reply	other threads:[~2018-11-27 13:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 11:41 [Qemu-devel] [PATCH v1] s390x/tod: properly stop the KVM TOD while the guest is not running David Hildenbrand
2018-11-27 12:19 ` Thomas Huth
2018-11-27 12:50   ` David Hildenbrand
2018-11-27 13:03     ` Thomas Huth
2018-11-27 12:38 ` Cornelia Huck
2018-11-27 12:50   ` David Hildenbrand
2018-11-27 13:17   ` David Hildenbrand
2018-11-27 12:43 ` Christian Borntraeger
2018-11-27 12:48   ` Cornelia Huck
2018-11-27 12:59   ` David Hildenbrand [this message]
2018-11-27 13:06   ` Thomas Huth
2018-11-27 13:11     ` Christian Borntraeger
2018-11-27 13:16     ` David Hildenbrand

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=2a028560-064c-b397-a318-0ec279d03a9d@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=thuth@redhat.com \
    /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).