<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/acpi/processor_idle.c, branch v5.10.78</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.78</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.78'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-07-14T14:55:57+00:00</updated>
<entry>
<title>ACPI: processor idle: Fix up C-state latency if not ordered</title>
<updated>2021-07-14T14:55:57+00:00</updated>
<author>
<name>Mario Limonciello</name>
<email>mario.limonciello@amd.com</email>
</author>
<published>2021-05-12T22:15:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0f2f5293023f1e71a439b2e9c9fb629ee423eff4'/>
<id>urn:sha1:0f2f5293023f1e71a439b2e9c9fb629ee423eff4</id>
<content type='text'>
[ Upstream commit 65ea8f2c6e230bdf71fed0137cf9e9d1b307db32 ]

Generally, the C-state latency is provided by the _CST method or
FADT, but some OEM platforms using AMD Picasso, Renoir, Van Gogh,
and Cezanne set the C2 latency greater than C3's which causes the
C2 state to be skipped.

That will block the core entering PC6, which prevents S0ix working
properly on Linux systems.

In other operating systems, the latency values are not validated and
this does not cause problems by skipping states.

To avoid this issue on Linux, detect when latencies are not an
arithmetic progression and sort them.

Link: https://gitlab.freedesktop.org/agd5f/linux/-/commit/026d186e4592c1ee9c1cb44295912d0294508725
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1230#note_712174
Suggested-by: Prike Liang &lt;Prike.Liang@amd.com&gt;
Suggested-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m</title>
<updated>2021-04-14T06:41:58+00:00</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2021-04-06T15:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=856f60e3e8002626de44426196eba945ee5fb989'/>
<id>urn:sha1:856f60e3e8002626de44426196eba945ee5fb989</id>
<content type='text'>
commit fa26d0c778b432d3d9814ea82552e813b33eeb5c upstream.

