Commit 8ed0239
virtio-pmem: Set DRIVER_OK status prior to creating pmem region
Update virtio-pmem to call virtio_device_ready prior to creating the pmem
region. Otherwise, the guest may try to access the pmem region prior to
the DRIVER_OK status being set.
In the case of Hyper-V, the backing pmem file isn't mapped to the guest
until the DRIVER_OK status is set. Therefore, attempts to access the pmem
region can cause the guest to crash. Hyper-V could map the file earlier,
for example at VM creation, but we didn't want to pay the mapping cost if
the device is never used. Additionally, it felt weird to allow the guest
to access the region prior to the device fully coming online.
Signed-off-by: Taylor Stark <[email protected]>
Reviewed-by: Pankaj Gupta <[email protected]>
Link: https://lore.kernel.org/r/20210715223638.GA29649@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net
Signed-off-by: Tyler Hicks <[email protected]>1 parent 171d82c commit 8ed0239
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
94 | 99 | | |
95 | 100 | | |
96 | 101 | | |
| |||
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| 113 | + | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
| |||
0 commit comments