Merge tag 'flexible-array-transformations-UAPI-6.0-rc1' of git://git.kernel.org/pub...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2022 02:50:47 +0000 (19:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Aug 2022 02:50:47 +0000 (19:50 -0700)
Pull uapi flexible array update from Gustavo Silva:
 "A treewide patch that replaces zero-length arrays with flexible-array
  members in UAPI. This has been baking in linux-next for 5 weeks now.

  '-fstrict-flex-arrays=3' is coming and we need to land these changes
  to prevent issues like these in the short future:

    fs/minix/dir.c:337:3: warning: 'strcpy' will always overflow; destination buffer has size 0, but the source string has length 2 (including NUL byte) [-Wfortify-source]
strcpy(de3->name, ".");
^

  Since these are all [0] to [] changes, the risk to UAPI is nearly
  zero. If this breaks anything, we can use a union with a new member
  name"

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101836
* tag 'flexible-array-transformations-UAPI-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
  treewide: uapi: Replace zero-length arrays with flexible-array members

1  2 
arch/x86/include/uapi/asm/bootparam.h
include/uapi/linux/bpf.h
include/uapi/linux/dm-ioctl.h
include/uapi/linux/fanotify.h
include/uapi/linux/kvm.h
include/uapi/linux/perf_event.h
tools/arch/x86/include/uapi/asm/kvm.h
tools/include/uapi/drm/i915_drm.h
tools/include/uapi/linux/kvm.h

  #define SETUP_APPLE_PROPERTIES                5
  #define SETUP_JAILHOUSE                       6
  #define SETUP_CC_BLOB                 7
 +#define SETUP_IMA                     8
 +#define SETUP_RNG_SEED                        9
 +#define SETUP_ENUM_MAX                        SETUP_RNG_SEED
  
  #define SETUP_INDIRECT                        (1<<31)
 -
 -/* SETUP_INDIRECT | max(SETUP_*) */
 -#define SETUP_TYPE_MAX                        (SETUP_INDIRECT | SETUP_JAILHOUSE)
 +#define SETUP_TYPE_MAX                        (SETUP_ENUM_MAX | SETUP_INDIRECT)
  
  /* ram_size flags */
  #define RAMDISK_IMAGE_START_MASK      0x07FF
@@@ -53,7 -52,7 +53,7 @@@ struct setup_data 
        __u64 next;
        __u32 type;
        __u32 len;
-       __u8 data[0];
+       __u8 data[];
  };
  
  /* extensible setup indirect data node */
@@@ -173,14 -172,6 +173,14 @@@ struct jailhouse_setup_data 
        } __attribute__((packed)) v2;
  } __attribute__((packed));
  
 +/*
 + * IMA buffer setup data information from the previous kernel during kexec
 + */
 +struct ima_setup_data {
 +      __u64 addr;
 +      __u64 size;
 +} __attribute__((packed));
 +
  /* The so-called "zeropage" */
  struct boot_params {
        struct screen_info screen_info;                 /* 0x000 */
diff --combined include/uapi/linux/bpf.h
@@@ -79,7 -79,7 +79,7 @@@ struct bpf_insn 
  /* Key of an a BPF_MAP_TYPE_LPM_TRIE entry */
  struct bpf_lpm_trie_key {
        __u32   prefixlen;      /* up to 32 for AF_INET, 128 for AF_INET6 */
-       __u8    data[0];        /* Arbitrary size */
+       __u8    data[]; /* Arbitrary size */
  };
  
  struct bpf_cgroup_storage_key {
@@@ -5222,25 -5222,22 +5222,25 @@@ union bpf_attr 
   *    Return
   *            Nothing. Always succeeds.
   *
 - * long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset)
 + * long bpf_dynptr_read(void *dst, u32 len, struct bpf_dynptr *src, u32 offset, u64 flags)
   *    Description
   *            Read *len* bytes from *src* into *dst*, starting from *offset*
   *            into *src*.
 + *            *flags* is currently unused.
   *    Return
   *            0 on success, -E2BIG if *offset* + *len* exceeds the length
 - *            of *src*'s data, -EINVAL if *src* is an invalid dynptr.
 + *            of *src*'s data, -EINVAL if *src* is an invalid dynptr or if
 + *            *flags* is not 0.
   *
 - * long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len)
 + * long bpf_dynptr_write(struct bpf_dynptr *dst, u32 offset, void *src, u32 len, u64 flags)
   *    Description
   *            Write *len* bytes from *src* into *dst*, starting from *offset*
   *            into *dst*.
 + *            *flags* is currently unused.
   *    Return
   *            0 on success, -E2BIG if *offset* + *len* exceeds the length
   *            of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
 - *            is a read-only dynptr.
 + *            is a read-only dynptr or if *flags* is not 0.
   *
   * void *bpf_dynptr_data(struct bpf_dynptr *ptr, u32 offset, u32 len)
   *    Description
