valgrind supports many of the ioctls from kernel based virtual machine (KVM). This bug will track all remaining things. Already working are several KVm ioctls via the IORW macros, as well as VKI_KVM_CREATE_IRQCHIP VKI_KVM_S390_ENABLE_SIE VKI_KVM_S390_INITIAL_RESET VKI_KVM_GET_API_VERSION VKI_KVM_CREATE_VM VKI_KVM_GET_VCPU_MMAP_SIZE VKI_KVM_CHECK_EXTENSION VKI_KVM_CREATE_VCPU VKI_KVM_RUN via specific handlers in syswrap-linux.c Reproducible: Always Steps to Reproduce: 3.10: shows Warning: noted but unhandled ioctl 0xae47 with no size/direction hints. There are probably others. Will add later
ae47 (KVM_SET_TSS_ADDR) fixed with Commit 14568.
next on list: Warning: noted but unhandled ioctl 0xaead with no size/direction hints
aead (KVM_KVMCLOCK_CTRL) fixed with Commit 14569
Christian, is this bug still alive, or can it be closed?
Its alive and I will continue to work on that, as soon as other things have settled again. sorry
the new s390 memop ioctl causes several false positives: I plan to apply this patch soon: Index: coregrind/m_syswrap/syswrap-linux.c =================================================================== --- coregrind/m_syswrap/syswrap-linux.c (Revision 15332) +++ coregrind/m_syswrap/syswrap-linux.c (Arbeitskopie) @@ -7220,6 +7220,21 @@ case VKI_KVM_RUN: break; + case VKI_KVM_S390_MEM_OP: { + struct vki_kvm_s390_mem_op *args = + (struct vki_kvm_s390_mem_op *)(ARG3); + PRE_MEM_READ("ioctl(KVM_S390_MEM_OP)", ARG3, + sizeof(struct vki_kvm_s390_mem_op)); + if (args->flags & VKI_KVM_S390_MEMOP_F_CHECK_ONLY) + break; + if (args->op == VKI_KVM_S390_MEMOP_LOGICAL_READ) + PRE_MEM_WRITE("ioctl(KVM_S390_MEM_OP).buf", (Addr)args->buf, args->size); + if (args->op == VKI_KVM_S390_MEMOP_LOGICAL_WRITE) + PRE_MEM_READ("ioctl(KVM_S390_MEM_OP).buf", (Addr)args->buf, args->size); + } + break; + + #ifdef ENABLE_XEN case VKI_XEN_IOCTL_PRIVCMD_HYPERCALL: { SyscallArgs harrghs; @@ -9614,6 +9629,18 @@ case VKI_KVM_KVMCLOCK_CTRL: break; + case VKI_KVM_S390_MEM_OP: { + struct vki_kvm_s390_mem_op *args = + (struct vki_kvm_s390_mem_op *)(ARG3); + PRE_MEM_READ("ioctl(KVM_S390_MEM_OP)", ARG3, + sizeof(struct vki_kvm_s390_mem_op)); + if (args->flags & VKI_KVM_S390_MEMOP_F_CHECK_ONLY) + break; + if (args->op == VKI_KVM_S390_MEMOP_LOGICAL_READ) + POST_MEM_WRITE((Addr)args->buf, args->size); + } + break; + #ifdef ENABLE_XEN case VKI_XEN_IOCTL_PRIVCMD_HYPERCALL: { SyscallArgs harrghs; Index: include/vki/vki-linux.h =================================================================== --- include/vki/vki-linux.h (Revision 15332) +++ include/vki/vki-linux.h (Arbeitskopie) @@ -3167,6 +3167,24 @@ #define VKI_KVM_NMI _VKI_IO(KVMIO, 0x9a) #define VKI_KVM_KVMCLOCK_CTRL _VKI_IO(KVMIO, 0xad) +struct vki_kvm_s390_mem_op { + /* in */ + __vki_u64 gaddr; /* the guest address */ + __vki_u64 flags; /* flags */ + __vki_u32 size; /* amount of bytes */ + __vki_u32 op; /* type of operation */ + __vki_u64 buf; /* buffer in userspace */ + __vki_u8 ar; /* the access register number */ + __vki_u8 reserved[31]; /* should be set to 0 */ +}; + +#define VKI_KVM_S390_MEMOP_LOGICAL_READ 0 +#define VKI_KVM_S390_MEMOP_LOGICAL_WRITE 1 +#define VKI_KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0) +#define VKI_KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1) + +#define VKI_KVM_S390_MEM_OP _VKI_IOW(KVMIO, 0xb1, struct vki_kvm_s390_mem_op) + //---------------------------------------------------------------------- // From linux-2.6/include/linux/net_stamp.h //----------------------------------------------------------------------
The 2nd + PRE_MEM_READ("ioctl(KVM_S390_MEM_OP)", ARG3, + sizeof(struct vki_kvm_s390_mem_op)); in the post handler is a leftover. Fixed and committed as 15334
Christian, can this be closed now?
Well it will be an endless task, but valgrind works reasonably well with qemu 2.3 and recent kernels. So lets close this and open new bugzilla (or just jfix) if we have new ioctls.