[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/22] ioport: reserve the whole range of an I/O port
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 15/22] ioport: reserve the whole range of an I/O port in the AddressSpace |
Date: |
Tue, 28 Apr 2015 16:40:22 +0200 |
When an I/O port is more than 1 byte long, ioport.c is currently
creating "short" regions, for example 0x1ce-0x1ce for the 16-bit
Bochs index port. When I/O ports are memory mapped, and thus
accessed via a subpage_ops memory region, subpage_accepts gets
confused because it finds a hole at 0x1cf and rejects the access.
In order to fix this, modify registration of the region to cover
the whole size of the I/O port. Attempts to access an invalid
port will be blocked by find_portio returning NULL.
This only affects the VBE DISPI regions. For all other cases,
the MemoryRegionPortio entries for 2- or 4-byte accesses overlap
an entry for 1-byte accesses, thus the size of the memory region
is not affected.
Reported-by: Zoltan Balaton <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
ioport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ioport.c b/ioport.c
index 090c262..304d5d6 100644
--- a/ioport.c
+++ b/ioport.c
@@ -269,7 +269,7 @@ void portio_list_add(PortioList *piolist,
/* Handle the first entry specially. */
off_last = off_low = pio_start->offset;
- off_high = off_low + pio_start->len;
+ off_high = off_low + pio_start->len + pio_start->size - 1;
count = 1;
for (pio = pio_start + 1; pio->size != 0; pio++, count++) {
@@ -284,10 +284,10 @@ void portio_list_add(PortioList *piolist,
/* ... and start collecting anew. */
pio_start = pio;
off_low = off_last;
- off_high = off_low + pio->len;
+ off_high = off_low + pio->len + pio_start->size - 1;
count = 0;
} else if (off_last + pio->len > off_high) {
- off_high = off_last + pio->len;
+ off_high = off_last + pio->len + pio_start->size - 1;
}
}
--
2.3.5
- [Qemu-devel] [PULL 05/22] exec: Notify cpu_register_map_client caller if the bounce buffer is available, (continued)
- [Qemu-devel] [PULL 05/22] exec: Notify cpu_register_map_client caller if the bounce buffer is available, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 06/22] dma-helpers: Fix race condition of continue_after_map_failure and dma_aio_cancel, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 07/22] memory: add memory_region_ram_resize, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 08/22] acpi-build: remove dependency from ram_addr.h, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 09/22] sun4m: fix slavio sysctrl and led register sizes, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 10/22] sb16: remove useless mixer_write_indexw, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 11/22] gus: clean up MemoryRegionPortio, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 12/22] ide: there is only one data port, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 13/22] ioport: remove wrong comment, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 14/22] ioport: loosen assertions on emulation of 16-bit ports, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 15/22] ioport: reserve the whole range of an I/O port in the AddressSpace,
Paolo Bonzini <=
- [Qemu-devel] [PULL 16/22] exec: Respect as_translate_internal length clamp, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 18/22] milkymist: do not modify libs-softmmu, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 17/22] configure: Add support for tcmalloc, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 19/22] Makefile.target: prepend $libs_softmmu to $LIBS, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 21/22] translate-all: use bitmap helpers for PageDesc's bitmap, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 20/22] target-i386: disable LINT0 after reset, Paolo Bonzini, 2015/04/28
- [Qemu-devel] [PULL 22/22] nbd/trivial: fix type cast for ioctl, Paolo Bonzini, 2015/04/28
- Re: [Qemu-devel] [PULL 00/22] Memory, TCG, NBD, build system changes for 2015-04-27, Peter Maydell, 2015/04/28