mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/IRQ: flip legacy and dynamic vector ranges
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. This is to reduce the priority of PIC vectors in the LAPIC vs all other ones. 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> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
53fd9dafeb
commit
8fb4e83dc3
5 files changed
+16
-11
No files matched your search
+2
-2
@@ -528,9 +528,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 physbase, unsigned int reg, u32 val)
|
||||
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;
|
||||
|
||||
|
||||
+1
-1
@@ -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 generated stubs. */
|
||||
|
||||
/* 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 */
|
||||