Re: A lingering doubt on PCI-MMIO region of PCI-passthrough-device

From: Ajay Garg

Date: Sun Dec 14 2025 - 22:50:31 EST


Thanks Alex.

So does something like the following happen :

i)
During bootup, guest starts pci-enumeration as usual.

ii)
Upon discovering the "passthrough-device", guest carves the physical
MMIO regions (as usual) in the guest's physical-address-space, and
starts-to/attempts to program the BARs with the
guest-physical-base-addresses carved out.

iii)
These attempts to program the BARs (lying in the
"passthrough-device"'s config-space), are intercepted by the
hypervisor instead (causing a VM-exit in the interim).

iv)
The hypervisor uses the above info to update the EPT, to ensure GPA =>
HPA conversions go fine when the guest tries to access the PCI-MMIO
regions later (once gurst is fully booted up). Also, the hypervisor
marks the operation as success (without "really" re-programming the
BARs).

v)
The VM-entry is called, and the guest resumes with the "impression"
that the BARs have been "programmed by guest".

Is the above sequencing correct at a bird's view level?


Once again, many thanks for the help !

Thanks and Regards,
Ajay