Pull perf fixes from Borislav Petkov: - Add Sapphire Rapids CPU support - Fix a perf vmalloc-ed buffer mapping error (PERF_USE_VMALLOC in use) * tag 'perf_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/cstate: Add SAPPHIRERAPIDS_X CPU support perf/core: Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled
Unified · Split
| @@ -51,7 +51,7 @@ · 50 unmodified lines | ||
| 51 | 51 | * perf code: 0x02 |
| 52 | 52 | * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, |
| 53 | 53 | * SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX, |
| 54 | − * TGL,TNT,RKL,ADL,RPL | |
| 54 | + * TGL,TNT,RKL,ADL,RPL,SPR | |
| 55 | 55 | * Scope: Core |
| 56 | 56 | * MSR_CORE_C7_RESIDENCY: CORE C7 Residency Counter |
| 57 | 57 | * perf code: 0x03 |
| @@ -62,7 +62,7 @@ · 4 unmodified lines | ||
| 62 | 62 | * perf code: 0x00 |
| 63 | 63 | * Available model: SNB,IVB,HSW,BDW,SKL,KNL,GLM,CNL, |
| 64 | 64 | * KBL,CML,ICL,ICX,TGL,TNT,RKL,ADL, |
| 65 | − * RPL | |
| 65 | + * RPL,SPR | |
| 66 | 66 | * Scope: Package (physical package) |
| 67 | 67 | * MSR_PKG_C3_RESIDENCY: Package C3 Residency Counter. |
| 68 | 68 | * perf code: 0x01 |
| @@ -74,7 +74,7 @@ · 5 unmodified lines | ||
| 74 | 74 | * perf code: 0x02 |
| 75 | 75 | * Available model: SLM,AMT,NHM,WSM,SNB,IVB,HSW,BDW, |
| 76 | 76 | * SKL,KNL,GLM,CNL,KBL,CML,ICL,ICX, |
| 77 | − * TGL,TNT,RKL,ADL,RPL | |
| 77 | + * TGL,TNT,RKL,ADL,RPL,SPR | |
| 78 | 78 | * Scope: Package (physical package) |
| 79 | 79 | * MSR_PKG_C7_RESIDENCY: Package C7 Residency Counter. |
| 80 | 80 | * perf code: 0x03 |
| @@ -675,6 +675,7 @@ static const struct x86_cpu_id intel_cstates_match[] __initconst = { · 594 unmodified lines | ||
| 675 | 675 | X86_MATCH_INTEL_FAM6_MODEL(ICELAKE, &icl_cstates), |
| 676 | 676 | X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &icx_cstates), |
| 677 | 677 | X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, &icx_cstates), |
| 678 | + X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &icx_cstates), | |
| 678 | 679 | |
| 679 | 680 | X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &icl_cstates), |
| 680 | 681 | X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &icl_cstates), |
| @@ -6247,7 +6247,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma) · 6246 unmodified lines | ||
| 6247 | 6247 | again: |
| 6248 | 6248 | mutex_lock(&event->mmap_mutex); |
| 6249 | 6249 | if (event->rb) { |
| 6250 | − if (event->rb->nr_pages != nr_pages) { | |
| 6250 | + if (data_page_nr(event->rb) != nr_pages) { | |
| 6251 | 6251 | ret = -EINVAL; |
| 6252 | 6252 | goto unlock; |
| 6253 | 6253 | } |
| @@ -116,6 +116,11 @@ static inline int page_order(struct perf_buffer *rb) · 115 unmodified lines | ||
| 116 | 116 | } |
| 117 | 117 | #endif |
| 118 | 118 | |
| 119 | +static inline int data_page_nr(struct perf_buffer *rb) | |
| 120 | +{ | |
| 121 | + return rb->nr_pages << page_order(rb); | |
| 122 | +} | |
| 123 | + | |
| 119 | 124 | static inline unsigned long perf_data_size(struct perf_buffer *rb) |
| 120 | 125 | { |
| 121 | 126 | return rb->nr_pages << (PAGE_SHIFT + page_order(rb)); |
| @@ -859,11 +859,6 @@ void rb_free(struct perf_buffer *rb) · 858 unmodified lines | ||
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | #else |
| 862 | −static int data_page_nr(struct perf_buffer *rb) | |
| 863 | −{ | |
| 864 | − return rb->nr_pages << page_order(rb); | |
| 865 | −} | |
| 866 | − | |
| 867 | 862 | static struct page * |
| 868 | 863 | __perf_mmap_to_page(struct perf_buffer *rb, unsigned long pgoff) |
| 869 | 864 | { |