qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 3/5] exec: Support 64-bit operations in address_s


From: Richard Henderson
Subject: Re: [Qemu-devel] [PULL 3/5] exec: Support 64-bit operations in address_space_rw
Date: Wed, 17 Jul 2013 06:23:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

On 07/17/2013 04:09 AM, Paolo Bonzini wrote:
>>
>> Fails for me:
>>
>> qemu-system-x86_64: /work/armbru/qemu/exec.c:1927: memory_access_size: 
>> Assertion `l >= access_size_min' failed.
> 
> This:
> 
>     unsigned access_size_min = mr->ops->impl.min_access_size;
>     unsigned access_size_max = mr->ops->impl.max_access_size;
> 
> must be respectively:
> 
>     unsigned access_size_min = 1;
>     unsigned access_size_max = mr->ops->valid.max_access_size;
> 
> access_size_min can be 1 because erroneous accesses must not crash 
> QEMU, they should trigger exceptions in the guest or just return 
> garbage (depending on the CPU).  I'm not sure I understand the comment, 
> placing a 4-byte field at the last byte of a region makes no sense 
> (unless impl.unaligned is true).
> 
> access_size_max can be mr->ops->valid.max_access_size because memory.c 
> can and will still break accesses bigger than 
> mr->ops->impl.max_access_size.
> 
> Markus, can you try the minimal patch above?  Or this one that also
> does the consequent simplifications.

NAK.

If you remove the check here, you're just trading it for one in the device.
The device told you that it can't support a 1 byte read.  (Either that, or the
device incorrectly reported what it can actually do.)

The proper fix is to change the interface of memory_access_size such that it
can report errors.  Indeed, very likely we should change it and its callers to
also support over-sized reads, like access_with_adjusted_size in memory.c.


r~



reply via email to

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