]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'linus' into x86/apic
authorThomas Gleixner <tglx@linutronix.de>
Sat, 19 Dec 2015 10:03:18 +0000 (11:03 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 19 Dec 2015 10:03:18 +0000 (11:03 +0100)
Pull in update changes so we can apply conflicting patches

13 files changed:
arch/x86/include/asm/apic.h
arch/x86/include/asm/ipi.h
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/apic_flat_64.c
arch/x86/kernel/apic/apic_noop.c
arch/x86/kernel/apic/apic_numachip.c
arch/x86/kernel/apic/bigsmp_32.c
arch/x86/kernel/apic/ipi.c
arch/x86/kernel/apic/probe_32.c
arch/x86/kernel/apic/x2apic_cluster.c
arch/x86/kernel/apic/x2apic_phys.c
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/smp.c

index a30316bf801ab9da14753425de67670f71feece0..7f62ad47d7e4342f490d8daf138040f5002fc8e9 100644 (file)
@@ -303,6 +303,7 @@ struct apic {
                                      unsigned int *apicid);
 
        /* ipi */
+       void (*send_IPI)(int cpu, int vector);
        void (*send_IPI_mask)(const struct cpumask *mask, int vector);
        void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
                                         int vector);
index 615fa9061b57cde4f8cdb10ac574904eec6e1147..cfc9a0d2d07ce4b6d2bf2a3dc1aa623114eb11bb 100644 (file)
@@ -119,6 +119,8 @@ static inline void
        native_apic_mem_write(APIC_ICR, cfg);
 }
 
+extern void default_send_IPI_single(int cpu, int vector);
+extern void default_send_IPI_single_phys(int cpu, int vector);
 extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
                                                 int vector);
 extern void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
index 2f69e3b184f62c2f7e87c6956bc58fbadb711965..8d7df7478d84a093fbba232b18aa75b4e3fb03b9 100644 (file)
@@ -2270,6 +2270,7 @@ static struct {
        unsigned int apic_tmict;
        unsigned int apic_tdcr;
        unsigned int apic_thmr;
+       unsigned int apic_cmci;
 } apic_pm_state;
 
 static int lapic_suspend(void)
@@ -2299,6 +2300,10 @@ static int lapic_suspend(void)
        if (maxlvt >= 5)
                apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR);
 #endif
+#ifdef CONFIG_X86_MCE_INTEL
+       if (maxlvt >= 6)
+               apic_pm_state.apic_cmci = apic_read(APIC_LVTCMCI);
+#endif
 
        local_irq_save(flags);
        disable_local_APIC();
@@ -2355,9 +2360,13 @@ static void lapic_resume(void)
        apic_write(APIC_SPIV, apic_pm_state.apic_spiv);
        apic_write(APIC_LVT0, apic_pm_state.apic_lvt0);
        apic_write(APIC_LVT1, apic_pm_state.apic_lvt1);
-#if defined(CONFIG_X86_MCE_INTEL)
+#ifdef CONFIG_X86_THERMAL_VECTOR
        if (maxlvt >= 5)
                apic_write(APIC_LVTTHMR, apic_pm_state.apic_thmr);
+#endif
+#ifdef CONFIG_X86_MCE_INTEL
+       if (maxlvt >= 6)
+               apic_write(APIC_LVTCMCI, apic_pm_state.apic_cmci);
 #endif
        if (maxlvt >= 4)
                apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc);
index f92ab36979a207911d63bb522d45cc40d71f5a9e..9968f30cca3e187d28acf2d7631609c29cb1bcf6 100644 (file)
@@ -185,6 +185,7 @@ static struct apic apic_flat =  {
 
        .cpu_mask_to_apicid_and         = flat_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = default_send_IPI_single,
        .send_IPI_mask                  = flat_send_IPI_mask,
        .send_IPI_mask_allbutself       = flat_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = flat_send_IPI_allbutself,
@@ -230,17 +231,6 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
        return 0;
 }
 
