qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] QEMU etc/e820 and fw_cfg


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] QEMU etc/e820 and fw_cfg
Date: Thu, 05 Mar 2015 11:42:46 +0100

  Hi,

> >> Thank you for responding. The situation I have is that my PCIe
> >> bridges are buggy and they seem to bypass the upstream PCIe hub
> >> IOMMU. The problem with this is that when the guest accesses
> >> RAM within it's emulated address space that overlaps with
> >> PCI I/O memory ranges in the host's address space, what should
> >> have ended up in RAM in the guest ends up trampling over the
> >> IOMEM on the host.
> > 
> > The iommu isn't involved here at all.  When the pci devices are
> > accessing host ram via busmaster dma, *this* goes through the iommu.
> > And unless you are trying to use pci device assignment the iommu should
> > not matter at all.
> 
> I am using PCI device assignment. I'm passing a PCI devices to the
> guest VM.

Oh.  I didn't expect someone trying to use device assign with a
known-broken iommu.  /me looks surprised.

> I'm pretty sure I am dealing with a hardware bug here. I have
> a workaround that I know works (mark the host's IOMEM areas
> as reserved) - I just need a way to get QEMU to adjust the
> exposed e820 map accordingly.

Add "e820_add_entry(start, size, E820_RESERVED)" calls in qemu.

Also make sure the firmware doesn't use those ranges, which may need
firmware patching.  At least seabios should happily add those
reservations to the e820 map, but will not look at them otherwise, so
you could end up with pci bars being mapped within the reserved regions.
The linux kernel might fix it up at boot though.

Not fully sure how OVMF behaves here.

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]