* [PATCH v2] vhost: add vsock compat ioctl
@ 2018-03-14 21:36 Sonny Rao
2018-03-15 13:51 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Sonny Rao @ 2018-03-14 21:36 UTC (permalink / raw)
To: kvm
Cc: Stefan Hajnoczi, Michael S . Tsirkin, Jason Wang, virtualization,
netdev, linux-kernel
This will allow usage of vsock from 32-bit binaries on a 64-bit
kernel.
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
---
drivers/vhost/vsock.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 0d14e2ff19f16..ee0c385d9fe54 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -699,12 +699,23 @@ static long vhost_vsock_dev_ioctl(struct file *f, unsigned int ioctl,
}
}
+#ifdef CONFIG_COMPAT
+static long vhost_vsock_dev_compat_ioctl(struct file *f, unsigned int ioctl,
+ unsigned long arg)
+{
+ return vhost_vsock_dev_ioctl(f, ioctl, (unsigned long)compat_ptr(arg));
+}
+#endif
+
static const struct file_operations vhost_vsock_fops = {
.owner = THIS_MODULE,
.open = vhost_vsock_dev_open,
.release = vhost_vsock_dev_release,
.llseek = noop_llseek,
.unlocked_ioctl = vhost_vsock_dev_ioctl,
+#ifdef CONFIG_COMPAT
+ .compat_ioctl = vhost_vsock_dev_compat_ioctl,
+#endif
};
static struct miscdevice vhost_vsock_misc = {
--
2.13.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] vhost: add vsock compat ioctl
2018-03-14 21:36 [PATCH v2] vhost: add vsock compat ioctl Sonny Rao
@ 2018-03-15 13:51 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2018-03-15 13:51 UTC (permalink / raw)
To: Sonny Rao
Cc: kvm, Michael S . Tsirkin, Jason Wang, virtualization, netdev,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
On Wed, Mar 14, 2018 at 02:36:25PM -0700, Sonny Rao wrote:
> This will allow usage of vsock from 32-bit binaries on a 64-bit
> kernel.
>
> Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
> ---
> drivers/vhost/vsock.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-03-16 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-14 21:36 [PATCH v2] vhost: add vsock compat ioctl Sonny Rao
2018-03-15 13:51 ` Stefan Hajnoczi
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).