linux-headers: Update
authorBharata B Rao <bharata@linux.ibm.com>
Tue, 6 Jul 2021 11:24:39 +0000 (16:54 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 9 Jul 2021 01:01:06 +0000 (11:01 +1000)
Update to mainline commit: 79160a603bdb ("Merge tag 'usb-5.14-rc1' of
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb"

Signed-off-by: Bharata B Rao <bharata@linux.ibm.com>
Message-Id: <20210706112440.1449562-2-bharata@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
23 files changed:
include/standard-headers/asm-x86/kvm_para.h
include/standard-headers/drm/drm_fourcc.h
include/standard-headers/linux/ethtool.h
include/standard-headers/linux/input-event-codes.h
include/standard-headers/linux/virtio_ids.h
include/standard-headers/linux/virtio_vsock.h
linux-headers/asm-arm64/kvm.h
linux-headers/asm-generic/mman-common.h
linux-headers/asm-generic/unistd.h
linux-headers/asm-mips/mman.h
linux-headers/asm-mips/unistd_n32.h
linux-headers/asm-mips/unistd_n64.h
linux-headers/asm-mips/unistd_o32.h
linux-headers/asm-powerpc/unistd_32.h
linux-headers/asm-powerpc/unistd_64.h
linux-headers/asm-s390/unistd_32.h
linux-headers/asm-s390/unistd_64.h
linux-headers/asm-x86/kvm.h
linux-headers/asm-x86/unistd_32.h
linux-headers/asm-x86/unistd_64.h
linux-headers/asm-x86/unistd_x32.h
linux-headers/linux/kvm.h
linux-headers/linux/userfaultfd.h

index 215d01b4eca8195aca3a6abce9676d2f1a680bb6..204cfb8640d45a081c78758069f191b7e1d32d9e 100644 (file)
@@ -33,6 +33,8 @@
 #define KVM_FEATURE_PV_SCHED_YIELD     13
 #define KVM_FEATURE_ASYNC_PF_INT       14
 #define KVM_FEATURE_MSI_EXT_DEST_ID    15
+#define KVM_FEATURE_HC_MAP_GPA_RANGE   16
+#define KVM_FEATURE_MIGRATION_CONTROL  17
 
 #define KVM_HINTS_REALTIME      0
 
@@ -54,6 +56,7 @@
 #define MSR_KVM_POLL_CONTROL   0x4b564d05
 #define MSR_KVM_ASYNC_PF_INT   0x4b564d06
 #define MSR_KVM_ASYNC_PF_ACK   0x4b564d07
+#define MSR_KVM_MIGRATION_CONTROL      0x4b564d08
 
 struct kvm_steal_time {
        uint64_t steal;
@@ -90,6 +93,16 @@ struct kvm_clock_pairing {
 /* MSR_KVM_ASYNC_PF_INT */
 #define KVM_ASYNC_PF_VEC_MASK                  GENMASK(7, 0)
 
+/* MSR_KVM_MIGRATION_CONTROL */
+#define KVM_MIGRATION_READY            (1 << 0)
+
+/* KVM_HC_MAP_GPA_RANGE */
+#define KVM_MAP_GPA_RANGE_PAGE_SZ_4K   0
+#define KVM_MAP_GPA_RANGE_PAGE_SZ_2M   (1 << 0)
+#define KVM_MAP_GPA_RANGE_PAGE_SZ_1G   (1 << 1)
+#define KVM_MAP_GPA_RANGE_ENC_STAT(n)  (n << 4)
+#define KVM_MAP_GPA_RANGE_ENCRYPTED    KVM_MAP_GPA_RANGE_ENC_STAT(1)
+#define KVM_MAP_GPA_RANGE_DECRYPTED    KVM_MAP_GPA_RANGE_ENC_STAT(0)
 
 /* Operations for KVM_HC_MMU_OP */
 #define KVM_MMU_OP_WRITE_PTE            1
index a61ae520c2db102073e00d1449b0dfa4cc8566f9..352b51fd0ac96fd78687f0e3453477076eda0e9f 100644 (file)
@@ -167,6 +167,13 @@ extern "C" {
 #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
 #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
 
+/* 64 bpp RGB */
+#define DRM_FORMAT_XRGB16161616        fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
+#define DRM_FORMAT_XBGR16161616        fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */
+
+#define DRM_FORMAT_ARGB16161616        fourcc_code('A', 'R', '4', '8') /* [63:0] A:R:G:B 16:16:16:16 little endian */
+#define DRM_FORMAT_ABGR16161616        fourcc_code('A', 'B', '4', '8') /* [63:0] A:B:G:R 16:16:16:16 little endian */
+
 /*
  * Floating point 64bpp RGB
  * IEEE 754-2008 binary16 half-precision float
index 218d944a17412d95e75edfc2c5d8d44c748ad32a..053d3fafdf3577c0ca54c6440a742faeb15e03ae 100644 (file)
@@ -233,7 +233,7 @@ enum tunable_id {
        ETHTOOL_PFC_PREVENTION_TOUT, /* timeout in msecs */
        /*
         * Add your fresh new tunable attribute above and remember to update
-        * tunable_strings[] in net/core/ethtool.c
+        * tunable_strings[] in net/ethtool/common.c
         */
        __ETHTOOL_TUNABLE_COUNT,
 };
@@ -297,7 +297,7 @@ enum phy_tunable_id {
        ETHTOOL_PHY_EDPD,
        /*
         * Add your fresh new phy tunable attribute above and remember to update
-        * phy_tunable_strings[] in net/core/ethtool.c
+        * phy_tunable_strings[] in net/ethtool/common.c
         */
        __ETHTOOL_PHY_TUNABLE_COUNT,
 };
index c403b9cb0d4ed62fb0aedd2c1e7796ffc8d9d818..b5e86b40abdcbceb6703b1bedcb25a29c871b1b5 100644 (file)
 #define KEY_VOICECOMMAND               0x246   /* Listening Voice Command */
 #define KEY_ASSISTANT          0x247   /* AL Context-aware desktop assistant */
 #define KEY_KBD_LAYOUT_NEXT    0x248   /* AC Next Keyboard Layout Select */
+#define KEY_EMOJI_PICKER       0x249   /* Show/hide emoji picker (HUTRR101) */
 
 #define KEY_BRIGHTNESS_MIN             0x250   /* Set Brightness to Minimum */
 #define KEY_BRIGHTNESS_MAX             0x251   /* Set Brightness to Maximum */
index f0c35ce8628c933991b1731692ef68efee44f680..4fe842c3a3a9847ab102dd73f4b0d1134cc2abdf 100644 (file)
@@ -54,7 +54,7 @@
 #define VIRTIO_ID_SOUND                        25 /* virtio sound */
 #define VIRTIO_ID_FS                   26 /* virtio filesystem */
 #define VIRTIO_ID_PMEM                 27 /* virtio pmem */
-#define VIRTIO_ID_BT                   28 /* virtio bluetooth */
 #define VIRTIO_ID_MAC80211_HWSIM       29 /* virtio mac80211-hwsim */
+#define VIRTIO_ID_BT                   40 /* virtio bluetooth */
 
 #endif /* _LINUX_VIRTIO_IDS_H */
index be443211ce96c17b4e1ef40335b2d686d5ad4f5e..3a23488e42170d80e7aa022f3235208b8439cfd9 100644 (file)
@@ -38,6 +38,9 @@
 #include "standard-headers/linux/virtio_ids.h"
 #include "standard-headers/linux/virtio_config.h"
 
+/* The feature bitmap for virtio vsock */
+#define VIRTIO_VSOCK_F_SEQPACKET       1       /* SOCK_SEQPACKET supported */
+
 struct virtio_vsock_config {
        uint64_t guest_cid;
 } QEMU_PACKED;
@@ -65,6 +68,7 @@ struct virtio_vsock_hdr {
 
 enum virtio_vsock_type {
        VIRTIO_VSOCK_TYPE_STREAM = 1,
+       VIRTIO_VSOCK_TYPE_SEQPACKET = 2,
 };
 
 enum virtio_vsock_op {
@@ -91,4 +95,9 @@ enum virtio_vsock_shutdown {
        VIRTIO_VSOCK_SHUTDOWN_SEND = 2,
 };
 
+/* VIRTIO_VSOCK_OP_RW flags values */
+enum virtio_vsock_rw {
+       VIRTIO_VSOCK_SEQ_EOR = 1,
+};
+
 #endif /* _LINUX_VIRTIO_VSOCK_H */
index b6a0eaa32ae68ff63a86b89f2c20f6979a426c9e..3d2ce9912dc64ec441eec9de451c6efbefe9e0d6 100644 (file)
@@ -184,6 +184,17 @@ struct kvm_vcpu_events {
        __u32 reserved[12];
 };
 
+struct kvm_arm_copy_mte_tags {
+       __u64 guest_ipa;
+       __u64 length;
+       void *addr;
+       __u64 flags;
+       __u64 reserved[2];
+};
+
+#define KVM_ARM_TAGS_TO_GUEST          0
+#define KVM_ARM_TAGS_FROM_GUEST                1
+
 /* If you need to interpret the index values, here is the key: */
 #define KVM_REG_ARM_COPROC_MASK                0x000000000FFF0000
 #define KVM_REG_ARM_COPROC_SHIFT       16
index f94f65d429bea3c26bdcdc3197376916399089e9..1567a3294c3dbf3ee38295bc915e612538b2519d 100644 (file)
@@ -72,6 +72,9 @@
 #define MADV_COLD      20              /* deactivate these pages */
 #define MADV_PAGEOUT   21              /* reclaim these pages */
 
+#define MADV_POPULATE_READ     22      /* populate (prefault) page tables readable */
+#define MADV_POPULATE_WRITE    23      /* populate (prefault) page tables writable */
+
 /* compatibility flags */
 #define MAP_FILE       0
 
index 6de5a7fc066b8fd4ca47dd276e0b899fad1658cf..f211961ce1da69ac38995531e22a411238be5233 100644 (file)
@@ -863,8 +863,8 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
 __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
 #define __NR_mount_setattr 442
 __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
-#define __NR_quotactl_path 443
-__SYSCALL(__NR_quotactl_path, sys_quotactl_path)
+#define __NR_quotactl_fd 443
+__SYSCALL(__NR_quotactl_fd, sys_quotactl_fd)
 
 #define __NR_landlock_create_ruleset 444
 __SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
index 57dc2ac4f8bda21700f71d4c80551cf8d31828c0..40b210c65a5af6b714d201a9ebc867f1e4edfd45 100644 (file)
@@ -98,6 +98,9 @@
 #define MADV_COLD      20              /* deactivate these pages */
 #define MADV_PAGEOUT   21              /* reclaim these pages */
 
+#define MADV_POPULATE_READ     22      /* populate (prefault) page tables readable */
+#define MADV_POPULATE_WRITE    23      /* populate (prefault) page tables writable */
+
 /* compatibility flags */
 #define MAP_FILE       0
 
index fce51fee0964bc54aaff770ae71ea3905b212847..09cd297698e82cb3768c67148c8aef6f9d54ce90 100644 (file)
 #define __NR_process_madvise (__NR_Linux + 440)
 #define __NR_epoll_pwait2 (__NR_Linux + 441)
 #define __NR_mount_setattr (__NR_Linux + 442)
+#define __NR_quotactl_fd (__NR_Linux + 443)
 #define __NR_landlock_create_ruleset (__NR_Linux + 444)
 #define __NR_landlock_add_rule (__NR_Linux + 445)
 #define __NR_landlock_restrict_self (__NR_Linux + 446)
index 0996001802eb426418993161e93554168795d42c..780e0cead66473c7d90886b7f2ad72a71dde6496 100644 (file)
 #define __NR_process_madvise (__NR_Linux + 440)
 #define __NR_epoll_pwait2 (__NR_Linux + 441)
 #define __NR_mount_setattr (__NR_Linux + 442)
+#define __NR_quotactl_fd (__NR_Linux + 443)
 #define __NR_landlock_create_ruleset (__NR_Linux + 444)
 #define __NR_landlock_add_rule (__NR_Linux + 445)
 #define __NR_landlock_restrict_self (__NR_Linux + 446)
index 954303ad69c2cea33b935bfcb4ab28a958618580..06a2b3b55e632b4658487bb4a10ef8c36883b3f4 100644 (file)
 #define __NR_process_madvise (__NR_Linux + 440)
 #define __NR_epoll_pwait2 (__NR_Linux + 441)
 #define __NR_mount_setattr (__NR_Linux + 442)
+#define __NR_quotactl_fd (__NR_Linux + 443)
 #define __NR_landlock_create_ruleset (__NR_Linux + 444)
 #define __NR_landlock_add_rule (__NR_Linux + 445)
 #define __NR_landlock_restrict_self (__NR_Linux + 446)
index 9155778c1967a239184c824214fe7319b6ff7b83..cd5a8a41b26bed2c2dea298e4bf66b8eada1fc9c 100644 (file)
 #define __NR_process_madvise 440
 #define __NR_epoll_pwait2 441
 #define __NR_mount_setattr 442
+#define __NR_quotactl_fd 443
 #define __NR_landlock_create_ruleset 444
 #define __NR_landlock_add_rule 445
 #define __NR_landlock_restrict_self 446
index 3cefa889320c645a94077012c5d80eb390109755..8458effa8d879a4c63ca3c1486d5cf6fb3b34127 100644 (file)
 #define __NR_process_madvise 440
 #define __NR_epoll_pwait2 441
 #define __NR_mount_setattr 442
+#define __NR_quotactl_fd 443
 #define __NR_landlock_create_ruleset 444
 #define __NR_landlock_add_rule 445
 #define __NR_landlock_restrict_self 446
index e8cd34334f37366277981d7713aaae7bd716de97..0c3cd299e425dab5a6870b507049074fc5a9baaa 100644 (file)
 #define __NR_process_madvise 440
 #define __NR_epoll_pwait2 441
 #define __NR_mount_setattr 442
+#define __NR_quotactl_fd 443
 #define __NR_landlock_create_ruleset 444
 #define __NR_landlock_add_rule 445
 #define __NR_landlock_restrict_self 446
index 86830e1e83d893ada1334896c5cb17dd93fc7f11..8dfc08b5e6237223528944bd6bbd64c895cf2bad 100644 (file)
 #define __NR_process_madvise 440
 #define __NR_epoll_pwait2 441
 #define __NR_mount_setattr 442
+#define __NR_quotactl_fd 443
 #define __NR_landlock_create_ruleset 444
 #define __NR_landlock_add_rule 445
 #define __NR_landlock_restrict_self 446
index 0662f644aad9da71e25b9f7554d20d6981a5e7c7..a6c327f8ad9e5f079dd7039229e3df7e296fc345 100644 (file)
@@ -159,6 +159,19 @@ struct kvm_sregs {
        __u64 interrupt_bitmap[(KVM_NR_INTERRUPTS + 63) / 64];
 };
 
+struct kvm_sregs2 {
+       /* out (KVM_GET_SREGS2) / in (KVM_SET_SREGS2) */
+       struct kvm_segment cs, ds, es, fs, gs, ss;
+       struct kvm_segment tr, ldt;
+       struct kvm_dtable gdt, idt;
+       __u64 cr0, cr2, cr3, cr4, cr8;
+       __u64 efer;
+       __u64 apic_base;
+       __u64 flags;
+       __u64 pdptrs[4];
+};
+#define KVM_SREGS2_FLAGS_PDPTRS_VALID 1
+
 /* for KVM_GET_FPU and KVM_SET_FPU */
 struct kvm_fpu {
        __u8  fpr[8][16];
index 8f6ac8c19f7d4b76212b079f9b35b6584973c19d..66e96c0c685bea887c5e5d3390ec132f46c2e694 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_UNISTD_32_H
-#define _ASM_X86_UNISTD_32_H 1
+#ifndef _ASM_UNISTD_32_H
+#define _ASM_UNISTD_32_H
 
 #define __NR_restart_syscall 0
 #define __NR_exit 1
 #define __NR_process_madvise 440
 #define __NR_epoll_pwait2 441
 #define __NR_mount_setattr 442
+#define __NR_quotactl_fd 443
 #define __NR_landlock_create_ruleset 444
 #define __NR_landlock_add_rule 445
 #define __NR_landlock_restrict_self 446
 
 
-#endif /* _ASM_X86_UNISTD_32_H */
+#endif /* _ASM_UNISTD_32_H */
index bb187a9268ea87ac295daeaefc9a202d06194525..b8ff6f14ee857e1f938328bacb9ee7ed6f9a67a6 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_UNISTD_64_H
-#define _ASM_X86_UNISTD_64_H 1
+#ifndef _ASM_UNISTD_64_H
+#define _ASM_UNISTD_64_H
 
 #define __NR_read 0
 #define __NR_write 1
 #define __NR_process_madvise 440
 #define __NR_epoll_pwait2 441
 #define __NR_mount_setattr 442
+#define __NR_quotactl_fd 443
 #define __NR_landlock_create_ruleset 444
 #define __NR_landlock_add_rule 445
 #define __NR_landlock_restrict_self 446
 
 
-#endif /* _ASM_X86_UNISTD_64_H */
+#endif /* _ASM_UNISTD_64_H */
index 4edd0103ace8a80289b975ceccfc04c85193bc5d..06a1097c15ed44b62b2f321f1833b2ec959df962 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_UNISTD_X32_H
-#define _ASM_X86_UNISTD_X32_H 1
+#ifndef _ASM_UNISTD_X32_H
+#define _ASM_UNISTD_X32_H
 
 #define __NR_read (__X32_SYSCALL_BIT + 0)
 #define __NR_write (__X32_SYSCALL_BIT + 1)
 #define __NR_process_madvise (__X32_SYSCALL_BIT + 440)
 #define __NR_epoll_pwait2 (__X32_SYSCALL_BIT + 441)
 #define __NR_mount_setattr (__X32_SYSCALL_BIT + 442)
+#define __NR_quotactl_fd (__X32_SYSCALL_BIT + 443)
 #define __NR_landlock_create_ruleset (__X32_SYSCALL_BIT + 444)
 #define __NR_landlock_add_rule (__X32_SYSCALL_BIT + 445)
 #define __NR_landlock_restrict_self (__X32_SYSCALL_BIT + 446)
 #define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
 
 
-#endif /* _ASM_X86_UNISTD_X32_H */
+#endif /* _ASM_UNISTD_X32_H */
index 20d6a263bb3884a6982ee75b45e0576a7ddbcc52..bcaf66cc4d2a06a861322b0ee82c2c5b38454b98 100644 (file)
@@ -280,6 +280,9 @@ struct kvm_xen_exit {
 /* Encounter unexpected vm-exit reason */
 #define KVM_INTERNAL_ERROR_UNEXPECTED_EXIT_REASON      4
 
+/* Flags that describe what fields in emulation_failure hold valid data. */
+#define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0)
+
 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
 struct kvm_run {
        /* in */
@@ -383,6 +386,25 @@ struct kvm_run {
                        __u32 ndata;
                        __u64 data[16];
                } internal;
+               /*
+                * KVM_INTERNAL_ERROR_EMULATION
+                *
+                * "struct emulation_failure" is an overlay of "struct internal"
+                * that is used for the KVM_INTERNAL_ERROR_EMULATION sub-type of
+                * KVM_EXIT_INTERNAL_ERROR.  Note, unlike other internal error
+                * sub-types, this struct is ABI!  It also needs to be backwards
+                * compatible with "struct internal".  Take special care that
+                * "ndata" is correct, that new fields are enumerated in "flags",
+                * and that each flag enumerates fields that are 64-bit aligned
+                * and sized (so that ndata+internal.data[] is valid/accurate).
+                */
+               struct {
+                       __u32 suberror;
+                       __u32 ndata;
+                       __u64 flags;
+                       __u8  insn_size;
+                       __u8  insn_bytes[15];
+               } emulation_failure;
                /* KVM_EXIT_OSI */
                struct {
                        __u64 gprs[32];
@@ -1083,6 +1105,13 @@ struct kvm_ppc_resize_hpt {
 #define KVM_CAP_SGX_ATTRIBUTE 196
 #define KVM_CAP_VM_COPY_ENC_CONTEXT_FROM 197
 #define KVM_CAP_PTP_KVM 198
+#define KVM_CAP_HYPERV_ENFORCE_CPUID 199
+#define KVM_CAP_SREGS2 200
+#define KVM_CAP_EXIT_HYPERCALL 201
+#define KVM_CAP_PPC_RPT_INVALIDATE 202
+#define KVM_CAP_BINARY_STATS_FD 203
+#define KVM_CAP_EXIT_ON_EMULATION_FAILURE 204
+#define KVM_CAP_ARM_MTE 205
 
 #ifdef KVM_CAP_IRQ_ROUTING
 
@@ -1428,6 +1457,7 @@ struct kvm_s390_ucas_mapping {
 /* Available with KVM_CAP_PMU_EVENT_FILTER */
 #define KVM_SET_PMU_EVENT_FILTER  _IOW(KVMIO,  0xb2, struct kvm_pmu_event_filter)
 #define KVM_PPC_SVM_OFF                  _IO(KVMIO,  0xb3)
+#define KVM_ARM_MTE_COPY_TAGS    _IOR(KVMIO,  0xb4, struct kvm_arm_copy_mte_tags)
 
 /* ioctl for vm fd */
 #define KVM_CREATE_DEVICE        _IOWR(KVMIO,  0xe0, struct kvm_create_device)
@@ -1621,6 +1651,9 @@ struct kvm_xen_hvm_attr {
 #define KVM_XEN_VCPU_GET_ATTR  _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr)
 #define KVM_XEN_VCPU_SET_ATTR  _IOW(KVMIO,  0xcb, struct kvm_xen_vcpu_attr)
 
+#define KVM_GET_SREGS2             _IOR(KVMIO,  0xcc, struct kvm_sregs2)
+#define KVM_SET_SREGS2             _IOW(KVMIO,  0xcd, struct kvm_sregs2)
+
 struct kvm_xen_vcpu_attr {
        __u16 type;
        __u16 pad[3];
@@ -1899,4 +1932,76 @@ struct kvm_dirty_gfn {
 #define KVM_BUS_LOCK_DETECTION_OFF             (1 << 0)
 #define KVM_BUS_LOCK_DETECTION_EXIT            (1 << 1)
 
+/**
+ * struct kvm_stats_header - Header of per vm/vcpu binary statistics data.
+ * @flags: Some extra information for header, always 0 for now.
+ * @name_size: The size in bytes of the memory which contains statistics
+ *             name string including trailing '\0'. The memory is allocated
+ *             at the send of statistics descriptor.
+ * @num_desc: The number of statistics the vm or vcpu has.
+ * @id_offset: The offset of the vm/vcpu stats' id string in the file pointed
+ *             by vm/vcpu stats fd.
+ * @desc_offset: The offset of the vm/vcpu stats' descriptor block in the file
+ *               pointd by vm/vcpu stats fd.
+ * @data_offset: The offset of the vm/vcpu stats' data block in the file
+ *               pointed by vm/vcpu stats fd.
+ *
+ * This is the header userspace needs to read from stats fd before any other
+ * readings. It is used by userspace to discover all the information about the
+ * vm/vcpu's binary statistics.
+ * Userspace reads this header from the start of the vm/vcpu's stats fd.
+ */
+struct kvm_stats_header {
+       __u32 flags;
+       __u32 name_size;
+       __u32 num_desc;
+       __u32 id_offset;
+       __u32 desc_offset;
+       __u32 data_offset;
+};
+
+#define KVM_STATS_TYPE_SHIFT           0
+#define KVM_STATS_TYPE_MASK            (0xF << KVM_STATS_TYPE_SHIFT)
+#define KVM_STATS_TYPE_CUMULATIVE      (0x0 << KVM_STATS_TYPE_SHIFT)
+#define KVM_STATS_TYPE_INSTANT         (0x1 << KVM_STATS_TYPE_SHIFT)
+#define KVM_STATS_TYPE_PEAK            (0x2 << KVM_STATS_TYPE_SHIFT)
+#define KVM_STATS_TYPE_MAX             KVM_STATS_TYPE_PEAK
+
+#define KVM_STATS_UNIT_SHIFT           4
+#define KVM_STATS_UNIT_MASK            (0xF << KVM_STATS_UNIT_SHIFT)
+#define KVM_STATS_UNIT_NONE            (0x0 << KVM_STATS_UNIT_SHIFT)
+#define KVM_STATS_UNIT_BYTES           (0x1 << KVM_STATS_UNIT_SHIFT)
+#define KVM_STATS_UNIT_SECONDS         (0x2 << KVM_STATS_UNIT_SHIFT)
+#define KVM_STATS_UNIT_CYCLES          (0x3 << KVM_STATS_UNIT_SHIFT)
+#define KVM_STATS_UNIT_MAX             KVM_STATS_UNIT_CYCLES
+
+#define KVM_STATS_BASE_SHIFT           8
+#define KVM_STATS_BASE_MASK            (0xF << KVM_STATS_BASE_SHIFT)
+#define KVM_STATS_BASE_POW10           (0x0 << KVM_STATS_BASE_SHIFT)
+#define KVM_STATS_BASE_POW2            (0x1 << KVM_STATS_BASE_SHIFT)
+#define KVM_STATS_BASE_MAX             KVM_STATS_BASE_POW2
+
+/**
+ * struct kvm_stats_desc - Descriptor of a KVM statistics.
+ * @flags: Annotations of the stats, like type, unit, etc.
+ * @exponent: Used together with @flags to determine the unit.
+ * @size: The number of data items for this stats.
+ *        Every data item is of type __u64.
+ * @offset: The offset of the stats to the start of stat structure in
+ *          struture kvm or kvm_vcpu.
+ * @unused: Unused field for future usage. Always 0 for now.
+ * @name: The name string for the stats. Its size is indicated by the
+ *        &kvm_stats_header->name_size.
+ */
+struct kvm_stats_desc {
+       __u32 flags;
+       __s16 exponent;
+       __u16 size;
+       __u32 offset;
+       __u32 unused;
+       char name[];
+};
+
+#define KVM_GET_STATS_FD  _IO(KVMIO,  0xce)
+
 #endif /* __LINUX_KVM_H */
index b9ac97b70f3832c4096dd15c0574958b14a94fe1..8479af5f4c73925464d3463ce5970055589ee009 100644 (file)
@@ -31,7 +31,8 @@
                           UFFD_FEATURE_MISSING_SHMEM |         \
                           UFFD_FEATURE_SIGBUS |                \
                           UFFD_FEATURE_THREAD_ID |             \
-                          UFFD_FEATURE_MINOR_HUGETLBFS)
+                          UFFD_FEATURE_MINOR_HUGETLBFS |       \
+                          UFFD_FEATURE_MINOR_SHMEM)
 #define UFFD_API_IOCTLS                                \
        ((__u64)1 << _UFFDIO_REGISTER |         \
         (__u64)1 << _UFFDIO_UNREGISTER |       \
@@ -80,8 +81,8 @@
                                      struct uffdio_zeropage)
 #define UFFDIO_WRITEPROTECT    _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \
                                      struct uffdio_writeprotect)
-#define UFFDIO_CONTINUE                _IOR(UFFDIO, _UFFDIO_CONTINUE,  \
-                                    struct uffdio_continue)
+#define UFFDIO_CONTINUE                _IOWR(UFFDIO, _UFFDIO_CONTINUE, \
+                                     struct uffdio_continue)
 
 /* read() structure */
 struct uffd_msg {
@@ -185,6 +186,9 @@ struct uffdio_api {
         * UFFD_FEATURE_MINOR_HUGETLBFS indicates that minor faults
         * can be intercepted (via REGISTER_MODE_MINOR) for
         * hugetlbfs-backed pages.
+        *
+        * UFFD_FEATURE_MINOR_SHMEM indicates the same support as
+        * UFFD_FEATURE_MINOR_HUGETLBFS, but for shmem-backed pages instead.
         */
 #define UFFD_FEATURE_PAGEFAULT_FLAG_WP         (1<<0)
 #define UFFD_FEATURE_EVENT_FORK                        (1<<1)
@@ -196,6 +200,7 @@ struct uffdio_api {
 #define UFFD_FEATURE_SIGBUS                    (1<<7)
 #define UFFD_FEATURE_THREAD_ID                 (1<<8)
 #define UFFD_FEATURE_MINOR_HUGETLBFS           (1<<9)
+#define UFFD_FEATURE_MINOR_SHMEM               (1<<10)
        __u64 features;
 
        __u64 ioctls;