1 Star 0 Fork 131

XuFei/src_openeuler_qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vfio-common-Avoid-unmap-ram-section-at-vfio_listener.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
From 9d7b782a0b2c5288e82f3064b4c5b7bf18887280 Mon Sep 17 00:00:00 2001
From: Kunkun Jiang <jiangkunkun@huawei.com>
Date: Sat, 31 Jul 2021 10:02:18 +0800
Subject: [PATCH] vfio/common: Avoid unmap ram section at
vfio_listener_region_del() in nested mode
The ram section will be unmapped at vfio_prereg_listener_region_del()
in nested mode. So let's avoid unmap ram section at
vfio_listener_region_dev().
Signed-off-by: Kunkun Jiang <jiangkunkun@huawei.com>
---
hw/vfio/common.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index d05a485808..bdfcc854fe 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -1441,6 +1441,16 @@ static void vfio_listener_region_del(MemoryListener *listener,
}
}
+ /*
+ * In nested mode, stage 2 (gpa->hpa) and the stage 1
+ * (giova->gpa) are set separately. The ram section
+ * will be unmapped in vfio_prereg_listener_region_del().
+ * Hence it doesn't need to unmap ram section here.
+ */
+ if (container->iommu_type == VFIO_TYPE1_NESTING_IOMMU) {
+ return;
+ }
+
/*
* FIXME: We assume the one big unmap below is adequate to
* remove any individual page mappings in the IOMMU which
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/flyking001/src_openeuler_qemu.git
git@gitee.com:flyking001/src_openeuler_qemu.git
flyking001
src_openeuler_qemu
src_openeuler_qemu
master

搜索帮助