Commit 6f54e31
committed
fix(iodispatcher): initialize virtio_requests_lock and hypercall context fields
Initialize client->virtio_requests_lock in bao_io_client_create().
Without explicitly initializing this mutex, the first lock operation
can trigger a breakpoint (BKP) exception on RISC-V due to operating
on an uninitialized lock structure.
Also explicitly initialize ctx.access_width and ctx.npend_req in
bao_dispatch_io() before issuing the hypercall. This avoids passing
uninitialized stack data to the hypervisor and makes the hypercall
context state fully defined.
These changes improve robustness and prevent runtime exceptions on
RISC-V systems.
Signed-off-by: João Peixoto <joaopeixotooficial@gmail.com>1 parent 5940e1c commit 6f54e31
2 files changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
282 | 283 | | |
283 | 284 | | |
284 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
0 commit comments