Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread Igor Mammedov
On Thu, 27 Sep 2018 13:58:45 +0200 David Hildenbrand wrote: > On 27/09/2018 13:53, Igor Mammedov wrote: > > On Thu, 27 Sep 2018 10:58:47 +0200 > > David Hildenbrand wrote: > > > >> On 27/09/2018 10:47, Igor Mammedov wrote: > >>> On Thu, 27 Sep 2018 10:13:07 +0200 > >>> David Hildenbrand wr

Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread David Hildenbrand
On 27/09/2018 13:53, Igor Mammedov wrote: > On Thu, 27 Sep 2018 10:58:47 +0200 > David Hildenbrand wrote: > >> On 27/09/2018 10:47, Igor Mammedov wrote: >>> On Thu, 27 Sep 2018 10:13:07 +0200 >>> David Hildenbrand wrote: >>> On 27/09/2018 10:02, Igor Mammedov wrote: > On Wed, 26 Se

Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread Igor Mammedov
On Thu, 27 Sep 2018 10:58:47 +0200 David Hildenbrand wrote: > On 27/09/2018 10:47, Igor Mammedov wrote: > > On Thu, 27 Sep 2018 10:13:07 +0200 > > David Hildenbrand wrote: > > > >> On 27/09/2018 10:02, Igor Mammedov wrote: > >>> On Wed, 26 Sep 2018 11:41:59 +0200 > >>> David Hildenbrand wr

Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread David Hildenbrand
On 27/09/2018 10:47, Igor Mammedov wrote: > On Thu, 27 Sep 2018 10:13:07 +0200 > David Hildenbrand wrote: > >> On 27/09/2018 10:02, Igor Mammedov wrote: >>> On Wed, 26 Sep 2018 11:41:59 +0200 >>> David Hildenbrand wrote: >>> Make address_space_end point at the real end, instead of end +

Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread Igor Mammedov
On Thu, 27 Sep 2018 10:13:07 +0200 David Hildenbrand wrote: > On 27/09/2018 10:02, Igor Mammedov wrote: > > On Wed, 26 Sep 2018 11:41:59 +0200 > > David Hildenbrand wrote: > > > >> Make address_space_end point at the real end, instead of end + 1, so we > >> don't > >> have to handle special

Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread David Hildenbrand
On 27/09/2018 10:02, Igor Mammedov wrote: > On Wed, 26 Sep 2018 11:41:59 +0200 > David Hildenbrand wrote: > >> Make address_space_end point at the real end, instead of end + 1, so we don't >> have to handle special cases like it being 0. This will allow us to >> place a memory device at the very

Re: [Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-27 Thread Igor Mammedov
On Wed, 26 Sep 2018 11:41:59 +0200 David Hildenbrand wrote: > Make address_space_end point at the real end, instead of end + 1, so we don't > have to handle special cases like it being 0. This will allow us to > place a memory device at the very end of the guest physical 64bit address > space (if

[Qemu-devel] [PATCH v4 04/24] memory-device: handle integer overflows properly

2018-09-26 Thread David Hildenbrand
Although unlikely in practice, we could have integer overflows on some calculations based on addresses and sizes, leading to error checks not triggering. Let's properly handle this whenever we do an addition. Make address_space_end point at the real end, instead of end + 1, so we don't have to han