Skip to content

Commit fad8afd

Browse files
committed
tools headers: Update tools's copy of arm64/asm headers
tldr; Just FYI, I'm carrying this on the perf tools tree. Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Cc: [email protected] Signed-off-by: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c23708f commit fad8afd

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

tools/arch/arm64/include/asm/cputype.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,15 @@
7979
#define ARM_CPU_PART_CORTEX_A78AE 0xD42
8080
#define ARM_CPU_PART_CORTEX_X1 0xD44
8181
#define ARM_CPU_PART_CORTEX_A510 0xD46
82+
#define ARM_CPU_PART_CORTEX_A520 0xD80
8283
#define ARM_CPU_PART_CORTEX_A710 0xD47
8384
#define ARM_CPU_PART_CORTEX_A715 0xD4D
8485
#define ARM_CPU_PART_CORTEX_X2 0xD48
8586
#define ARM_CPU_PART_NEOVERSE_N2 0xD49
8687
#define ARM_CPU_PART_CORTEX_A78C 0xD4B
8788

88-
#define APM_CPU_PART_POTENZA 0x000
89+
#define APM_CPU_PART_XGENE 0x000
90+
#define APM_CPU_VAR_POTENZA 0x00
8991

9092
#define CAVIUM_CPU_PART_THUNDERX 0x0A1
9193
#define CAVIUM_CPU_PART_THUNDERX_81XX 0x0A2
@@ -148,6 +150,7 @@
148150
#define MIDR_CORTEX_A78AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A78AE)
149151
#define MIDR_CORTEX_X1 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X1)
150152
#define MIDR_CORTEX_A510 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A510)
153+
#define MIDR_CORTEX_A520 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A520)
151154
#define MIDR_CORTEX_A710 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A710)
152155
#define MIDR_CORTEX_A715 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A715)
153156
#define MIDR_CORTEX_X2 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X2)

tools/arch/arm64/include/uapi/asm/kvm.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,38 @@ struct kvm_smccc_filter {
505505
#define KVM_HYPERCALL_EXIT_SMC (1U << 0)
506506
#define KVM_HYPERCALL_EXIT_16BIT (1U << 1)
507507

508+
/*
509+
* Get feature ID registers userspace writable mask.
510+
*
511+
* From DDI0487J.a, D19.2.66 ("ID_AA64MMFR2_EL1, AArch64 Memory Model
512+
* Feature Register 2"):
513+
*
514+
* "The Feature ID space is defined as the System register space in
515+
* AArch64 with op0==3, op1=={0, 1, 3}, CRn==0, CRm=={0-7},
516+
* op2=={0-7}."
517+
*
518+
* This covers all currently known R/O registers that indicate
519+
* anything useful feature wise, including the ID registers.
520+
*
521+
* If we ever need to introduce a new range, it will be described as
522+
* such in the range field.
523+
*/
524+
#define KVM_ARM_FEATURE_ID_RANGE_IDX(op0, op1, crn, crm, op2) \
525+
({ \
526+
__u64 __op1 = (op1) & 3; \
527+
__op1 -= (__op1 == 3); \
528+
(__op1 << 6 | ((crm) & 7) << 3 | (op2)); \
529+
})
530+
531+
#define KVM_ARM_FEATURE_ID_RANGE 0
532+
#define KVM_ARM_FEATURE_ID_RANGE_SIZE (3 * 8 * 8)
533+
534+
struct reg_mask_range {
535+
__u64 addr; /* Pointer to mask array */
536+
__u32 range; /* Requested range */
537+
__u32 reserved[13];
538+
};
539+
508540
#endif
509541

510542
#endif /* __ARM_KVM_H__ */

tools/arch/arm64/include/uapi/asm/perf_regs.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ enum perf_event_arm_regs {
3636
PERF_REG_ARM64_LR,
3737
PERF_REG_ARM64_SP,
3838
PERF_REG_ARM64_PC,
39+
PERF_REG_ARM64_MAX,
3940

4041
/* Extended/pseudo registers */
41-
PERF_REG_ARM64_VG = 46, // SVE Vector Granule
42-
43-
PERF_REG_ARM64_MAX = PERF_REG_ARM64_PC + 1,
44-
PERF_REG_ARM64_EXTENDED_MAX = PERF_REG_ARM64_VG + 1
42+
PERF_REG_ARM64_VG = 46, /* SVE Vector Granule */
43+
PERF_REG_ARM64_EXTENDED_MAX
4544
};
45+
46+
#define PERF_REG_EXTENDED_MASK (1ULL << PERF_REG_ARM64_VG)
47+
4648
#endif /* _ASM_ARM64_PERF_REGS_H */

0 commit comments

Comments
 (0)