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: Gordan Bobic
Subject: Re: [Qemu-devel] QEMU etc/e820 and fw_cfg
Date: Thu, 05 Mar 2015 11:01:04 +0000
User-agent: Roundcube Webmail/1.0.3

On 2015-03-05 10:42, Gerd Hoffmann wrote:
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.

Since all I have is lemons I'm trying to make lemonade. :)

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.

Could you please point me at the correct file/function to add
the relevant block into?

I would probably look to do add these based on a config file
in /etc/qemu/. Happy to forward a patch for inclusion if I
manage to make it work.

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.

Are you saying that seabios will find reserved areas in the e820
map and despite that map a BAR into a reserved block? That's pretty
broken...

The linux kernel might fix it up at boot though.

If you mean inside the VM, Linux-on-Linux isn't my intended use case,
though.

Not fully sure how OVMF behaves here.

Thanks for your input. I'll find an appropriate place to ask
about OVMF once I have the QEMU patched appropriately.

Gordan



reply via email to

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