Merge tag 'perf_urgent_for_v5.18_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
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
This commit is contained in:
@@ -6247,7 +6247,7 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
again:
|
||||
mutex_lock(&event->mmap_mutex);
|
||||
if (event->rb) {
|
||||
if (event->rb->nr_pages != nr_pages) {
|
||||
if (data_page_nr(event->rb) != nr_pages) {
|
||||
ret = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
@@ -116,6 +116,11 @@ static inline int page_order(struct perf_buffer *rb)
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline int data_page_nr(struct perf_buffer *rb)
|
||||
{
|
||||
return rb->nr_pages << page_order(rb);
|
||||
}
|
||||
|
||||
static inline unsigned long perf_data_size(struct perf_buffer *rb)
|
||||
{
|
||||
return rb->nr_pages << (PAGE_SHIFT + page_order(rb));
|
||||
|
||||
@@ -859,11 +859,6 @@ void rb_free(struct perf_buffer *rb)
|
||||
}
|
||||
|
||||
#else
|
||||
static int data_page_nr(struct perf_buffer *rb)
|
||||
{
|
||||
return rb->nr_pages << page_order(rb);
|
||||
}
|
||||
|
||||
static struct page *
|
||||
__perf_mmap_to_page(struct perf_buffer *rb, unsigned long pgoff)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user