All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH] x86/hvm: make ACPI PM timer support optional
@ 2024-09-16  6:37 Sergiy Kibrik
  2024-09-16  7:44 ` Roger Pau Monné
  0 siblings, 1 reply; 14+ messages in thread
From: Sergiy Kibrik @ 2024-09-16  6:37 UTC (permalink / raw)
  To: xen-devel
  Cc: Sergiy Kibrik, Jan Beulich, Andrew Cooper, Roger Pau Monné,
	Stefano Stabellini

Introduce config option X86_PMTIMER so that pmtimer driver can be disabled on
systems that don't need it.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/Kconfig               |  9 +++++++++
 xen/arch/x86/hvm/Makefile          |  2 +-
 xen/arch/x86/include/asm/acpi.h    |  5 +++++
 xen/arch/x86/include/asm/hvm/vpt.h | 10 ++++++++++
 4 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 62f0b5e0f4..0a762be14e 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -385,6 +385,15 @@ config ALTP2M
 
 	  If unsure, stay with defaults.
 
+config X86_PMTIMER
+	bool "ACPI PM timer emulation support" if EXPERT
+	default y
+	depends on HVM
+	help
+	  Build pmtimer driver that emulates ACPI PM timer for HVM guests.
+
+	  If unsure, say Y.
+
 endmenu
 
 source "common/Kconfig"
diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile
index 4c1fa5c6c2..321241f0bf 100644
--- a/xen/arch/x86/hvm/Makefile
+++ b/xen/arch/x86/hvm/Makefile
@@ -18,7 +18,7 @@ obj-y += irq.o
 obj-y += monitor.o
 obj-y += mtrr.o
 obj-y += nestedhvm.o
-obj-y += pmtimer.o
+obj-$(CONFIG_X86_PMTIMER) += pmtimer.o
 obj-y += quirks.o
 obj-y += rtc.o
 obj-y += save.o
diff --git a/xen/arch/x86/include/asm/acpi.h b/xen/arch/x86/include/asm/acpi.h
index 217819dd61..8d92014ae9 100644
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -150,8 +150,13 @@ void acpi_mmcfg_init(void);
 /* Incremented whenever we transition through S3. Value is 1 during boot. */
 extern uint32_t system_reset_counter;
 
+#ifdef CONFIG_X86_PMTIMER
 void hvm_acpi_power_button(struct domain *d);
 void hvm_acpi_sleep_button(struct domain *d);
+#else
+static inline void hvm_acpi_power_button(struct domain *d) {}
+static inline void hvm_acpi_sleep_button(struct domain *d) {}
+#endif
 
 /* suspend/resume */
 void save_rest_processor_state(void);
diff --git a/xen/arch/x86/include/asm/hvm/vpt.h b/xen/arch/x86/include/asm/hvm/vpt.h
index 0b92b28625..333b346068 100644
--- a/xen/arch/x86/include/asm/hvm/vpt.h
+++ b/xen/arch/x86/include/asm/hvm/vpt.h
@@ -187,10 +187,20 @@ void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
 
+#ifdef CONFIG_X86_PMTIMER
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);
 void pmtimer_reset(struct domain *d);
 int pmtimer_change_ioport(struct domain *d, uint64_t version);
+#else
+static inline void pmtimer_init(struct vcpu *v) {}
+static inline void pmtimer_deinit(struct domain *d) {}
+static inline void pmtimer_reset(struct domain *d) {}
+static inline int pmtimer_change_ioport(struct domain *d, uint64_t version)
+{
+    return -ENODEV;
+}
+#endif
 
 void hpet_init(struct domain *d);
 void hpet_deinit(struct domain *d);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-10-03 10:52 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-16  6:37 [XEN PATCH] x86/hvm: make ACPI PM timer support optional Sergiy Kibrik
2024-09-16  7:44 ` Roger Pau Monné
2024-09-16 19:57   ` Stefano Stabellini
2024-09-18  9:29     ` Sergiy Kibrik
2024-09-18  9:41       ` Roger Pau Monné
2024-09-18 13:35         ` Sergiy Kibrik
2024-09-18 13:56           ` Roger Pau Monné
2024-09-23 10:01           ` Jan Beulich
2024-09-27  9:42             ` Sergiy Kibrik
2024-09-27  9:44               ` Jan Beulich
2024-09-30 11:03                 ` Sergiy Kibrik
2024-09-30 11:27                   ` Jan Beulich
2024-09-30 11:33                     ` Andrew Cooper
2024-10-03 10:52                       ` Sergiy Kibrik

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.