Skip to contentSkip to conversation

linux-user: Add some random ioctls

PATCH In review Marco A L Barbosa 2 participants 4 messages Oct 5, 2017 – Oct 9, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: Add some random ioctls

---
 linux-user/ioctls.h       | 5 +++++
 linux-user/syscall.c      | 1 +
 linux-user/syscall_defs.h | 7 +++++++
 3 files changed, 13 insertions(+)
linux-user/ioctls.h +5 -0
index e6997ff230..35cad6f944 100644
@@ -173,6 +173,11 @@
   IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
   IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
 
+  IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
+  IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT))
+  IOCTL(RNDZAPENTCNT, 0, TYPE_NULL)
+  IOCTL(RNDCLEARPOOL, 0, TYPE_NULL)
+
   IOCTL(CDROMPAUSE, 0, TYPE_NULL)
   IOCTL(CDROMSTART, 0, TYPE_NULL)
   IOCTL(CDROMSTOP, 0, TYPE_NULL)
linux-user/syscall.c +1 -0
index 9b6364a266..d4c21a557c 100644
@@ -59,6 +59,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
 #include <linux/icmp.h>
 #include <linux/icmpv6.h>
 #include <linux/errqueue.h>
+#include <linux/random.h>
 #include "qemu-common.h"
 #ifdef CONFIG_TIMERFD
 #include <sys/timerfd.h>
linux-user/syscall_defs.h +7 -0
index 40c5027e93..b3d55e35ac 100644
@@ -1060,6 +1060,13 @@ struct target_pollfd {
 
 #define TARGET_SIOCGIWNAME     0x8B01          /* get name == wireless protocol */
 
+/* From <linux/random.h> */
+
+#define TARGET_RNDGETENTCNT    TARGET_IOR('R', 0x00, int)
+#define TARGET_RNDADDTOENTCNT  TARGET_IOW('R', 0x01, int)
+#define TARGET_RNDZAPENTCNT    TARGET_IO('R', 0x04)
+#define TARGET_RNDCLEARPOOL    TARGET_IO('R', 0x06)
+
 /* From <linux/fs.h> */
 
 #define TARGET_BLKROSET   TARGET_IO(0x12,93) /* set device read-only (0 = read-write) */
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 44 lines · Marco A L Barbosa
---
 linux-user/ioctls.h       | 5 +++++
 linux-user/syscall.c      | 1 +
 linux-user/syscall_defs.h | 7 +++++++
 3 files changed, 13 insertions(+)
linux-user/ioctls.h +5 -0
index e6997ff230..35cad6f944 100644
@@ -173,6 +173,11 @@
   IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
   IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
 
+  IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
+  IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT))
+  IOCTL(RNDZAPENTCNT, 0, TYPE_NULL)
+  IOCTL(RNDCLEARPOOL, 0, TYPE_NULL)
+
   IOCTL(CDROMPAUSE, 0, TYPE_NULL)
   IOCTL(CDROMSTART, 0, TYPE_NULL)
   IOCTL(CDROMSTOP, 0, TYPE_NULL)
linux-user/syscall.c +1 -0
index 9b6364a266..d4c21a557c 100644
@@ -59,6 +59,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
 #include <linux/icmp.h>
 #include <linux/icmpv6.h>
 #include <linux/errqueue.h>
+#include <linux/random.h>
 #include "qemu-common.h"
 #ifdef CONFIG_TIMERFD
 #include <sys/timerfd.h>
linux-user/syscall_defs.h +0 -0
index 40c5027e93..b3d55e35ac 100644
@@ -1060,6 +1060,13 @@ struct target_pollfd {
 
 #define TARGET_SIOCGIWNAME     0x8B01          /* get name == wireless protocol */
 

linux-user/syscall_defs.h struct target_pollfd { · line 1072

Quoted 10 lines
linux-user/syscall_defs.h +7 -0
+/* From <linux/random.h> */
+
+#define TARGET_RNDGETENTCNT    TARGET_IOR('R', 0x00, int)
+#define TARGET_RNDADDTOENTCNT  TARGET_IOW('R', 0x01, int)
+#define TARGET_RNDZAPENTCNT    TARGET_IO('R', 0x04)
+#define TARGET_RNDCLEARPOOL    TARGET_IO('R', 0x06)
+
 /* From <linux/fs.h> */
 
 #define TARGET_BLKROSET   TARGET_IO(0x12,93) /* set device read-only (0 = read-write) */

Please, add a tag version and include history when you resend a series.

Read https://wiki.qemu.org/Contribute/SubmitAPatch

Thanks,
Laurent

#2 lore raw

Thanks again for the advice.

This and the other patch should be resubmitted following those instructions or it is not necessary?

Quoted 67 lines · Laurent Vivier
Quoted 40 lines · Marco A L Barbosa
---
 linux-user/ioctls.h       | 5 +++++
 linux-user/syscall.c      | 1 +
 linux-user/syscall_defs.h | 7 +++++++
 3 files changed, 13 insertions(+)
linux-user/ioctls.h +5 -0
index e6997ff230..35cad6f944 100644
@@ -173,6 +173,11 @@
   IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
   IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
 
+  IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT))
+  IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT))
+  IOCTL(RNDZAPENTCNT, 0, TYPE_NULL)
+  IOCTL(RNDCLEARPOOL, 0, TYPE_NULL)
+
   IOCTL(CDROMPAUSE, 0, TYPE_NULL)
   IOCTL(CDROMSTART, 0, TYPE_NULL)
   IOCTL(CDROMSTOP, 0, TYPE_NULL)
linux-user/syscall.c +1 -0
index 9b6364a266..d4c21a557c 100644
@@ -59,6 +59,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
 #include <linux/icmp.h>
 #include <linux/icmpv6.h>
 #include <linux/errqueue.h>
+#include <linux/random.h>
 #include "qemu-common.h"
 #ifdef CONFIG_TIMERFD
 #include <sys/timerfd.h>
linux-user/syscall_defs.h +0 -0
index 40c5027e93..b3d55e35ac 100644

linux-user/syscall_defs.h struct target_pollfd { · line 1061

Quoted 2 lines
linux-user/syscall_defs.h +0 -0
@@ -1060,6 +1060,13 @@ struct target_pollfd {
 
 #define TARGET_SIOCGIWNAME     0x8B01          /* get name == wireless

protocol */

linux-user/syscall_defs.h struct target_pollfd {

Quoted 11 lines
linux-user/syscall_defs.h +7 -0
+/* From <linux/random.h> */
+
+#define TARGET_RNDGETENTCNT    TARGET_IOR('R', 0x00, int)
+#define TARGET_RNDADDTOENTCNT  TARGET_IOW('R', 0x01, int)
+#define TARGET_RNDZAPENTCNT    TARGET_IO('R', 0x04)
+#define TARGET_RNDCLEARPOOL    TARGET_IO('R', 0x06)
+
 /* From <linux/fs.h> */
 
 #define TARGET_BLKROSET   TARGET_IO(0x12,93) /* set device read-only (0

= read-write) */

Quoted 1 line

Please, add a tag version and include history when you resend a series.

Read https://wiki.qemu.org/Contribute/SubmitAPatch

Thanks,
Laurent

Signature · 3 lines
Marco A L Barbosa
http://malbarbo.pro.br
--
#3 lore raw
Quoted 4 lines · Marco A L Barbosa

Thanks again for the advice.

This and the other patch should be resubmitted following those instructions or it is not necessary?

I don't think it's necessary.

Thanks,
Laurent