linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "Limonciello, Mario" <mario.limonciello@amd.com>
Cc: Grzegorz Jaszczyk <jaz@semihalf.com>,
	linux-kernel@vger.kernel.org, Dmytro Maluka <dmy@semihalf.com>,
	Zide Chen <zide.chen@intel.corp-partner.google.com>,
	Peter Fang <peter.fang@intel.corp-partner.google.com>,
	Tomasz Nowicki <tn@semihalf.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Ashish Kalra <ashish.kalra@amd.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Sachi King <nakato@nakato.io>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	David Dunn <daviddunn@google.com>,
	Wei Wang <wei.w.wang@intel.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	"open list:KERNEL VIRTUAL MACHINE (KVM)" <kvm@vger.kernel.org>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	"open list:ACPI" <linux-acpi@vger.kernel.org>,
	"open list:HIBERNATION (aka Software Suspend,
	aka swsusp)"  <linux-pm@vger.kernel.org>,
	Dominik Behr <dbehr@google.com>,
	Dmitry Torokhov <dtor@google.com>
Subject: Re: [PATCH 1/2] x86: notify hypervisor about guest entering s2idle state
Date: Thu, 23 Jun 2022 16:47:31 +0000	[thread overview]
Message-ID: <YrSZIxfWUJoQqEt/@google.com> (raw)
In-Reply-To: <7c428b03-261f-78cb-4ce3-5949ac93f028@amd.com>

On Wed, Jun 22, 2022, Limonciello, Mario wrote:
> On 6/22/2022 04:53, Grzegorz Jaszczyk wrote:
> > It will be problematic since the abort/restore notification could
> > arrive too late and therefore the whole system will go to suspend
> > thinking that the guest is in desired s2ilde state. Also in this case
> > it would be impossible to prevent races and actually making sure that
> > the guest is suspended or not. We already had similar discussion with
> > Sean earlier in this thread why the notification have to be send just
> > before swait_event_exclusive(s2idle_wait_head, s2idle_state ==
> > S2IDLE_STATE_WAKE) and that the VMM have to have control over guest
> > resumption.
> > 
> > Nevertheless if extending acpi_s2idle_dev_ops is possible, why not
> > extend it about the hypervisor_notify() and use it in the same place
> > where the hypercall is used in this patch? Do you see any issue with
> > that?
> 
> If this needs to be a hypercall and the hypercall needs to go at that
> specific time, I wouldn't bother with extending acpi_s2idle_dev_ops. The
> whole idea there was that this would be less custom and could follow a spec.

It doesn't need to be a hypercall though.  PIO and MMIO provide the same "exit to
host userspace" behavior, and there is zero reason to get KVM involved since KVM
(on x86) doesn't deal with platform scoped power management.

I get that squeezing this into the ACPI device model is awkward, but forcing KVM
into the picture isn't any better.

> TBH - given the strong dependency on being the very last command and this
> being all Linux specific (you won't need to do something similar with
> Windows) - I think the way you already did it makes the most sense.
> It seems to me the ACPI device model doesn't really work well for this
> scenario.

  reply	other threads:[~2022-06-23 16:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09 11:03 [PATCH 0/2] x86: notify hypervisor/VMM about guest entering s2idle Grzegorz Jaszczyk
2022-06-09 11:03 ` [PATCH 1/2] x86: notify hypervisor about guest entering s2idle state Grzegorz Jaszczyk
2022-06-09 14:27   ` Dave Hansen
2022-06-10 11:36     ` Grzegorz Jaszczyk
2022-06-10 12:49       ` Dave Hansen
2022-06-13  5:03         ` Mario Limonciello
2022-06-15 18:00           ` Grzegorz Jaszczyk
2022-06-09 14:55   ` Sean Christopherson
2022-06-10 12:26     ` Grzegorz Jaszczyk
2022-06-10 14:29       ` Sean Christopherson
2022-06-15 18:53         ` Grzegorz Jaszczyk
2022-06-16 16:48           ` Sean Christopherson
2022-06-16 16:58             ` Limonciello, Mario
2022-06-20 15:43               ` Grzegorz Jaszczyk
2022-06-20 16:32                 ` Limonciello, Mario
2022-06-22  9:53                   ` Grzegorz Jaszczyk
2022-06-22 21:50                     ` Limonciello, Mario
2022-06-23 16:47                       ` Sean Christopherson [this message]
2022-06-23 16:50                       ` Grzegorz Jaszczyk
2022-06-23 17:19                         ` Limonciello, Mario
2022-06-09 11:03 ` [PATCH 2/2] KVM: x86: notify user space about guest entering s2idle Grzegorz Jaszczyk

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=YrSZIxfWUJoQqEt/@google.com \
    --to=seanjc@google.com \
    --cc=acme@redhat.com \
    --cc=ashish.kalra@amd.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=daviddunn@google.com \
    --cc=dbehr@google.com \
    --cc=dmy@semihalf.com \
    --cc=dtor@google.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jaz@semihalf.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=nakato@nakato.io \
    --cc=npiggin@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=pbonzini@redhat.com \
    --cc=peter.fang@intel.corp-partner.google.com \
    --cc=rafael@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tn@semihalf.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=wei.w.wang@intel.com \
    --cc=x86@kernel.org \
    --cc=zide.chen@intel.corp-partner.google.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).