@@@ -182,7 -182,7 +182,7 @@@ struct dm_target_spec 
  struct dm_target_deps {
        __u32 count;    /* Array size */
        __u32 padding;  /* unused */
-       __u64 dev[0];   /* out */
+       __u64 dev[];    /* out */
  };
  
  /*
@@@ -192,7 -192,7 +192,7 @@@ struct dm_name_list 
        __u64 dev;
        __u32 next;             /* offset to the next record from
                                   the _start_ of this */
-       char name[0];
+       char name[];
  
        /*
         * The following members can be accessed by taking a pointer that
@@@ -216,7 -216,7 +216,7 @@@ struct dm_target_versions 
          __u32 next;
          __u32 version[3];
  
-         char name[0];
+         char name[];
  };
  
  /*
  struct dm_target_msg {
        __u64 sector;   /* Device sector */
  
-       char message[0];
+       char message[];
  };
  
  /*
@@@ -286,9 -286,9 +286,9 @@@ enum 
  #define DM_DEV_SET_GEOMETRY   _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
  
  #define DM_VERSION_MAJOR      4
 -#define DM_VERSION_MINOR      46
 +#define DM_VERSION_MINOR      47
  #define DM_VERSION_PATCHLEVEL 0
 -#define DM_VERSION_EXTRA      "-ioctl (2022-02-22)"
 +#define DM_VERSION_EXTRA      "-ioctl (2022-07-28)"
  
  /* Status bits */
  #define DM_READONLY_FLAG      (1 << 0) /* In/Out */
  #define FAN_MARK_FLUSH                0x00000080
  /* FAN_MARK_FILESYSTEM is     0x00000100 */
  #define FAN_MARK_EVICTABLE    0x00000200
 +/* This bit is mutually exclusive with FAN_MARK_IGNORED_MASK bit */
 +#define FAN_MARK_IGNORE               0x00000400
  
  /* These are NOT bitwise flags.  Both bits can be used togther.  */
  #define FAN_MARK_INODE                0x00000000
  #define FAN_MARK_MOUNT                0x00000010
  #define FAN_MARK_FILESYSTEM   0x00000100
  
 +/*
 + * Convenience macro - FAN_MARK_IGNORE requires FAN_MARK_IGNORED_SURV_MODIFY
 + * for non-inode mark types.
 + */
 +#define FAN_MARK_IGNORE_SURV  (FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY)
 +
  /* Deprecated - do not use this in programs and do not add new flags here! */
  #define FAN_ALL_MARK_FLAGS    (FAN_MARK_ADD |\
                                 FAN_MARK_REMOVE |\
@@@ -170,7 -162,7 +170,7 @@@ struct fanotify_event_info_fid 
         * Following is an opaque struct file_handle that can be passed as
         * an argument to open_by_handle_at(2).
         */
-       unsigned char handle[0];
+       unsigned char handle[];
  };
  
  /*
diff --combined include/uapi/linux/kvm.h
@@@ -542,7 -542,7 +542,7 @@@ struct kvm_coalesced_mmio 
  
  struct kvm_coalesced_mmio_ring {
        __u32 first, last;
-       struct kvm_coalesced_mmio coalesced_mmio[0];
+       struct kvm_coalesced_mmio coalesced_mmio[];
  };
  
  #define KVM_COALESCED_MMIO_MAX \
@@@ -621,7 -621,7 +621,7 @@@ struct kvm_clear_dirty_log 
  /* for KVM_SET_SIGNAL_MASK */
  struct kvm_signal_mask {
        __u32 len;
-       __u8  sigset[0];
+       __u8  sigset[];
  };
  
  /* for KVM_TPR_ACCESS_REPORTING */
@@@ -1221,7 -1221,7 +1221,7 @@@ struct kvm_irq_routing_entry 
  struct kvm_irq_routing {
        __u32 nr;
        __u32 flags;
-       struct kvm_irq_routing_entry entries[0];
+       struct kvm_irq_routing_entry entries[];
  };
  
  #endif
