linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT pull] x86/apic for v5.13-rc1
@ 2021-04-26 12:17 Thomas Gleixner
  2021-04-26 12:17 ` [GIT pull] x86/entry " Thomas Gleixner
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Thomas Gleixner @ 2021-04-26 12:17 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, x86

Linus,

please pull the latest x86/apic branch from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-apic-2021-04-26

up to:  9a98bc2cf08a: x86/vector: Add a sanity check to prevent IRQ2 allocations


A single commit to make the vector allocation code more resilent against an
accidental allocation attempt for IRQ2.

Thanks,

	tglx

------------------>
Thomas Gleixner (1):
      x86/vector: Add a sanity check to prevent IRQ2 allocations


 arch/x86/kernel/apic/vector.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 3c9c7492252f..9b75a70ebf90 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -543,6 +543,14 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
 	if ((info->flags & X86_IRQ_ALLOC_CONTIGUOUS_VECTORS) && nr_irqs > 1)
 		return -ENOSYS;
 
+	/*
+	 * Catch any attempt to touch the cascade interrupt on a PIC
+	 * equipped system.
+	 */
+	if (WARN_ON_ONCE(info->flags & X86_IRQ_ALLOC_LEGACY &&
+			 virq == PIC_CASCADE_IR))
+		return -EINVAL;
+
 	for (i = 0; i < nr_irqs; i++) {
 		irqd = irq_domain_get_irq_data(domain, virq + i);
 		BUG_ON(!irqd);
@@ -745,6 +753,11 @@ void __init lapic_assign_system_vectors(void)
 
 	/* Mark the preallocated legacy interrupts */
 	for (i = 0; i < nr_legacy_irqs(); i++) {
+		/*
+		 * Don't touch the cascade interrupt. It's unusable
+		 * on PIC equipped machines. See the large comment
+		 * in the IO/APIC code.
+		 */
 		if (i != PIC_CASCADE_IR)
 			irq_matrix_assign(vector_matrix, ISA_IRQ_VECTOR(i));
 	}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-26 17:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 12:17 [GIT pull] x86/apic for v5.13-rc1 Thomas Gleixner
2021-04-26 12:17 ` [GIT pull] x86/entry " Thomas Gleixner
2021-04-26 17:19   ` pr-tracker-bot
2021-04-26 12:17 ` [GIT pull] x86/splitlock " Thomas Gleixner
2021-04-26 17:19   ` pr-tracker-bot
2021-04-26 12:17 ` [GIT pull] x86/vdso " Thomas Gleixner
2021-04-26 17:19   ` pr-tracker-bot
2021-04-26 17:19 ` [GIT pull] x86/apic " pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).