1 Star 0 Fork 120

Jiabo Feng/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vhost-vdpa-add-VHOST_BACKEND_F_BYTEMAPLOG.patch 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-04-07 10:21 . QEMU update to version 8.2.0-5
From 3fe9a15feba924675ffcc5b797185091cfb8a007 Mon Sep 17 00:00:00 2001
From: libai <libai12@huawei.com>
Date: Mon, 4 Dec 2023 14:49:53 +0800
Subject: [PATCH] vhost-vdpa: add VHOST_BACKEND_F_BYTEMAPLOG
support VHOST_BACKEND_F_BYTEMAPLOG to support vhost
device bytemap logging.
Signed-off-by: libai <libai12@huawei.com>
---
hw/virtio/vhost-vdpa.c | 9 +++++----
include/standard-headers/linux/vhost_types.h | 2 ++
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 819b2d811a..ce8ff7f417 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -829,10 +829,11 @@ static int vhost_vdpa_set_features(struct vhost_dev *dev,
static int vhost_vdpa_set_backend_cap(struct vhost_dev *dev)
{
uint64_t features;
- uint64_t f = 0x1ULL << VHOST_BACKEND_F_IOTLB_MSG_V2 |
- 0x1ULL << VHOST_BACKEND_F_IOTLB_BATCH |
- 0x1ULL << VHOST_BACKEND_F_IOTLB_ASID |
- 0x1ULL << VHOST_BACKEND_F_SUSPEND;
+ uint64_t f = BIT_ULL(VHOST_BACKEND_F_IOTLB_MSG_V2) |
+ BIT_ULL(VHOST_BACKEND_F_IOTLB_BATCH) |
+ BIT_ULL(VHOST_BACKEND_F_IOTLB_ASID) |
+ BIT_ULL(VHOST_BACKEND_F_SUSPEND) |
+ BIT_ULL(VHOST_BACKEND_F_BYTEMAPLOG);
int r;
if (vhost_vdpa_call(dev, VHOST_GET_BACKEND_FEATURES, &features)) {
diff --git a/include/standard-headers/linux/vhost_types.h b/include/standard-headers/linux/vhost_types.h
index fd54044936..46fc53cd83 100644
--- a/include/standard-headers/linux/vhost_types.h
+++ b/include/standard-headers/linux/vhost_types.h
@@ -192,5 +192,7 @@ struct vhost_vdpa_iova_range {
#define VHOST_BACKEND_F_DESC_ASID 0x7
/* IOTLB don't flush memory mapping across device reset */
#define VHOST_BACKEND_F_IOTLB_PERSIST 0x8
+/* device can use bytemap log */
+#define VHOST_BACKEND_F_BYTEMAPLOG 0x3f
#endif
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JiaboFeng/qemu.git
git@gitee.com:JiaboFeng/qemu.git
JiaboFeng
qemu
qemu
master

搜索帮助