@@@ -1341,7 -1341,7 +1341,7 @@@ struct kvm_dirty_tlb 
  
  struct kvm_reg_list {
        __u64 n; /* number of regs */
-       __u64 reg[0];
+       __u64 reg[];
  };
  
  struct kvm_one_reg {
@@@ -2083,8 -2083,7 +2083,8 @@@ struct kvm_stats_header 
  #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_UNIT_BOOLEAN                (0x4 << KVM_STATS_UNIT_SHIFT)
 +#define KVM_STATS_UNIT_MAX            KVM_STATS_UNIT_BOOLEAN
  
  #define KVM_STATS_BASE_SHIFT          8
  #define KVM_STATS_BASE_MASK           (0xF << KVM_STATS_BASE_SHIFT)
@@@ -301,7 -301,6 +301,7 @@@ enum 
   *      { u64         time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
   *      { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
   *      { u64         id;           } && PERF_FORMAT_ID
 + *      { u64         lost;         } && PERF_FORMAT_LOST
   *    } && !PERF_FORMAT_GROUP
   *
   *    { u64           nr;
   *      { u64         time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
   *      { u64         value;
   *        { u64       id;           } && PERF_FORMAT_ID
 + *        { u64       lost;         } && PERF_FORMAT_LOST
   *      }             cntr[nr];
   *    } && PERF_FORMAT_GROUP
   * };
@@@ -319,9 -317,8 +319,9 @@@ enum perf_event_read_format 
        PERF_FORMAT_TOTAL_TIME_RUNNING          = 1U << 1,
        PERF_FORMAT_ID                          = 1U << 2,
        PERF_FORMAT_GROUP                       = 1U << 3,
 +      PERF_FORMAT_LOST                        = 1U << 4,
  
 -      PERF_FORMAT_MAX = 1U << 4,              /* non-ABI */
 +      PERF_FORMAT_MAX = 1U << 5,              /* non-ABI */
  };
  
  #define PERF_ATTR_SIZE_VER0   64      /* sizeof first published struct */
@@@ -494,7 -491,7 +494,7 @@@ struct perf_event_query_bpf 
        /*
         * User provided buffer to store program ids
         */
-       __u32   ids[0];
+       __u32   ids[];
  };
  
  /*
@@@ -198,13 -198,13 +198,13 @@@ struct kvm_msrs 
        __u32 nmsrs; /* number of msrs in entries */
        __u32 pad;
  
-       struct kvm_msr_entry entries[0];
+       struct kvm_msr_entry entries[];
  };
  
  /* for KVM_GET_MSR_INDEX_LIST */
  struct kvm_msr_list {
        __u32 nmsrs; /* number of msrs in entries */
-       __u32 indices[0];
+       __u32 indices[];
  };
  
  /* Maximum size of any access bitmap in bytes */
@@@ -241,7 -241,7 +241,7 @@@ struct kvm_cpuid_entry 
  struct kvm_cpuid {
        __u32 nent;
        __u32 padding;
-       struct kvm_cpuid_entry entries[0];
+       struct kvm_cpuid_entry entries[];
  };
  
  struct kvm_cpuid_entry2 {
  struct kvm_cpuid2 {
        __u32 nent;
        __u32 padding;
-       struct kvm_cpuid_entry2 entries[0];
+       struct kvm_cpuid_entry2 entries[];
  };
  
  /* for KVM_GET_PIT and KVM_SET_PIT */
@@@ -389,7 -389,7 +389,7 @@@ struct kvm_xsave 
         * the contents of CPUID leaf 0xD on the host.
         */
        __u32 region[1024];
-       __u32 extra[0];
+       __u32 extra[];
  };
  
  #define KVM_MAX_XCRS  16
@@@ -428,12 -428,11 +428,12 @@@ struct kvm_sync_regs 
        struct kvm_vcpu_events events;
  };
  
 -#define KVM_X86_QUIRK_LINT0_REENABLED    (1 << 0)
 -#define KVM_X86_QUIRK_CD_NW_CLEARED      (1 << 1)
 -#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE    (1 << 2)
 -#define KVM_X86_QUIRK_OUT_7E_INC_RIP     (1 << 3)
 -#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
 +#define KVM_X86_QUIRK_LINT0_REENABLED         (1 << 0)
 +#define KVM_X86_QUIRK_CD_NW_CLEARED           (1 << 1)
 +#define KVM_X86_QUIRK_LAPIC_MMIO_HOLE         (1 << 2)
 +#define KVM_X86_QUIRK_OUT_7E_INC_RIP          (1 << 3)
 +#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT    (1 << 4)
 +#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN      (1 << 5)
  
  #define KVM_STATE_NESTED_FORMAT_VMX   0
  #define KVM_STATE_NESTED_FORMAT_SVM   1
@@@ -516,7 -515,7 +516,7 @@@ struct kvm_pmu_event_filter 
        __u32 fixed_counter_bitmap;
        __u32 flags;
        __u32 pad[4];
-       __u64 events[0];
+       __u64 events[];
  };
  
  #define KVM_PMU_EVENT_ALLOW 0
