[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 0/7] int128: reparing broken 128 bit memory calc
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 0/7] int128: reparing broken 128 bit memory calculations |
Date: |
Thu, 5 Nov 2015 17:32:24 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 05/11/2015 17:18, Pierre Morel wrote:
> The size of a memory area can never be negative.
> It follows it must be defined as an unsigned value.
>
> Let's modify the memory regions size to unsigned 128 integer
> and modify accordingly the 128 bit arithmetic.
>
> This makes memory size calculations easier and easier to understand.
>
> I fear loud protest but really, it is a broken concept that
> obfuscate the code.
You are right in fearing loud protest, though the protest is for the
lack of explanation of what is broken.
Since the values are never going to be > 2^65, there is no chance of
overflow. On the other hand there are cases where we compute
start+size-1, and size-1 *could* overflow if you use unsigned integers.
So I am not sure... why?
Paolo
- [Qemu-devel] [PATCH 0/7] int128: reparing broken 128 bit memory calculations, Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 4/7] 128bit: adapt sparc mmu_helper for UInt128, Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 1/7] int128: use unsigned 128 bit arithmetic, Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 2/7] memory: modify memory size for an unsigned 128bit int, Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 6/7] 128bit: adapt Virtio for UInt128 arithmetic, Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 7/7] 128bits: some HW components use 128bit arithmetic., Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 5/7] 128bit: adapt VFIO for UInt128 arithmetic, Pierre Morel, 2015/11/05
- [Qemu-devel] [PATCH 3/7] 128bit: adapt core files for unsigned 128bits, Pierre Morel, 2015/11/05
- Re: [Qemu-devel] [PATCH 0/7] int128: reparing broken 128 bit memory calculations,
Paolo Bonzini <=