<feed xmlns='http://www.w3.org/2005/Atom'>
<title>blaster4385/linux-IllusionX/arch/x86/kernel/apic, branch v6.12.1</title>
<subtitle>Linux kernel with personal config changes for arch linux</subtitle>
<id>http://git.tablaster.dev/blaster4385/linux-IllusionX/atom?h=v6.12.1</id>
<link rel='self' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/atom?h=v6.12.1'/>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/'/>
<updated>2024-10-15T12:45:18Z</updated>
<entry>
<title>x86/apic: Always explicitly disarm TSC-deadline timer</title>
<updated>2024-10-15T12:45:18Z</updated>
<author>
<name>Zhang Rui</name>
<email>rui.zhang@intel.com</email>
</author>
<published>2024-10-15T06:15:22Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=ffd95846c6ec6cf1f93da411ea10d504036cab42'/>
<id>urn:sha1:ffd95846c6ec6cf1f93da411ea10d504036cab42</id>
<content type='text'>
New processors have become pickier about the local APIC timer state
before entering low power modes. These low power modes are used (for
example) when you close your laptop lid and suspend. If you put your
laptop in a bag and it is not in this low power mode, it is likely
to get quite toasty while it quickly sucks the battery dry.

The problem boils down to some CPUs' inability to power down until the
CPU recognizes that the local APIC timer is shut down. The current
kernel code works in one-shot and periodic modes but does not work for
deadline mode. Deadline mode has been the supported and preferred mode
on Intel CPUs for over a decade and uses an MSR to drive the timer
instead of an APIC register.

Disable the TSC Deadline timer in lapic_timer_shutdown() by writing to
MSR_IA32_TSC_DEADLINE when in TSC-deadline mode. Also avoid writing
to the initial-count register (APIC_TMICT) which is ignored in
TSC-deadline mode.

Note: The APIC_LVTT|=APIC_LVT_MASKED operation should theoretically be
enough to tell the hardware that the timer will not fire in any of the
timer modes. But mitigating AMD erratum 411[1] also requires clearing
out APIC_TMICT. Solely setting APIC_LVT_MASKED is also ineffective in
practice on Intel Lunar Lake systems, which is the motivation for this
change.

1. 411 Processor May Exit Message-Triggered C1E State Without an Interrupt if Local APIC Timer Reaches Zero - https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/revision-guides/41322_10h_Rev_Gd.pdf

Fixes: 279f1461432c ("x86: apic: Use tsc deadline for oneshot when available")
Suggested-by: Dave Hansen &lt;dave.hansen@intel.com&gt;
Signed-off-by: Zhang Rui &lt;rui.zhang@intel.com&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Tested-by: Srinivas Pandruvada &lt;srinivas.pandruvada@linux.intel.com&gt;
Tested-by: Todd Brandt &lt;todd.e.brandt@intel.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20241015061522.25288-1-rui.zhang%40intel.com
</content>
</entry>
<entry>
<title>Merge tag 'x86-apic-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2024-09-17T11:09:49Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2024-09-17T11:09:49Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=61d1ea914b3556c44f9ca04277ab990a60afb44d'/>
<id>urn:sha1:61d1ea914b3556c44f9ca04277ab990a60afb44d</id>
<content type='text'>
Pull x86 APIC updates from Thomas Gleixner:

 - Handle an allocation failure in the IO/APIC code gracefully instead
   of crashing the machine.

 - Remove support for APIC local destination mode on 64bit

   Logical destination mode of the local APIC is used for systems with
   up to 8 CPUs. It has an advantage over physical destination mode as
   it allows to target multiple CPUs at once with IPIs. That advantage
   was definitely worth it when systems with up to 8 CPUs were state of
   the art for servers and workstations, but that's history.

   In the recent past there were quite some reports of new laptops
   failing to boot with logical destination mode, but they work fine
   with physical destination mode. That's not a suprise because physical
   destination mode is guaranteed to work as it's the only way to get a
   CPU up and running via the INIT/INIT/STARTUP sequence. Some of the
   affected systems were cured by BIOS updates, but not all OEMs provide
   them.

   As the number of CPUs keep increasing, logical destination mode
   becomes less used and the benefit for small systems, like laptops, is
   not really worth the trouble. So just remove logical destination mode
   support for 64bit and be done with it.

 - Code and comment cleanups in the APIC area.

* tag 'x86-apic-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/irq: Fix comment on IRQ vector layout
  x86/apic: Remove unused extern declarations
  x86/apic: Remove logical destination mode for 64-bit
  x86/apic: Remove unused inline function apic_set_eoi_cb()
  x86/ioapic: Cleanup remaining coding style issues
  x86/ioapic: Cleanup line breaks
  x86/ioapic: Cleanup bracket usage
  x86/ioapic: Cleanup comments
  x86/ioapic: Move replace_pin_at_irq_node() to the call site
  iommu/vt-d: Cleanup apic_printk()
  x86/mpparse: Cleanup apic_printk()s
  x86/ioapic: Cleanup guarded debug printk()s
  x86/ioapic: Cleanup apic_printk()s
  x86/apic: Cleanup apic_printk()s
  x86/apic: Provide apic_printk() helpers
  x86/ioapic: Use guard() for locking where applicable
  x86/ioapic: Cleanup structs
  x86/ioapic: Mark mp_alloc_timer_irq() __init
  x86/ioapic: Handle allocation failures gracefully
</content>
</entry>
<entry>
<title>x86/apic: Make x2apic_disable() work correctly</title>
<updated>2024-08-13T13:15:19Z</updated>
<author>
<name>Yuntao Wang</name>
<email>yuntao.wang@linux.dev</email>
</author>
<published>2024-08-13T01:48:27Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=0ecc5be200c84e67114f3640064ba2bae3ba2f5a'/>
<id>urn:sha1:0ecc5be200c84e67114f3640064ba2bae3ba2f5a</id>
<content type='text'>
x2apic_disable() clears x2apic_state and x2apic_mode unconditionally, even
when the state is X2APIC_ON_LOCKED, which prevents the kernel to disable
it thereby creating inconsistent state.

