qemu/include/exec
Igor Mammedov 8e46bbf362 memory_region_present: return false if address is not found in child MemoryRegion
Windows XP shows COM2 port as non functional in
"Device Manager" although no COM2 port backing device
is present in QEMU.

This regression is really due to
3bb28b7208b349e7a1b326e3c6ef9efac1d462bf?
    memory: Provide separate handling of unassigned io ports accesses

That is caused by the fact that QEMU reports to
OSPM that device is present by setting 5th bit in
PII4XPM.pci_conf[0x67] register when COM2 doesn't
exist.

It happens due to memory_region_present(io_as, 0x2f8)
returning false positive since 0x2f8 address eventually
translates into catchall io_as address space.

Fix memory_region_present(parent, addr) by returning
true only if addr maps into a MemoryRegion within
parent (excluding parent itself), to match its
doc comment.

While at it fix copy/paste error in
memory_region_present() doc comment.

Note: this is a temporary hack: we really need better handling for
unassigned regions, we should avoid fallback regions since they are bad
for performance (breaking radix tree assumption that the data structure
is sparsely populated); for memory we need to fix this to implement PCI
master abort properly, anyway.

Cc: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-03-09 21:09:37 +02:00
..
user abitypes.h: Remove incorrect ARM ABI_LLONG_ALIGNMENT 2013-09-10 19:09:33 +01:00
address-spaces.h exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
cpu-all.h memory: split dirty bitmap into three 2014-01-13 14:04:54 +01:00
cpu-common.h exec: Make cpu_physical_memory_write_rom input an AS 2014-02-11 22:57:44 +10:00
cpu-defs.h cpu: Drop cpu_model_str from CPU_COMMON 2013-10-07 11:48:47 +02:00
cputlb.h exec: Resolve subpages in one step except for IOTLB fills 2013-06-20 16:32:46 +02:00
def-helper.h tcg: Put target helper data into an array. 2013-10-10 11:44:25 -07:00
exec-all.h cpu: Add per-cpu address space 2014-02-11 22:56:37 +10:00
gdbstub.h cpu: Introduce CPUClass::gdb_{read,write}_register() 2013-07-27 00:04:17 +02:00
gen-icount.h tcg: Change tcg_gen_exit_tb argument to uintptr_t 2013-09-02 09:08:30 -07:00
hwaddr.h hwaddr: Make hwaddr type usable beyond softmmu 2013-06-28 13:25:13 +02:00
ioport.h portio: Allow to mark portio lists as coalesced MMIO flushing 2013-10-17 17:24:15 +02:00
memory-internal.h memory: split cpu_physical_memory_* functions to its own include 2014-01-13 14:04:54 +01:00
memory.h memory_region_present: return false if address is not found in child MemoryRegion 2014-03-09 21:09:37 +02:00
poison.h exec: Remove env from list of poisoned names 2013-07-27 11:22:54 +04:00
ram_addr.h exec: fix ram_list dirty map optimization 2014-02-04 16:45:22 +01:00
softmmu-semi.h exec: Change cpu_memory_rw_debug() argument to CPUState 2013-07-23 02:41:33 +02:00
softmmu_exec.h exec: Split softmmu_defs.h 2013-09-02 09:08:30 -07:00
softmmu_header.h exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
softmmu_template.h cpu: Add per-cpu address space 2014-02-11 22:56:37 +10:00
spinlock.h exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00