<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/apic/vector.c, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-05-23T19:51:50Z</updated>
<entry>
<title>genirq/cpuhotplug, x86/vector: Prevent vector leak during CPU offline</title>
<updated>2024-05-23T19:51:50Z</updated>
<author>
<name>Dongli Zhang</name>
</author>
<published>2024-05-22T22:02:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6c11c0a5235fb144a65e0cb2ffd360ddc1f6c32'/>
<id>urn:sha1:a6c11c0a5235fb144a65e0cb2ffd360ddc1f6c32</id>
<content type='text'>
The absence of IRQD_MOVE_PCNTXT prevents immediate effectiveness of
interrupt affinity reconfiguration via procfs. Instead, the change is
deferred until the next instance of the interrupt being triggered on the
original CPU.

When the interrupt next triggers on the original CPU, the new affinity is
enforced within __irq_move_irq(). A vector is allocated from the new CPU,
but the old vector on the original CPU remains and is not immediately
reclaimed. Instead, apicd-&gt;move_in_progress is flagged, and the reclaiming
process is delayed until the next trigger of the interrupt on the new CPU.

Upon the subsequent triggering of the interrupt on the new CPU,
irq_complete_move() adds a task to the old CPU's vector_cleanup list if it
remains online. Subsequently, the timer on the old CPU iterates over its
vector_cleanup list, reclaiming old vectors.

However, a rare scenario arises if the old CPU is outgoing before the
interrupt triggers again on the new CPU.

In that case irq_force_complete_move() is not invoked on the outgoing CPU
to reclaim the old apicd-&gt;prev_vector because the interrupt isn't currently
affine to the outgoing CPU, and irq_needs_fixup() returns false. Even
though __vector_schedule_cleanup() is later called on the new CPU, it
doesn't reclaim apicd-&gt;prev_vector; instead, it simply resets both
apicd-&gt;move_in_progress and apicd-&gt;prev_vector to 0.

As a result, the vector remains unreclaimed in vector_matrix, leading to a
CPU vector leak.

To address this issue, move the invocation of irq_force_complete_move()
before the irq_needs_fixup() call to reclaim apicd-&gt;prev_vector, if the
interrupt is currently or used to be affine to the outgoing CPU.

Additionally, reclaim the vector in __vector_schedule_cleanup() as well,
following a warning message, although theoretically it should never see
apicd-&gt;move_in_progress with apicd-&gt;prev_cpu pointing to an offline CPU.

Fixes: f0383c24b485 ("genirq/cpuhotplug: Add support for cleaning up move in progress")
Signed-off-by: Dongli Zhang &lt;dongli.zhang@oracle.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240522220218.162423-1-dongli.zhang@oracle.com
</content>
</entry>
<entry>
<title>x86/irq: Factor out common code for checking pending interrupts</title>
<updated>2024-04-29T22:54:43Z</updated>
<author>
<name>Jacob Pan</name>
</author>
<published>2024-04-23T17:41:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fef05a078b6fa1e9047e0486f1f6daf70664fd12'/>
<id>urn:sha1:fef05a078b6fa1e9047e0486f1f6daf70664fd12</id>
<content type='text'>
Use a common function for checking pending interrupt vector in APIC IRR
instead of duplicated open coding them.

Additional checks for posted MSI vectors can then be contained in this
function.

Signed-off-by: Jacob Pan &lt;jacob.jun.pan@linux.intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20240423174114.526704-10-jacob.jun.pan@linux.intel.com

</content>
</entry>
<entry>
<title>arch/x86: Fix typos</title>
<updated>2024-01-03T10:46:22Z</updated>
<author>
<name>Bjorn Helgaas</name>
</author>
<published>2024-01-03T00:40:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=54aa699e8094efb7d7675fefbc03dfce24f98456'/>
<id>urn:sha1:54aa699e8094efb7d7675fefbc03dfce24f98456</id>
<content type='text'>
Fix typos, most reported by "codespell arch/x86".  Only touches comments,
no code changes.

Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Reviewed-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Link: https://lore.kernel.org/r/20240103004011.1758650-1-helgaas@kernel.org
</content>
</entry>
<entry>
<title>x86/apic: Wrap IPI calls into helper functions</title>
<updated>2023-08-09T19:00:55Z</updated>
<author>
<name>Dave Hansen</name>
</author>
<published>2023-08-09T15:21:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=28b8235238fa39a1b5c5820e7f5b14e7f104aac0'/>
<id>urn:sha1:28b8235238fa39a1b5c5820e7f5b14e7f104aac0</id>
<content type='text'>
Move them to one place so the static call conversion gets simpler.

No functional change.