-static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
-{
-       default_send_IPI_mask_sequence_phys(cpumask, vector);
-}
-
-static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
-                                             int vector)
-{
-       default_send_IPI_mask_allbutself_phys(cpumask, vector);
-}
-
 static void physflat_send_IPI_allbutself(int vector)
 {
        default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
@@ -248,7 +238,7 @@ static void physflat_send_IPI_allbutself(int vector)
 
 static void physflat_send_IPI_all(int vector)
 {
-       physflat_send_IPI_mask(cpu_online_mask, vector);
+       default_send_IPI_mask_sequence_phys(cpu_online_mask, vector);
 }
 
 static int physflat_probe(void)
@@ -292,8 +282,9 @@ static struct apic apic_physflat =  {
 
        .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
 
-       .send_IPI_mask                  = physflat_send_IPI_mask,
-       .send_IPI_mask_allbutself       = physflat_send_IPI_mask_allbutself,
+       .send_IPI                       = default_send_IPI_single_phys,
+       .send_IPI_mask                  = default_send_IPI_mask_sequence_phys,
+       .send_IPI_mask_allbutself       = default_send_IPI_mask_allbutself_phys,
        .send_IPI_allbutself            = physflat_send_IPI_allbutself,
        .send_IPI_all                   = physflat_send_IPI_all,
        .send_IPI_self                  = apic_send_IPI_self,
index 0d96749cfcacf4c558fc3c1163bd2825a0fa84bf..331a7a07c48fefe0313f3089c1bb497dc48cd7e4 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/e820.h>
 
 static void noop_init_apic_ldr(void) { }
+static void noop_send_IPI(int cpu, int vector) { }
 static void noop_send_IPI_mask(const struct cpumask *cpumask, int vector) { }
 static void noop_send_IPI_mask_allbutself(const struct cpumask *cpumask, int vector) { }
 static void noop_send_IPI_allbutself(int vector) { }
@@ -144,6 +145,7 @@ struct apic apic_noop = {
 
        .cpu_mask_to_apicid_and         = flat_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = noop_send_IPI,
        .send_IPI_mask                  = noop_send_IPI_mask,
        .send_IPI_mask_allbutself       = noop_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = noop_send_IPI_allbutself,
index 38dd5efdd04c33aa58b2b20b19596bcd12e3e4af..69329a6e1dc0750a68277c21a2ff6b5cb24e9f6a 100644 (file)
@@ -276,6 +276,7 @@ static const struct apic apic_numachip1 __refconst = {
 
        .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = numachip_send_IPI_one,
        .send_IPI_mask                  = numachip_send_IPI_mask,
        .send_IPI_mask_allbutself       = numachip_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = numachip_send_IPI_allbutself,
@@ -327,6 +328,7 @@ static const struct apic apic_numachip2 __refconst = {
 
        .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = numachip_send_IPI_one,
        .send_IPI_mask                  = numachip_send_IPI_mask,
        .send_IPI_mask_allbutself       = numachip_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = numachip_send_IPI_allbutself,
index 971cf8875939d1a5264a46018a7997abe0525158..cf9bd896c12d38f8ac5772a2d578fae1b68da3df 100644 (file)
@@ -96,11 +96,6 @@ static int bigsmp_phys_pkg_id(int cpuid_apic, int index_msb)
        return cpuid_apic >> index_msb;
 }
 
-static inline void bigsmp_send_IPI_mask(const struct cpumask *mask, int vector)
-{
-       default_send_IPI_mask_sequence_phys(mask, vector);
-}
-
 static void bigsmp_send_IPI_allbutself(int vector)
 {
        default_send_IPI_mask_allbutself_phys(cpu_online_mask, vector);
@@ -108,7 +103,7 @@ static void bigsmp_send_IPI_allbutself(int vector)
 
 static void bigsmp_send_IPI_all(int vector)
 {
-       bigsmp_send_IPI_mask(cpu_online_mask, vector);
+       default_send_IPI_mask_sequence_phys(cpu_online_mask, vector);
 }
 
 static int dmi_bigsmp; /* can be set by dmi scanners */
@@ -180,7 +175,8 @@ static struct apic apic_bigsmp = {
 
        .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
 
-       .send_IPI_mask                  = bigsmp_send_IPI_mask,
+       .send_IPI                       = default_send_IPI_single_phys,
+       .send_IPI_mask                  = default_send_IPI_mask_sequence_phys,
        .send_IPI_mask_allbutself       = NULL,
        .send_IPI_allbutself            = bigsmp_send_IPI_allbutself,
        .send_IPI_all                   = bigsmp_send_IPI_all,
index 62071569bd50d8137758a64be8b5b1c32329b240..eb45fc9b61248e9c9e819c974741c2652f56e644 100644 (file)
 #include <asm/proto.h>
 #include <asm/ipi.h>
 
+void default_send_IPI_single_phys(int cpu, int vector)
+{
+       unsigned long flags;
+
+       local_irq_save(flags);
+       __default_send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, cpu),
+                                     vector, APIC_DEST_PHYSICAL);
+       local_irq_restore(flags);
+}
+
 void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, int vector)
 {
        unsigned long query_cpu;
@@ -55,6 +65,14 @@ void default_send_IPI_mask_allbutself_phys(const struct cpumask *mask,
        local_irq_restore(flags);
 }
 
+/*
+ * Helper function for APICs which insist on cpumasks
+ */
+void default_send_IPI_single(int cpu, int vector)
+{
+       apic->send_IPI_mask(cpumask_of(cpu), vector);
+}
+
 #ifdef CONFIG_X86_32
 
 void default_send_IPI_mask_sequence_logical(const struct cpumask *mask,
index 7694ae6c1199b370331e550601ac6a36d89933e9..f316e34abb42bef31fbf8948bb1cdd8c4491fcbe 100644 (file)
@@ -105,6 +105,7 @@ static struct apic apic_default = {
 
        .cpu_mask_to_apicid_and         = flat_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = default_send_IPI_single,
        .send_IPI_mask                  = default_send_IPI_mask_logical,
        .send_IPI_mask_allbutself       = default_send_IPI_mask_allbutself_logical,
        .send_IPI_allbutself            = default_send_IPI_allbutself,
index cc8311c4d29850c4d0760fabfbd305ead526d321..aca8b75c15527fcb0aa78bcabbcbb9fe6b14fdc0 100644 (file)
@@ -23,6 +23,14 @@ static inline u32 x2apic_cluster(int cpu)
        return per_cpu(x86_cpu_to_logical_apicid, cpu) >> 16;
 }
 
+static void x2apic_send_IPI(int cpu, int vector)
+{
+       u32 dest = per_cpu(x86_cpu_to_logical_apicid, cpu);
+
+       x2apic_wrmsr_fence();
+       __x2apic_send_IPI_dest(dest, vector, APIC_DEST_LOGICAL);
+}
+
 static void
 __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
 {
@@ -266,6 +274,7 @@ static struct apic apic_x2apic_cluster = {
 
        .cpu_mask_to_apicid_and         = x2apic_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = x2apic_send_IPI,
        .send_IPI_mask                  = x2apic_send_IPI_mask,
        .send_IPI_mask_allbutself       = x2apic_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = x2apic_send_IPI_allbutself,
index 662e9150ea6f29e6c050ce76d719ed3d77385148..a1242e2c12e646d4eb2b805e4359ce9068e4db56 100644 (file)
@@ -36,6 +36,14 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
        return x2apic_enabled() && (x2apic_phys || x2apic_fadt_phys());
 }
 
+static void x2apic_send_IPI(int cpu, int vector)
+{
+       u32 dest = per_cpu(x86_cpu_to_apicid, cpu);
+
+       x2apic_wrmsr_fence();
+       __x2apic_send_IPI_dest(dest, vector, APIC_DEST_PHYSICAL);
+}
+
 static void
 __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
 {
@@ -122,6 +130,7 @@ static struct apic apic_x2apic_phys = {
 
        .cpu_mask_to_apicid_and         = default_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = x2apic_send_IPI,
        .send_IPI_mask                  = x2apic_send_IPI_mask,
        .send_IPI_mask_allbutself       = x2apic_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = x2apic_send_IPI_allbutself,
index 4a139465f1d4f025366af706b410594dc43d65b1..d760c6bb37b53c25931bef3bc47c903def86c8ee 100644 (file)
@@ -406,6 +406,7 @@ static struct apic __refdata apic_x2apic_uv_x = {
 
        .cpu_mask_to_apicid_and         = uv_cpu_mask_to_apicid_and,
 
+       .send_IPI                       = uv_send_IPI_one,
        .send_IPI_mask                  = uv_send_IPI_mask,
        .send_IPI_mask_allbutself       = uv_send_IPI_mask_allbutself,
        .send_IPI_allbutself            = uv_send_IPI_allbutself,
index 12c8286206ce27c1627b7202836d7d5419a2b4b6..658777cf38512872b4e5d049a8618e4bbd1b869b 100644 (file)
@@ -125,12 +125,12 @@ static void native_smp_send_reschedule(int cpu)
                WARN_ON(1);
                return;
        }
-       apic->send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
+       apic->send_IPI(cpu, RESCHEDULE_VECTOR);
 }
 
 void native_send_call_func_single_ipi(int cpu)
 {
-       apic->send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
+       apic->send_IPI(cpu, CALL_FUNCTION_SINGLE_VECTOR);
 }
 
 void native_send_call_func_ipi(const struct cpumask *mask)