@@@ -154,77 -154,25 +154,77 @@@ enum i915_mocs_table_index 
        I915_MOCS_CACHED,
  };
  
 -/*
 +/**
 + * enum drm_i915_gem_engine_class - uapi engine type enumeration
 + *
   * Different engines serve different roles, and there may be more than one
 - * engine serving each role. enum drm_i915_gem_engine_class provides a
 - * classification of the role of the engine, which may be used when requesting
 - * operations to be performed on a certain subset of engines, or for providing
 - * information about that group.
 + * engine serving each role.  This enum provides a classification of the role
 + * of the engine, which may be used when requesting operations to be performed
 + * on a certain subset of engines, or for providing information about that
 + * group.
   */
  enum drm_i915_gem_engine_class {
 +      /**
 +       * @I915_ENGINE_CLASS_RENDER:
 +       *
 +       * Render engines support instructions used for 3D, Compute (GPGPU),
 +       * and programmable media workloads.  These instructions fetch data and
 +       * dispatch individual work items to threads that operate in parallel.
 +       * The threads run small programs (called "kernels" or "shaders") on
 +       * the GPU's execution units (EUs).
 +       */
        I915_ENGINE_CLASS_RENDER        = 0,
 +
 +      /**
 +       * @I915_ENGINE_CLASS_COPY:
 +       *
 +       * Copy engines (also referred to as "blitters") support instructions
 +       * that move blocks of data from one location in memory to another,
 +       * or that fill a specified location of memory with fixed data.
 +       * Copy engines can perform pre-defined logical or bitwise operations
 +       * on the source, destination, or pattern data.
 +       */
        I915_ENGINE_CLASS_COPY          = 1,
 +
 +      /**
 +       * @I915_ENGINE_CLASS_VIDEO:
 +       *
 +       * Video engines (also referred to as "bit stream decode" (BSD) or
 +       * "vdbox") support instructions that perform fixed-function media
 +       * decode and encode.
 +       */
        I915_ENGINE_CLASS_VIDEO         = 2,
 +
 +      /**
 +       * @I915_ENGINE_CLASS_VIDEO_ENHANCE:
 +       *
 +       * Video enhancement engines (also referred to as "vebox") support
 +       * instructions related to image enhancement.
 +       */
        I915_ENGINE_CLASS_VIDEO_ENHANCE = 3,
  
 -      /* should be kept compact */
 +      /**
 +       * @I915_ENGINE_CLASS_COMPUTE:
 +       *
 +       * Compute engines support a subset of the instructions available
 +       * on render engines:  compute engines support Compute (GPGPU) and
 +       * programmable media workloads, but do not support the 3D pipeline.
 +       */
 +      I915_ENGINE_CLASS_COMPUTE       = 4,
 +
 +      /* Values in this enum should be kept compact. */
  
 +      /**
 +       * @I915_ENGINE_CLASS_INVALID:
 +       *
 +       * Placeholder value to represent an invalid engine class assignment.
 +       */
        I915_ENGINE_CLASS_INVALID       = -1
  };
  
 -/*
 +/**
 + * struct i915_engine_class_instance - Engine class/instance identifier
 + *
   * There may be more than one engine fulfilling any role within the system.
   * Each engine of a class is given a unique instance number and therefore
   * any engine can be specified by its class:instance tuplet. APIs that allow
   * for this identification.
   */
  struct i915_engine_class_instance {
 -      __u16 engine_class; /* see enum drm_i915_gem_engine_class */
 -      __u16 engine_instance;
 +      /**
 +       * @engine_class:
 +       *
 +       * Engine class from enum drm_i915_gem_engine_class
 +       */
 +      __u16 engine_class;
  #define I915_ENGINE_CLASS_INVALID_NONE -1
  #define I915_ENGINE_CLASS_INVALID_VIRTUAL -2
 +
 +      /**
 +       * @engine_instance:
 +       *
 +       * Engine instance.
 +       */
 +      __u16 engine_instance;
  };
  
  /**
@@@ -2123,7 -2060,7 +2123,7 @@@ struct i915_context_engines_load_balanc
  
        __u64 mbz64; /* reserved for future use; must be zero */
  
-       struct i915_engine_class_instance engines[0];
+       struct i915_engine_class_instance engines[];
  } __attribute__((packed));
  
  #define I915_DEFINE_CONTEXT_ENGINES_LOAD_BALANCE(name__, N__) struct { \
@@@ -2161,7 -2098,7 +2161,7 @@@ struct i915_context_engines_bond 
        __u64 flags; /* all undefined flags must be zero */
        __u64 mbz64[4]; /* reserved for future use; must be zero */
  
-       struct i915_engine_class_instance engines[0];
+       struct i915_engine_class_instance engines[];
  } __attribute__((packed));
  
  #define I915_DEFINE_CONTEXT_ENGINES_BOND(name__, N__) struct { \
@@@ -2288,7 -2225,7 +2288,7 @@@ struct i915_context_engines_parallel_su
         * length = width (i) * num_siblings (j)
         * index = j + i * num_siblings
         */
-       struct i915_engine_class_instance engines[0];
+       struct i915_engine_class_instance engines[];
  
  } __packed;
  
