Fixes: 55e49dc43a8 ("virtio_ring: switch to dma_XX barriers for
rpmsg")
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
tools/virtio/asm/barrier.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
index 0ac3caf90877..d0351f83aebe 100644
--- a/tools/virtio/asm/barrier.h
+++ b/tools/virtio/asm/barrier.h
@@ -13,8 +13,8 @@
} while (0);
/* Weak barriers should be used. If not - it's a bug */
# define mb() abort()
-# define rmb() abort()
-# define wmb() abort()
+# define dma_rmb() abort()
+# define dma_wmb() abort()
#else
#error Please fill in barrier macros
#endif
--
MST
Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
tools/virtio/linux/kernel.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index fca8381bbe04..fb22bccfbc8a 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -52,6 +52,11 @@ static inline void *kmalloc(size_t s, gfp_t gfp)
return __kmalloc_fake;
return malloc(s);
}
+static inline void *kmalloc_array(unsigned n, size_t s, gfp_t gfp)
+{
+ return kmalloc(n * s, gfp);
+}
+
static inline void *kzalloc(size_t s, gfp_t gfp)
{
void *p = kmalloc(s, gfp);
--
MST
On 2018?07?25? 21:45, Michael S. Tsirkin wrote:> Fixes: 55e49dc43a8 ("virtio_ring: switch to dma_XX barriers for rpmsg") > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > tools/virtio/asm/barrier.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h > index 0ac3caf90877..d0351f83aebe 100644 > --- a/tools/virtio/asm/barrier.h > +++ b/tools/virtio/asm/barrier.h > @@ -13,8 +13,8 @@ > } while (0); > /* Weak barriers should be used. If not - it's a bug */ > # define mb() abort() > -# define rmb() abort() > -# define wmb() abort() > +# define dma_rmb() abort() > +# define dma_wmb() abort() > #else > #error Please fill in barrier macros > #endifReviewed-by: Jason Wang <jasowang at redhat.com>
On 2018?07?25? 21:45, Michael S. Tsirkin wrote:> Fixes: 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()") > Signed-off-by: Michael S. Tsirkin <mst at redhat.com> > --- > tools/virtio/linux/kernel.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h > index fca8381bbe04..fb22bccfbc8a 100644 > --- a/tools/virtio/linux/kernel.h > +++ b/tools/virtio/linux/kernel.h > @@ -52,6 +52,11 @@ static inline void *kmalloc(size_t s, gfp_t gfp) > return __kmalloc_fake; > return malloc(s); > } > +static inline void *kmalloc_array(unsigned n, size_t s, gfp_t gfp) > +{ > + return kmalloc(n * s, gfp); > +} > + > static inline void *kzalloc(size_t s, gfp_t gfp) > { > void *p = kmalloc(s, gfp);Reviewed-by: Jason Wang <jasowang at redhat.com>
Maybe Matching Threads
- [PATCH 2/2] tools/virtio: add kmalloc_array stub
- [PATCH v4 02/12] tools/virtio: make asm/barrier.h self contained
- [PATCH v5 02/12] tools/virtio: make asm/barrier.h self contained
- [PATCH v6 02/12] tools/virtio: make asm/barrier.h self contained
- [PATCH v7 02/19] tools/virtio: make asm/barrier.h self contained