tools/virtio: add dma barrier stubs
Michael S. Tsirkin
maintainerPATCH 2/2 tools/virtio: add kmalloc_array stub
In reply to Michael S. Tsirkin--- tools/virtio/linux/kernel.h | 5 +++++ 1 file changed, 5 insertions(+)
tools/virtio/linux/kernel.h +5 -0
@@ -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);
Signature · 1 line
MST
Michael S. Tsirkin
maintainerPATCH 1/2 tools/virtio: add dma barrier stubs
--- tools/virtio/asm/barrier.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/virtio/asm/barrier.h +2 -2
@@ -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
Signature · 1 line
MST
Michael S. Tsirkin
maintainerPATCH 2/2 tools/virtio: add kmalloc_array stub
--- tools/virtio/linux/kernel.h | 5 +++++ 1 file changed, 5 insertions(+)
tools/virtio/linux/kernel.h +5 -0
@@ -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);
Signature · 1 line
MST
Quoted 11 lines · Michael S. Tsirkin
Fixes 55e49dc43a8 ("virtio_ring: switch to dma_XX barriers for rpmsg")Signed-off-by Michael S. Tsirkin <[email protected]>--- tools/virtio/asm/barrier.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)tools/virtio/asm/barrier.h +0
-0
tools/virtio/asm/barrier.h line 20
Quoted 10 lines
tools/virtio/asm/barrier.h +2
-2@@ -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
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 2/2] tools/virtio: add kmalloc_array stub
In reply to Michael S. TsirkinQuoted 12 lines · Michael S. Tsirkin
Fixes 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")Signed-off-by Michael S. Tsirkin <[email protected]>--- tools/virtio/linux/kernel.h | 5 +++++ 1 file changed, 5 insertions(+)tools/virtio/linux/kernel.h +0
-0@@ -52,6 +52,11 @@ static inline void *kmalloc(size_t s, gfp_t gfp)return __kmalloc_fake;
tools/virtio/linux/kernel.h static inline void *kmalloc(size_t s, gfp_t gfp) · line 62
Quoted 10 lines
tools/virtio/linux/kernel.h +5
-0return 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);
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Re: [PATCH 2/2] tools/virtio: add kmalloc_array stub
In reply to Michael S. TsirkinQuoted 12 lines · Michael S. Tsirkin
Fixes 6da2ec56059 ("treewide: kmalloc() -> kmalloc_array()")Signed-off-by Michael S. Tsirkin <[email protected]>--- tools/virtio/linux/kernel.h | 5 +++++ 1 file changed, 5 insertions(+)tools/virtio/linux/kernel.h +0
-0@@ -52,6 +52,11 @@ static inline void *kmalloc(size_t s, gfp_t gfp)return __kmalloc_fake;
tools/virtio/linux/kernel.h static inline void *kmalloc(size_t s, gfp_t gfp) · line 62
Quoted 10 lines
tools/virtio/linux/kernel.h +5
-0return 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);