From a858a1f1153494ad4a5c4d3ae70e9ae0806804f6 Mon Sep 17 00:00:00 2001 From: Damian Barabonkov Date: Wed, 6 May 2026 08:17:45 +0200 Subject: [PATCH] docs: Document VFIO mmap BAR exclusion Explain how operators can exclude selected VFIO BARs from mmap when they know their workloads do not require MMIO access to those regions. Documenting the option separately keeps the new device argument discoverable and calls out the valid BAR index range. Signed-off-by: Damian Barabonkov Assisted-by: OpenCode:gpt-5.5 --- docs/vfio.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/vfio.md b/docs/vfio.md index 15be31e01..9bdf37732 100644 --- a/docs/vfio.md +++ b/docs/vfio.md @@ -159,6 +159,17 @@ nvidia-smi topo -p2p r GPU7 OK OK OK OK OK OK OK X ``` +Some VFIO devices expose BARs that should not be mmapped by the VMM even when +the kernel reports them as mappable. The `x_exclude_mmap_bars` config argument can +be used to skip mmap for specific BAR indices. + +BAR indices must be between 0 and 5 inclusive. The following example disables +mmap for BAR 2 of the assigned device: + +``` +--device path=/sys/bus/pci/devices/0000:01:00.0/,x_exclude_mmap_bars=[2] +``` + Some VFIO devices have a 32-bit mmio BAR. When using many such devices, it is possible to exhaust the 32-bit mmio space available on a PCI segment. The following example demonstrates an example device with a 16 MiB 32-bit mmio BAR.