Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-16 Thread Michael S. Tsirkin
On Mon, Mar 16, 2020 at 07:20:02PM +, Peter Maydell wrote: > On Mon, 16 Mar 2020 at 18:40, Eduardo Habkost wrote: > > > > On Mon, Mar 16, 2020 at 06:08:54PM +, Peter Maydell wrote: > > > The usual approach is that if you don't have the Linux-specific > > > feature available you quietly

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-16 Thread Peter Maydell
On Mon, 16 Mar 2020 at 18:40, Eduardo Habkost wrote: > > On Mon, Mar 16, 2020 at 06:08:54PM +, Peter Maydell wrote: > > The usual approach is that if you don't have the Linux-specific > > feature available you quietly fall back to whatever the sensible > > behaviour is for when the feature

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-16 Thread Michael S. Tsirkin
On Mon, Mar 16, 2020 at 02:40:46PM -0400, Eduardo Habkost wrote: > On Mon, Mar 16, 2020 at 06:08:54PM +, Peter Maydell wrote: > > On Mon, 16 Mar 2020 at 17:51, Eduardo Habkost wrote: > > > Yes, but both MAP_SYNC and MAP_SHARED_VALIDATE aren't available > > > if the host is not Linux. > > > >

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-16 Thread Eduardo Habkost
On Sun, Mar 15, 2020 at 05:15:46PM -0400, Michael S. Tsirkin wrote: > On Sun, Mar 15, 2020 at 11:45:59AM -0400, Eduardo Habkost wrote: > > On Wed, Mar 11, 2020 at 07:23:42PM -0400, Eduardo Habkost wrote: > > > The CONFIG_LINUX check at the top of mmap-alloc.c never worked > > > because it was done

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-16 Thread Peter Maydell
On Mon, 16 Mar 2020 at 17:51, Eduardo Habkost wrote: > Yes, but both MAP_SYNC and MAP_SHARED_VALIDATE aren't available > if the host is not Linux. > > Defining MAP_SYNC to 0 on MIPS would restore the existing > behavior, so it seems like a reasonable step to fix the build > failure. But not even

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-16 Thread Eduardo Habkost
On Mon, Mar 16, 2020 at 06:08:54PM +, Peter Maydell wrote: > On Mon, 16 Mar 2020 at 17:51, Eduardo Habkost wrote: > > Yes, but both MAP_SYNC and MAP_SHARED_VALIDATE aren't available > > if the host is not Linux. > > > > Defining MAP_SYNC to 0 on MIPS would restore the existing > > behavior,

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-15 Thread Michael S. Tsirkin
On Sun, Mar 15, 2020 at 11:45:59AM -0400, Eduardo Habkost wrote: > On Wed, Mar 11, 2020 at 07:23:42PM -0400, Eduardo Habkost wrote: > > The CONFIG_LINUX check at the top of mmap-alloc.c never worked > > because it was done before including osdep.h. > > > > This means MAP_SYNC and

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-15 Thread Eduardo Habkost
On Wed, Mar 11, 2020 at 07:23:42PM -0400, Eduardo Habkost wrote: > The CONFIG_LINUX check at the top of mmap-alloc.c never worked > because it was done before including osdep.h. > > This means MAP_SYNC and MAP_SHARED_VALIDATE would always be set > to 0 at the beginning of the file. Luckily, this

Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-12 Thread Michael S. Tsirkin
On Wed, Mar 11, 2020 at 07:23:42PM -0400, Eduardo Habkost wrote: > The CONFIG_LINUX check at the top of mmap-alloc.c never worked > because it was done before including osdep.h. > > This means MAP_SYNC and MAP_SHARED_VALIDATE would always be set > to 0 at the beginning of the file. Luckily, this

[PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX

2020-03-11 Thread Eduardo Habkost
The CONFIG_LINUX check at the top of mmap-alloc.c never worked because it was done before including osdep.h. This means MAP_SYNC and MAP_SHARED_VALIDATE would always be set to 0 at the beginning of the file. Luckily, this didn't break when using recent glibc versions (2.28+), because those