Commit 810cd4b
Alex Williamson
vfio/pci: Lock external INTx masking ops
Mask operations through config space changes to DisINTx may race INTx
configuration changes via ioctl. Create wrappers that add locking for
paths outside of the core interrupt code.
In particular, irq_type is updated holding igate, therefore testing
is_intx() requires holding igate. For example clearing DisINTx from
config space can otherwise race changes of the interrupt configuration.
This aligns interfaces which may trigger the INTx eventfd into two
camps, one side serialized by igate and the other only enabled while
INTx is configured. A subsequent patch introduces synchronization for
the latter flows.
Cc: <[email protected]>
Fixes: 89e1f7d ("vfio: Add PCI device driver")
Reported-by: Reinette Chatre <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Reinette Chatre <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>1 parent fe9a708 commit 810cd4b
1 file changed
+28
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
146 | 159 | | |
147 | 160 | | |
148 | 161 | | |
| |||
194 | 207 | | |
195 | 208 | | |
196 | 209 | | |
197 | | - | |
| 210 | + | |
198 | 211 | | |
| 212 | + | |
| 213 | + | |
199 | 214 | | |
200 | 215 | | |
201 | 216 | | |
202 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
203 | 225 | | |
204 | 226 | | |
205 | 227 | | |
| |||
563 | 585 | | |
564 | 586 | | |
565 | 587 | | |
566 | | - | |
| 588 | + | |
567 | 589 | | |
568 | 590 | | |
569 | 591 | | |
570 | | - | |
| 592 | + | |
571 | 593 | | |
572 | 594 | | |
573 | 595 | | |
| |||
594 | 616 | | |
595 | 617 | | |
596 | 618 | | |
597 | | - | |
| 619 | + | |
598 | 620 | | |
599 | 621 | | |
600 | 622 | | |
601 | | - | |
| 623 | + | |
602 | 624 | | |
603 | 625 | | |
604 | 626 | | |
| |||
0 commit comments