Bug 27984 - Batch BAR sizing operations
Summary: Batch BAR sizing operations
Status: NEW
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: virt (show other bugs) virt
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: maqiao
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-11 09:33 UTC by nizhiguang
Modified: 2025-12-11 09:41 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nizhiguang hygon_group 2025-12-11 09:33:01 UTC
在外设直通虚拟机的环境中,PCI驱动会配置外设的Config space, 导致qemu中对外设的bar进行unmap和map操作,对于具有较大bar的设备,比如GPU设备,这种操作将会比较耗时,当直通多个GPU到虚拟机,情况变得更加糟糕。

在qemu的vfio_dma_map和vfio_dma_unmap中添加日志,可以观察到频繁unmap/map GPU的bar。
这个patch将多个配置PCI config space的操作合并,减少Qemu unmap/map GPU bar的操作,对于启动加速效果明显。

测试方法:
1. 不直通GPU到虚拟机,启动时间很短,大约1分钟
2. 直通1个GPU卡到虚拟机,启动时间变长,大约2分钟
3. 直通8张GPU卡到虚拟机,大约15分钟
Comment 1 小龙 admin 2025-12-11 09:41:09 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/6185