From: Wei Yang <richardw.yang@linux.intel.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Wei Yang <richardw.yang@linux.intel.com>,
qemu-devel@nongnu.org, xiaoguangrong.eric@gmail.com,
pbonzini@redhat.com, pagupta@redhat.com,
yu.c.zhang@linux.intel.com, mst@redhat.com, ehabkost@redhat.com,
imammedo@redhat.com, dan.j.williams@intel.com,
yi.z.zhang@linux.intel.com,
Haozhong Zhang <haozhong.zhang@intel.com>
Subject: Re: [Qemu-devel] [PATCH v14 1/2] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()
Date: Wed, 24 Apr 2019 09:01:05 +0800 [thread overview]
Message-ID: <20190424010105.GA12824@richard> (raw)
In-Reply-To: <20190423092518.GD32465@stefanha-x1.localdomain>
On Tue, Apr 23, 2019 at 10:25:18AM +0100, Stefan Hajnoczi wrote:
[...]
>> +#ifdef CONFIG_LINUX
>> +#include <linux/mman.h>
>> +#else /* !CONFIG_LINUX */
>> +#define MAP_SYNC 0x0
>> +#define MAP_SHARED_VALIDATE 0x0
>> +#endif /* CONFIG_LINUX */
>
>MAP_SHARED_VALIDATE is is from 2017:
>
> commit 1c9725974074a047f6080eecc62c50a8e840d050
> Author: Dan Williams <dan.j.williams@intel.com>
> Date: Wed Nov 1 16:36:30 2017 +0100
>
> mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags
>
>This code fails to compile on Linux hosts with pre-4.15 headers.
>
Ok, qemu build will fail on pre-4.15 linux.
>Instead you could use the following (even on Linux!):
>
> #ifndef MAP_SYNC
> #define MAP_SYNC 0
> #endif
> #ifndef MAP_SHARED_VALIDATE
> #define MAP_SHARED_VALIDATE 0
> #endif
>
>Either way:
You mean replace the above code to:
#ifdef CONFIG_LINUX
#include <linux/mman.h>
#endif /* CONFIG_LINUX */
#ifndef MAP_SYNC
#define MAP_SYNC 0
#endif
#ifndef MAP_SHARED_VALIDATE
#define MAP_SHARED_VALIDATE 0
#endif
>
>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
--
Wei Yang
Help you, Help me
WARNING: multiple messages have this Message-ID (diff)
From: Wei Yang <richardw.yang@linux.intel.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: pagupta@redhat.com, xiaoguangrong.eric@gmail.com, mst@redhat.com,
qemu-devel@nongnu.org, yi.z.zhang@linux.intel.com,
yu.c.zhang@linux.intel.com,
Wei Yang <richardw.yang@linux.intel.com>,
Haozhong Zhang <haozhong.zhang@intel.com>,
imammedo@redhat.com, pbonzini@redhat.com,
dan.j.williams@intel.com, ehabkost@redhat.com
Subject: Re: [Qemu-devel] [PATCH v14 1/2] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap()
Date: Wed, 24 Apr 2019 09:01:05 +0800 [thread overview]
Message-ID: <20190424010105.GA12824@richard> (raw)
Message-ID: <20190424010105.HeG1_cHsnZz_O-h9laCMIqmnsaGrA9hLr6OBYDe8AEA@z> (raw)
In-Reply-To: <20190423092518.GD32465@stefanha-x1.localdomain>
On Tue, Apr 23, 2019 at 10:25:18AM +0100, Stefan Hajnoczi wrote:
[...]
>> +#ifdef CONFIG_LINUX
>> +#include <linux/mman.h>
>> +#else /* !CONFIG_LINUX */
>> +#define MAP_SYNC 0x0
>> +#define MAP_SHARED_VALIDATE 0x0
>> +#endif /* CONFIG_LINUX */
>
>MAP_SHARED_VALIDATE is is from 2017:
>
> commit 1c9725974074a047f6080eecc62c50a8e840d050
> Author: Dan Williams <dan.j.williams@intel.com>
> Date: Wed Nov 1 16:36:30 2017 +0100
>
> mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags
>
>This code fails to compile on Linux hosts with pre-4.15 headers.
>
Ok, qemu build will fail on pre-4.15 linux.
>Instead you could use the following (even on Linux!):
>
> #ifndef MAP_SYNC
> #define MAP_SYNC 0
> #endif
> #ifndef MAP_SHARED_VALIDATE
> #define MAP_SHARED_VALIDATE 0
> #endif
>
>Either way:
You mean replace the above code to:
#ifdef CONFIG_LINUX
#include <linux/mman.h>
#endif /* CONFIG_LINUX */
#ifndef MAP_SYNC
#define MAP_SYNC 0
#endif
#ifndef MAP_SHARED_VALIDATE
#define MAP_SHARED_VALIDATE 0
#endif
>
>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
--
Wei Yang
Help you, Help me
next prev parent reply other threads:[~2019-04-24 1:01 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 0:48 [Qemu-devel] [PATCH v14 0/2] support MAP_SYNC for memory-backend-file Wei Yang
2019-04-22 0:48 ` Wei Yang
2019-04-22 0:48 ` [Qemu-devel] [PATCH v14 1/2] util/mmap-alloc: support MAP_SYNC in qemu_ram_mmap() Wei Yang
2019-04-22 0:48 ` Wei Yang
2019-04-23 9:25 ` Stefan Hajnoczi
2019-04-23 9:25 ` Stefan Hajnoczi
2019-04-24 1:01 ` Wei Yang [this message]
2019-04-24 1:01 ` Wei Yang
2019-04-25 8:26 ` Stefan Hajnoczi
2019-04-25 8:26 ` Stefan Hajnoczi
2019-04-22 0:48 ` [Qemu-devel] [PATCH v14 2/2] docs: Added MAP_SYNC documentation Wei Yang
2019-04-22 0:48 ` Wei Yang
2019-04-23 9:26 ` Stefan Hajnoczi
2019-04-23 9:26 ` Stefan Hajnoczi
2019-04-23 9:57 ` Pankaj Gupta
2019-04-23 9:57 ` Pankaj Gupta
2019-04-22 12:34 ` [Qemu-devel] [PATCH v14 0/2] support MAP_SYNC for memory-backend-file Michael S. Tsirkin
2019-04-22 12:34 ` Michael S. Tsirkin
2019-04-22 18:22 ` Eduardo Habkost
2019-04-22 18:22 ` Eduardo Habkost
2019-04-23 2:41 ` Wei Yang
2019-04-23 2:41 ` Wei Yang
2019-04-23 12:43 ` Michael S. Tsirkin
2019-04-23 12:43 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190424010105.GA12824@richard \
--to=richardw.yang@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=ehabkost@redhat.com \
--cc=haozhong.zhang@intel.com \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=pagupta@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=xiaoguangrong.eric@gmail.com \
--cc=yi.z.zhang@linux.intel.com \
--cc=yu.c.zhang@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.