mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: block: Reuse descriptor chain's memory for queue enable
The two synchronous completion paths add the head to the used ring with desc_chain.memory() but reload self.mem.memory() to enable notifications. Keep both on the snapshot the chain was parsed from so the used ring update and the notification enable always act on one guest memory view rather than two independent atomic loads. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
dd2f18e73e
commit
1db8858fac
@@ -317,7 +317,7 @@ impl BlockEpollHandler {
|
||||
.add_used(desc_chain.memory(), desc_chain.head_index(), 1)
|
||||
.map_err(Error::QueueAddUsed)?;
|
||||
queue
|
||||
.enable_notification(self.mem.memory().deref())
|
||||
.enable_notification(desc_chain.memory())
|
||||
.map_err(Error::QueueEnableNotification)?;
|
||||
continue;
|
||||
}
|
||||
@@ -404,7 +404,7 @@ impl BlockEpollHandler {
|
||||
.add_used(desc_chain.memory(), desc_chain.head_index(), len)
|
||||
.map_err(Error::QueueAddUsed)?;
|
||||
queue
|
||||
.enable_notification(self.mem.memory().deref())
|
||||
.enable_notification(desc_chain.memory())
|
||||
.map_err(Error::QueueEnableNotification)?;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user