On 2011-05-19 10:13, Avi Kivity wrote: > On 05/19/2011 11:08 AM, Jan Kiszka wrote: >> On 2011-05-19 10:06, Avi Kivity wrote: >> > On 05/18/2011 10:40 PM, Jan Kiszka wrote: >> >> On 2011-05-18 15:12, Avi Kivity wrote: >> >> > void cpu_register_memory_region(MemoryRegion *mr, >> >> target_phys_addr_t addr); >> >> >> >> OK, let's allow overlapping, but make it explicit: >> >> >> >> void cpu_register_memory_region_overlap(MemoryRegion *mr, >> >> target_phys_addr_t addr, >> >> int priority); >> >> >> >> We need that ordering, so we need an interface. Regions registered >> via >> >> cpu_register_memory_region must not overlap with existing one or >> we will >> >> throw an hwerror. And they shall get a low default priority. >> >> >> > >> > PCI BARs can overlap with anything. So any region can overlap with >> any >> > other region. >> >> I know, but that result is unspecified anyway. The user (guest OS) can't >> expect any reasonable result. We rather need priorities for useful >> overlapping. > > Unspecified doesn't mean abort. It means we need to specify something > (which translates to: we get to pick the priorities). Of course, PCI bars would have to be registered via cpu_register_memory_region_overlap, just specifying the default priority. Here we know that overlapping can happen and is not a bug in the board emulation. I want to avoid that such use cases make overlapping generally legal, papering over real bugs. Jan