@@@ -2720,65 -2657,24 +2720,65 @@@ enum drm_i915_perf_record_type 
        DRM_I915_PERF_RECORD_MAX /* non-ABI */
  };
  
 -/*
 +/**
 + * struct drm_i915_perf_oa_config
 + *
   * Structure to upload perf dynamic configuration into the kernel.
   */
  struct drm_i915_perf_oa_config {
 -      /** String formatted like "%08x-%04x-%04x-%04x-%012x" */
 +      /**
 +       * @uuid:
 +       *
 +       * String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x"
 +       */
        char uuid[36];
  
 +      /**
 +       * @n_mux_regs:
 +       *
 +       * Number of mux regs in &mux_regs_ptr.
 +       */
        __u32 n_mux_regs;
 +
 +      /**
 +       * @n_boolean_regs:
 +       *
 +       * Number of boolean regs in &boolean_regs_ptr.
 +       */
        __u32 n_boolean_regs;
 +
 +      /**
 +       * @n_flex_regs:
 +       *
 +       * Number of flex regs in &flex_regs_ptr.
 +       */
        __u32 n_flex_regs;
  
 -      /*
 -       * These fields are pointers to tuples of u32 values (register address,
 -       * value). For example the expected length of the buffer pointed by
 -       * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs).
 +      /**
 +       * @mux_regs_ptr:
 +       *
 +       * Pointer to tuples of u32 values (register address, value) for mux
 +       * registers.  Expected length of buffer is (2 * sizeof(u32) *
 +       * &n_mux_regs).
         */
        __u64 mux_regs_ptr;
 +
 +      /**
 +       * @boolean_regs_ptr:
 +       *
 +       * Pointer to tuples of u32 values (register address, value) for mux
 +       * registers.  Expected length of buffer is (2 * sizeof(u32) *
 +       * &n_boolean_regs).
 +       */
        __u64 boolean_regs_ptr;
 +
 +      /**
 +       * @flex_regs_ptr:
 +       *
 +       * Pointer to tuples of u32 values (register address, value) for mux
 +       * registers.  Expected length of buffer is (2 * sizeof(u32) *
 +       * &n_flex_regs).
 +       */
        __u64 flex_regs_ptr;
  };
  
   * @data_ptr is also depends on the specific @query_id.
   */
  struct drm_i915_query_item {
 -      /** @query_id: The id for this query */
 +      /**
 +       * @query_id:
 +       *
 +       * The id for this query.  Currently accepted query IDs are:
 +       *  - %DRM_I915_QUERY_TOPOLOGY_INFO (see struct drm_i915_query_topology_info)
 +       *  - %DRM_I915_QUERY_ENGINE_INFO (see struct drm_i915_engine_info)
 +       *  - %DRM_I915_QUERY_PERF_CONFIG (see struct drm_i915_query_perf_config)
 +       *  - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions)
 +       *  - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`)
 +       *  - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info)
 +       */
        __u64 query_id;
 -#define DRM_I915_QUERY_TOPOLOGY_INFO    1
 -#define DRM_I915_QUERY_ENGINE_INFO    2
 -#define DRM_I915_QUERY_PERF_CONFIG      3
 -#define DRM_I915_QUERY_MEMORY_REGIONS   4
 +#define DRM_I915_QUERY_TOPOLOGY_INFO          1
 +#define DRM_I915_QUERY_ENGINE_INFO            2
 +#define DRM_I915_QUERY_PERF_CONFIG            3
 +#define DRM_I915_QUERY_MEMORY_REGIONS         4
 +#define DRM_I915_QUERY_HWCONFIG_BLOB          5
 +#define DRM_I915_QUERY_GEOMETRY_SUBSLICES     6
  /* Must be kept compact -- no holes and well documented */
  
        /**
        /**
         * @flags:
         *
 -       * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
 +       * When &query_id == %DRM_I915_QUERY_TOPOLOGY_INFO, must be 0.
         *
 -       * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the
 +       * When &query_id == %DRM_I915_QUERY_PERF_CONFIG, must be one of the
         * following:
         *
 -       *      - DRM_I915_QUERY_PERF_CONFIG_LIST
 -       *      - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
 -       *      - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
 +       *      - %DRM_I915_QUERY_PERF_CONFIG_LIST
 +       *      - %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID
 +       *      - %DRM_I915_QUERY_PERF_CONFIG_FOR_UUID
 +       *
 +       * When &query_id == %DRM_I915_QUERY_GEOMETRY_SUBSLICES must contain
 +       * a struct i915_engine_class_instance that references a render engine.
         */
        __u32 flags;
  #define DRM_I915_QUERY_PERF_CONFIG_LIST          1
@@@ -2890,112 -2771,66 +2890,112 @@@ struct drm_i915_query 
        __u64 items_ptr;
  };
  
 -/*
 - * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO :
 - *
 - * data: contains the 3 pieces of information :
 - *
 - * - the slice mask with one bit per slice telling whether a slice is
 - *   available. The availability of slice X can be queried with the following
 - *   formula :
 - *
 - *           (data[X / 8] >> (X % 8)) & 1
 - *
 - * - the subslice mask for each slice with one bit per subslice telling
 - *   whether a subslice is available. Gen12 has dual-subslices, which are
 - *   similar to two gen11 subslices. For gen12, this array represents dual-
 - *   subslices. The availability of subslice Y in slice X can be queried
 - *   with the following formula :
 - *
 - *           (data[subslice_offset +
 - *                 X * subslice_stride +
 - *                 Y / 8] >> (Y % 8)) & 1
 - *
 - * - the EU mask for each subslice in each slice with one bit per EU telling
 - *   whether an EU is available. The availability of EU Z in subslice Y in
 - *   slice X can be queried with the following formula :
 +/**
 + * struct drm_i915_query_topology_info
   *
 - *           (data[eu_offset +
 - *                 (X * max_subslices + Y) * eu_stride +
 - *                 Z / 8] >> (Z % 8)) & 1
 + * Describes slice/subslice/EU information queried by
 + * %DRM_I915_QUERY_TOPOLOGY_INFO
   */
  struct drm_i915_query_topology_info {
 -      /*
 +      /**
 +       * @flags:
 +       *
         * Unused for now. Must be cleared to zero.
         */
        __u16 flags;
  
 +      /**
 +       * @max_slices:
 +       *
 +       * The number of bits used to express the slice mask.
 +       */
        __u16 max_slices;
 +
 +      /**
 +       * @max_subslices:
 +       *
 +       * The number of bits used to express the subslice mask.
 +       */
        __u16 max_subslices;
 +
 +      /**
 +       * @max_eus_per_subslice:
 +       *
 +       * The number of bits in the EU mask that correspond to a single
 +       * subslice's EUs.
 +       */
        __u16 max_eus_per_subslice;
  
 -      /*
 +      /**
 +       * @subslice_offset:
 +       *
         * Offset in data[] at which the subslice masks are stored.
         */
        __u16 subslice_offset;
  
 -      /*
 +      /**
 +       * @subslice_stride:
 +       *
         * Stride at which each of the subslice masks for each slice are
         * stored.
         */
        __u16 subslice_stride;
  
 -      /*
 +      /**
 +       * @eu_offset:
 +       *
         * Offset in data[] at which the EU masks are stored.
         */
        __u16 eu_offset;
  
 -      /*
 +      /**
 +       * @eu_stride:
 +       *
         * Stride at which each of the EU masks for each subslice are stored.
         */
        __u16 eu_stride;
  
 +      /**
 +       * @data:
 +       *
 +       * Contains 3 pieces of information :
 +       *
 +       * - The slice mask with one bit per slice telling whether a slice is
 +       *   available. The availability of slice X can be queried with the
 +       *   following formula :
 +       *
 +       *   .. code:: c
 +       *
 +       *      (data[X / 8] >> (X % 8)) & 1
 +       *
 +       *   Starting with Xe_HP platforms, Intel hardware no longer has
 +       *   traditional slices so i915 will always report a single slice
 +       *   (hardcoded slicemask = 0x1) which contains all of the platform's
 +       *   subslices.  I.e., the mask here does not reflect any of the newer
 +       *   hardware concepts such as "gslices" or "cslices" since userspace
 +       *   is capable of inferring those from the subslice mask.
 +       *
 +       * - The subslice mask for each slice with one bit per subslice telling
 +       *   whether a subslice is available.  Starting with Gen12 we use the
 +       *   term "subslice" to refer to what the hardware documentation
 +       *   describes as a "dual-subslices."  The availability of subslice Y
 +       *   in slice X can be queried with the following formula :
 +       *
 +       *   .. code:: c
 +       *
 +       *      (data[subslice_offset + X * subslice_stride + Y / 8] >> (Y % 8)) & 1
 +       *
 +       * - The EU mask for each subslice in each slice, with one bit per EU
 +       *   telling whether an EU is available. The availability of EU Z in
 +       *   subslice Y in slice X can be queried with the following formula :
 +       *
 +       *   .. code:: c
 +       *
 +       *      (data[eu_offset +
 +       *            (X * max_subslices + Y) * eu_stride +
 +       *            Z / 8
 +       *       ] >> (Z % 8)) & 1
 +       */
        __u8 data[];
  };
  
