Skip to content

Commit d4d3a2d

Browse files
author
Ian Seyler
committed
Verified pending bit is set on receive
``` (qemu) xp /16bx 0xfebd1800 00000000febd1800: 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ```
1 parent c199aed commit d4d3a2d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/drivers/msi.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
; 00038411 <- Cap ID 0x11 (MSI-X), next ptr 0x84, message control 0x0003 - Table size is bits 10:0 so 3 (n-1 so table size is actually 4)
2424
; 00000001 <- BIR (2:0) is 0x1 so BAR1, Table Offset (31:3) - 8-byte aligned so clear low 3 bits - 0x0 in this case
2525
; 00000801 <- Pending Bit BIR (2:0) is 0x1 so BAR1 and Pending Bit Offset (31:3) is 0x800
26+
;
27+
; Resulting MSI-X table entry in memory should look similar to:
28+
; 0xXXXXXXXX: FEE00000 00000000 000040XX 00000000
2629
msix_init:
2730
push r8
2831
push rdi

src/drivers/net/virtio-net.asm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ virtio_net_init_reset_wait:
266266
; reading and possibly writing the device’s virtio configuration space
267267
; population of virtqueues
268268

269-
mov ax, 0x0000
269+
mov ax, 0xFFFF
270270
mov [rsi+VIRTIO_CONFIG_MSIX_VECTOR], ax
271271

272272
; Set up Queue 0 (Receive)
@@ -290,9 +290,8 @@ virtio_net_init_reset_wait:
290290
rol rax, 32
291291
mov [rsi+VIRTIO_QUEUE_DEVICE+8], eax
292292
rol rax, 32
293-
mov ax, 0x0001
293+
mov ax, 0x0000
294294
mov [rsi+VIRTIO_QUEUE_MSIX_VECTOR], ax
295-
mov ax, [rsi+VIRTIO_QUEUE_MSIX_VECTOR]
296295
mov ax, 1
297296
mov [rsi+VIRTIO_QUEUE_ENABLE], ax
298297

0 commit comments

Comments
 (0)