[SeaBIOS] [Qemu-devel] [PATCH v2] map 64-bit PCI BARs at location provided by emulator
Michael S. Tsirkin
mst at redhat.com
Mon Oct 14 18:37:14 CEST 2013
On Mon, Oct 14, 2013 at 06:15:25PM +0200, Igor Mammedov wrote:
> On Mon, 14 Oct 2013 17:00:47 +0300
> "Michael S. Tsirkin" <mst at redhat.com> wrote:
> > On Mon, Oct 14, 2013 at 03:04:45PM +0200, Gerd Hoffmann wrote:
> > > Hi,
> > >
> > > > >
> > > > > To me it makes more sense to just go the direct route and say "please
> > > > > put the 64bit bars at this location" rather than indirect "we might want
> > > > > hotplug $thatmuch memory" and then expect the bios to leave that much
> > > > > room.
> > > >
> > > > Only if the newfeature address is not under bios control. I know that
> > > > bios is simplistic so all it cares about ATM is pci window, but can't
> > > > shake the impression that we are better off telling the guest what's
> > > > going on rather than what it should do.
> > > >
> > > > In particular the issue that was discussed (what to do
> > > > if pci start is set by host to below ram end)
> > > > will simply go away if we pass in an incremental
> > > > value: there will be no invalid configurations.
> > >
> > > The "what is going on" might need updates in both qemu and seabios if
> > > something new goes on. For example qemu getting support non-contignous
> > > memory. The "leave that much address space free above memory" suddenly
> > > is ambiguous as there are two (or more) memory blocks above 4g. "please
> > > place 64bit pci bars there" continues to work just fine.
> > Yes but at the cost of overspecifying it.
> > I think it's down to the name: it's called pcimem64-start
> > but it can actually be less than 4G and we need to worry what to
> > do then. Also, 64 doesn't really mean >4G.
> Why 64bit PCI window can't start below 4G, is there a SPEC that forbids it?
> If hardware says it has window start below 4G, than it's build this way.
That's the issue.
There's no such thing as a 64 bit window in spec or any
On PIIX RAM had priority so where you put RAM
you could't put PCI devices.
This is what creates the "64 bit window".
> I'd use v1 of this patch, i.e. if QEMU tells that window starts below 4G,
> then it supports such configuration.
How does this work exactly?
"64 bit window" is simply BIOS putting devices
above 4G if it can't put them all below 4G.
It seems that if you create this config you will
just get a broken system.
> > So how about "reserve-memory-over-4g"?
> > bios then does 1ull << 32 + reserve-memory-over-4g
> > to figure out how much to skip.
> That name means making implicit assumption that PCI windows start after
> "reserve-memory-over-4g". I'd rather have an explicit interface that tells
> where window starts, without making any assumptions.
Not at all. It allows bios to put pci where it wants.
QEMU just tells bios where it *can't* go.
> Alternatively how about
> something like "pcimem64-start-high-dword" and making it 32 bit value
> passing 32-63 bits?
It's an option ...
More information about the SeaBIOS