Commit 0d3a936
viostor: Fix MessageId update in MESSAGENUMBER_TO_QUEUE()
In the case that StorPortGetStartIoPerfParams() returns an optimal
MessageNumber that is higher than the MessageNumber of the existing
queues, MESSAGENUMBER_TO_QUEUE() tries to wrap around and assign queues
in a round-robin fashion. While it does this correctly for QueueNumber,
it fails to update MessageId correctly.
The correct relation is MessageId = QueueNumber + 1, and this has to be
ensured after limiting QueueNumber, too. The existing MessageId += 1
will make MessageId only more out of bounds for the array accesses it is
used for amongst others in VioStorCompleteRequest() and VioStorVQLock/
Unlock().
This code path is hard to hit because normally, the MessageNumber
returned by StorPortGetStartIoPerfParams() is limited to num_queues + 1
through the STOR_PERF_INTERRUPT_MESSAGE_RANGES feature. However, when I
modified VirtIoHwInitialize() to not enable this feature, I got instant
BSODs without this fix on a setup with 10 vcpus and virtio-blk
configured with num-queues=2,vectors=10.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>1 parent c2af034 commit 0d3a936
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
0 commit comments