Skip to content

Commit 0901382

Browse files
committed
x86/vector: Reserve vectors for Hyper-V redirected interrupts
Recent versions of Hyper-V hosts use IOMMU posted interrupts to deliver the interrupts of VTL0 passthrough devices directly the underlying VTL2 guest. These interrupts are hardware vectors in the VTL2 guest and need an interrupt gate in the Interrupt Descriptor Table. Reserve a block of 32 interrupt vectors immediately below the FIRST_ SYSTEM_VECTOR. This can be regarded as an expansion of the system vectors at the expense of external vectors. This should be acceptable since not many external vectors are used in the normal operation of the VTL2 kernel. Moreover, the proxy interrupts that the VTL2 guest handles come from devices. Signed-off-by: Ricardo Neri <[email protected]> --- Changes since v1: * None
1 parent a78b206 commit 0901382

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/x86/include/asm/irq_vectors.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
* Vectors 0 ... 31 : system traps and exceptions - hardcoded events
1919
* Vectors 32 ... 127 : device interrupts
2020
* Vector 128 : legacy int80 syscall interface
21-
* Vectors 129 ... FIRST_SYSTEM_VECTOR-1 : device interrupts
21+
* Vectors 129 ... FIRST_HV_VTL_REDIRECTED_VECTOR-1: more device interrupts
22+
* Vectors FIRST_HV_VTL_REDIRECTED_VECTOR ... FIRST_SYSTEM_VECTOR-1
23+
* : HyperV redirected device interrupts
2224
* Vectors FIRST_SYSTEM_VECTOR ... 255 : special interrupts
2325
*
2426
* 64-bit x86 has per CPU IDT tables, 32-bit has one shared IDT table.
@@ -91,6 +93,7 @@
9193
#define MANAGED_IRQ_SHUTDOWN_VECTOR 0xef
9294

9395
#if IS_ENABLED(CONFIG_HYPERV)
96+
#define FIRST_HV_VTL_REDIRECTED_VECTOR 0xcc
9497
#define HYPERV_REENLIGHTENMENT_VECTOR 0xee
9598
#define HYPERV_STIMER0_VECTOR 0xed
9699
#endif
@@ -111,7 +114,12 @@
111114
#define FIRST_SYSTEM_VECTOR NR_VECTORS
112115
#endif
113116

117+
#ifdef CONFIG_HYPERV_VTL_MODE
118+
#define NR_EXTERNAL_VECTORS (FIRST_HV_VTL_REDIRECTED_VECTOR - FIRST_EXTERNAL_VECTOR)
119+
#define NR_HV_VTL_REDIRECTED_VECTORS (FIRST_SYSTEM_VECTOR - FIRST_HV_VTL_REDIRECTED_VECTOR)
120+
#else
114121
#define NR_EXTERNAL_VECTORS (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
122+
#endif
115123
#define NR_SYSTEM_VECTORS (NR_VECTORS - FIRST_SYSTEM_VECTOR)
116124

117125
/*

0 commit comments

Comments
 (0)