Bug 1619734

Summary: [RFE] vfio page accounting enhancements for viommu
Product: Red Hat Enterprise Linux 8 Reporter: Alex Williamson <alex.williamson>
Component: kernelAssignee: Alex Williamson <alex.williamson>
kernel sub component: KVM QA Contact: Pei Zhang <pezhang>
Status: CLOSED DEFERRED Docs Contact:
Severity: unspecified    
Priority: medium CC: ailan, alex.williamson, chayang, jhsiao, jinzhao, juzhang, knoel, laine, mst, peterx, yalzhang, yanghliu, yfu
Version: 8.1Keywords: FutureFeature, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-06 22:22:44 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Williamson 2018-08-21 15:29:27 UTC
Description of problem:

vfio manages user locked pages on a per container basis.  Containers represent an address space for a device.  When a viommu is not present, all assigned devices in a VM share the same address space and therefore share the same container.  In this mode, the locked memory limits of the QEMU process generally matches the overall RAM configured for the VM.

When a viommu is configured for the VM, whether disabled or in passthrough mode, each assigned device has its own address space and is therefore configured within its own container.  In passthrough mode, the address space for each container is required to map the full VM, therefore the locked memory requirements increase to the full VM address space PER assigned device.

If we intend to make viommu a default configuration, this increase in locked memory needs to be addressed, either by enlightening management tools to multiply the locked memory limit by the number of assigned devices or changing the vfio APIs to be able to associate multiple containers to the same user process and avoid duplicate accounting.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Alex Williamson 2019-07-09 19:10:52 UTC
*** Bug 1718124 has been marked as a duplicate of this bug. ***

Comment 10 Laine Stump 2021-01-26 00:51:23 UTC
*** Bug 1912093 has been marked as a duplicate of this bug. ***

Comment 11 yalzhang@redhat.com 2023-09-11 09:02:37 UTC
This is supported on rhel9.3 with kernel-5.14.0-362.1.1.el9_3.x86_64.
1) Start vm with intel iommu and 2 hostdev interfaces - Pass
2) Start vm with intel iommu and 1 hostdev interface, then hotplug another hostdev interface - Pass