Displaying 11 results from an estimated 11 matches for "getu16_kern".
2016 Nov 24
12
[PATCH 0/3] virtio/vringh: kill off ACCESS_ONCE()
For several reasons, it would be beneficial to kill off ACCESS_ONCE()
tree-wide, in favour of {READ,WRITE}_ONCE(). These work with aggregate types,
more obviously document their intended behaviour, and are necessary for tools
like KTSAN to work correctly (as otherwise reads and writes cannot be
instrumented separately).
While it's possible to script the bulk of this tree-wide conversion, some
2016 Nov 24
12
[PATCH 0/3] virtio/vringh: kill off ACCESS_ONCE()
For several reasons, it would be beneficial to kill off ACCESS_ONCE()
tree-wide, in favour of {READ,WRITE}_ONCE(). These work with aggregate types,
more obviously document their intended behaviour, and are necessary for tools
like KTSAN to work correctly (as otherwise reads and writes cannot be
instrumented separately).
While it's possible to script the bulk of this tree-wide conversion, some
2016 Nov 24
0
[PATCH 2/3] vringh: kill off ACCESS_ONCE()
...n userspace, we use (inline) accessors.
> */
> +#include <linux/compiler.h>
> #include <linux/module.h>
> #include <linux/vringh.h>
> #include <linux/virtio_ring.h>
> @@ -820,13 +821,13 @@ EXPORT_SYMBOL(vringh_need_notify_user);
> static inline int getu16_kern(const struct vringh *vrh,
> u16 *val, const __virtio16 *p)
> {
> - *val = vringh16_to_cpu(vrh, ACCESS_ONCE(*p));
> + *val = vringh16_to_cpu(vrh, READ_ONCE(*p));
> return 0;
> }
>
> static inline int putu16_kern(const struct vringh *vrh, __virtio16 *p, u16 val...
2016 Nov 25
0
[PATCH 2/3] vringh: kill off ACCESS_ONCE()
...rspace, we use (inline) accessors.
> */
> +#include <linux/compiler.h>
> #include <linux/module.h>
> #include <linux/vringh.h>
> #include <linux/virtio_ring.h>
> @@ -820,13 +821,13 @@ EXPORT_SYMBOL(vringh_need_notify_user);
> static inline int getu16_kern(const struct vringh *vrh,
> u16 *val, const __virtio16 *p)
> {
> - *val = vringh16_to_cpu(vrh, ACCESS_ONCE(*p));
> + *val = vringh16_to_cpu(vrh, READ_ONCE(*p));
> return 0;
> }
>
> static inline int putu16_kern(const struct vringh *vrh, __virtio16 *p,...
2016 Nov 24
0
[PATCH 2/3] vringh: kill off ACCESS_ONCE()
...3,7 @@
*
* Since these may be in userspace, we use (inline) accessors.
*/
+#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/vringh.h>
#include <linux/virtio_ring.h>
@@ -820,13 +821,13 @@ EXPORT_SYMBOL(vringh_need_notify_user);
static inline int getu16_kern(const struct vringh *vrh,
u16 *val, const __virtio16 *p)
{
- *val = vringh16_to_cpu(vrh, ACCESS_ONCE(*p));
+ *val = vringh16_to_cpu(vrh, READ_ONCE(*p));
return 0;
}
static inline int putu16_kern(const struct vringh *vrh, __virtio16 *p, u16 val)
{
- ACCESS_ONCE(*p) = cpu_to_vringh1...
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
...ges.
+ * @vrh: the vring.
+ *
+ * This is our normal running state: we disable and then only enable when
+ * we're going to sleep.
+ */
+void vringh_notify_disable_user(struct vringh *vrh)
+{
+ __vringh_notify_disable(vrh, putu16_user);
+}
+
+/* Kernelspace access helpers. */
+static inline int getu16_kern(u16 *val, const u16 *p)
+{
+ *val = *p;
+ return 0;
+}
+
+static inline int putu16_kern(u16 *p, u16 val)
+{
+ *p = val;
+ return 0;
+}
+
+static inline int getdesc_kern(struct vring_desc *dst,
+ const struct vring_desc *src)
+{
+ *dst = *src;
+ return 0;
+}
+
+static inline int putused_ker...
2013 Jan 17
8
[PATCH 1/6] virtio_host: host-side implementation of virtio rings.
...ges.
+ * @vrh: the vring.
+ *
+ * This is our normal running state: we disable and then only enable when
+ * we're going to sleep.
+ */
+void vringh_notify_disable_user(struct vringh *vrh)
+{
+ __vringh_notify_disable(vrh, putu16_user);
+}
+
+/* Kernelspace access helpers. */
+static inline int getu16_kern(u16 *val, const u16 *p)
+{
+ *val = *p;
+ return 0;
+}
+
+static inline int putu16_kern(u16 *p, u16 val)
+{
+ *p = val;
+ return 0;
+}
+
+static inline int getdesc_kern(struct vring_desc *dst,
+ const struct vring_desc *src)
+{
+ *dst = *src;
+ return 0;
+}
+
+static inline int putused_ker...
2014 Dec 15
4
[PATCH 0/3] fix up vringh/mic sparse errors
This fixes remaining sparse warnings in vringh and mic by using
virtio 1.0 compliant wrappers.
This also needs by get_user patches to avoid getting warnings
from these calls.
Tested by running vringh_test.
Rusty, I prefer fixing all these warnings for 3.19, any objections?
Michael S. Tsirkin (3):
vringh: 64 bit features
vringh: initial virtio 1.0 support
mic/host: initial virtio 1.0
2014 Dec 15
4
[PATCH 0/3] fix up vringh/mic sparse errors
This fixes remaining sparse warnings in vringh and mic by using
virtio 1.0 compliant wrappers.
This also needs by get_user patches to avoid getting warnings
from these calls.
Tested by running vringh_test.
Rusty, I prefer fixing all these warnings for 3.19, any objections?
Michael S. Tsirkin (3):
vringh: 64 bit features
vringh: initial virtio 1.0 support
mic/host: initial virtio 1.0
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