@@@ -3116,68 -2951,52 +3116,68 @@@ struct drm_i915_query_engine_info 
        struct drm_i915_engine_info engines[];
  };
  
 -/*
 - * Data written by the kernel with query DRM_I915_QUERY_PERF_CONFIG.
 +/**
 + * struct drm_i915_query_perf_config
 + *
 + * Data written by the kernel with query %DRM_I915_QUERY_PERF_CONFIG and
 + * %DRM_I915_QUERY_GEOMETRY_SUBSLICES.
   */
  struct drm_i915_query_perf_config {
        union {
 -              /*
 -               * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets
 -               * this fields to the number of configurations available.
 +              /**
 +               * @n_configs:
 +               *
 +               * When &drm_i915_query_item.flags ==
 +               * %DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets this fields to
 +               * the number of configurations available.
                 */
                __u64 n_configs;
  
 -              /*
 -               * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID,
 -               * i915 will use the value in this field as configuration
 -               * identifier to decide what data to write into config_ptr.
 +              /**
 +               * @config:
 +               *
 +               * When &drm_i915_query_item.flags ==
 +               * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID, i915 will use the
 +               * value in this field as configuration identifier to decide
 +               * what data to write into config_ptr.
                 */
                __u64 config;
  
 -              /*
 -               * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID,
 -               * i915 will use the value in this field as configuration
 -               * identifier to decide what data to write into config_ptr.
 +              /**
 +               * @uuid:
 +               *
 +               * When &drm_i915_query_item.flags ==
 +               * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID, i915 will use the
 +               * value in this field as configuration identifier to decide
 +               * what data to write into config_ptr.
                 *
                 * String formatted like "%08x-%04x-%04x-%04x-%012x"
                 */
                char uuid[36];
        };
  
 -      /*
 +      /**
 +       * @flags:
 +       *
         * Unused for now. Must be cleared to zero.
         */
        __u32 flags;
  
 -      /*
 -       * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 will
 -       * write an array of __u64 of configuration identifiers.
 +      /**
 +       * @data:
         *
 -       * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_DATA, i915 will
 -       * write a struct drm_i915_perf_oa_config. If the following fields of
 -       * drm_i915_perf_oa_config are set not set to 0, i915 will write into
 -       * the associated pointers the values of submitted when the
 +       * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_LIST,
 +       * i915 will write an array of __u64 of configuration identifiers.
 +       *
 +       * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_DATA,
 +       * i915 will write a struct drm_i915_perf_oa_config. If the following
 +       * fields of struct drm_i915_perf_oa_config are not set to 0, i915 will
 +       * write into the associated pointers the values of submitted when the
         * configuration was created :
         *
 -       *         - n_mux_regs
 -       *         - n_boolean_regs
 -       *         - n_flex_regs
 +       *  - &drm_i915_perf_oa_config.n_mux_regs
 +       *  - &drm_i915_perf_oa_config.n_boolean_regs
 +       *  - &drm_i915_perf_oa_config.n_flex_regs
         */
        __u8 data[];
  };
