qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH v2 1/2] memory: Fix old portio word accesses
Date: Sun, 18 Sep 2011 18:28:16 +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 2011-09-18 17:45, Avi Kivity wrote:
> On 09/18/2011 06:43 PM, Jan Kiszka wrote:
>> On 2011-09-18 17:37, Avi Kivity wrote:
>> >  On 09/18/2011 03:51 PM, Jan Kiszka wrote:
>> >>  From: Jan Kiszka<address@hidden>
>> >>
>> >>  As we register old portio regions via ioport_register, we are also
>> >>  responsible for providing the word access wrapper.
>> >>
>> >>  Signed-off-by: Jan Kiszka<address@hidden>
>> >>  ---
>> >>
>> >>  Oops, was lacking a shift for word reads.
>> >>
>> >>    memory.c |   10 ++++++++++
>> >>    1 files changed, 10 insertions(+), 0 deletions(-)
>> >>
>> >>  diff --git a/memory.c b/memory.c
>> >>  index b3ee232..aef4702 100644
>> >>  --- a/memory.c
>> >>  +++ b/memory.c
>> >>  @@ -397,6 +397,11 @@ static void memory_region_iorange_read(IORange
>> >>  *iorange,
>> >>            *data = ((uint64_t)1<<   (width * 8)) - 1;
>> >>            if (mrp) {
>> >>                *data = mrp->read(mr->opaque, offset + mr->offset);
>> >>  +        } else if (width == 2) {
>> >>  +            mrp = find_portio(mr, offset, 1, false);
>> >>  +            assert(mrp);
>> >>  +            *data = mrp->read(mr->opaque, offset + mr->offset) |
>> >>  +                    (mrp->read(mr->opaque, offset + mr->offset +
>> >>  1)<<   8);
>> >>            }
>> >
>> >  What about width 4?
>>
>> This is PIO, limited by the x86 address space to 16 bit. Will add a
>> comment.
> 
> x86 PIO is not limited to 16 bits, just ISA, which memory.c knows
> nothing about.

Confused address and data, the former is limited 16, the latter can be
32 as well. But I guess only ISA models made use of the core's split up
service, and that's why QEMU limited itself accordingly.

> 
>> >   Why not use access_with_adjusted_size()?
>>
>> Because of different accessor prototypes.
>>
> 
> Can be thunked.  There is a different issue, a_w_a_s() can use small
> accesses to emulate large ones, but not vice versa.  It needs fixing
> anyway.
> 

IIRC, that's a feature: Devices not implementing small accesses tend to
refuse them in reality.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]