[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks |
Date: |
Tue, 26 Oct 2010 15:09:43 +0000 |
On Tue, Oct 26, 2010 at 8:05 AM, Avi Kivity <address@hidden> wrote:
> On 10/25/2010 08:38 PM, Blue Swirl wrote:
>>
>> >
>> > I don't really see why we need registration; cpu_register_io() takes
>> > function pointers, a size, and an opaque, and gives an integer handle
>> > in
>> > return. With the IOPort object approach, you set up the IOPort with
>> > function pointers, size is implied, and the opaque is derived using
>> > container_of(); the handle is simply the address of the object.
>>
>> With the handle, we can separate setting up the structures at device
>> level, and mapping the object using only the handle at bus or other
>> higher level. Can this be done with the object approach?
>
> I believe so. The handle is simply an indirect pointer, no?
Yes, but then the object should also contain size information. That
should not be needed for mapping at higher level.
>> The purpose of that patch series was to perform the separation for PCI
>> BARs. I wasn't so happy with the series, so I never pushed.
>
> In fact I think an IOPort is even more suitable; if we need additional
> attributes we can use a derived object:
>
> struct PCIIOPort {
> IOPort ioport;
> /* additional fields */
> };
One issue with my series was that it would be great if the devices
just had some BAR structures (used by PCI layer to map the devices)
inside PCI/qdev structures, but I invented that too late. Maybe this
can be addressed in your design?
- [Qemu-devel] [PATCH 0/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/24
- [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/24
- [Qemu-devel] Re: [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/24
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Blue Swirl, 2010/10/24
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/25
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Blue Swirl, 2010/10/25
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/26
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks,
Blue Swirl <=
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/26
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Anthony Liguori, 2010/10/26
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/26
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Blue Swirl, 2010/10/26
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Avi Kivity, 2010/10/27
- Re: [Qemu-devel] [PATCH 1/2] Type-safe ioport callbacks, Blue Swirl, 2010/10/27
[Qemu-devel] Re: [PATCH 1/2] Type-safe ioport callbacks, Juan Quintela, 2010/10/25
[Qemu-devel] [PATCH 2/2] piix4 acpi: convert io BAR to type-safe ioport callbacks, Avi Kivity, 2010/10/24
[Qemu-devel] Re: [PATCH 0/2] Type-safe ioport callbacks, Paolo Bonzini, 2010/10/24