@@@ -3316,16 -3135,6 +3316,16 @@@ struct drm_i915_query_memory_regions 
  };
  
  /**
 + * DOC: GuC HWCONFIG blob uAPI
 + *
 + * The GuC produces a blob with information about the current device.
 + * i915 reads this blob from GuC and makes it available via this uAPI.
 + *
 + * The format and meaning of the blob content are documented in the
 + * Programmer's Reference Manual.
 + */
 +
 +/**
   * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
   * extension support using struct i915_user_extension.
   *
@@@ -444,9 -444,6 +444,9 @@@ struct kvm_run 
  #define KVM_SYSTEM_EVENT_SHUTDOWN       1
  #define KVM_SYSTEM_EVENT_RESET          2
  #define KVM_SYSTEM_EVENT_CRASH          3
 +#define KVM_SYSTEM_EVENT_WAKEUP         4
 +#define KVM_SYSTEM_EVENT_SUSPEND        5
 +#define KVM_SYSTEM_EVENT_SEV_TERM       6
                        __u32 type;
                        __u32 ndata;
                        union {
@@@ -542,7 -539,7 +542,7 @@@ struct kvm_coalesced_mmio 
  
  struct kvm_coalesced_mmio_ring {
        __u32 first, last;
-       struct kvm_coalesced_mmio coalesced_mmio[0];
+       struct kvm_coalesced_mmio coalesced_mmio[];
  };
  
  #define KVM_COALESCED_MMIO_MAX \
@@@ -621,7 -618,7 +621,7 @@@ struct kvm_clear_dirty_log 
  /* for KVM_SET_SIGNAL_MASK */
  struct kvm_signal_mask {
        __u32 len;
-       __u8  sigset[0];
+       __u8  sigset[];
  };
  
  /* for KVM_TPR_ACCESS_REPORTING */
