qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

linux-headers: update

Update headers against 4.8-rc2.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

+236 -7
+32
include/standard-headers/linux/input-event-codes.h
··· 611 611 #define KEY_KBDINPUTASSIST_ACCEPT 0x264 612 612 #define KEY_KBDINPUTASSIST_CANCEL 0x265 613 613 614 + /* Diagonal movement keys */ 615 + #define KEY_RIGHT_UP 0x266 616 + #define KEY_RIGHT_DOWN 0x267 617 + #define KEY_LEFT_UP 0x268 618 + #define KEY_LEFT_DOWN 0x269 619 + 620 + #define KEY_ROOT_MENU 0x26a /* Show Device's Root Menu */ 621 + /* Show Top Menu of the Media (e.g. DVD) */ 622 + #define KEY_MEDIA_TOP_MENU 0x26b 623 + #define KEY_NUMERIC_11 0x26c 624 + #define KEY_NUMERIC_12 0x26d 625 + /* 626 + * Toggle Audio Description: refers to an audio service that helps blind and 627 + * visually impaired consumers understand the action in a program. Note: in 628 + * some countries this is referred to as "Video Description". 629 + */ 630 + #define KEY_AUDIO_DESC 0x26e 631 + #define KEY_3D_MODE 0x26f 632 + #define KEY_NEXT_FAVORITE 0x270 633 + #define KEY_STOP_RECORD 0x271 634 + #define KEY_PAUSE_RECORD 0x272 635 + #define KEY_VOD 0x273 /* Video on Demand */ 636 + #define KEY_UNMUTE 0x274 637 + #define KEY_FASTREVERSE 0x275 638 + #define KEY_SLOWREVERSE 0x276 639 + /* 640 + * Control a data application associated with the currently viewed channel, 641 + * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.) 642 + */ 643 + #define KEY_DATA 0x275 644 + 614 645 #define BTN_TRIGGER_HAPPY 0x2c0 615 646 #define BTN_TRIGGER_HAPPY1 0x2c0 616 647 #define BTN_TRIGGER_HAPPY2 0x2c1 ··· 749 780 #define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ 750 781 #define SW_LINEIN_INSERT 0x0d /* set = inserted */ 751 782 #define SW_MUTE_DEVICE 0x0e /* set = device disabled */ 783 + #define SW_PEN_INSERTED 0x0f /* set = pen inserted */ 752 784 #define SW_MAX_ 0x0f 753 785 #define SW_CNT (SW_MAX_+1) 754 786
+1
include/standard-headers/linux/input.h
··· 244 244 #define BUS_ATARI 0x1B 245 245 #define BUS_SPI 0x1C 246 246 #define BUS_RMI 0x1D 247 + #define BUS_CEC 0x1E 247 248 248 249 /* 249 250 * MT_TOOL types
+9 -1
include/standard-headers/linux/virtio_config.h
··· 49 49 * transport being used (eg. virtio_ring), the rest are per-device feature 50 50 * bits. */ 51 51 #define VIRTIO_TRANSPORT_F_START 28 52 - #define VIRTIO_TRANSPORT_F_END 33 52 + #define VIRTIO_TRANSPORT_F_END 34 53 53 54 54 #ifndef VIRTIO_CONFIG_NO_LEGACY 55 55 /* Do we get callbacks when the ring is completely used, even if we've ··· 63 63 /* v1.0 compliant. */ 64 64 #define VIRTIO_F_VERSION_1 32 65 65 66 + /* 67 + * If clear - device has the IOMMU bypass quirk feature. 68 + * If set - use platform tools to detect the IOMMU. 69 + * 70 + * Note the reverse polarity (compared to most other features), 71 + * this is for compatibility with legacy systems. 72 + */ 73 + #define VIRTIO_F_IOMMU_PLATFORM 33 66 74 #endif /* _LINUX_VIRTIO_CONFIG_H */
+1
include/standard-headers/linux/virtio_ids.h
··· 41 41 #define VIRTIO_ID_CAIF 12 /* Virtio caif */ 42 42 #define VIRTIO_ID_GPU 16 /* virtio GPU */ 43 43 #define VIRTIO_ID_INPUT 18 /* virtio input */ 44 + #define VIRTIO_ID_VSOCK 19 /* virtio vsock transport */ 44 45 45 46 #endif /* _LINUX_VIRTIO_IDS_H */
+3
include/standard-headers/linux/virtio_net.h
··· 35 35 #define VIRTIO_NET_F_CSUM 0 /* Host handles pkts w/ partial csum */ 36 36 #define VIRTIO_NET_F_GUEST_CSUM 1 /* Guest handles pkts w/ partial csum */ 37 37 #define VIRTIO_NET_F_CTRL_GUEST_OFFLOADS 2 /* Dynamic offload configuration. */ 38 + #define VIRTIO_NET_F_MTU 3 /* Initial MTU advice */ 38 39 #define VIRTIO_NET_F_MAC 5 /* Host has given MAC address. */ 39 40 #define VIRTIO_NET_F_GUEST_TSO4 7 /* Guest can handle TSOv4 in. */ 40 41 #define VIRTIO_NET_F_GUEST_TSO6 8 /* Guest can handle TSOv6 in. */ ··· 73 74 * Legal values are between 1 and 0x8000 74 75 */ 75 76 uint16_t max_virtqueue_pairs; 77 + /* Default maximum transmit unit advice */ 78 + uint16_t mtu; 76 79 } QEMU_PACKED; 77 80 78 81 /*
+94
include/standard-headers/linux/virtio_vsock.h
··· 1 + /* 2 + * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 3 + * anyone can use the definitions to implement compatible drivers/servers: 4 + * 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions 8 + * are met: 9 + * 1. Redistributions of source code must retain the above copyright 10 + * notice, this list of conditions and the following disclaimer. 11 + * 2. Redistributions in binary form must reproduce the above copyright 12 + * notice, this list of conditions and the following disclaimer in the 13 + * documentation and/or other materials provided with the distribution. 14 + * 3. Neither the name of IBM nor the names of its contributors 15 + * may be used to endorse or promote products derived from this software 16 + * without specific prior written permission. 17 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' 18 + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 + * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE 21 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 + * SUCH DAMAGE. 28 + * 29 + * Copyright (C) Red Hat, Inc., 2013-2015 30 + * Copyright (C) Asias He <asias@redhat.com>, 2013 31 + * Copyright (C) Stefan Hajnoczi <stefanha@redhat.com>, 2015 32 + */ 33 + 34 + #ifndef _LINUX_VIRTIO_VSOCK_H 35 + #define _LINUX_VIRTIO_VSOCK_H 36 + 37 + #include "standard-headers/linux/types.h" 38 + #include "standard-headers/linux/virtio_ids.h" 39 + #include "standard-headers/linux/virtio_config.h" 40 + 41 + struct virtio_vsock_config { 42 + uint64_t guest_cid; 43 + } QEMU_PACKED; 44 + 45 + enum virtio_vsock_event_id { 46 + VIRTIO_VSOCK_EVENT_TRANSPORT_RESET = 0, 47 + }; 48 + 49 + struct virtio_vsock_event { 50 + uint32_t id; 51 + } QEMU_PACKED; 52 + 53 + struct virtio_vsock_hdr { 54 + uint64_t src_cid; 55 + uint64_t dst_cid; 56 + uint32_t src_port; 57 + uint32_t dst_port; 58 + uint32_t len; 59 + uint16_t type; /* enum virtio_vsock_type */ 60 + uint16_t op; /* enum virtio_vsock_op */ 61 + uint32_t flags; 62 + uint32_t buf_alloc; 63 + uint32_t fwd_cnt; 64 + } QEMU_PACKED; 65 + 66 + enum virtio_vsock_type { 67 + VIRTIO_VSOCK_TYPE_STREAM = 1, 68 + }; 69 + 70 + enum virtio_vsock_op { 71 + VIRTIO_VSOCK_OP_INVALID = 0, 72 + 73 + /* Connect operations */ 74 + VIRTIO_VSOCK_OP_REQUEST = 1, 75 + VIRTIO_VSOCK_OP_RESPONSE = 2, 76 + VIRTIO_VSOCK_OP_RST = 3, 77 + VIRTIO_VSOCK_OP_SHUTDOWN = 4, 78 + 79 + /* To send payload */ 80 + VIRTIO_VSOCK_OP_RW = 5, 81 + 82 + /* Tell the peer our credit info */ 83 + VIRTIO_VSOCK_OP_CREDIT_UPDATE = 6, 84 + /* Request the peer to send the credit info to us */ 85 + VIRTIO_VSOCK_OP_CREDIT_REQUEST = 7, 86 + }; 87 + 88 + /* VIRTIO_VSOCK_OP_SHUTDOWN flags values */ 89 + enum virtio_vsock_shutdown { 90 + VIRTIO_VSOCK_SHUTDOWN_RCV = 1, 91 + VIRTIO_VSOCK_SHUTDOWN_SEND = 2, 92 + }; 93 + 94 + #endif /* _LINUX_VIRTIO_VSOCK_H */
+2 -2
linux-headers/asm-arm/kvm.h
··· 139 139 #define ARM_CP15_REG64(...) __ARM_CP15_REG64(__VA_ARGS__) 140 140 141 141 #define KVM_REG_ARM_TIMER_CTL ARM_CP15_REG32(0, 14, 3, 1) 142 - #define KVM_REG_ARM_TIMER_CNT ARM_CP15_REG64(1, 14) 143 - #define KVM_REG_ARM_TIMER_CVAL ARM_CP15_REG64(3, 14) 142 + #define KVM_REG_ARM_TIMER_CNT ARM_CP15_REG64(1, 14) 143 + #define KVM_REG_ARM_TIMER_CVAL ARM_CP15_REG64(3, 14) 144 144 145 145 /* Normal registers are mapped as coprocessor 16. */ 146 146 #define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
+2
linux-headers/asm-arm64/kvm.h
··· 87 87 /* Supported VGICv3 address types */ 88 88 #define KVM_VGIC_V3_ADDR_TYPE_DIST 2 89 89 #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3 90 + #define KVM_VGIC_ITS_ADDR_TYPE 4 90 91 91 92 #define KVM_VGIC_V3_DIST_SIZE SZ_64K 92 93 #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K) 94 + #define KVM_VGIC_V3_ITS_SIZE (2 * SZ_64K) 93 95 94 96 #define KVM_ARM_VCPU_POWER_OFF 0 /* CPU is started in OFF state */ 95 97 #define KVM_ARM_VCPU_EL1_32BIT 1 /* CPU running a 32bit VM */
+41
linux-headers/asm-s390/kvm.h
··· 93 93 __u64 fac_list[256]; 94 94 }; 95 95 96 + #define KVM_S390_VM_CPU_PROCESSOR_FEAT 2 97 + #define KVM_S390_VM_CPU_MACHINE_FEAT 3 98 + 99 + #define KVM_S390_VM_CPU_FEAT_NR_BITS 1024 100 + #define KVM_S390_VM_CPU_FEAT_ESOP 0 101 + #define KVM_S390_VM_CPU_FEAT_SIEF2 1 102 + #define KVM_S390_VM_CPU_FEAT_64BSCAO 2 103 + #define KVM_S390_VM_CPU_FEAT_SIIF 3 104 + #define KVM_S390_VM_CPU_FEAT_GPERE 4 105 + #define KVM_S390_VM_CPU_FEAT_GSLS 5 106 + #define KVM_S390_VM_CPU_FEAT_IB 6 107 + #define KVM_S390_VM_CPU_FEAT_CEI 7 108 + #define KVM_S390_VM_CPU_FEAT_IBS 8 109 + #define KVM_S390_VM_CPU_FEAT_SKEY 9 110 + #define KVM_S390_VM_CPU_FEAT_CMMA 10 111 + #define KVM_S390_VM_CPU_FEAT_PFMFI 11 112 + #define KVM_S390_VM_CPU_FEAT_SIGPIF 12 113 + struct kvm_s390_vm_cpu_feat { 114 + __u64 feat[16]; 115 + }; 116 + 117 + #define KVM_S390_VM_CPU_PROCESSOR_SUBFUNC 4 118 + #define KVM_S390_VM_CPU_MACHINE_SUBFUNC 5 119 + /* for "test bit" instructions MSB 0 bit ordering, for "query" raw blocks */ 120 + struct kvm_s390_vm_cpu_subfunc { 121 + __u8 plo[32]; /* always */ 122 + __u8 ptff[16]; /* with TOD-clock steering */ 123 + __u8 kmac[16]; /* with MSA */ 124 + __u8 kmc[16]; /* with MSA */ 125 + __u8 km[16]; /* with MSA */ 126 + __u8 kimd[16]; /* with MSA */ 127 + __u8 klmd[16]; /* with MSA */ 128 + __u8 pckmo[16]; /* with MSA3 */ 129 + __u8 kmctr[16]; /* with MSA4 */ 130 + __u8 kmf[16]; /* with MSA4 */ 131 + __u8 kmo[16]; /* with MSA4 */ 132 + __u8 pcc[16]; /* with MSA4 */ 133 + __u8 ppno[16]; /* with MSA5 */ 134 + __u8 reserved[1824]; 135 + }; 136 + 96 137 /* kvm attributes for crypto */ 97 138 #define KVM_S390_VM_CRYPTO_ENABLE_AES_KW 0 98 139 #define KVM_S390_VM_CRYPTO_ENABLE_DEA_KW 1
+2 -2
linux-headers/asm-x86/unistd_x32.h
··· 306 306 #define __NR_vmsplice (__X32_SYSCALL_BIT + 532) 307 307 #define __NR_move_pages (__X32_SYSCALL_BIT + 533) 308 308 #define __NR_preadv (__X32_SYSCALL_BIT + 534) 309 - #define __NR_preadv2 (__X32_SYSCALL_BIT + 534) 310 309 #define __NR_pwritev (__X32_SYSCALL_BIT + 535) 311 - #define __NR_pwritev2 (__X32_SYSCALL_BIT + 535) 312 310 #define __NR_rt_tgsigqueueinfo (__X32_SYSCALL_BIT + 536) 313 311 #define __NR_recvmmsg (__X32_SYSCALL_BIT + 537) 314 312 #define __NR_sendmmsg (__X32_SYSCALL_BIT + 538) ··· 319 317 #define __NR_io_setup (__X32_SYSCALL_BIT + 543) 320 318 #define __NR_io_submit (__X32_SYSCALL_BIT + 544) 321 319 #define __NR_execveat (__X32_SYSCALL_BIT + 545) 320 + #define __NR_preadv2 (__X32_SYSCALL_BIT + 546) 321 + #define __NR_pwritev2 (__X32_SYSCALL_BIT + 547) 322 322 323 323 #endif /* _ASM_X86_UNISTD_X32_H */
+16 -2
linux-headers/linux/kvm.h
··· 866 866 #define KVM_CAP_ARM_PMU_V3 126 867 867 #define KVM_CAP_VCPU_ATTRIBUTES 127 868 868 #define KVM_CAP_MAX_VCPU_ID 128 869 + #define KVM_CAP_X2APIC_API 129 870 + #define KVM_CAP_S390_USER_INSTR0 130 871 + #define KVM_CAP_MSI_DEVID 131 872 + #define KVM_CAP_PPC_HTM 132 869 873 870 874 #ifdef KVM_CAP_IRQ_ROUTING 871 875 ··· 878 882 __u32 address_lo; 879 883 __u32 address_hi; 880 884 __u32 data; 881 - __u32 pad; 885 + union { 886 + __u32 pad; 887 + __u32 devid; 888 + }; 882 889 }; 883 890 884 891 struct kvm_irq_routing_s390_adapter { ··· 1024 1031 __u64 addr; 1025 1032 }; 1026 1033 1034 + #define KVM_MSI_VALID_DEVID (1U << 0) 1027 1035 struct kvm_msi { 1028 1036 __u32 address_lo; 1029 1037 __u32 address_hi; 1030 1038 __u32 data; 1031 1039 __u32 flags; 1032 - __u8 pad[16]; 1040 + __u32 devid; 1041 + __u8 pad[12]; 1033 1042 }; 1034 1043 1035 1044 struct kvm_arm_device_addr { ··· 1074 1083 #define KVM_DEV_TYPE_FLIC KVM_DEV_TYPE_FLIC 1075 1084 KVM_DEV_TYPE_ARM_VGIC_V3, 1076 1085 #define KVM_DEV_TYPE_ARM_VGIC_V3 KVM_DEV_TYPE_ARM_VGIC_V3 1086 + KVM_DEV_TYPE_ARM_VGIC_ITS, 1087 + #define KVM_DEV_TYPE_ARM_VGIC_ITS KVM_DEV_TYPE_ARM_VGIC_ITS 1077 1088 KVM_DEV_TYPE_MAX, 1078 1089 }; 1079 1090 ··· 1312 1323 __u16 entry; /* The index of entry in the MSI-X table */ 1313 1324 __u16 padding[3]; 1314 1325 }; 1326 + 1327 + #define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0) 1328 + #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1) 1315 1329 1316 1330 #endif /* __LINUX_KVM_H */
+33
linux-headers/linux/vhost.h
··· 47 47 __u64 log_guest_addr; 48 48 }; 49 49 50 + /* no alignment requirement */ 51 + struct vhost_iotlb_msg { 52 + __u64 iova; 53 + __u64 size; 54 + __u64 uaddr; 55 + #define VHOST_ACCESS_RO 0x1 56 + #define VHOST_ACCESS_WO 0x2 57 + #define VHOST_ACCESS_RW 0x3 58 + __u8 perm; 59 + #define VHOST_IOTLB_MISS 1 60 + #define VHOST_IOTLB_UPDATE 2 61 + #define VHOST_IOTLB_INVALIDATE 3 62 + #define VHOST_IOTLB_ACCESS_FAIL 4 63 + __u8 type; 64 + }; 65 + 66 + #define VHOST_IOTLB_MSG 0x1 67 + 68 + struct vhost_msg { 69 + int type; 70 + union { 71 + struct vhost_iotlb_msg iotlb; 72 + __u8 padding[64]; 73 + }; 74 + }; 75 + 50 76 struct vhost_memory_region { 51 77 __u64 guest_phys_addr; 52 78 __u64 memory_size; /* bytes */ ··· 146 172 #define VHOST_F_LOG_ALL 26 147 173 /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */ 148 174 #define VHOST_NET_F_VIRTIO_NET_HDR 27 175 + /* Vhost have device IOTLB */ 176 + #define VHOST_F_DEVICE_IOTLB 63 149 177 150 178 /* VHOST_SCSI specific definitions */ 151 179 ··· 174 202 /* Set and get the events missed flag */ 175 203 #define VHOST_SCSI_SET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x43, __u32) 176 204 #define VHOST_SCSI_GET_EVENTS_MISSED _IOW(VHOST_VIRTIO, 0x44, __u32) 205 + 206 + /* VHOST_VSOCK specific defines */ 207 + 208 + #define VHOST_VSOCK_SET_GUEST_CID _IOW(VHOST_VIRTIO, 0x60, __u64) 209 + #define VHOST_VSOCK_SET_RUNNING _IOW(VHOST_VIRTIO, 0x61, int) 177 210 178 211 #endif