@@ -525,9 +525,9 @@ void setup_local_APIC(void)
init_apic_ldr();
/*
- * Set Task Priority to reject any interrupts below FIRST_DYNAMIC_VECTOR.
+ * Set Task Priority to reject any interrupts below FIRST_IRQ_VECTOR.
*/
- apic_write(APIC_TASKPRI, (FIRST_DYNAMIC_VECTOR & 0xF0) - 0x10);
+ apic_write(APIC_TASKPRI, (FIRST_IRQ_VECTOR & 0xF0) - 0x10);
/*
* After a crash, we no longer service the interrupts and a pending
@@ -2388,7 +2388,9 @@ int ioapic_guest_write(unsigned long phy
return 0;
}
- if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR )
+ if ( desc->arch.vector <= 0 || desc->arch.vector > LAST_DYNAMIC_VECTOR ||
+ (desc->arch.vector >= FIRST_LEGACY_VECTOR &&
+ desc->arch.vector <= LAST_LEGACY_VECTOR) )
{
int vector = desc->arch.vector;
@@ -101,7 +101,7 @@ void unlock_vector_lock(void)
static inline bool valid_irq_vector(unsigned int vector)
{
- return vector >= FIRST_DYNAMIC_VECTOR && vector <= LAST_HIPRIORITY_VECTOR;
+ return vector >= FIRST_IRQ_VECTOR && vector <= LAST_IRQ_VECTOR;
}
static void release_old_vec(struct irq_desc *desc)
@@ -923,9 +923,9 @@ autogen_stubs: /* Automatically generate
/* Common interrupts, heading towards do_IRQ(). */
#ifdef CONFIG_PV
- .if vec >= FIRST_DYNAMIC_VECTOR && vec != HYPERCALL_VECTOR && vec != LEGACY_SYSCALL_VECTOR
+ .if vec >= FIRST_IRQ_VECTOR && vec != HYPERCALL_VECTOR && vec != LEGACY_SYSCALL_VECTOR
#else
- .if vec >= FIRST_DYNAMIC_VECTOR
+ .if vec >= FIRST_IRQ_VECTOR
#endif
ALIGN
@@ -18,20 +18,23 @@
/* IRQ0 (timer) is statically allocated but must be high priority. */
#define IRQ0_VECTOR 0xf0
-/* Legacy PIC uses vectors 0xe0-0xef. */
-#define FIRST_LEGACY_VECTOR 0xe0
-#define LAST_LEGACY_VECTOR 0xef
+/* Legacy PIC uses vectors 0x20-0x2f. */
+#define FIRST_LEGACY_VECTOR 0x20
+#define LAST_LEGACY_VECTOR (FIRST_LEGACY_VECTOR + 0xf)
#define HYPERCALL_VECTOR 0x82
#define LEGACY_SYSCALL_VECTOR 0x80
/* Dynamically-allocated vectors available to any driver. */
-#define FIRST_DYNAMIC_VECTOR 0x20
-#define LAST_DYNAMIC_VECTOR 0xdf
+#define FIRST_DYNAMIC_VECTOR (LAST_LEGACY_VECTOR + 1)
+#define LAST_DYNAMIC_VECTOR 0xef
#define NR_DYNAMIC_VECTORS (LAST_DYNAMIC_VECTOR - FIRST_DYNAMIC_VECTOR + 1)
#define IRQ_MOVE_CLEANUP_VECTOR FIRST_DYNAMIC_VECTOR
#define NR_VECTORS 256
+#define FIRST_IRQ_VECTOR FIRST_LEGACY_VECTOR
+#define LAST_IRQ_VECTOR LAST_HIPRIORITY_VECTOR
+
#endif /* _ASM_IRQ_VECTORS_H */
There's no reason to have the PIC vectors (which are typically entirely unused on 64-bit systems anyway) right below the high priority ones. Put them in the lowest possible range, and shift the dynamic vector range up accordingly. Note that irq_move_cleanup_interrupt(), despite using FIRST_DYNAMIC_VECTOR, does not get touched, as PIC interrupts aren't movable. Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com>