@@@ -649,7 -646,6 +649,7 @@@ struct kvm_vapic_addr 
  #define KVM_MP_STATE_OPERATING         7
  #define KVM_MP_STATE_LOAD              8
  #define KVM_MP_STATE_AP_RESET_HOLD     9
 +#define KVM_MP_STATE_SUSPENDED         10
  
  struct kvm_mp_state {
        __u32 mp_state;
@@@ -1154,9 -1150,8 +1154,9 @@@ struct kvm_ppc_resize_hpt 
  #define KVM_CAP_S390_MEM_OP_EXTENSION 211
  #define KVM_CAP_PMU_CAPABILITY 212
  #define KVM_CAP_DISABLE_QUIRKS2 213
 -/* #define KVM_CAP_VM_TSC_CONTROL 214 */
 +#define KVM_CAP_VM_TSC_CONTROL 214
  #define KVM_CAP_SYSTEM_EVENT_DATA 215
 +#define KVM_CAP_ARM_SYSTEM_SUSPEND 216
  
  #ifdef KVM_CAP_IRQ_ROUTING
  
@@@ -1221,7 -1216,7 +1221,7 @@@ struct kvm_irq_routing_entry 
  struct kvm_irq_routing {
        __u32 nr;
        __u32 flags;
-       struct kvm_irq_routing_entry entries[0];
+       struct kvm_irq_routing_entry entries[];
  };
  
  #endif
@@@ -1245,7 -1240,6 +1245,7 @@@ struct kvm_x86_mce 
  #define KVM_XEN_HVM_CONFIG_SHARED_INFO                (1 << 2)
  #define KVM_XEN_HVM_CONFIG_RUNSTATE           (1 << 3)
  #define KVM_XEN_HVM_CONFIG_EVTCHN_2LEVEL      (1 << 4)
 +#define KVM_XEN_HVM_CONFIG_EVTCHN_SEND                (1 << 5)
  
  struct kvm_xen_hvm_config {
        __u32 flags;
@@@ -1341,7 -1335,7 +1341,7 @@@ struct kvm_dirty_tlb 
  
  struct kvm_reg_list {
        __u64 n; /* number of regs */
-       __u64 reg[0];
+       __u64 reg[];
  };
  
  struct kvm_one_reg {
@@@ -1484,8 -1478,7 +1484,8 @@@ struct kvm_s390_ucas_mapping 
  #define KVM_SET_PIT2              _IOW(KVMIO,  0xa0, struct kvm_pit_state2)
  /* Available with KVM_CAP_PPC_GET_PVINFO */
  #define KVM_PPC_GET_PVINFO      _IOW(KVMIO,  0xa1, struct kvm_ppc_pvinfo)
 -/* Available with KVM_CAP_TSC_CONTROL */
 +/* Available with KVM_CAP_TSC_CONTROL for a vCPU, or with
 +*  KVM_CAP_VM_TSC_CONTROL to set defaults for a VM */
  #define KVM_SET_TSC_KHZ           _IO(KVMIO,  0xa2)
  #define KVM_GET_TSC_KHZ           _IO(KVMIO,  0xa3)
  /* Available with KVM_CAP_PCI_2_3 */
@@@ -1701,32 -1694,6 +1701,32 @@@ struct kvm_xen_hvm_attr 
                struct {
                        __u64 gfn;
                } shared_info;
 +              struct {
 +                      __u32 send_port;
 +                      __u32 type; /* EVTCHNSTAT_ipi / EVTCHNSTAT_interdomain */
 +                      __u32 flags;
 +#define KVM_XEN_EVTCHN_DEASSIGN               (1 << 0)
 +#define KVM_XEN_EVTCHN_UPDATE         (1 << 1)
 +#define KVM_XEN_EVTCHN_RESET          (1 << 2)
 +                      /*
 +                       * Events sent by the guest are either looped back to
 +                       * the guest itself (potentially on a different port#)
 +                       * or signalled via an eventfd.
 +                       */
 +                      union {
 +                              struct {
 +                                      __u32 port;
 +                                      __u32 vcpu;
 +                                      __u32 priority;
 +                              } port;
 +                              struct {
 +                                      __u32 port; /* Zero for eventfd */
 +                                      __s32 fd;
 +                              } eventfd;
 +                              __u32 padding[4];
 +                      } deliver;
 +              } evtchn;
 +              __u32 xen_version;
                __u64 pad[8];
        } u;
  };
  #define KVM_XEN_ATTR_TYPE_LONG_MODE           0x0
  #define KVM_XEN_ATTR_TYPE_SHARED_INFO         0x1
  #define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR               0x2
 +/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
 +#define KVM_XEN_ATTR_TYPE_EVTCHN              0x3
 +#define KVM_XEN_ATTR_TYPE_XEN_VERSION         0x4
  
  /* Per-vCPU Xen attributes */
  #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)
  
 +/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
 +#define KVM_XEN_HVM_EVTCHN_SEND       _IOW(KVMIO,  0xd0, struct kvm_irq_routing_xen_evtchn)
 +
  #define KVM_GET_SREGS2             _IOR(KVMIO,  0xcc, struct kvm_sregs2)
  #define KVM_SET_SREGS2             _IOW(KVMIO,  0xcd, struct kvm_sregs2)
  
@@@ -1763,13 -1724,6 +1763,13 @@@ struct kvm_xen_vcpu_attr 
                        __u64 time_blocked;
                        __u64 time_offline;
                } runstate;
 +              __u32 vcpu_id;
 +              struct {
 +                      __u32 port;
 +                      __u32 priority;
 +                      __u64 expires_ns;
 +              } timer;
 +              __u8 vector;
        } u;
  };
  
  #define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT       0x3
  #define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA  0x4
  #define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST        0x5
 +/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_EVTCHN_SEND */
 +#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_ID                0x6
 +#define KVM_XEN_VCPU_ATTR_TYPE_TIMER          0x7
 +#define KVM_XEN_VCPU_ATTR_TYPE_UPCALL_VECTOR  0x8
  
  /* Secure Encrypted Virtualization command */
  enum sev_cmd_id {
@@@ -2083,8 -2033,7 +2083,8 @@@ struct kvm_stats_header 
  #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_UNIT_BOOLEAN                (0x4 << KVM_STATS_UNIT_SHIFT)
 +#define KVM_STATS_UNIT_MAX            KVM_STATS_UNIT_BOOLEAN
  
  #define KVM_STATS_BASE_SHIFT          8
  #define KVM_STATS_BASE_MASK           (0xF << KVM_STATS_BASE_SHIFT)