public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Grzegorz Jaszczyk <jaz@semihalf.com>
To: linux-kernel@vger.kernel.org
Cc: jaz@semihalf.com, dmy@semihalf.com, mario.limonciello@amd.com,
	seanjc@google.com, dbehr@google.com, upstream@semihalf.com,
	zide.chen@intel.corp-partner.google.com,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <markgross@kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Sachi King <nakato@nakato.io>,
	linux-acpi@vger.kernel.org (open list:ACPI),
	platform-driver-x86@vger.kernel.org (open list:X86 PLATFORM
	DRIVERS),
	linux-pm@vger.kernel.org (open list:HIBERNATION (aka Software
	Suspend, aka swsusp))
Subject: [RFC PATCH 0/2] x86: allow to notify host about guest entering s2idle
Date: Thu,  7 Jul 2022 12:53:22 +0000	[thread overview]
Message-ID: <20220707125329.378277-1-jaz@semihalf.com> (raw)

According to the mailing list discussion [1] about the preferred approach
for notifying hypervisor/VMM about guest entering s2idle state this RFC was
implemented.

Instead of original hypercall based approach, which involves KVM change [2]
and makes it hypervisor specific, implement different mechanism, which
takes advantage of MMIO/PIO trapping and makes it hypervisor independent.

Patch #1 extends S2Idle ops by new notify handler which will be invoked as
a very last command before system actually enters S2Idle states. It also
allows to register and use driver specific notification hook which is used
in patch #2.

Patch #2 introduces new driver for virtual PMC, which registers
acpi_s2idle_dev_ops's notify handler. Its implementation is based on an
ACPI _DSM evaluation, which in turn can perform MMIO access and allow to
trap and therefore notify the VMM about guest entering S2Idle state.

Please see individual patches and commit logs for more verbose description.

This patchset is marked as RFC since patch #2 implements driver for non
existing device "HYPE0001", which ACPI ID was not registered yet.
Furthermore the required registration process [3] will not be started
before getting positive feedback about this patchset.

[1] https://patchwork.kernel.org/project/linux-pm/patch/20220609110337.1238762-2-jaz@semihalf.com/
[2] https://patchwork.kernel.org/project/linux-pm/patch/20220609110337.1238762-3-jaz@semihalf.com/
[3] https://uefi.org/PNP_ACPI_Registry

Grzegorz Jaszczyk (2):
  suspend: extend S2Idle ops by new notify handler
  platform/x86: Add virtual PMC driver used for S2Idle

 drivers/acpi/x86/s2idle.c       | 11 +++++
 drivers/platform/x86/Kconfig    |  7 ++++
 drivers/platform/x86/Makefile   |  1 +
 drivers/platform/x86/virt_pmc.c | 73 +++++++++++++++++++++++++++++++++
 include/linux/acpi.h            |  1 +
 include/linux/suspend.h         |  1 +
 kernel/power/suspend.c          |  4 ++
 7 files changed, 98 insertions(+)
 create mode 100644 drivers/platform/x86/virt_pmc.c

-- 
2.37.0.rc0.161.g10f37bed90-goog


             reply	other threads:[~2022-07-07 12:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 12:53 Grzegorz Jaszczyk [this message]
2022-07-07 12:53 ` [RFC PATCH 1/2] suspend: extend S2Idle ops by new notify handler Grzegorz Jaszczyk
2022-07-19 18:08   ` Rafael J. Wysocki
2022-07-20 13:15     ` Grzegorz Jaszczyk
2022-07-20 15:22       ` Limonciello, Mario
2022-07-20 15:54         ` Grzegorz Jaszczyk
2022-08-22  9:26       ` Grzegorz Jaszczyk
2022-09-12 14:44         ` Grzegorz Jaszczyk
2022-11-30 12:25           ` Grzegorz Jaszczyk
2023-02-06 18:58             ` Rafael J. Wysocki
2022-07-07 12:53 ` [RFC PATCH 2/2] platform/x86: Add virtual PMC driver used for S2Idle Grzegorz Jaszczyk
2022-07-07 15:51   ` Randy Dunlap
2022-07-07 15:27 ` [RFC PATCH 0/2] x86: allow to notify host about guest entering s2idle Limonciello, Mario
2022-07-15 13:27   ` 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=20220707125329.378277-1-jaz@semihalf.com \
    --to=jaz@semihalf.com \
    --cc=dbehr@google.com \
    --cc=dmy@semihalf.com \
    --cc=hdegoede@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=markgross@kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=nakato@nakato.io \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=seanjc@google.com \
    --cc=upstream@semihalf.com \
    --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