From: Marc Zyngier <maz@kernel.org>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Suleiman Souhlal <suleiman@google.com>,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2 2/2] kvm: x86: implement KVM PM-notifier
Date: Sat, 05 Jun 2021 11:15:51 +0100 [thread overview]
Message-ID: <87im2sty5k.wl-maz@kernel.org> (raw)
In-Reply-To: <YLtL/JPvGs2efZKO@google.com>
On Sat, 05 Jun 2021 11:03:40 +0100,
Sergey Senozhatsky <senozhatsky@chromium.org> wrote:
>
> On (21/06/05 18:58), Sergey Senozhatsky wrote:
> [..]
> > > > +static int kvm_arch_suspend_notifier(struct kvm *kvm)
> > > > +{
> > > > + struct kvm_vcpu *vcpu;
> > > > + int i, ret;
> > > > +
> > > > + mutex_lock(&kvm->lock);
> > > > + kvm_for_each_vcpu(i, vcpu, kvm) {
> > > > + ret = kvm_set_guest_paused(vcpu);
> > > > + if (ret) {
> > > > + pr_err("Failed to pause guest VCPU%d: %d\n",
> > > > + vcpu->vcpu_id, ret);
> > >
> > > Is it really a good idea to fail suspend when a guest doesn't have PV
> > > time enabled? I also wonder how useful the pr_err() is, given that it
> > > contains no information that would help identifying which guest failed
> > > to pause.
> >
> > No opinion. What shall we do when we fail to suspend the VM?
> > VM's watchdogs will trigger and maybe panic the system after
> > resume.
Panic the guest, maybe. Panic the host, surely not? You cannot decide
what the guest uses or doesn't use anyway, so that's out of your
hands. I don't think this should prevent the host from suspending, in
any case.
> For the time being kvm_set_guest_paused() errors out when
> !vcpu->arch.pv_time_enabled, but this probably can change in the
> future (who knows?). So shall I check vcpu->arch.pv_time_enabled in
> kvm_arch_suspend_notifier()?
That, or check for the -EINVAL return value.
M.
--
Without deviation from the norm, progress is not possible.
next prev parent reply other threads:[~2021-06-05 10:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-05 2:30 [PATCHv2 1/2] kvm: add PM-notifier Sergey Senozhatsky
2021-06-05 2:30 ` [PATCHv2 2/2] kvm: x86: implement KVM PM-notifier Sergey Senozhatsky
2021-06-05 9:00 ` Marc Zyngier
2021-06-05 9:58 ` Sergey Senozhatsky
2021-06-05 10:03 ` Sergey Senozhatsky
2021-06-05 10:15 ` Marc Zyngier [this message]
2021-06-05 10:26 ` Sergey Senozhatsky
2021-06-05 10:48 ` Sergey Senozhatsky
2021-06-05 11:27 ` Marc Zyngier
2021-06-05 11:32 ` Sergey Senozhatsky
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=87im2sty5k.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=senozhatsky@chromium.org \
--cc=suleiman@google.com \
--cc=vkuznets@redhat.com \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.