Commit 8cdddd182bd7 ("ACPI: processor: Fix CPU0 wakeup in
acpi_idle_play_dead()") tried to fix CPU0 hotplug breakage by copying
wakeup_cpu0() + start_cpu0() logic from hlt_play_dead()//mwait_play_dead()
into acpi_idle_play_dead(). The problem is that these functions are not
exported to modules so when CONFIG_ACPI_PROCESSOR=m build fails.

The issue could've been fixed by exporting both wakeup_cpu0()/start_cpu0()
(the later from assembly) but it seems putting the whole pattern into a
new function and exporting it instead is better.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Fixes: 8cdddd182bd7 ("CPI: processor: Fix CPU0 wakeup in acpi_idle_play_dead()")
Cc: &lt;stable@vger.kernel.org&gt; # 5.10+
Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: Fix CPU0 wakeup in acpi_idle_play_dead()</title>
<updated>2021-04-07T13:00:08+00:00</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2021-03-24T15:22:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e525cd364c091c0c8c10c3223e893d5ef2d65d2e'/>
<id>urn:sha1:e525cd364c091c0c8c10c3223e893d5ef2d65d2e</id>
<content type='text'>
commit 8cdddd182bd7befae6af49c5fd612893f55d6ccb upstream.

Commit 496121c02127 ("ACPI: processor: idle: Allow probing on platforms
with one ACPI C-state") broke CPU0 hotplug on certain systems, e.g.
I'm observing the following on AWS Nitro (e.g r5b.xlarge but other
instance types are affected as well):

 # echo 0 &gt; /sys/devices/system/cpu/cpu0/online
 # echo 1 &gt; /sys/devices/system/cpu/cpu0/online
 &lt;10 seconds delay&gt;
 -bash: echo: write error: Input/output error

In fact, the above mentioned commit only revealed the problem and did
not introduce it. On x86, to wakeup CPU an NMI is being used and
hlt_play_dead()/mwait_play_dead() loops are prepared to handle it:

	/*
	 * If NMI wants to wake up CPU0, start CPU0.
	 */
	if (wakeup_cpu0())
		start_cpu0();

cpuidle_play_dead() -&gt; acpi_idle_play_dead() (which is now being called on
systems where it wasn't called before the above mentioned commit) serves
the same purpose but it doesn't have a path for CPU0. What happens now on
wakeup is:
 - NMI is sent to CPU0
 - wakeup_cpu0_nmi() works as expected
 - we get back to while (1) loop in acpi_idle_play_dead()
 - safe_halt() puts CPU0 to sleep again.

The straightforward/minimal fix is add the special handling for CPU0 on x86
and that's what the patch is doing.

Fixes: 496121c02127 ("ACPI: processor: idle: Allow probing on platforms with one ACPI C-state")
Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Cc: 5.10+ &lt;stable@vger.kernel.org&gt; # 5.10+
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: Fix build for ARCH_APICTIMER_STOPS_ON_C3 unset</title>
<updated>2020-09-23T11:50:12+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2020-09-23T11:50:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=955921289dcdbc49b46a731ec07978fb7d4e1fc7'/>
<id>urn:sha1:955921289dcdbc49b46a731ec07978fb7d4e1fc7</id>
<content type='text'>
Fix the lapic_timer_needs_broadcast() stub for
ARCH_APICTIMER_STOPS_ON_C3 unset to actually return
a value.

Fixes: aa6b43d57f99 ("ACPI: processor: Use CPUIDLE_FLAG_TIMER_STOP")
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: Take over RCU-idle for C3-BM idle</title>
<updated>2020-09-16T17:36:26+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-09-15T10:32:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1fecfdbb7acc6624655450a609221c89b5197a06'/>
<id>urn:sha1:1fecfdbb7acc6624655450a609221c89b5197a06</id>
<content type='text'>
The C3 BusMaster idle code takes lock in a number of places, some deep
inside the ACPI code. Instead of wrapping it all in RCU_NONIDLE, have
the driver take over RCU-idle duty and avoid flipping RCU state back
and forth a lot.

( by marking 'C3 &amp;&amp; bm_check' as RCU_IDLE, we _must_ call enter_bm() for
  that combination, otherwise we'll loose RCU-idle, this requires
  shuffling some code around )

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: Use CPUIDLE_FLAG_TLB_FLUSHED</title>
<updated>2020-09-16T17:36:25+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-09-15T10:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a889a23a98fee183c9b6b0b14b2fd70583429c5e'/>
<id>urn:sha1:a889a23a98fee183c9b6b0b14b2fd70583429c5e</id>
<content type='text'>
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) &lt;peterz@infradead.org&gt;
Tested-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>ACPI: processor: Use CPUIDLE_FLAG_TIMER_STOP</title>
<updated>2020-09-16T17:36:25+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2020-09-15T10:31:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa6b43d57f995f6eec0e9e744dcb200e09ecb8e0'/>
<id>urn:sha1:aa6b43d57f995f6eec0e9e744dcb200e09ecb8e0</id>
<content type='text'>
Make acpi_processor_idle use the common broadcast code, there's no
reason not to. This also removes some RCU usage after
rcu_idle_enter().

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reported-by: Borislav Petkov &lt;bp@suse.de&gt;
Tested-by: Borislav Petkov &lt;bp@suse.de&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'acpi-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2020-08-04T03:37:22+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-08-04T03:37:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2baa85d6927d11b8d946da2e4ad00dddca5b8da2'/>
<id>urn:sha1:2baa85d6927d11b8d946da2e4ad00dddca5b8da2</id>
<content type='text'>
Pull ACPI updates from Rafael Wysocki:
 "These eliminate significant AML processing overhead related to using
  operation regions in system memory, update the ACPICA code in the
  kernel to upstream revision 20200717 (including a fix to prevent
  operation region reference counts from overflowing in some cases),
  remove the last bits of the (long deprecated) ACPI procfs interface
  and do some assorted cleanups.

  Specifics:

   - Eliminate significant AML processing overhead related to using
     operation regions in system memory by reworking the management of
     memory mappings in the ACPI code to defer unmap operations (to do
     them outside of the ACPICA locks, among other things) and making
     the memory operation reagion handler avoid releasing memory
     mappings created by it too early (Rafael Wysocki).

   - Update the ACPICA code in the kernel to upstream revision 20200717:

       * Prevent operation region reference counts from overflowing in
         some cases (Erik Kaneda).

       * Replace one-element array with flexible-array (Gustavo A. R.
         Silva).

   - Fix ACPI PCI hotplug reference counting (Rafael Wysocki).

   - Drop last bits of the ACPI procfs interface (Thomas Renninger).

   - Drop some redundant checks from the code parsing ACPI tables
     related to NUMA (Hanjun Guo).

   - Avoid redundant object evaluation in the ACPI device properties
     handling code (Heikki Krogerus).

   - Avoid unecessary memory overhead related to storing the signatures
     of the ACPI tables recognized by the kernel (Ard Biesheuvel).

   - Add missing newline characters when printing module parameter
     values in some places (Xiongfeng Wang).

   - Update the link to the ACPI specifications in some places (Tiezhu
     Yang).

   - Use the fallthrough pseudo-keyword in the ACPI code (Gustavo A. R.
     Silva).

   - Drop redundant variable initialization from the APEI code (Colin
     Ian King).

   - Drop uninitialized_var() from the ACPI PAD driver (Jason Yan).

   - Replace HTTP links with HTTPS ones in the ACPI code (Alexander A.
     Klimov)"

* tag 'acpi-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits)
  ACPI: APEI: remove redundant assignment to variable rc
  ACPI: NUMA: Remove the useless 'node &gt;= MAX_NUMNODES' check
  ACPI: NUMA: Remove the useless sub table pointer check
  ACPI: tables: Remove the duplicated checks for acpi_parse_entries_array()
  ACPICA: Update version to 20200717
  ACPICA: Do not increment operation_region reference counts for field units
  ACPICA: Replace one-element array with flexible-array
  ACPI: Replace HTTP links with HTTPS ones
  ACPI: Use valid link to the ACPI specification
  ACPI: OSL: Clean up the removal of unused memory mappings
  ACPI: OSL: Use deferred unmapping in acpi_os_unmap_iomem()
  ACPI: OSL: Use deferred unmapping in acpi_os_unmap_generic_address()
  ACPICA: Preserve memory opregion mappings
  ACPI: OSL: Implement deferred unmapping of ACPI memory
  ACPI: Use fallthrough pseudo-keyword
  PCI: hotplug: ACPI: Fix context refcounting in acpiphp_grab_context()
  ACPI: tables: avoid relocations for table signature array
  ACPI: PAD: Eliminate usage of uninitialized_var() macro
  ACPI: sysfs: add newlines when printing module parameters
  ACPI: EC: add newline when printing 'ec_event_clearing' module parameter
  ...
</content>
</entry>
<entry>
<title>cpuidle: ACPI: fix 'return' with no value build warning</title>
<updated>2020-07-31T11:29:13+00:00</updated>
<author>
<name>Neal Liu</name>
<email>neal.liu@mediatek.com</email>
</author>
<published>2020-07-31T03:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0a398945d6f3e54f9f88ba2a17908674c659bfa4'/>
<id>urn:sha1:0a398945d6f3e54f9f88ba2a17908674c659bfa4</id>
<content type='text'>
Add return value to fix return-type build warning introduced by
commit efe9711214e6 ("cpuidle: change enter_s2idle() prototype").

Fixes: efe9711214e6 ("cpuidle: change enter_s2idle() prototype")
Signed-off-by: Neal Liu &lt;neal.liu@mediatek.com&gt;
[ rjw: Subject &amp; changelog edits, make acpi_idle_enter_s2idle()
  return 0 in all cases ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>cpuidle: change enter_s2idle() prototype</title>
<updated>2020-07-29T16:38:30+00:00</updated>
<author>
<name>Neal Liu</name>
<email>neal.liu@mediatek.com</email>
</author>
<published>2020-07-27T03:25:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=efe9711214e6138a5a2a46ca4068bfce50c03444'/>
<id>urn:sha1:efe9711214e6138a5a2a46ca4068bfce50c03444</id>
<content type='text'>
Control Flow Integrity(CFI) is a security mechanism that disallows
changes to the original control flow graph of a compiled binary,
making it significantly harder to perform such attacks.

init_state_node() assign same function callback to different
function pointer declarations.

static int init_state_node(struct cpuidle_state *idle_state,
                           const struct of_device_id *matches,
                           struct device_node *state_node) { ...
        idle_state-&gt;enter = match_id-&gt;data; ...
        idle_state-&gt;enter_s2idle = match_id-&gt;data; }

Function declarations:

struct cpuidle_state { ...
        int (*enter) (struct cpuidle_device *dev,
                      struct cpuidle_driver *drv,
                      int index);

        void (*enter_s2idle) (struct cpuidle_device *dev,
                              struct cpuidle_driver *drv,
                              int index); };

In this case, either enter() or enter_s2idle() would cause CFI check
failed since they use same callee.

Align function prototype of enter() since it needs return value for
some use cases. The return value of enter_s2idle() is no
need currently.

Signed-off-by: Neal Liu &lt;neal.liu@mediatek.com&gt;
Reviewed-by: Sami Tolvanen &lt;samitolvanen@google.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
</feed>
