Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / x86 / kernel / apic / apic_flat_64.c
index f58a49769bc6be706fc5335658407f49aa1276dc..e84c9eb4e5b414a8e1ba2a094c19a1c0e22a177c 100644 (file)
@@ -19,6 +19,7 @@
 #include <asm/smp.h>
 #include <asm/apic.h>
 #include <asm/ipi.h>
+#include <asm/jailhouse_para.h>
 
 #include <linux/acpi.h>
 
@@ -147,7 +148,7 @@ static struct apic apic_flat __ro_after_init = {
        .apic_id_valid                  = default_apic_id_valid,
        .apic_id_registered             = flat_apic_id_registered,
 
-       .irq_delivery_mode              = dest_LowestPrio,
+       .irq_delivery_mode              = dest_Fixed,
        .irq_dest_mode                  = 1, /* logical */
 
        .disable_esr                    = 0,
@@ -214,6 +215,15 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
        return 0;
 }
 
+static void physflat_init_apic_ldr(void)
+{
+       /*
+        * LDR and DFR are not involved in physflat mode, rather:
+        * "In physical destination mode, the destination processor is
+        * specified by its local APIC ID [...]." (Intel SDM, 10.6.2.1)
+        */
+}
+
 static void physflat_send_IPI_allbutself(int vector)
 {
        default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
@@ -226,7 +236,8 @@ static void physflat_send_IPI_all(int vector)
 
 static int physflat_probe(void)
 {
-       if (apic == &apic_physflat || num_possible_cpus() > 8)
+       if (apic == &apic_physflat || num_possible_cpus() > 8 ||
+           jailhouse_paravirt())
                return 1;
 
        return 0;
@@ -247,8 +258,7 @@ static struct apic apic_physflat __ro_after_init = {
        .dest_logical                   = 0,
        .check_apicid_used              = NULL,
 
-       /* not needed, but shouldn't hurt: */
-       .init_apic_ldr                  = flat_init_apic_ldr,
+       .init_apic_ldr                  = physflat_init_apic_ldr,
 
        .ioapic_phys_id_map             = NULL,
        .setup_apic_routing             = NULL,