summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalesh Singh <kaleshsingh@google.com>2024-05-03 16:47:37 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2024-05-03 16:47:37 +0000
commit55b8d11bd442f98239f6afda4b66245195be124b (patch)
tree9e014b59952be173344769a50c8216879530bd43
parent375499f43178d1173d1166c66d50415edef58ef6 (diff)
parentf952d4f3c8ef60c93566792929fc1f598af30a8a (diff)
downloadcommon-android11-kiwi-5.4.tar.gz
ANDROID: 16K: Fix show maps CFI failure am: f952d4f3c8android11-kiwi-5.4
Original change: https://android-review.googlesource.com/c/kernel/common/+/3071269 Change-Id: I7350df113f414fffdd9bde4eb1e751b1c2dd55d0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--fs/proc/task_mmu.c4
-rw-r--r--include/linux/pgsize_migration.h6
-rw-r--r--mm/pgsize_migration.c10
3 files changed, 12 insertions, 8 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 4843a0473487..1afd67def3c1 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -426,7 +426,7 @@ static int show_map(struct seq_file *m, void *v)
if (vma_pages(vma))
show_map_vma(m, vma);
- show_map_pad_vma(vma, pad_vma, m, show_map_vma);
+ show_map_pad_vma(vma, pad_vma, m, show_map_vma, false);
m_cache_vma(m, v);
return 0;
@@ -924,7 +924,7 @@ static int show_smap(struct seq_file *m, void *v)
if (vma_pages(vma))
show_smap_vma(m, vma);
- show_map_pad_vma(vma, pad_vma, m, (show_pad_vma_fn)show_smap_vma);
+ show_map_pad_vma(vma, pad_vma, m, show_smap_vma, true);
m_cache_vma(m, v);
return 0;
diff --git a/include/linux/pgsize_migration.h b/include/linux/pgsize_migration.h
index 5c47ec28ea7d..fbfb1b9b9196 100644
--- a/include/linux/pgsize_migration.h
+++ b/include/linux/pgsize_migration.h
@@ -43,8 +43,6 @@
#define VM_PAD_MASK (VM_TOTAL_PAD_PAGES << VM_PAD_SHIFT)
#define VMA_PAD_START(vma) (vma->vm_end - (vma_pad_pages(vma) << PAGE_SHIFT))
-typedef void (*show_pad_vma_fn)(struct seq_file *m, struct vm_area_struct *vma);
-
#if PAGE_SIZE == SZ_4K && defined(CONFIG_64BIT)
extern void vma_set_pad_pages(struct vm_area_struct *vma,
unsigned long nr_pages);
@@ -60,7 +58,7 @@ extern struct vm_area_struct *get_data_vma(struct vm_area_struct *vma);
extern void show_map_pad_vma(struct vm_area_struct *vma,
struct vm_area_struct *pad,
- struct seq_file *m, show_pad_vma_fn func);
+ struct seq_file *m, void *func, bool smaps);
extern void split_pad_vma(struct vm_area_struct *vma, struct vm_area_struct *new,
unsigned long addr, int new_below);
@@ -92,7 +90,7 @@ static inline struct vm_area_struct *get_data_vma(struct vm_area_struct *vma)
static inline void show_map_pad_vma(struct vm_area_struct *vma,
struct vm_area_struct *pad,
- struct seq_file *m, show_pad_vma_fn func)
+ struct seq_file *m, void *func, bool smaps)
{
}
diff --git a/mm/pgsize_migration.c b/mm/pgsize_migration.c
index 305036b3d45a..9efadd1412a3 100644
--- a/mm/pgsize_migration.c
+++ b/mm/pgsize_migration.c
@@ -21,6 +21,9 @@
#include <linux/slab.h>
#include <linux/sysfs.h>
+typedef void (*show_pad_maps_fn) (struct seq_file *m, struct vm_area_struct *vma);
+typedef void (*show_pad_smaps_fn) (struct seq_file *m, void *v);
+
#ifdef CONFIG_64BIT
#if PAGE_SIZE == SZ_4K
DEFINE_STATIC_KEY_TRUE(pgsize_migration_enabled);
@@ -304,7 +307,7 @@ struct vm_area_struct *get_data_vma(struct vm_area_struct *vma)
* and @pad.
*/
void show_map_pad_vma(struct vm_area_struct *vma, struct vm_area_struct *pad,
- struct seq_file *m, show_pad_vma_fn func)
+ struct seq_file *m, void *func, bool smaps)
{
if (!pad)
return;
@@ -321,7 +324,10 @@ void show_map_pad_vma(struct vm_area_struct *vma, struct vm_area_struct *pad,
*/
BUG_ON(!vma);
- func(m, pad);
+ if (smaps)
+ ((show_pad_smaps_fn)func)(m, pad);
+ else
+ ((show_pad_maps_fn)func)(m, pad);
kfree(pad);
kfree(vma);