[ dhansen: merge against recent x86/apic changes ]

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Tested-by: Juergen Gross &lt;jgross@suse.com&gt; # Xen PV (dom0 and unpriv. guest)
</content>
</entry>
<entry>
<title>x86/apic: Nuke ack_APIC_irq()</title>
<updated>2023-08-09T18:58:34Z</updated>
<author>
<name>Dave Hansen</name>
</author>
<published>2023-08-09T15:16:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=670c04add6e1a22de7c59e282c138ddcf6c9e5a2'/>
<id>urn:sha1:670c04add6e1a22de7c59e282c138ddcf6c9e5a2</id>
<content type='text'>
Yet another wrapper of a wrapper gone along with the outdated comment
that this compiles to a single instruction.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Reviewed-by: Wei Liu &lt;wei.liu@kernel.org&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Tested-by: Juergen Gross &lt;jgross@suse.com&gt; # Xen PV (dom0 and unpriv. guest)
</content>
</entry>
<entry>
<title>x86/apic: Wrap APIC ID validation into an inline</title>
<updated>2023-08-09T18:58:30Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-08-08T22:04:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9132d720eb8a40be5eaa539ed940beaf2bd2e421'/>
<id>urn:sha1:9132d720eb8a40be5eaa539ed940beaf2bd2e421</id>
<content type='text'>
Prepare for removing the callback and making this as simple comparison to
an upper limit, which is the obvious solution to do for limit checks...

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Tested-by: Juergen Gross &lt;jgross@suse.com&gt; # Xen PV (dom0 and unpriv. guest)
</content>
</entry>
<entry>
<title>x86/apic: Get rid of hard_smp_processor_id()</title>
<updated>2023-08-09T18:58:17Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-08-08T22:03:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6625b473b943b8c624fde3f2b444781114942d3'/>
<id>urn:sha1:a6625b473b943b8c624fde3f2b444781114942d3</id>
<content type='text'>
No point in having a wrapper around read_apic_id().

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Tested-by: Juergen Gross &lt;jgross@suse.com&gt; # Xen PV (dom0 and unpriv. guest)
</content>
</entry>
<entry>
<title>x86/apic: Rename disable_apic</title>
<updated>2023-08-09T18:58:16Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-08-08T22:03:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=49062454a3eb4a27add7a3df57e7a34266f6a760'/>
<id>urn:sha1:49062454a3eb4a27add7a3df57e7a34266f6a760</id>
<content type='text'>
It reflects a state and not a command. Make it bool while at it.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Acked-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Michael Kelley &lt;mikelley@microsoft.com&gt;
Tested-by: Sohil Mehta &lt;sohil.mehta@intel.com&gt;
Tested-by: Juergen Gross &lt;jgross@suse.com&gt; # Xen PV (dom0 and unpriv. guest)
</content>
</entry>
<entry>
<title>x86/vector: Replace IRQ_MOVE_CLEANUP_VECTOR with a timer callback</title>
<updated>2023-08-06T12:15:10Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-06-21T17:12:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdc1dad299bb1d38ce329de0dad0beadc76badf4'/>
<id>urn:sha1:bdc1dad299bb1d38ce329de0dad0beadc76badf4</id>
<content type='text'>
The left overs of a moved interrupt are cleaned up once the interrupt is
raised on the new target CPU. Keeping the vector valid on the original
target CPU guarantees that there can't be an interrupt lost if the affinity
change races with an concurrent interrupt from the device.

This cleanup utilizes the lowest priority interrupt vector for this
cleanup, which makes sure that in the unlikely case when the to be cleaned
up interrupt is pending in the local APICs IRR the cleanup vector does not
live lock.

But there is no real reason to use an interrupt vector for cleaning up the
leftovers of a moved interrupt. It's not a high performance operation. The
only requirement is that it happens on the original target CPU.

Convert it to use a timer instead and adjust the code accordingly.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Xin Li &lt;xin3.li@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/r/20230621171248.6805-3-xin3.li@intel.com

</content>
</entry>
<entry>
<title>x86/vector: Rename send_cleanup_vector() to vector_schedule_cleanup()</title>
<updated>2023-08-06T12:15:09Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2023-06-21T17:12:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a539cc86a1cb688df24d9cff17d946a8c0b94b38'/>
<id>urn:sha1:a539cc86a1cb688df24d9cff17d946a8c0b94b38</id>
<content type='text'>
Rename send_cleanup_vector() to vector_schedule_cleanup() to prepare for
replacing the vector cleanup IPI with a timer callback.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Xin Li &lt;xin3.li@intel.com&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Steve Wahl &lt;steve.wahl@hpe.com&gt;
Link: https://lore.kernel.org/r/20230621171248.6805-2-xin3.li@intel.com

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