search for: __user_addr_min

Displaying 20 results from an estimated 53 matches for "__user_addr_min".

2020 Apr 06
0
[PATCH v4 09/12] tools/virtio: switch to virtio_legacy_init/size
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 06
0
[PATCH v4 09/12] tools/virtio: switch to virtio_legacy_init/size
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 06
0
[PATCH v5 09/12] tools/virtio: switch to virtio_legacy_init/size
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 06
0
[PATCH v6 09/12] tools/virtio: switch to virtio_legacy_init/size
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 07
0
[PATCH v7 13/19] tools/virtio: switch to virtio_legacy_init/size
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 07
0
[PATCH v8 13/19] tools/virtio: switch to virtio_legacy_init/size
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 06
1
[PATCH v3 1/2] virtio: stop using legacy struct vring in kernel
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...need RINGSIZE+1 */ - data = guest_map + vring_size(RINGSIZE, ALIGN); + data = guest_map + vring_legacy_size(RINGSIZE, ALIGN); indirects = (void *)data + (RINGSIZE + 1) * 2 * sizeof(int); /* We are the guest. */ @@ -478,7 +478,7 @@ int main(int argc, char *argv[]) if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); __user_addr_max = __user_addr_min + USER_MEM; - memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); + memset(__user_addr_min, 0, vring_legacy_size(RINGSIZE, ALIGN)); /* Set up guest side. */ vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev,...
2017 Apr 17
0
[PATCH] tools/virtio: fix build breakage
...e(0, RINGSIZE, ALIGN, &gvdev.vdev, true, - guest_map, fast_vringh ? no_notify_host + false, guest_map, + fast_vringh ? no_notify_host : parallel_notify_host, never_callback_guest, "guest vq"); @@ -479,7 +480,7 @@ int main(int argc, char *argv[]) memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); /* Set up guest side. */ - vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, + vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, false, __user_addr_min, never_notify_host, never_callback_guest, "guest vq"); @@...
2017 Apr 17
0
[PATCH] tools/virtio: fix build breakage
...e(0, RINGSIZE, ALIGN, &gvdev.vdev, true, - guest_map, fast_vringh ? no_notify_host + false, guest_map, + fast_vringh ? no_notify_host : parallel_notify_host, never_callback_guest, "guest vq"); @@ -479,7 +480,7 @@ int main(int argc, char *argv[]) memset(__user_addr_min, 0, vring_size(RINGSIZE, ALIGN)); /* Set up guest side. */ - vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, + vq = vring_new_virtqueue(0, RINGSIZE, ALIGN, &vdev, true, false, __user_addr_min, never_notify_host, never_callback_guest, "guest vq"); @@...
2014 Nov 27
2
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
..._slow; else if (strcmp(argv[1], "--fast-vringh") == 0) @@ -468,7 +468,7 @@ int main(int argc, char *argv[]) } if (parallel) - return parallel_test(vdev.features[0], getrange, fast_vringh); + return parallel_test(vdev.features, getrange, fast_vringh); if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); @@ -483,7 +483,7 @@ int main(int argc, char *argv[]) /* Set up host side. */ vring_init(&vrh.vring, RINGSIZE, __user_addr_min, ALIGN); - vringh_init_user(&vrh, vdev.features[0], RINGSIZE, true, + vringh_init_user(&vrh, vdev.features, RINGSIZ...
2014 Nov 27
2
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
..._slow; else if (strcmp(argv[1], "--fast-vringh") == 0) @@ -468,7 +468,7 @@ int main(int argc, char *argv[]) } if (parallel) - return parallel_test(vdev.features[0], getrange, fast_vringh); + return parallel_test(vdev.features, getrange, fast_vringh); if (posix_memalign(&__user_addr_min, PAGE_SIZE, USER_MEM) != 0) abort(); @@ -483,7 +483,7 @@ int main(int argc, char *argv[]) /* Set up host side. */ vring_init(&vrh.vring, RINGSIZE, __user_addr_min, ALIGN); - vringh_init_user(&vrh, vdev.features[0], RINGSIZE, true, + vringh_init_user(&vrh, vdev.features, RINGSIZ...
2023 Apr 10
2
[PATCH v2 2/2] tools/virtio: fix build caused by virtio_ring changes
...re careful. > > diff --git a/tools/virtio/linux/uaccess.h b/tools/virtio/linux/uaccess.h > > index 991dfb263998..cde2c344b260 100644 > > --- a/tools/virtio/linux/uaccess.h > > +++ b/tools/virtio/linux/uaccess.h > > @@ -6,15 +6,10 @@ > > > > extern void *__user_addr_min, *__user_addr_max; > > > > -static inline void __chk_user_ptr(const volatile void *p, size_t size) > > -{ > > - assert(p >= __user_addr_min && p + size <= __user_addr_max); > > -} > > - What does this function have to do with container_of()? &g...
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2013 Feb 18
9
[PATCH 0/5] vringh
This introduces vringh, which are generic accessors for virtio rings (host side). There's a host-side implementation in vhost, but it assumes that the rings are in userspace, and is tied to the vhost implementation. I have patches to adapt it to use vringh, but I'm pushing this in the next merge window for Sjur, who has CAIF patches which need it. This also includes a test program in
2016 Nov 25
0
[PATCH 3/3] tools/virtio: use {READ,WRITE}_ONCE() in uaccess.h
...eletions(-) > > diff --git a/tools/virtio/linux/uaccess.h b/tools/virtio/linux/uaccess.h > index 0a578fe..fa05d01 100644 > --- a/tools/virtio/linux/uaccess.h > +++ b/tools/virtio/linux/uaccess.h > @@ -1,8 +1,9 @@ > #ifndef UACCESS_H > #define UACCESS_H > -extern void *__user_addr_min, *__user_addr_max; > > -#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) > +#include <linux/compiler.h> > + > +extern void *__user_addr_min, *__user_addr_max; > > static inline void __chk_user_ptr(const volatile void *p, size_t size) > { > @@ -13,7...
2016 Nov 24
0
[PATCH 3/3] tools/virtio: use {READ,WRITE}_ONCE() in uaccess.h
...++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/virtio/linux/uaccess.h b/tools/virtio/linux/uaccess.h index 0a578fe..fa05d01 100644 --- a/tools/virtio/linux/uaccess.h +++ b/tools/virtio/linux/uaccess.h @@ -1,8 +1,9 @@ #ifndef UACCESS_H #define UACCESS_H -extern void *__user_addr_min, *__user_addr_max; -#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +#include <linux/compiler.h> + +extern void *__user_addr_min, *__user_addr_max; static inline void __chk_user_ptr(const volatile void *p, size_t size) { @@ -13,7 +14,7 @@ static inline void __chk_user_ptr(const...
2014 Nov 27
0
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
...; > } > @@ -168,18 +168,18 @@ static int virtio_dev_probe(struct device *_d) > device_features = dev->config->get_features(dev); > [...] > @@ -483,7 +483,7 @@ int main(int argc, char *argv[]) > > /* Set up host side. */ > vring_init(&vrh.vring, RINGSIZE, __user_addr_min, ALIGN); > - vringh_init_user(&vrh, vdev.features[0], RINGSIZE, true, > + vringh_init_user(&vrh, vdev.features, RINGSIZE, true, > vrh.vring.desc, vrh.vring.avail, vrh.vring.used); > > /* No descriptor to get yet... */ > @@ -652,13 +652,13 @@ int main(int argc, char...
2014 Nov 27
0
[PATCH v5 01/45] virtio: use u32, not bitmap for struct virtio_device's features
...; > } > @@ -168,18 +168,18 @@ static int virtio_dev_probe(struct device *_d) > device_features = dev->config->get_features(dev); > [...] > @@ -483,7 +483,7 @@ int main(int argc, char *argv[]) > > /* Set up host side. */ > vring_init(&vrh.vring, RINGSIZE, __user_addr_min, ALIGN); > - vringh_init_user(&vrh, vdev.features[0], RINGSIZE, true, > + vringh_init_user(&vrh, vdev.features, RINGSIZE, true, > vrh.vring.desc, vrh.vring.avail, vrh.vring.used); > > /* No descriptor to get yet... */ > @@ -652,13 +652,13 @@ int main(int argc, char...