Merge tag 'perf-tools-fixes-for-v5.17-2022-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools fixes from Arnaldo Carvalho de Melo:

- Fix event parser error for hybrid systems

- Fix NULL check against wrong variable in 'perf bench' and in the
parsing code

- Update arm64 KVM headers from the kernel sources

- Sync cpufeatures header with the kernel sources

* tag 'perf-tools-fixes-for-v5.17-2022-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
perf parse: Fix event parser error for hybrid systems
perf bench: Fix NULL check against wrong variable
perf parse-events: Fix NULL check against wrong variable
tools headers cpufeatures: Sync with the kernel sources
tools kvm headers arm64: Update KVM headers from the kernel sources

Changed files
+12 -5
tools
arch
arm64
include
uapi
asm
x86
include
perf
+5
tools/arch/arm64/include/uapi/asm/kvm.h
··· 281 281 #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_REQUIRED 3 282 282 #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_ENABLED (1U << 4) 283 283 284 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3 KVM_REG_ARM_FW_REG(3) 285 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_NOT_AVAIL 0 286 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_AVAIL 1 287 + #define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_3_NOT_REQUIRED 2 288 + 284 289 /* SVE registers */ 285 290 #define KVM_REG_ARM64_SVE (0x15 << KVM_REG_ARM_COPROC_SHIFT) 286 291
+1 -1
tools/arch/x86/include/asm/cpufeatures.h
··· 204 204 /* FREE! ( 7*32+10) */ 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 - #define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCEs for Spectre variant 2 */ 207 + #define X86_FEATURE_RETPOLINE_LFENCE ( 7*32+13) /* "" Use LFENCE for Spectre variant 2 */ 208 208 #define X86_FEATURE_INTEL_PPIN ( 7*32+14) /* Intel Processor Inventory Number */ 209 209 #define X86_FEATURE_CDP_L2 ( 7*32+15) /* Code and Data Prioritization L2 */ 210 210 #define X86_FEATURE_MSR_SPEC_CTRL ( 7*32+16) /* "" MSR SPEC_CTRL is implemented */
+1 -1
tools/perf/bench/epoll-ctl.c
··· 106 106 printinfo("Nesting level(s): %d\n", nested); 107 107 108 108 epollfdp = calloc(nested, sizeof(int)); 109 - if (!epollfd) 109 + if (!epollfdp) 110 110 err(EXIT_FAILURE, "calloc"); 111 111 112 112 for (i = 0; i < nested; i++) {
+5 -3
tools/perf/util/parse-events.c
··· 1648 1648 { 1649 1649 struct parse_events_term *term; 1650 1650 struct list_head *list = NULL; 1651 + struct list_head *orig_head = NULL; 1651 1652 struct perf_pmu *pmu = NULL; 1652 1653 int ok = 0; 1653 1654 char *config; ··· 1675 1674 } 1676 1675 list_add_tail(&term->list, head); 1677 1676 1678 - 1679 1677 /* Add it for all PMUs that support the alias */ 1680 1678 list = malloc(sizeof(struct list_head)); 1681 1679 if (!list) ··· 1687 1687 1688 1688 list_for_each_entry(alias, &pmu->aliases, list) { 1689 1689 if (!strcasecmp(alias->name, str)) { 1690 + parse_events_copy_term_list(head, &orig_head); 1690 1691 if (!parse_events_add_pmu(parse_state, list, 1691 - pmu->name, head, 1692 + pmu->name, orig_head, 1692 1693 true, true)) { 1693 1694 pr_debug("%s -> %s/%s/\n", str, 1694 1695 pmu->name, alias->str); 1695 1696 ok++; 1696 1697 } 1698 + parse_events_terms__delete(orig_head); 1697 1699 } 1698 1700 } 1699 1701 } ··· 2195 2193 for (i = 0; i < ARRAY_SIZE(symbols); i++, tmp++) { 2196 2194 tmp->type = symbols[i].type; 2197 2195 tmp->symbol = strdup(symbols[i].symbol); 2198 - if (!list->symbol) 2196 + if (!tmp->symbol) 2199 2197 goto err_free; 2200 2198 } 2201 2199