[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: |
Mon, 9 Nov 2015 13:20:56 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 09/11/2015 13:01, Pierre Morel wrote:
>>> This leads to have UINT64_MAX represented with {1, 0} instead of
>>> {0, UINT64_MAX} while {1, 0} is 2^64. This again leads to have
>>> unnecessary and obfuscating transformations with int128_2_64() to
>>> test for UINT64_MAX and return {1,0} in memory_region_init()
>>> while using inverse translation test{1,0} and return UINT64_MAX
>>> in memory_region_size()>>
>>
>> Yes, the use of UINT64_MAX for 2^64 is a hack, but it is unrelated to
>> the signedness of Int128.
>
> OK, we agree it is a hack,
> but sorry, I should have missed something,
> because I do not understand what this hack is useful for.
It's used in the size argument of memory_region_init*, so that it can
remain an uint64_t. The size is usually small (up to 2^40, say) unless
it is 2^64 meaning "the whole address space". The latter case is
covered by UINT64_MAX.
Paolo
- [Qemu-devel] [PATCH 4/7] 128bit: adapt sparc mmu_helper for UInt128, (continued)
- [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, 2015/11/05