Merge tag 'perf-tools-fixes-for-v5.19-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

- Enable ignore_missing_thread in 'perf stat', enabling counting with
'--pid' when threads disappear during counting session setup

- Adjust output data offset for backward compatibility in 'perf inject'

- Fix missing free in copy_kcore_dir() in 'perf inject'

- Fix caching files with a wrong build ID

- Sync drm, cpufeatures, vhost and svn headers with the kernel

* tag 'perf-tools-fixes-for-v5.19-2022-06-26' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
tools headers UAPI: Synch KVM's svm.h header with the kernel
tools include UAPI: Sync linux/vhost.h with the kernel sources
perf stat: Enable ignore_missing_thread
perf inject: Adjust output data offset for backward compatibility
perf trace beauty: Fix generation of errno id->str table on ALT Linux
perf build-id: Fix caching files with a wrong build ID
tools headers cpufeatures: Sync with the kernel sources
tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
perf inject: Fix missing free in copy_kcore_dir()

Changed files
+369 -104
tools
arch
x86
include
include
uapi
drm
linux
perf
+5 -2
tools/arch/x86/include/asm/cpufeatures.h
··· 201 201 #define X86_FEATURE_INVPCID_SINGLE ( 7*32+ 7) /* Effectively INVPCID && CR4.PCIDE=1 */ 202 202 #define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */ 203 203 #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */ 204 - /* FREE! ( 7*32+10) */ 204 + #define X86_FEATURE_XCOMPACTED ( 7*32+10) /* "" Use compacted XSTATE (XSAVES or XSAVEC) */ 205 205 #define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */ 206 206 #define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */ 207 207 #define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCE for Spectre variant 2 */ ··· 211 211 #define X86_FEATURE_SSBD ( 7*32+17) /* Speculative Store Bypass Disable */ 212 212 #define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */ 213 213 #define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* "" Fill RSB on context switches */ 214 - /* FREE! ( 7*32+20) */ 214 + #define X86_FEATURE_PERFMON_V2 ( 7*32+20) /* AMD Performance Monitoring Version 2 */ 215 215 #define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */ 216 216 #define X86_FEATURE_USE_IBRS_FW ( 7*32+22) /* "" Use IBRS during runtime firmware calls */ 217 217 #define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE ( 7*32+23) /* "" Disable Speculative Store Bypass. */ ··· 238 238 #define X86_FEATURE_VMW_VMMCALL ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */ 239 239 #define X86_FEATURE_PVUNLOCK ( 8*32+20) /* "" PV unlock function */ 240 240 #define X86_FEATURE_VCPUPREEMPT ( 8*32+21) /* "" PV vcpu_is_preempted function */ 241 + #define X86_FEATURE_TDX_GUEST ( 8*32+22) /* Intel Trust Domain Extensions Guest */ 241 242 242 243 /* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */ 243 244 #define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/ ··· 316 315 #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */ 317 316 #define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */ 318 317 #define X86_FEATURE_CPPC (13*32+27) /* Collaborative Processor Performance Control */ 318 + #define X86_FEATURE_BRS (13*32+31) /* Branch Sampling available */ 319 319 320 320 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */ 321 321 #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */ ··· 407 405 #define X86_FEATURE_SEV (19*32+ 1) /* AMD Secure Encrypted Virtualization */ 408 406 #define X86_FEATURE_VM_PAGE_FLUSH (19*32+ 2) /* "" VM Page Flush MSR is supported */ 409 407 #define X86_FEATURE_SEV_ES (19*32+ 3) /* AMD Secure Encrypted Virtualization - Encrypted State */ 408 + #define X86_FEATURE_V_TSC_AUX (19*32+ 9) /* "" Virtual TSC_AUX */ 410 409 #define X86_FEATURE_SME_COHERENT (19*32+10) /* "" AMD hardware-enforced cache coherency */ 411 410 412 411 /*
+7 -1
tools/arch/x86/include/asm/disabled-features.h
··· 62 62 # define DISABLE_SGX (1 << (X86_FEATURE_SGX & 31)) 63 63 #endif 64 64 65 + #ifdef CONFIG_INTEL_TDX_GUEST 66 + # define DISABLE_TDX_GUEST 0 67 + #else 68 + # define DISABLE_TDX_GUEST (1 << (X86_FEATURE_TDX_GUEST & 31)) 69 + #endif 70 + 65 71 /* 66 72 * Make sure to add features to the correct mask 67 73 */ ··· 79 73 #define DISABLED_MASK5 0 80 74 #define DISABLED_MASK6 0 81 75 #define DISABLED_MASK7 (DISABLE_PTI) 82 - #define DISABLED_MASK8 0 76 + #define DISABLED_MASK8 (DISABLE_TDX_GUEST) 83 77 #define DISABLED_MASK9 (DISABLE_SGX) 84 78 #define DISABLED_MASK10 0 85 79 #define DISABLED_MASK11 0
+13
tools/arch/x86/include/uapi/asm/svm.h
··· 108 108 #define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005 109 109 #define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0 110 110 #define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1 111 + #define SVM_VMGEXIT_PSC 0x80000010 112 + #define SVM_VMGEXIT_GUEST_REQUEST 0x80000011 113 + #define SVM_VMGEXIT_EXT_GUEST_REQUEST 0x80000012 114 + #define SVM_VMGEXIT_AP_CREATION 0x80000013 115 + #define SVM_VMGEXIT_AP_CREATE_ON_INIT 0 116 + #define SVM_VMGEXIT_AP_CREATE 1 117 + #define SVM_VMGEXIT_AP_DESTROY 2 118 + #define SVM_VMGEXIT_HV_FEATURES 0x8000fffd 111 119 #define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff 112 120 113 121 /* Exit code reserved for hypervisor/software use */ ··· 226 218 { SVM_VMGEXIT_NMI_COMPLETE, "vmgexit_nmi_complete" }, \ 227 219 { SVM_VMGEXIT_AP_HLT_LOOP, "vmgexit_ap_hlt_loop" }, \ 228 220 { SVM_VMGEXIT_AP_JUMP_TABLE, "vmgexit_ap_jump_table" }, \ 221 + { SVM_VMGEXIT_PSC, "vmgexit_page_state_change" }, \ 222 + { SVM_VMGEXIT_GUEST_REQUEST, "vmgexit_guest_request" }, \ 223 + { SVM_VMGEXIT_EXT_GUEST_REQUEST, "vmgexit_ext_guest_request" }, \ 224 + { SVM_VMGEXIT_AP_CREATION, "vmgexit_ap_creation" }, \ 225 + { SVM_VMGEXIT_HV_FEATURES, "vmgexit_hypervisor_feature" }, \ 229 226 { SVM_EXIT_ERR, "invalid_guest_state" } 230 227 231 228
+272 -81
tools/include/uapi/drm/i915_drm.h
··· 154 154 I915_MOCS_CACHED, 155 155 }; 156 156 157 - /* 157 + /** 158 + * enum drm_i915_gem_engine_class - uapi engine type enumeration 159 + * 158 160 * Different engines serve different roles, and there may be more than one 159 - * engine serving each role. enum drm_i915_gem_engine_class provides a 160 - * classification of the role of the engine, which may be used when requesting 161 - * operations to be performed on a certain subset of engines, or for providing 162 - * information about that group. 161 + * engine serving each role. This enum provides a classification of the role 162 + * of the engine, which may be used when requesting operations to be performed 163 + * on a certain subset of engines, or for providing information about that 164 + * group. 163 165 */ 164 166 enum drm_i915_gem_engine_class { 167 + /** 168 + * @I915_ENGINE_CLASS_RENDER: 169 + * 170 + * Render engines support instructions used for 3D, Compute (GPGPU), 171 + * and programmable media workloads. These instructions fetch data and 172 + * dispatch individual work items to threads that operate in parallel. 173 + * The threads run small programs (called "kernels" or "shaders") on 174 + * the GPU's execution units (EUs). 175 + */ 165 176 I915_ENGINE_CLASS_RENDER = 0, 177 + 178 + /** 179 + * @I915_ENGINE_CLASS_COPY: 180 + * 181 + * Copy engines (also referred to as "blitters") support instructions 182 + * that move blocks of data from one location in memory to another, 183 + * or that fill a specified location of memory with fixed data. 184 + * Copy engines can perform pre-defined logical or bitwise operations 185 + * on the source, destination, or pattern data. 186 + */ 166 187 I915_ENGINE_CLASS_COPY = 1, 188 + 189 + /** 190 + * @I915_ENGINE_CLASS_VIDEO: 191 + * 192 + * Video engines (also referred to as "bit stream decode" (BSD) or 193 + * "vdbox") support instructions that perform fixed-function media 194 + * decode and encode. 195 + */ 167 196 I915_ENGINE_CLASS_VIDEO = 2, 197 + 198 + /** 199 + * @I915_ENGINE_CLASS_VIDEO_ENHANCE: 200 + * 201 + * Video enhancement engines (also referred to as "vebox") support 202 + * instructions related to image enhancement. 203 + */ 168 204 I915_ENGINE_CLASS_VIDEO_ENHANCE = 3, 169 205 170 - /* should be kept compact */ 206 + /** 207 + * @I915_ENGINE_CLASS_COMPUTE: 208 + * 209 + * Compute engines support a subset of the instructions available 210 + * on render engines: compute engines support Compute (GPGPU) and 211 + * programmable media workloads, but do not support the 3D pipeline. 212 + */ 213 + I915_ENGINE_CLASS_COMPUTE = 4, 171 214 215 + /* Values in this enum should be kept compact. */ 216 + 217 + /** 218 + * @I915_ENGINE_CLASS_INVALID: 219 + * 220 + * Placeholder value to represent an invalid engine class assignment. 221 + */ 172 222 I915_ENGINE_CLASS_INVALID = -1 173 223 }; 174 224 175 - /* 225 + /** 226 + * struct i915_engine_class_instance - Engine class/instance identifier 227 + * 176 228 * There may be more than one engine fulfilling any role within the system. 177 229 * Each engine of a class is given a unique instance number and therefore 178 230 * any engine can be specified by its class:instance tuplet. APIs that allow ··· 232 180 * for this identification. 233 181 */ 234 182 struct i915_engine_class_instance { 235 - __u16 engine_class; /* see enum drm_i915_gem_engine_class */ 236 - __u16 engine_instance; 183 + /** 184 + * @engine_class: 185 + * 186 + * Engine class from enum drm_i915_gem_engine_class 187 + */ 188 + __u16 engine_class; 237 189 #define I915_ENGINE_CLASS_INVALID_NONE -1 238 190 #define I915_ENGINE_CLASS_INVALID_VIRTUAL -2 191 + 192 + /** 193 + * @engine_instance: 194 + * 195 + * Engine instance. 196 + */ 197 + __u16 engine_instance; 239 198 }; 240 199 241 200 /** ··· 2720 2657 DRM_I915_PERF_RECORD_MAX /* non-ABI */ 2721 2658 }; 2722 2659 2723 - /* 2660 + /** 2661 + * struct drm_i915_perf_oa_config 2662 + * 2724 2663 * Structure to upload perf dynamic configuration into the kernel. 2725 2664 */ 2726 2665 struct drm_i915_perf_oa_config { 2727 - /** String formatted like "%08x-%04x-%04x-%04x-%012x" */ 2666 + /** 2667 + * @uuid: 2668 + * 2669 + * String formatted like "%\08x-%\04x-%\04x-%\04x-%\012x" 2670 + */ 2728 2671 char uuid[36]; 2729 2672 2673 + /** 2674 + * @n_mux_regs: 2675 + * 2676 + * Number of mux regs in &mux_regs_ptr. 2677 + */ 2730 2678 __u32 n_mux_regs; 2679 + 2680 + /** 2681 + * @n_boolean_regs: 2682 + * 2683 + * Number of boolean regs in &boolean_regs_ptr. 2684 + */ 2731 2685 __u32 n_boolean_regs; 2686 + 2687 + /** 2688 + * @n_flex_regs: 2689 + * 2690 + * Number of flex regs in &flex_regs_ptr. 2691 + */ 2732 2692 __u32 n_flex_regs; 2733 2693 2734 - /* 2735 - * These fields are pointers to tuples of u32 values (register address, 2736 - * value). For example the expected length of the buffer pointed by 2737 - * mux_regs_ptr is (2 * sizeof(u32) * n_mux_regs). 2694 + /** 2695 + * @mux_regs_ptr: 2696 + * 2697 + * Pointer to tuples of u32 values (register address, value) for mux 2698 + * registers. Expected length of buffer is (2 * sizeof(u32) * 2699 + * &n_mux_regs). 2738 2700 */ 2739 2701 __u64 mux_regs_ptr; 2702 + 2703 + /** 2704 + * @boolean_regs_ptr: 2705 + * 2706 + * Pointer to tuples of u32 values (register address, value) for mux 2707 + * registers. Expected length of buffer is (2 * sizeof(u32) * 2708 + * &n_boolean_regs). 2709 + */ 2740 2710 __u64 boolean_regs_ptr; 2711 + 2712 + /** 2713 + * @flex_regs_ptr: 2714 + * 2715 + * Pointer to tuples of u32 values (register address, value) for mux 2716 + * registers. Expected length of buffer is (2 * sizeof(u32) * 2717 + * &n_flex_regs). 2718 + */ 2741 2719 __u64 flex_regs_ptr; 2742 2720 }; 2743 2721 ··· 2789 2685 * @data_ptr is also depends on the specific @query_id. 2790 2686 */ 2791 2687 struct drm_i915_query_item { 2792 - /** @query_id: The id for this query */ 2688 + /** 2689 + * @query_id: 2690 + * 2691 + * The id for this query. Currently accepted query IDs are: 2692 + * - %DRM_I915_QUERY_TOPOLOGY_INFO (see struct drm_i915_query_topology_info) 2693 + * - %DRM_I915_QUERY_ENGINE_INFO (see struct drm_i915_engine_info) 2694 + * - %DRM_I915_QUERY_PERF_CONFIG (see struct drm_i915_query_perf_config) 2695 + * - %DRM_I915_QUERY_MEMORY_REGIONS (see struct drm_i915_query_memory_regions) 2696 + * - %DRM_I915_QUERY_HWCONFIG_BLOB (see `GuC HWCONFIG blob uAPI`) 2697 + * - %DRM_I915_QUERY_GEOMETRY_SUBSLICES (see struct drm_i915_query_topology_info) 2698 + */ 2793 2699 __u64 query_id; 2794 - #define DRM_I915_QUERY_TOPOLOGY_INFO 1 2795 - #define DRM_I915_QUERY_ENGINE_INFO 2 2796 - #define DRM_I915_QUERY_PERF_CONFIG 3 2797 - #define DRM_I915_QUERY_MEMORY_REGIONS 4 2700 + #define DRM_I915_QUERY_TOPOLOGY_INFO 1 2701 + #define DRM_I915_QUERY_ENGINE_INFO 2 2702 + #define DRM_I915_QUERY_PERF_CONFIG 3 2703 + #define DRM_I915_QUERY_MEMORY_REGIONS 4 2704 + #define DRM_I915_QUERY_HWCONFIG_BLOB 5 2705 + #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 2798 2706 /* Must be kept compact -- no holes and well documented */ 2799 2707 2800 2708 /** ··· 2822 2706 /** 2823 2707 * @flags: 2824 2708 * 2825 - * When query_id == DRM_I915_QUERY_TOPOLOGY_INFO, must be 0. 2709 + * When &query_id == %DRM_I915_QUERY_TOPOLOGY_INFO, must be 0. 2826 2710 * 2827 - * When query_id == DRM_I915_QUERY_PERF_CONFIG, must be one of the 2711 + * When &query_id == %DRM_I915_QUERY_PERF_CONFIG, must be one of the 2828 2712 * following: 2829 2713 * 2830 - * - DRM_I915_QUERY_PERF_CONFIG_LIST 2831 - * - DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2832 - * - DRM_I915_QUERY_PERF_CONFIG_FOR_UUID 2714 + * - %DRM_I915_QUERY_PERF_CONFIG_LIST 2715 + * - %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID 2716 + * - %DRM_I915_QUERY_PERF_CONFIG_FOR_UUID 2717 + * 2718 + * When &query_id == %DRM_I915_QUERY_GEOMETRY_SUBSLICES must contain 2719 + * a struct i915_engine_class_instance that references a render engine. 2833 2720 */ 2834 2721 __u32 flags; 2835 2722 #define DRM_I915_QUERY_PERF_CONFIG_LIST 1 ··· 2890 2771 __u64 items_ptr; 2891 2772 }; 2892 2773 2893 - /* 2894 - * Data written by the kernel with query DRM_I915_QUERY_TOPOLOGY_INFO : 2774 + /** 2775 + * struct drm_i915_query_topology_info 2895 2776 * 2896 - * data: contains the 3 pieces of information : 2897 - * 2898 - * - the slice mask with one bit per slice telling whether a slice is 2899 - * available. The availability of slice X can be queried with the following 2900 - * formula : 2901 - * 2902 - * (data[X / 8] >> (X % 8)) & 1 2903 - * 2904 - * - the subslice mask for each slice with one bit per subslice telling 2905 - * whether a subslice is available. Gen12 has dual-subslices, which are 2906 - * similar to two gen11 subslices. For gen12, this array represents dual- 2907 - * subslices. The availability of subslice Y in slice X can be queried 2908 - * with the following formula : 2909 - * 2910 - * (data[subslice_offset + 2911 - * X * subslice_stride + 2912 - * Y / 8] >> (Y % 8)) & 1 2913 - * 2914 - * - the EU mask for each subslice in each slice with one bit per EU telling 2915 - * whether an EU is available. The availability of EU Z in subslice Y in 2916 - * slice X can be queried with the following formula : 2917 - * 2918 - * (data[eu_offset + 2919 - * (X * max_subslices + Y) * eu_stride + 2920 - * Z / 8] >> (Z % 8)) & 1 2777 + * Describes slice/subslice/EU information queried by 2778 + * %DRM_I915_QUERY_TOPOLOGY_INFO 2921 2779 */ 2922 2780 struct drm_i915_query_topology_info { 2923 - /* 2781 + /** 2782 + * @flags: 2783 + * 2924 2784 * Unused for now. Must be cleared to zero. 2925 2785 */ 2926 2786 __u16 flags; 2927 2787 2788 + /** 2789 + * @max_slices: 2790 + * 2791 + * The number of bits used to express the slice mask. 2792 + */ 2928 2793 __u16 max_slices; 2794 + 2795 + /** 2796 + * @max_subslices: 2797 + * 2798 + * The number of bits used to express the subslice mask. 2799 + */ 2929 2800 __u16 max_subslices; 2801 + 2802 + /** 2803 + * @max_eus_per_subslice: 2804 + * 2805 + * The number of bits in the EU mask that correspond to a single 2806 + * subslice's EUs. 2807 + */ 2930 2808 __u16 max_eus_per_subslice; 2931 2809 2932 - /* 2810 + /** 2811 + * @subslice_offset: 2812 + * 2933 2813 * Offset in data[] at which the subslice masks are stored. 2934 2814 */ 2935 2815 __u16 subslice_offset; 2936 2816 2937 - /* 2817 + /** 2818 + * @subslice_stride: 2819 + * 2938 2820 * Stride at which each of the subslice masks for each slice are 2939 2821 * stored. 2940 2822 */ 2941 2823 __u16 subslice_stride; 2942 2824 2943 - /* 2825 + /** 2826 + * @eu_offset: 2827 + * 2944 2828 * Offset in data[] at which the EU masks are stored. 2945 2829 */ 2946 2830 __u16 eu_offset; 2947 2831 2948 - /* 2832 + /** 2833 + * @eu_stride: 2834 + * 2949 2835 * Stride at which each of the EU masks for each subslice are stored. 2950 2836 */ 2951 2837 __u16 eu_stride; 2952 2838 2839 + /** 2840 + * @data: 2841 + * 2842 + * Contains 3 pieces of information : 2843 + * 2844 + * - The slice mask with one bit per slice telling whether a slice is 2845 + * available. The availability of slice X can be queried with the 2846 + * following formula : 2847 + * 2848 + * .. code:: c 2849 + * 2850 + * (data[X / 8] >> (X % 8)) & 1 2851 + * 2852 + * Starting with Xe_HP platforms, Intel hardware no longer has 2853 + * traditional slices so i915 will always report a single slice 2854 + * (hardcoded slicemask = 0x1) which contains all of the platform's 2855 + * subslices. I.e., the mask here does not reflect any of the newer 2856 + * hardware concepts such as "gslices" or "cslices" since userspace 2857 + * is capable of inferring those from the subslice mask. 2858 + * 2859 + * - The subslice mask for each slice with one bit per subslice telling 2860 + * whether a subslice is available. Starting with Gen12 we use the 2861 + * term "subslice" to refer to what the hardware documentation 2862 + * describes as a "dual-subslices." The availability of subslice Y 2863 + * in slice X can be queried with the following formula : 2864 + * 2865 + * .. code:: c 2866 + * 2867 + * (data[subslice_offset + X * subslice_stride + Y / 8] >> (Y % 8)) & 1 2868 + * 2869 + * - The EU mask for each subslice in each slice, with one bit per EU 2870 + * telling whether an EU is available. The availability of EU Z in 2871 + * subslice Y in slice X can be queried with the following formula : 2872 + * 2873 + * .. code:: c 2874 + * 2875 + * (data[eu_offset + 2876 + * (X * max_subslices + Y) * eu_stride + 2877 + * Z / 8 2878 + * ] >> (Z % 8)) & 1 2879 + */ 2953 2880 __u8 data[]; 2954 2881 }; 2955 2882 ··· 3116 2951 struct drm_i915_engine_info engines[]; 3117 2952 }; 3118 2953 3119 - /* 3120 - * Data written by the kernel with query DRM_I915_QUERY_PERF_CONFIG. 2954 + /** 2955 + * struct drm_i915_query_perf_config 2956 + * 2957 + * Data written by the kernel with query %DRM_I915_QUERY_PERF_CONFIG and 2958 + * %DRM_I915_QUERY_GEOMETRY_SUBSLICES. 3121 2959 */ 3122 2960 struct drm_i915_query_perf_config { 3123 2961 union { 3124 - /* 3125 - * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets 3126 - * this fields to the number of configurations available. 2962 + /** 2963 + * @n_configs: 2964 + * 2965 + * When &drm_i915_query_item.flags == 2966 + * %DRM_I915_QUERY_PERF_CONFIG_LIST, i915 sets this fields to 2967 + * the number of configurations available. 3127 2968 */ 3128 2969 __u64 n_configs; 3129 2970 3130 - /* 3131 - * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID, 3132 - * i915 will use the value in this field as configuration 3133 - * identifier to decide what data to write into config_ptr. 2971 + /** 2972 + * @config: 2973 + * 2974 + * When &drm_i915_query_item.flags == 2975 + * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID, i915 will use the 2976 + * value in this field as configuration identifier to decide 2977 + * what data to write into config_ptr. 3134 2978 */ 3135 2979 __u64 config; 3136 2980 3137 - /* 3138 - * When query_id == DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID, 3139 - * i915 will use the value in this field as configuration 3140 - * identifier to decide what data to write into config_ptr. 2981 + /** 2982 + * @uuid: 2983 + * 2984 + * When &drm_i915_query_item.flags == 2985 + * %DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID, i915 will use the 2986 + * value in this field as configuration identifier to decide 2987 + * what data to write into config_ptr. 3141 2988 * 3142 2989 * String formatted like "%08x-%04x-%04x-%04x-%012x" 3143 2990 */ 3144 2991 char uuid[36]; 3145 2992 }; 3146 2993 3147 - /* 2994 + /** 2995 + * @flags: 2996 + * 3148 2997 * Unused for now. Must be cleared to zero. 3149 2998 */ 3150 2999 __u32 flags; 3151 3000 3152 - /* 3153 - * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_LIST, i915 will 3154 - * write an array of __u64 of configuration identifiers. 3001 + /** 3002 + * @data: 3155 3003 * 3156 - * When query_item.flags == DRM_I915_QUERY_PERF_CONFIG_DATA, i915 will 3157 - * write a struct drm_i915_perf_oa_config. If the following fields of 3158 - * drm_i915_perf_oa_config are set not set to 0, i915 will write into 3159 - * the associated pointers the values of submitted when the 3004 + * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_LIST, 3005 + * i915 will write an array of __u64 of configuration identifiers. 3006 + * 3007 + * When &drm_i915_query_item.flags == %DRM_I915_QUERY_PERF_CONFIG_DATA, 3008 + * i915 will write a struct drm_i915_perf_oa_config. If the following 3009 + * fields of struct drm_i915_perf_oa_config are not set to 0, i915 will 3010 + * write into the associated pointers the values of submitted when the 3160 3011 * configuration was created : 3161 3012 * 3162 - * - n_mux_regs 3163 - * - n_boolean_regs 3164 - * - n_flex_regs 3013 + * - &drm_i915_perf_oa_config.n_mux_regs 3014 + * - &drm_i915_perf_oa_config.n_boolean_regs 3015 + * - &drm_i915_perf_oa_config.n_flex_regs 3165 3016 */ 3166 3017 __u8 data[]; 3167 3018 }; ··· 3314 3133 /** @regions: Info about each supported region */ 3315 3134 struct drm_i915_memory_region_info regions[]; 3316 3135 }; 3136 + 3137 + /** 3138 + * DOC: GuC HWCONFIG blob uAPI 3139 + * 3140 + * The GuC produces a blob with information about the current device. 3141 + * i915 reads this blob from GuC and makes it available via this uAPI. 3142 + * 3143 + * The format and meaning of the blob content are documented in the 3144 + * Programmer's Reference Manual. 3145 + */ 3317 3146 3318 3147 /** 3319 3148 * struct drm_i915_gem_create_ext - Existing gem_create behaviour, with added
+20 -6
tools/include/uapi/linux/vhost.h
··· 89 89 90 90 /* Set or get vhost backend capability */ 91 91 92 - /* Use message type V2 */ 93 - #define VHOST_BACKEND_F_IOTLB_MSG_V2 0x1 94 - /* IOTLB can accept batching hints */ 95 - #define VHOST_BACKEND_F_IOTLB_BATCH 0x2 96 - 97 92 #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64) 98 93 #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64) 99 94 ··· 145 150 /* Get the valid iova range */ 146 151 #define VHOST_VDPA_GET_IOVA_RANGE _IOR(VHOST_VIRTIO, 0x78, \ 147 152 struct vhost_vdpa_iova_range) 148 - 149 153 /* Get the config size */ 150 154 #define VHOST_VDPA_GET_CONFIG_SIZE _IOR(VHOST_VIRTIO, 0x79, __u32) 151 155 152 156 /* Get the count of all virtqueues */ 153 157 #define VHOST_VDPA_GET_VQS_COUNT _IOR(VHOST_VIRTIO, 0x80, __u32) 158 + 159 + /* Get the number of virtqueue groups. */ 160 + #define VHOST_VDPA_GET_GROUP_NUM _IOR(VHOST_VIRTIO, 0x81, __u32) 161 + 162 + /* Get the number of address spaces. */ 163 + #define VHOST_VDPA_GET_AS_NUM _IOR(VHOST_VIRTIO, 0x7A, unsigned int) 164 + 165 + /* Get the group for a virtqueue: read index, write group in num, 166 + * The virtqueue index is stored in the index field of 167 + * vhost_vring_state. The group for this specific virtqueue is 168 + * returned via num field of vhost_vring_state. 169 + */ 170 + #define VHOST_VDPA_GET_VRING_GROUP _IOWR(VHOST_VIRTIO, 0x7B, \ 171 + struct vhost_vring_state) 172 + /* Set the ASID for a virtqueue group. The group index is stored in 173 + * the index field of vhost_vring_state, the ASID associated with this 174 + * group is stored at num field of vhost_vring_state. 175 + */ 176 + #define VHOST_VDPA_SET_GROUP_ASID _IOW(VHOST_VIRTIO, 0x7C, \ 177 + struct vhost_vring_state) 154 178 155 179 #endif
+4 -2
tools/perf/builtin-inject.c
··· 891 891 if (ret < 0) 892 892 return ret; 893 893 pr_debug("%s\n", cmd); 894 - return system(cmd); 894 + ret = system(cmd); 895 + free(cmd); 896 + return ret; 895 897 } 896 898 897 899 static int output_fd(struct perf_inject *inject) ··· 918 916 inject->tool.tracing_data = perf_event__repipe_tracing_data; 919 917 } 920 918 921 - output_data_offset = session->header.data_offset; 919 + output_data_offset = perf_session__data_offset(session->evlist); 922 920 923 921 if (inject->build_id_all) { 924 922 inject->tool.mmap = perf_event__repipe_buildid_mmap;
+2
tools/perf/builtin-stat.c
··· 2586 2586 if (evlist__initialize_ctlfd(evsel_list, stat_config.ctl_fd, stat_config.ctl_fd_ack)) 2587 2587 goto out; 2588 2588 2589 + /* Enable ignoring missing threads when -p option is defined. */ 2590 + evlist__first(evsel_list)->ignore_missing_thread = target.pid; 2589 2591 status = 0; 2590 2592 for (run_idx = 0; forever || run_idx < stat_config.run_count; run_idx++) { 2591 2593 if (stat_config.run_count != 1 && verbose > 0)
+2 -12
tools/perf/trace/beauty/arch_errno_names.sh
··· 33 33 local arch=$(arch_string "$1") 34 34 local nr name 35 35 36 - cat <<EoFuncBegin 37 - static const char *errno_to_name__$arch(int err) 38 - { 39 - switch (err) { 40 - EoFuncBegin 36 + printf "static const char *errno_to_name__%s(int err)\n{\n\tswitch (err) {\n" $arch 41 37 42 38 while read name nr; do 43 39 printf '\tcase %d: return "%s";\n' $nr $name 44 40 done 45 41 46 - cat <<EoFuncEnd 47 - default: 48 - return "(unknown)"; 49 - } 50 - } 51 - 52 - EoFuncEnd 42 + printf '\tdefault: return "(unknown)";\n\t}\n}\n' 53 43 } 54 44 55 45 process_arch()
+28
tools/perf/util/build-id.c
··· 872 872 return err; 873 873 } 874 874 875 + static int filename__read_build_id_ns(const char *filename, 876 + struct build_id *bid, 877 + struct nsinfo *nsi) 878 + { 879 + struct nscookie nsc; 880 + int ret; 881 + 882 + nsinfo__mountns_enter(nsi, &nsc); 883 + ret = filename__read_build_id(filename, bid); 884 + nsinfo__mountns_exit(&nsc); 885 + 886 + return ret; 887 + } 888 + 889 + static bool dso__build_id_mismatch(struct dso *dso, const char *name) 890 + { 891 + struct build_id bid; 892 + 893 + if (filename__read_build_id_ns(name, &bid, dso->nsinfo) < 0) 894 + return false; 895 + 896 + return !dso__build_id_equal(dso, &bid); 897 + } 898 + 875 899 static int dso__cache_build_id(struct dso *dso, struct machine *machine, 876 900 void *priv __maybe_unused) 877 901 { ··· 910 886 is_kallsyms = true; 911 887 name = machine->mmap_name; 912 888 } 889 + 890 + if (!is_kallsyms && dso__build_id_mismatch(dso, name)) 891 + return 0; 892 + 913 893 return build_id_cache__add_b(&dso->bid, name, dso->nsinfo, 914 894 is_kallsyms, is_vdso); 915 895 }
+14
tools/perf/util/header.c
··· 3686 3686 return perf_session__do_write_header(session, evlist, fd, at_exit, NULL); 3687 3687 } 3688 3688 3689 + size_t perf_session__data_offset(const struct evlist *evlist) 3690 + { 3691 + struct evsel *evsel; 3692 + size_t data_offset; 3693 + 3694 + data_offset = sizeof(struct perf_file_header); 3695 + evlist__for_each_entry(evlist, evsel) { 3696 + data_offset += evsel->core.ids * sizeof(u64); 3697 + } 3698 + data_offset += evlist->core.nr_entries * sizeof(struct perf_file_attr); 3699 + 3700 + return data_offset; 3701 + } 3702 + 3689 3703 int perf_session__inject_header(struct perf_session *session, 3690 3704 struct evlist *evlist, 3691 3705 int fd,
+2
tools/perf/util/header.h
··· 136 136 int fd, 137 137 struct feat_copier *fc); 138 138 139 + size_t perf_session__data_offset(const struct evlist *evlist); 140 + 139 141 void perf_header__set_feat(struct perf_header *header, int feat); 140 142 void perf_header__clear_feat(struct perf_header *header, int feat); 141 143 bool perf_header__has_feat(const struct perf_header *header, int feat);