Skip to content

Commit 0aa8f6c

Browse files
Marshal1lShadowCurse
authored andcommitted
fix(aarch64/fdt): add dma-coherent property to virtio-mmio nodes
Add the "dma-coherent" property to virtio-mmio nodes in the aarch64 FDT. This ensures that the guest allocates virtio queues with a Write-Back memory attribute on platforms that do not support Stage-2 Forced Write-Back (FWB), maintaining cache coherency between the guest driver and Firecracker's accesses to the virtio queue. Signed-off-by: mzh <[email protected]>
1 parent 71d3f07 commit 0aa8f6c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ and this project adheres to
5656
- [#5494](https://github.com/firecracker-microvm/firecracker/pull/5494): Fixed a
5757
watchdog soft lockup bug on microVMs restored from snapshots by calling
5858
KVM_KVMCLOCK_CTRL ioctl before resuming.
59+
- [#5538](https://github.com/firecracker-microvm/firecracker/pull/5538): Fixed a
60+
cache coherency issue on non-FWB aarch64 platforms by adding `dma-coherent`
61+
property to virtio-mmio nodes in the FDT.
5962

6063
## [1.13.0]
6164

src/vmm/src/arch/aarch64/fdt.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ fn create_psci_node(fdt: &mut FdtWriter) -> Result<(), FdtError> {
377377
fn create_virtio_node(fdt: &mut FdtWriter, dev_info: &MMIODeviceInfo) -> Result<(), FdtError> {
378378
let virtio_mmio = fdt.begin_node(&format!("virtio_mmio@{:x}", dev_info.addr))?;
379379

380+
// Adding the dma-coherent property ensures that the guest driver allocates the virtio
381+
// queue with the Write-Back attribute, maintaining cache coherency with Firecracker's
382+
// accesses to the virtio queue.
383+
fdt.property_null("dma-coherent")?;
380384
fdt.property_string("compatible", "virtio,mmio")?;
381385
fdt.property_array_u64("reg", &[dev_info.addr, dev_info.len])?;
382386
fdt.property_array_u32(

0 commit comments

Comments
 (0)