Re: [Qemu-devel] [Qemu-arm] [PATCH 2/2] hw/arm/smmu-common: Fix coverity issue in get_block_pte_address

2018-05-17 Thread Auger Eric
Hi Philippe, On 05/16/2018 10:01 PM, Philippe Mathieu-Daudé wrote: > On 05/16/2018 01:23 PM, Peter Maydell wrote: >> On 16 May 2018 at 16:16, Philippe Mathieu-Daudé wrote: >>> Hi Eric, >>> >>> On 05/16/2018 03:03 PM, Eric Auger wrote: Coverity points out that this can

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/2] hw/arm/smmu-common: Fix coverity issue in get_block_pte_address

2018-05-16 Thread Philippe Mathieu-Daudé
On 05/16/2018 01:23 PM, Peter Maydell wrote: > On 16 May 2018 at 16:16, Philippe Mathieu-Daudé wrote: >> Hi Eric, >> >> On 05/16/2018 03:03 PM, Eric Auger wrote: >>> Coverity points out that this can overflow if n > 31, >>> because it's only doing 32-bit arithmetic. Let's use

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/2] hw/arm/smmu-common: Fix coverity issue in get_block_pte_address

2018-05-16 Thread Peter Maydell
On 16 May 2018 at 16:16, Philippe Mathieu-Daudé wrote: > Hi Eric, > > On 05/16/2018 03:03 PM, Eric Auger wrote: >> Coverity points out that this can overflow if n > 31, >> because it's only doing 32-bit arithmetic. Let's use 1ULL instead >> of 1. Also the formulae used to compute

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/2] hw/arm/smmu-common: Fix coverity issue in get_block_pte_address

2018-05-16 Thread Philippe Mathieu-Daudé
Hi Eric, On 05/16/2018 03:03 PM, Eric Auger wrote: > Coverity points out that this can overflow if n > 31, > because it's only doing 32-bit arithmetic. Let's use 1ULL instead > of 1. Also the formulae used to compute n can be replaced by > the level_shift() macro. This level_shift() replacement