Due to the early state check for X2APIC_ON, the code path which warns about
a locked X2APIC cannot be reached.

Test for state &lt; X2APIC_ON instead and move the clearing of the state and
mode variables to the place which actually disables X2APIC.

[ tglx: Massaged change log. Added Fixes tag. Moved clearing so it's at the
  	right place for back ports ]

Fixes: a57e456a7b28 ("x86/apic: Fix fallout from x2apic cleanup")
Signed-off-by: Yuntao Wang &lt;yuntao.wang@linux.dev&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/20240813014827.895381-1-yuntao.wang@linux.dev

</content>
</entry>
<entry>
<title>x86/apic: Remove logical destination mode for 64-bit</title>
<updated>2024-08-09T12:34:16Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-07-28T11:06:10Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=838ba7733e4e3a94a928e8d0a058de1811a58621'/>
<id>urn:sha1:838ba7733e4e3a94a928e8d0a058de1811a58621</id>
<content type='text'>
Logical destination mode of the local APIC is used for systems with up to
8 CPUs. It has an advantage over physical destination mode as it allows to
target multiple CPUs at once with IPIs.

That advantage was definitely worth it when systems with up to 8 CPUs
were state of the art for servers and workstations, but that's history.

Aside of that there are systems which fail to work with logical destination
mode as the ACPI/DMI quirks show and there are AMD Zen1 systems out there
which fail when interrupt remapping is enabled as reported by Rob and
Christian. The latter problem can be cured by firmware updates, but not all
OEMs distribute the required changes.

Physical destination mode is guaranteed to work because it is the only way
to get a CPU up and running via the INIT/INIT/STARTUP sequence.

As the number of CPUs keeps increasing, logical destination mode becomes a
less used code path so there is no real good reason to keep it around.

Therefore remove logical destination mode support for 64-bit and default to
physical destination mode.

Reported-by: Rob Newcater &lt;rob@durendal.co.uk&gt;
Reported-by: Christian Heusel &lt;christian@heusel.eu&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Tested-by: Rob Newcater &lt;rob@durendal.co.uk&gt;
Link: https://lore.kernel.org/all/877cd5u671.ffs@tglx

</content>
</entry>
<entry>
<title>x86/ioapic: Cleanup remaining coding style issues</title>
<updated>2024-08-07T16:13:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-08-02T16:15:52Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=62e303e346d7f829ff4f52c73176451c7f85f4bc'/>
<id>urn:sha1:62e303e346d7f829ff4f52c73176451c7f85f4bc</id>
<content type='text'>
Add missing new lines and reorder variable definitions.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Tested-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/all/20240802155441.158662179@linutronix.de

</content>
</entry>
<entry>
<title>x86/ioapic: Cleanup line breaks</title>
<updated>2024-08-07T16:13:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-08-02T16:15:50Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=966e09b1862555267effa1db9032dc3dbc0cc588'/>
<id>urn:sha1:966e09b1862555267effa1db9032dc3dbc0cc588</id>
<content type='text'>
80 character limit is history.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Tested-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/all/20240802155441.095653193@linutronix.de

</content>
</entry>
<entry>
<title>x86/ioapic: Cleanup bracket usage</title>
<updated>2024-08-07T16:13:29Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-08-02T16:15:49Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=4bcfdf76d7d1976b035ca75776bc8d266a09d6c3'/>
<id>urn:sha1:4bcfdf76d7d1976b035ca75776bc8d266a09d6c3</id>
<content type='text'>
Add brackets around if/for constructs as required by coding style or remove
pointless line breaks to make it true single line statements which do not
require brackets.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Tested-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/all/20240802155441.032045616@linutronix.de

</content>
</entry>
<entry>
<title>x86/ioapic: Cleanup comments</title>
<updated>2024-08-07T16:13:28Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-08-02T16:15:48Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=75d449402b125648bf048309c9d22b39262d6fba'/>
<id>urn:sha1:75d449402b125648bf048309c9d22b39262d6fba</id>
<content type='text'>
Use proper comment styles and shrink comments to their scope where
applicable.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Tested-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/all/20240802155440.969619978@linutronix.de

</content>
</entry>
<entry>
<title>x86/ioapic: Move replace_pin_at_irq_node() to the call site</title>
<updated>2024-08-07T16:13:28Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-08-02T16:15:47Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=ee64510fb959991c3afd94e05e468a5b27e77f68'/>
<id>urn:sha1:ee64510fb959991c3afd94e05e468a5b27e77f68</id>
<content type='text'>
It's only used by check_timer().

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Tested-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/all/20240802155440.906636514@linutronix.de

</content>
</entry>
<entry>
<title>x86/ioapic: Cleanup guarded debug printk()s</title>
<updated>2024-08-07T16:13:28Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2024-08-02T16:15:43Z</published>
<link rel='alternate' type='text/html' href='http://git.tablaster.dev/blaster4385/linux-IllusionX/commit/?id=54cd3795b471057a7e82acaade2b6a22beee1242'/>
<id>urn:sha1:54cd3795b471057a7e82acaade2b6a22beee1242</id>
<content type='text'>
Cleanup the APIC printk()s which are inside of a apic verbosity guarded
region by using apic_dbg() for the KERN_DEBUG level prints.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Qiuxu Zhuo &lt;qiuxu.zhuo@intel.com&gt;
Tested-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/all/20240802155440.714763708@linutronix.de

</content>
</entry>
</feed>
