qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/3] memory: Fix access_with_adjusted_size(small


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH 3/3] memory: Fix access_with_adjusted_size(small size) on big-endian memory regions
Date: Thu, 27 Sep 2018 13:03:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

Hi Eric,

On 9/27/18 4:56 AM, Eric Blake wrote:
> On 9/26/18 7:24 PM, Philippe Mathieu-Daudé wrote:
>> Memory regions configured as DEVICE_BIG_ENDIAN (or
>> DEVICE_NATIVE_ENDIAN on
>> big-endian guest) behave incorrectly when the memory access 'size' is
>> smaller
>> than the implementation 'access_size'.
>>
> 
>>
>> Fix this by changing the access_fn() prototype to handle signed shift
>> values,
>> and modify the memory_region_shift_read|write_access() helpers to
>> correctly
>> arithmetic shift the opposite direction when the 'shift' value is
>> negative.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>>   memory.c | 34 +++++++++++++++++++++++-----------
>>   1 file changed, 23 insertions(+), 11 deletions(-)
>>
>> diff --git a/memory.c b/memory.c
>> index 48edf7dc23..a9f0fdc440 100644
>> --- a/memory.c
>> +++ b/memory.c
>> @@ -375,18 +375,30 @@ static void adjust_endianness(MemoryRegion *mr,
>> uint64_t *data, unsigned size)
>>   }
>>     static inline void memory_region_shift_read_access(uint64_t *value,
>> -                                                   unsigned shift,
>> +                                                   signed shift,
> 
> This is more typically spelled s/signed/int/

OK I'll update this when respining, once the meat of this patch got
reviewed.

And I'll also rebase the respin on Peter's series "Drop old_mmio
accessor support":
https://lists.gnu.org/archive/html/qemu-devel/2018-08/msg05472.html



reply via email to

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