From: Christian Borntraeger Date: Wed, 23 May 2012 15:59:40 +0000 (+0000) Subject: add some intial kvm ioctls (low hanging fruits). This gets rid of some valgrind X-Git-Tag: svn/VALGRIND_3_8_0~290 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=188189536da50cd7d9df851f62ec7a8ccd49b2f2;p=thirdparty%2Fvalgrind.git add some intial kvm ioctls (low hanging fruits). This gets rid of some valgrind warnings regarding KVM ioctl without a length/direction specifier. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12578 --- diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 438dae7348..62eb3bf63a 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -4198,6 +4198,10 @@ PRE(sys_ioctl) /* SCSI no operand */ case VKI_SCSI_IOCTL_DOORLOCK: case VKI_SCSI_IOCTL_DOORUNLOCK: + + /* KVM ioctls that dont check for a numeric value as parameter */ + case VKI_KVM_S390_ENABLE_SIE: + case VKI_KVM_S390_INITIAL_RESET: PRINT("sys_ioctl ( %ld, 0x%lx )",ARG1,ARG2); PRE_REG_READ2(long, "ioctl", unsigned int, fd, unsigned int, request); @@ -5402,6 +5406,15 @@ PRE(sys_ioctl) ir->num_rsp * sizeof(struct vki_inquiry_info)); } break; + + /* KVM ioctls that check for a numeric value as parameter */ + case VKI_KVM_GET_API_VERSION: + case VKI_KVM_CREATE_VM: + case VKI_KVM_GET_VCPU_MMAP_SIZE: + case VKI_KVM_CHECK_EXTENSION: + case VKI_KVM_CREATE_VCPU: + case VKI_KVM_RUN: + break; default: /* EVIOC* are variable length and return size written on success */ @@ -6385,6 +6398,17 @@ POST(sys_ioctl) } break; + /* KVM ioctls that only write the system call return value */ + case VKI_KVM_GET_API_VERSION: + case VKI_KVM_CREATE_VM: + case VKI_KVM_CHECK_EXTENSION: + case VKI_KVM_GET_VCPU_MMAP_SIZE: + case VKI_KVM_S390_ENABLE_SIE: + case VKI_KVM_CREATE_VCPU: + case VKI_KVM_RUN: + case VKI_KVM_S390_INITIAL_RESET: + break; + default: /* EVIOC* are variable length and return size written on success */ switch (ARG2 & ~(_VKI_IOC_SIZEMASK << _VKI_IOC_SIZESHIFT)) { diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index f5d16c2c06..d73b04439b 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -2946,6 +2946,30 @@ struct vki_hci_inquiry_req { __vki_u8 num_rsp; }; +//---------------------------------------------------------------------- +// From linux-3.4/include/linux/kvm.h +//---------------------------------------------------------------------- +#define KVMIO 0xAE + +#define VKI_KVM_GET_API_VERSION _VKI_IO(KVMIO, 0x00) +#define VKI_KVM_CREATE_VM _VKI_IO(KVMIO, 0x01) /* returns a VM fd */ +#define VKI_KVM_CHECK_EXTENSION _VKI_IO(KVMIO, 0x03) +#define VKI_KVM_GET_VCPU_MMAP_SIZE _VKI_IO(KVMIO, 0x04) /* in bytes */ +#define VKI_KVM_S390_ENABLE_SIE _VKI_IO(KVMIO, 0x06) +#define VKI_KVM_CREATE_VCPU _VKI_IO(KVMIO, 0x41) +#define VKI_KVM_SET_NR_MMU_PAGES _VKI_IO(KVMIO, 0x44) +#define VKI_KVM_GET_NR_MMU_PAGES _VKI_IO(KVMIO, 0x45) +#define VKI_KVM_SET_TSS_ADDR _VKI_IO(KVMIO, 0x47) +#define VKI_KVM_CREATE_IRQCHIP _VKI_IO(KVMIO, 0x60) +#define VKI_KVM_CREATE_PIT _VKI_IO(KVMIO, 0x64) +#define VKI_KVM_REINJECT_CONTROL _VKI_IO(KVMIO, 0x71) +#define VKI_KVM_SET_BOOT_CPU_ID _VKI_IO(KVMIO, 0x78) +#define VKI_KVM_SET_TSC_KHZ _VKI_IO(KVMIO, 0xa2) +#define VKI_KVM_GET_TSC_KHZ _VKI_IO(KVMIO, 0xa3) +#define VKI_KVM_RUN _VKI_IO(KVMIO, 0x80) +#define VKI_KVM_S390_INITIAL_RESET _VKI_IO(KVMIO, 0x97) +#define VKI_KVM_NMI _VKI_IO(KVMIO, 0x9a) + #endif // __VKI_LINUX_H /*--------------------------------------------------------------------*/