[tip:x86/platform] x86/jailhouse: Hide x2apic code when CONFIG_X86_X2APIC=n

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  be6d447e4f9c5cc6d48aabc3ec362b6a559c3fd7
Gitweb:     https://git.kernel.org/tip/be6d447e4f9c5cc6d48aabc3ec362b6a559c3fd7
Author:     Thomas Gleixner <tglx@xxxxxxxxxxxxx>
AuthorDate: Mon, 15 Jan 2018 10:24:34 +0100
Committer:  Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Mon, 15 Jan 2018 10:26:18 +0100

x86/jailhouse: Hide x2apic code when CONFIG_X86_X2APIC=n

x2apic_phys is not available when CONFIG_X86_X2APIC=n and the code is not
optimized out resulting in a build fail:

jailhouse.c: In function ‘jailhouse_get_smp_config’:
jailhouse.c:73:3: error: ‘x2apic_phys’ undeclared (first use in this function)

Fixes: 11c8dc419bbc ("x86/jailhouse: Enable APIC and SMP support")
Reported-by: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
Cc: jailhouse-dev@xxxxxxxxxxxxxxxx
---
 arch/x86/kernel/jailhouse.c | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/arch/x86/kernel/jailhouse.c b/arch/x86/kernel/jailhouse.c
index d6d5976..7ade152 100644
--- a/arch/x86/kernel/jailhouse.c
+++ b/arch/x86/kernel/jailhouse.c
@@ -52,6 +52,24 @@ static unsigned long jailhouse_get_tsc(void)
 	return precalibrated_tsc_khz;
 }
 
+static void __init jailhouse_x2apic_init(void)
+{
+#ifdef CONFIG_X86_X2APIC
+	if (!x2apic_enabled())
+		return;
+	/*
+	 * We do not have access to IR inside Jailhouse non-root cells.  So
+	 * we have to run in physical mode.
+	 */
+	x2apic_phys = 1;
+	/*
+	 * This will trigger the switch to apic_x2apic_phys.  Empty OEM IDs
+	 * ensure that only this APIC driver picks up the call.
+	 */
+	default_acpi_madt_oem_check("", "");
+#endif
+}
+
 static void __init jailhouse_get_smp_config(unsigned int early)
 {
 	struct ioapic_domain_cfg ioapic_cfg = {
@@ -65,20 +83,7 @@ static void __init jailhouse_get_smp_config(unsigned int early)
 	};
 	unsigned int cpu;
 
-	if (x2apic_enabled()) {
-		/*
-		 * We do not have access to IR inside Jailhouse non-root cells.
-		 * So we have to run in physical mode.
-		 */
-		x2apic_phys = 1;
-
-		/*
-		 * This will trigger the switch to apic_x2apic_phys.
-		 * Empty OEM IDs ensure that only this APIC driver picks up
-		 * the call.
-		 */
-		default_acpi_madt_oem_check("", "");
-	}
+	jailhouse_x2apic_init();
 
 	register_lapic_address(0xfee00000);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux