OSDN Git Service

ACPI: processor: Use CPUIDLE_FLAG_TLB_FLUSHED
authorPeter Zijlstra <peterz@infradead.org>
Tue, 15 Sep 2020 10:31:59 +0000 (12:31 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 16 Sep 2020 17:36:25 +0000 (19:36 +0200)
Make acpi_processor_idle() use the generic TLB flushing code.
This again removes RCU usage after rcu_idle_enter().

(XXX make every C3 invalidate TLBs, not just C3-BM)

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/ia64/include/asm/acpi.h
arch/x86/include/asm/acpi.h
drivers/acpi/processor_idle.c

index b66ba90..87927eb 100644 (file)
@@ -74,8 +74,6 @@ static inline void arch_acpi_set_pdc_bits(u32 *buf)
        buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
 }
 
-#define acpi_unlazy_tlb(x)
-
 #ifdef CONFIG_ACPI_NUMA
 extern cpumask_t early_cpu_possible_map;
 #define for_each_possible_early_cpu(cpu)  \
index ca09764..6d2df1e 100644 (file)
@@ -159,8 +159,6 @@ static inline u64 x86_default_get_root_pointer(void)
 extern int x86_acpi_numa_init(void);
 #endif /* CONFIG_ACPI_NUMA */
 
-#define acpi_unlazy_tlb(x)     leave_mm(x)
-
 #ifdef CONFIG_ACPI_APEI
 static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
 {
index 01ea986..9ec5040 100644 (file)
@@ -564,8 +564,6 @@ static DEFINE_RAW_SPINLOCK(c3_lock);
 static void acpi_idle_enter_bm(struct acpi_processor *pr,
                               struct acpi_processor_cx *cx)
 {
-       acpi_unlazy_tlb(smp_processor_id());
-
        /*
         * disable bus master
         * bm_check implies we need ARB_DIS
@@ -665,6 +663,7 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
                max_cstate = 1;
 
        for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
+               state = &acpi_idle_driver.states[count];
                cx = &pr->power.states[i];
 
                if (!cx->valid)
@@ -672,10 +671,11 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
 
                per_cpu(acpi_cstate[count], dev->cpu) = cx;
 
-               if (lapic_timer_needs_broadcast(pr, cx)) {
-                       state = &acpi_idle_driver.states[count];
+               if (lapic_timer_needs_broadcast(pr, cx))
                        state->flags |= CPUIDLE_FLAG_TIMER_STOP;
-               }
+
+               if (cx->type == ACPI_STATE_C3)
+                       state->flags |= CPUIDLE_FLAG_TLB_FLUSHED;
 
                count++;
                if (count == CPUIDLE_STATE_MAX)