]> Git Repo - linux.git/commitdiff
x86/apic: Only disable CPU x2apic mode when necessary
authorJiang Liu <[email protected]>
Wed, 7 Jan 2015 07:31:38 +0000 (15:31 +0800)
committerThomas Gleixner <[email protected]>
Thu, 15 Jan 2015 10:24:23 +0000 (11:24 +0100)
When interrupt remapping hardware is not in X2APIC, CPU X2APIC mode
will be disabled if:
1) Maximum CPU APIC ID is bigger than 255
2) hypervisior doesn't support x2apic mode.

But we should only check whether hypervisor supports X2APIC mode when
hypervisor(CONFIG_HYPERVISOR_GUEST) is enabled, otherwise X2APIC will
always be disabled when CONFIG_HYPERVISOR_GUEST is disabled and IR
doesn't work in X2APIC mode.

Signed-off-by: Jiang Liu <[email protected]>
Tested-by: Joerg Roedel <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: [email protected]
Cc: H. Peter Anvin <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: HATAYAMA Daisuke <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Oren Twaig <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
arch/x86/kernel/apic/apic.c

index 04aec6bc7481d791ce7d8b1160887463925eef5c..2f16116ced90e72161bad3965e51a96f4009074f 100644 (file)
@@ -1601,7 +1601,8 @@ static __init void try_to_enable_x2apic(int ir_stat)
                 * under KVM
                 */
                if (max_physical_apicid > 255 ||
-                   !hypervisor_x2apic_available()) {
+                   (IS_ENABLED(CONFIG_HYPERVISOR_GUEST) &&
+                    !hypervisor_x2apic_available())) {
                        pr_info("IRQ remapping doesn't support X2APIC mode, disable x2apic.\n");
                        if (x2apic_preenabled)
                                disable_x2apic();
This page took 0.060896 seconds and 4 git commands to generate.