search for: vhost_vsock_set_guest_cid

Displaying 20 results from an estimated 104 matches for "vhost_vsock_set_guest_cid".

2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...-git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h > > > > index 40d028eed645..5afbc2f08fa3 100644 > > > > --- a/include/uapi/linux/vhost.h > > > > +++ b/include/uapi/linux/vhost.h > > > > @@ -116,4 +116,12 @@ > > > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > +/* VHOST_MDEV specific defines */ > > > > + > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64) > > > > + &...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...-git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h > > > > index 40d028eed645..5afbc2f08fa3 100644 > > > > --- a/include/uapi/linux/vhost.h > > > > +++ b/include/uapi/linux/vhost.h > > > > @@ -116,4 +116,12 @@ > > > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > +/* VHOST_MDEV specific defines */ > > > > + > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64) > > > > + &...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
...27PM +0800, Tiwei Bie wrote: [...] > > diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h > > index 40d028eed645..5afbc2f08fa3 100644 > > --- a/include/uapi/linux/vhost.h > > +++ b/include/uapi/linux/vhost.h > > @@ -116,4 +116,12 @@ > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > +/* VHOST_MDEV specific defines */ > > + > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64) > > + > > +#define VHOST_MDEV_S_STOPPED...
2019 Sep 26
4
[PATCH] vhost: introduce mdev based hardware backend
...27PM +0800, Tiwei Bie wrote: [...] > > diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h > > index 40d028eed645..5afbc2f08fa3 100644 > > --- a/include/uapi/linux/vhost.h > > +++ b/include/uapi/linux/vhost.h > > @@ -116,4 +116,12 @@ > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > +/* VHOST_MDEV specific defines */ > > + > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64) > > + > > +#define VHOST_MDEV_S_STOPPED...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...nux/vhost.h > > > > > > index 40d028eed645..5afbc2f08fa3 100644 > > > > > > --- a/include/uapi/linux/vhost.h > > > > > > +++ b/include/uapi/linux/vhost.h > > > > > > @@ -116,4 +116,12 @@ > > > > > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > > > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > > > +/* VHOST_MDEV specific defines */ > > > > > > + > > > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIR...
2019 Sep 27
2
[PATCH] vhost: introduce mdev based hardware backend
...nux/vhost.h > > > > > > index 40d028eed645..5afbc2f08fa3 100644 > > > > > > --- a/include/uapi/linux/vhost.h > > > > > > +++ b/include/uapi/linux/vhost.h > > > > > > @@ -116,4 +116,12 @@ > > > > > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > > > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > > > +/* VHOST_MDEV specific defines */ > > > > > > + > > > > > > +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIR...
2023 Jun 06
2
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
On 6/6/23 4:49 AM, Stefano Garzarella wrote: > On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: >> If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we >> can race where: >> 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue >> 2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. >> 3. vhost_worker_create will set the dev->worker pointer before setting >> the work...
2023 Jun 06
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
On Tue, Jun 06, 2023 at 12:19:10PM -0500, Mike Christie wrote: > On 6/6/23 4:49 AM, Stefano Garzarella wrote: > > On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: > >> If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we > >> can race where: > >> 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue > >> 2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. > >> 3. vhost_worker_create will set the dev->worker pointer before setti...
2019 Sep 27
1
[PATCH] vhost: introduce mdev based hardware backend
...index 40d028eed645..5afbc2f08fa3 100644 > > > > > > > > --- a/include/uapi/linux/vhost.h > > > > > > > > +++ b/include/uapi/linux/vhost.h > > > > > > > > @@ -116,4 +116,12 @@ > > > > > > > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > > > > > > > #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > > > > > > > +/* VHOST_MDEV specific defines */ > > > > > > > > + > > > > > > > > +#d...
2023 Jun 06
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: >If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we >can race where: >1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue >2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. >3. vhost_worker_create will set the dev->worker pointer before setting >the worker->vtsk pointer. >...
2023 Jun 05
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we can race where: 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue 2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. 3. vhost_worker_create will set the dev->worker pointer before setting the worker->vtsk pointer. 4. thread0's vhost_w...
2023 Jun 05
1
[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls
If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we can race where: 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue 2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. 3. vhost_worker_create will set the dev->worker pointer before setting the worker->vtsk pointer. 4. thread0's vhost_w...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...unsigned long arg) > +{ > + struct vhost_vsock *vsock = f->private_data; > + void __user *argp = (void __user *)arg; > + u64 __user *featurep = argp; > + u32 __user *cidp = argp; > + u32 guest_cid; > + u64 features; > + int r; > + > + switch (ioctl) { > + case VHOST_VSOCK_SET_GUEST_CID: > + if (get_user(guest_cid, cidp)) > + return -EFAULT; > + return vhost_vsock_set_cid(vsock, guest_cid); > + case VHOST_GET_FEATURES: > + features = VHOST_VSOCK_FEATURES; > + if (copy_to_user(featurep, &features, sizeof(features))) > + return -EFAULT; > + retur...
2013 Jun 27
2
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...unsigned long arg) > +{ > + struct vhost_vsock *vsock = f->private_data; > + void __user *argp = (void __user *)arg; > + u64 __user *featurep = argp; > + u32 __user *cidp = argp; > + u32 guest_cid; > + u64 features; > + int r; > + > + switch (ioctl) { > + case VHOST_VSOCK_SET_GUEST_CID: > + if (get_user(guest_cid, cidp)) > + return -EFAULT; > + return vhost_vsock_set_cid(vsock, guest_cid); > + case VHOST_GET_FEATURES: > + features = VHOST_VSOCK_FEATURES; > + if (copy_to_user(featurep, &features, sizeof(features))) > + return -EFAULT; > + retur...
2013 Jun 27
0
[RFC 4/5] VSOCK: Introduce vhost-vsock.ko
...sock_dev_ioctl(struct file *f, unsigned int ioctl, + unsigned long arg) +{ + struct vhost_vsock *vsock = f->private_data; + void __user *argp = (void __user *)arg; + u64 __user *featurep = argp; + u32 __user *cidp = argp; + u32 guest_cid; + u64 features; + int r; + + switch (ioctl) { + case VHOST_VSOCK_SET_GUEST_CID: + if (get_user(guest_cid, cidp)) + return -EFAULT; + return vhost_vsock_set_cid(vsock, guest_cid); + case VHOST_GET_FEATURES: + features = VHOST_VSOCK_FEATURES; + if (copy_to_user(featurep, &features, sizeof(features))) + return -EFAULT; + return 0; + case VHOST_SET_FEATURES: + if (c...
2017 Nov 09
0
[PATCH] vhost/vsock: fix uninitialized vhost_vsock->guest_cid
The vhost_vsock->guest_cid field is uninitialized when /dev/vhost-vsock is opened until the VHOST_VSOCK_SET_GUEST_CID ioctl is called. kvmalloc(..., GFP_KERNEL | __GFP_RETRY_MAYFAIL) does not zero memory. All other vhost_vsock fields are initialized explicitly so just initialize this field too. Signed-off-by: Stefan Hajnoczi <stefanha at redhat.com> --- drivers/vhost/vsock.c | 2 ++ 1 file changed, 2 inse...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
...ote: > [...] >>> diff --git a/include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h >>> index 40d028eed645..5afbc2f08fa3 100644 >>> --- a/include/uapi/linux/vhost.h >>> +++ b/include/uapi/linux/vhost.h >>> @@ -116,4 +116,12 @@ >>> #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) >>> #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) >>> >>> +/* VHOST_MDEV specific defines */ >>> + >>> +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64) >>> + >>> +#defin...
2019 Sep 27
0
[PATCH] vhost: introduce mdev based hardware backend
.../include/uapi/linux/vhost.h b/include/uapi/linux/vhost.h >>>>> index 40d028eed645..5afbc2f08fa3 100644 >>>>> --- a/include/uapi/linux/vhost.h >>>>> +++ b/include/uapi/linux/vhost.h >>>>> @@ -116,4 +116,12 @@ >>>>> #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) >>>>> #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) >>>>> +/* VHOST_MDEV specific defines */ >>>>> + >>>>> +#define VHOST_MDEV_SET_STATE _IOW(VHOST_VIRTIO, 0x70, __u64) >>>>&g...
2020 Jul 22
0
[PATCH v4 1/4] vhost: convert VHOST_VSOCK_SET_RUNNING to a generic ioctl
..., __u64) #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64) +#define VHOST_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) + /* VHOST_NET specific defines */ /* Attach virtio net ring to a raw socket, or tap device. @@ -116,7 +118,7 @@ /* VHOST_VSOCK specific defines */ #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) -#define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) +#define VHOST_VSOCK_SET_RUNNING VHOST_SET_RUNNING /* VHOST_VDPA specific defines */ -- 2.27.0
2020 Sep 10
0
[PATCH v5 1/4] vhost: convert VHOST_VSOCK_SET_RUNNING to a generic ioctl
...xt patches, it is used in this patch - see below. Thanks Guennadi > > /* VHOST_NET specific defines */ > > > > /* Attach virtio net ring to a raw socket, or tap device. > > @@ -118,7 +120,7 @@ > > /* VHOST_VSOCK specific defines */ > > > > #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) > > -#define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) > > +#define VHOST_VSOCK_SET_RUNNING VHOST_SET_RUNNING > > > > /* VHOST_VDPA specific defines */ > > > > -- > > 2.28.0 > >