Re: [RFC PATCH 0/2] PCI bus/CPU address translation for MMIO

Jinyu Tang <[email protected]>
Newsgroups org.kernel.vger.kvm
Message-ID <[email protected]>
On Wed, Jul 15, 2026 at 04:47:47PM +0100, Will Deacon wrote:
> On Wed, Jul 01, 2026 at 10:26:52PM +0800, Jinyu Tang wrote:
> > This series adds PCI bus/CPU address translation hooks with an identity
> > default, then wires up RISC-V to exercise a non-identity PCI MMIO window
> > through a new --pci-mmio-cpu-base option.
>
> Why is that something a user would want to do?

I added it as a simple way to exercise a non-identity PCI host bridge
window without adding a new machine type.

The main case is for VFIO MMIO. PCI BAR values are bus addresses,
while KVM installs VFIO BAR mappings/traps at guest CPU physical
addresses. Linux appears to make the same distinction when probing BARs:
pcibios_bus_to_resource() converts the BAR bus address to the CPU
resource address before it is used. Some real systems also appear to have
such non-identity PCI host bridge windows, for example the PCIe host
described in arch/arm64/boot/dts/hisilicon/hi3660.dtsi.

I added the option in this RFC to help validate kvmtool with our
in-development platform model, but I can remove it in v2. I think
kvmtool can add the internal PCI bus/CPU translation for non-identity
PCI windows.

Thanks,
Jinyu
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.