[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 11/14] ioport: Switch dispatching to memory c
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH v3 11/14] ioport: Switch dispatching to memory core layer |
Date: |
Mon, 24 Jun 2013 08:07:22 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2013-06-23 22:50, Hervé Poussineau wrote:
> Jan Kiszka a écrit :
>> From: Jan Kiszka <address@hidden>
>>
>> The current ioport dispatcher is a complex beast, mostly due to the
>> need to deal with old portio interface users. But we can overcome it
>> without converting all portio users by embedding the required base
>> address of a MemoryRegionPortio access into that data structure. That
>> removes the need to have the additional MemoryRegionIORange structure
>> in the loop on every access.
>>
>> To handle old portio memory ops, we simply install dispatching handlers
>> for portio memory regions when registering them with the memory core.
>> This removes the need for the old_portio field.
>>
>> We can drop the additional aliasing of ioport regions and also the
>> special address space listener. cpu_in and cpu_out now simply call
>> address_space_read/write. And we can concentrate portio handling in a
>> single source file.
>>
>> Signed-off-by: Jan Kiszka <address@hidden>
>> ---
>
> ...
>
>> +
>> +static void portio_write(void *opaque, hwaddr addr, uint64_t data,
>> + unsigned size)
>> +{
>> + MemoryRegionPortioList *mrpio = opaque;
>> + const MemoryRegionPortio *mrp = find_portio(mrpio, addr, size,
>> true);
>> +
>> + if (mrp) {
>> + mrp->write(mrpio->portio_opaque, mrp->base + addr, data);
>> + } else if (size == 2) {
>> + mrp = find_portio(mrpio, addr, 1, true);
>> + assert(mrp);
>> + mrp->write(mrpio->portio_opaque, mrp->base + addr, data & 0xff);
>> + mrp->write(mrpio->portio_opaque, mrp->base + addr + 1, data
>> >> 8);
>> + }
>> +}
>> +
>> +static const MemoryRegionOps portio_ops = {
>> + .read = portio_read,
>> + .write = portio_write,
>> + .valid.unaligned = true,
>> + .impl.unaligned = true,
>> +};
>> +
>
> You need to mark these operations as DEVICE_LITTLE_ENDIAN.
> In portio_write above, you clearly assume that data is in LE format.
Anything behind PIO is little endian, of course. Will add this.
>
> This fixes PPC PReP emulation, which would otherwise be broken with this
> patchset.
Thanks,
Jan
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 00/14] Refactor portio dispatching, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 03/14] wdt_ib700: replace register_ioport*, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 08/14] isa: implement isa_is_ioport_assigned via memory_region_find, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 02/14] applesmc: replace register_ioport*, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 04/14] i82374: replace register_ioport*, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 10/14] xen: Mark fixed platform I/O as unaligned, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 09/14] vmware-vga: Accept unaligned I/O accesses, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 14/14] ioport: Move portio types to ioport.h, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 11/14] ioport: Switch dispatching to memory core layer, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 13/14] vmport: Disentangle read handler type from portio, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 05/14] prep: replace register_ioport*, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 01/14] adlib: replace register_ioport*, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 06/14] vt82c686: replace register_ioport*, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 07/14] Privatize register_ioport_read/write, Jan Kiszka, 2013/06/22
- [Qemu-devel] [PATCH v3 12/14] ioport: Remove unused old dispatching services, Jan Kiszka, 2013/06/22
- Re: [Qemu-devel] [PATCH v3 00/14] Refactor portio dispatching, Hervé Poussineau, 2013/06/23