From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: thibaut.collet@6wind.com, qemu-devel@nongnu.org, haifeng.lin@huawei.com
Subject: Re: [Qemu-devel] [PATCH RFC 2/6] posix: add linux-only memfd fallback
Date: Tue, 28 Jul 2015 10:11:30 +0200 [thread overview]
Message-ID: <55B73932.5000809@redhat.com> (raw)
In-Reply-To: <20150723181931-mutt-send-email-mst@redhat.com>
On 23/07/2015 17:25, Michael S. Tsirkin wrote:
> > +#ifdef CONFIG_LINUX
> > +
> > +#ifndef F_LINUX_SPECIFIC_BASE
> > +#define F_LINUX_SPECIFIC_BASE 1024
> > +#endif
> > +
> > +#ifndef F_ADD_SEALS
> > +#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
> > +#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
> > +
> > +#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
> > +#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
> > +#define F_SEAL_GROW 0x0004 /* prevent file from growing */
> > +#define F_SEAL_WRITE 0x0008 /* prevent writes */
> > +#endif
>
> These are from include/uapi/linux/fcntl.h,
> they should be imported into linux-headers I think.
linux-headers is usually used for virt-related features that we want in
QEMU a few weeks before they are distributed upstream.
Here, I think just including linux/fcntl.h is enough.
>> +#ifndef __NR_memfd_create
>> +# if defined __x86_64__
>> +# define __NR_memfd_create 319
>> +# elif defined __arm__
>> +# define __NR_memfd_create 385
>> +# elif defined __aarch64__
>> +# define __NR_memfd_create 279
>> +# elif defined _MIPS_SIM
>> +# if _MIPS_SIM == _MIPS_SIM_ABI32
>> +# define __NR_memfd_create 4354
>> +# endif
>> +# if _MIPS_SIM == _MIPS_SIM_NABI32
>> +# define __NR_memfd_create 6318
>> +# endif
>> +# if _MIPS_SIM == _MIPS_SIM_ABI64
>> +# define __NR_memfd_create 5314
>> +# endif
>
> What's defining all these macros?
They're in asm/unistd.h.
I think that, instead of making qemu/osdep.h the new qemu-common.h, the
wrappers added by patch 3 should be declared in a new header
qemu/memfd.h. The implementation in util/memfd.c can include both
linux/fcntl.h and asm/unistd.h.
Paolo
next prev parent reply other threads:[~2015-07-28 8:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 1:36 [Qemu-devel] [PATCH RFC 0/6] vhost-user: add migration log support Marc-André Lureau
2015-07-23 1:36 ` [Qemu-devel] [PATCH RFC 1/6] configure: probe for memfd Marc-André Lureau
2015-07-23 1:36 ` [Qemu-devel] [PATCH RFC 2/6] posix: add linux-only memfd fallback Marc-André Lureau
2015-07-23 15:25 ` Michael S. Tsirkin
2015-07-28 8:11 ` Paolo Bonzini [this message]
2015-07-28 10:58 ` Marc-André Lureau
2015-07-28 11:50 ` Paolo Bonzini
2015-07-28 14:25 ` Marc-André Lureau
2015-07-28 16:37 ` Paolo Bonzini
2015-07-23 1:36 ` [Qemu-devel] [PATCH RFC 3/6] osdep: add memfd helpers Marc-André Lureau
2015-07-23 1:36 ` [Qemu-devel] [PATCH RFC 4/6] vhost: alloc shareable log Marc-André Lureau
2015-07-28 5:28 ` Jason Wang
2015-07-28 10:10 ` Michael S. Tsirkin
2015-07-28 14:42 ` Marc-André Lureau
2015-07-23 1:36 ` [Qemu-devel] [PATCH RFC 5/6] vhost-user: send log shm fd along with log_base Marc-André Lureau
2015-07-23 1:36 ` [Qemu-devel] [PATCH RFC 6/6] vhost-user: document migration log Marc-André Lureau
2015-07-23 15:30 ` Michael S. Tsirkin
2015-07-23 15:36 ` Marc-André Lureau
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=55B73932.5000809@redhat.com \
--to=pbonzini@redhat.com \
--cc=haifeng.lin@huawei.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thibaut.collet@6wind.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).