Re: [PULL 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback

2020-07-28 Thread Peter Maydell
On Tue, 28 Jul 2020 at 17:04, Alex Bennée wrote: > Peter Maydell writes: > > Hi; Coverity thinks this conditional expression is suspicious > > (CID 1431059): > > > >> if (mmap_start != MAP_FAILED) { > >> munmap((void *) align_start, guest_size); > >> -

Re: [PULL 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback

2020-07-28 Thread Alex Bennée
Peter Maydell writes: > On Mon, 27 Jul 2020 at 13:24, Alex Bennée wrote: >> >> Plain MAP_FIXED has the undesirable behaviour of splatting exiting >> maps so we don't actually achieve what we want when looking for gaps. >> We should be using MAP_FIXED_NOREPLACE. As this isn't always available >

Re: [PULL 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback

2020-07-28 Thread Peter Maydell
On Mon, 27 Jul 2020 at 13:24, Alex Bennée wrote: > > Plain MAP_FIXED has the undesirable behaviour of splatting exiting > maps so we don't actually achieve what we want when looking for gaps. > We should be using MAP_FIXED_NOREPLACE. As this isn't always available > we need to potentially check th

[PULL 08/16] linux-user: don't use MAP_FIXED in pgd_find_hole_fallback

2020-07-27 Thread Alex Bennée
Plain MAP_FIXED has the undesirable behaviour of splatting exiting maps so we don't actually achieve what we want when looking for gaps. We should be using MAP_FIXED_NOREPLACE. As this isn't always available we need to potentially check the returned address to see if the kernel gave us what we aske