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
This commit is contained in:
Christian Borntraeger 2012-05-23 15:59:40 +00:00
parent 0bdcee8722
commit 188189536d
2 changed files with 48 additions and 0 deletions

View File

@ -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)) {

View File

@ -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
/*--------------------------------------------------------------------*/