linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Grzegorz Jaszczyk <jaz@semihalf.com>
Cc: linux-kernel@vger.kernel.org, rafael@kernel.org,
	dmy@semihalf.com, tn@semihalf.com, dbehr@google.com,
	zide.chen@intel.corp-partner.google.com, upstream@semihalf.com,
	hdegoede@redhat.com, markgross@kernel.org, dtor@google.com,
	mario.limonciello@amd.com, linux-pm@vger.kernel.org,
	x86@kernel.org, platform-driver-x86@vger.kernel.org
Subject: Re: [RESEND RFCv2 1/1] platform/x86: Add virtual PMC driver used for S2Idle
Date: Thu, 9 Feb 2023 21:26:33 +0000	[thread overview]
Message-ID: <Y+VlCWwn35ECE9iz@google.com> (raw)
In-Reply-To: <20230209152123.3186930-2-jaz@semihalf.com>

On Thu, Feb 09, 2023, Grzegorz Jaszczyk wrote:
> Virtual PMC driver is meant for the guest VMs for the S2Idle
> notification. Its purpose is to register S2Idle dev ops check handler,
> which will evaluate ACPI _DSM just before the guest enters S2Idle power
> state.
> 
> This allows to trap on MMIO access done as a consequence of _DSM
> evaluation and therefore notify the VMM about the guest entering S2Idle
> state.
> 
> Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com>
> ---
> Changelog v1..v2:
> - Take advantage of acpi_s2idle_dev_ops's check() instead of notify()
> ---
>  drivers/platform/x86/Kconfig    |  7 ++++
>  drivers/platform/x86/Makefile   |  3 ++
>  drivers/platform/x86/virt_pmc.c | 73 +++++++++++++++++++++++++++++++++
>  3 files changed, 83 insertions(+)
>  create mode 100644 drivers/platform/x86/virt_pmc.c
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 5692385e2d26..b7c3f98031d7 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1099,6 +1099,13 @@ config WINMATE_FM07_KEYS
>  	  buttons below the display. This module adds an input device
>  	  that delivers key events when these buttons are pressed.
>  
> +config VIRT_PMC
> +	tristate "Virt PMC"

Maybe spell out "Virtual Power Management Controller"?  See below.

> +	depends on ACPI && SUSPEND

I think it makes sense to take a dependency on HYPERVISOR_GUEST.  It's not strictly
required, but taking that dependency helps clarify that this is a guest-side thing,
e.g. "virtual PMC" in KVM-land means "virtual performance monitoring counter".

And IMO, disabling HYPERVISOR_GUEST should disable these type of guest-specific
features.

  parent reply	other threads:[~2023-02-09 21:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 15:21 [RESEND RFCv2 0/1] x86: allow to notify host about guest entering s2idle Grzegorz Jaszczyk
2023-02-09 15:21 ` [RESEND RFCv2 1/1] platform/x86: Add virtual PMC driver used for S2Idle Grzegorz Jaszczyk
2023-02-09 18:05   ` Thomas Gleixner
2023-02-10 10:51     ` Grzegorz Jaszczyk
2023-02-09 18:25   ` Limonciello, Mario
2023-02-10 10:56     ` Grzegorz Jaszczyk
2023-02-09 21:26   ` Sean Christopherson [this message]
2023-02-10 10:58     ` 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=Y+VlCWwn35ECE9iz@google.com \
    --to=seanjc@google.com \
    --cc=dbehr@google.com \
    --cc=dmy@semihalf.com \
    --cc=dtor@google.com \
    --cc=hdegoede@redhat.com \
    --cc=jaz@semihalf.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=tn@semihalf.com \
    --cc=upstream@semihalf.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).