]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
x86/jailhouse: Enable PMTIMER
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 27 Nov 2017 08:11:48 +0000 (09:11 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 14 Jan 2018 20:11:55 +0000 (21:11 +0100)
Jailhouse exposes the PMTIMER as only reference clock to all cells. Pick
up its address from the setup data. Allow to enable the Linux support of
it by relaxing its strict dependency on ACPI.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Cc: jailhouse-dev@googlegroups.com
Link: https://lkml.kernel.org/r/6d5c3fadd801eb3fba9510e2d3db14a9c404a1a0.1511770314.git.jan.kiszka@siemens.com
arch/x86/Kconfig
arch/x86/kernel/jailhouse.c
drivers/acpi/Kconfig

index fbea8d15fcfbb6adb2cdffe9c35c5f8fd3d23d7c..a936e29245d0a8cbe4856229201f56d5f0bc106f 100644 (file)
@@ -799,6 +799,7 @@ config PARAVIRT_CLOCK
 config JAILHOUSE_GUEST
        bool "Jailhouse non-root cell support"
        depends on X86_64
+       select X86_PM_TIMER
        ---help---
          This option allows to run Linux as guest in a Jailhouse non-root
          cell. You can leave this option disabled if you only want to start
index 57f49963d8dcbafb4a4e78a96f200323c49c70c1..21c107770d6747208b85a273be0f2bcaca89127d 100644 (file)
@@ -8,6 +8,7 @@
  *  Jan Kiszka <jan.kiszka@siemens.com>
  */
 
+#include <linux/acpi_pmtmr.h>
 #include <linux/kernel.h>
 #include <asm/apic.h>
 #include <asm/cpu.h>
@@ -91,6 +92,9 @@ static void __init jailhouse_init_platform(void)
 
        if (setup_data.compatible_version > JAILHOUSE_SETUP_REQUIRED_VERSION)
                panic("Jailhouse: Unsupported setup data structure");
+
+       pmtmr_ioport = setup_data.pm_timer_address;
+       pr_debug("Jailhouse: PM-Timer IO Port: %#x\n", pmtmr_ioport);
 }
 
 bool jailhouse_paravirt(void)
index 46505396869e615e17809d06ecac974798c39e51..d650c5b6ec90c8f07a4ac36565fdaceed7cc1f3b 100644 (file)
@@ -361,22 +361,6 @@ config ACPI_PCI_SLOT
          i.e., segment/bus/device/function tuples, with physical slots in
          the system.  If you are unsure, say N.
 
-config X86_PM_TIMER
-       bool "Power Management Timer Support" if EXPERT
-       depends on X86
-       default y
-       help
-         The Power Management Timer is available on all ACPI-capable,
-         in most cases even if ACPI is unusable or blacklisted.
-
-         This timing source is not affected by power management features
-         like aggressive processor idling, throttling, frequency and/or
-         voltage scaling, unlike the commonly used Time Stamp Counter
-         (TSC) timing source.
-
-         You should nearly always say Y here because many modern
-         systems require this timer. 
-
 config ACPI_CONTAINER
        bool "Container and Module Devices"
        default (ACPI_HOTPLUG_MEMORY || ACPI_HOTPLUG_CPU)
@@ -564,3 +548,19 @@ config TPS68470_PMIC_OPREGION
          using this, are probed.
 
 endif  # ACPI
+
+config X86_PM_TIMER
+       bool "Power Management Timer Support" if EXPERT
+       depends on X86 && (ACPI || JAILHOUSE_GUEST)
+       default y
+       help
+         The Power Management Timer is available on all ACPI-capable,
+         in most cases even if ACPI is unusable or blacklisted.
+
+         This timing source is not affected by power management features
+         like aggressive processor idling, throttling, frequency and/or
+         voltage scaling, unlike the commonly used Time Stamp Counter
+         (TSC) timing source.
+
+         You should nearly always say Y here because many modern
+         systems require this timer.