On 12/17/19 1:58 AM, Christophe de Dinechin wrote: > > >> On 17 Dec 2019, at 11:51, Paolo Bonzini <pbonz...@redhat.com> wrote: >> >> On 16/12/19 18:46, Philippe Mathieu-Daudé wrote: >>>>> >>>> >>>> I think in some cases this could be intentional, for example if you have >>>> different models with different BAR sizes and you organize this with the >>>> same tree of MemoryRegion and different sizes for the parent. >>> >>> But if a child is outside of the parent range, it can't be reached, >>> right? I'm confused, maybe AddressSpace can do that, but MemoryRegion >>> shouldn't? >> >> Yes, the idea is that you could have for one version of the device >> >> parent 0x000-0x7ff >> stuff 0x000-0x3ff >> morestuff 0x400-0x7ff >> >> and for another >> >> parent 0x000-0x3ff >> stuff 0x000-0x3ff >> morestuff 0x400-0x7ff >> >> where parent is the BAR, and you can share the code to generate the tree >> underneath parent. > > I can see why you would have code reuse reasons to do that, > but frankly it looks buggy and confusing. In the rare cases > where this is indented, maybe add a flag making it explicit?
The guest OS is programming the BAR, producing a configuration that, while it doesn't make sense, is also legal per PCI. QEMU cannot abort for this configuration. r~