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@xxxxxxxxxxxx> > --- > 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.