diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml
index fbb064dbdcb5..2cd5baedb02c 100644
--- a/android/abi_gki_aarch64.xml
+++ b/android/abi_gki_aarch64.xml
@@ -550,6 +550,13 @@
+
+
+
+
+
+
+
@@ -4434,6 +4441,7 @@
+
@@ -6856,7 +6864,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -23638,7 +23656,7 @@
-
+
@@ -25922,7 +25940,7 @@
-
+
@@ -25942,7 +25960,7 @@
-
+
@@ -27799,12 +27817,12 @@
-
+
-
+
-
+
@@ -28682,7 +28700,7 @@
-
+
@@ -30163,7 +30181,7 @@
-
+
@@ -32099,7 +32117,7 @@
-
+
@@ -32562,7 +32580,7 @@
-
+
@@ -36692,6 +36710,7 @@
+
@@ -59164,7 +59183,7 @@
-
+
@@ -78784,69 +78803,69 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -78866,9 +78885,9 @@
-
+
-
+
@@ -78879,50 +78898,50 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -79222,11 +79241,11 @@
-
+
-
+
@@ -79234,14 +79253,14 @@
-
+
-
+
-
+
@@ -89734,102 +89753,102 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -89847,264 +89866,264 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+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
+
@@ -103670,7 +103689,7 @@
-
+
@@ -103681,7 +103700,7 @@
-
+
@@ -104411,11 +104430,292 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -106148,12 +106448,12 @@
-
+
-
+
-
+
@@ -112904,8 +113204,8 @@
-
-
+
+
@@ -113009,9 +113309,9 @@
-
-
-
+
+
+
@@ -118474,8 +118774,8 @@
-
-
+
+
@@ -121677,22 +121977,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -121766,6 +122050,14 @@
+
+
+
+
+
+
+
+
@@ -121774,6 +122066,14 @@
+
+
+
+
+
+
+
+
@@ -122079,7 +122379,7 @@
-
+
@@ -122135,7 +122435,7 @@
-
+
@@ -129406,6 +129706,10 @@
+
+
+
+
@@ -130459,9 +130763,9 @@
-
-
-
+
+
+
@@ -142076,7 +142380,7 @@
-
+
@@ -144863,7 +145167,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -159540,10 +159854,10 @@
-
-
-
-
+
+
+
+
@@ -159568,14 +159882,14 @@
-
-
+
+
-
-
-
-
+
+
+
+
@@ -159804,9 +160118,9 @@
-
-
-
+
+
+
@@ -166288,7 +166602,7 @@
-
+
@@ -166296,7 +166610,7 @@
-
+
@@ -166318,7 +166632,7 @@
-
+
@@ -166338,7 +166652,7 @@
-
+
@@ -167949,10 +168263,10 @@
-
-
-
-
+
+
+
+
@@ -174771,7 +175085,7 @@
-
+
@@ -179569,7 +179883,7 @@
-
+
@@ -179598,7 +179912,7 @@
-
+
@@ -180190,7 +180504,7 @@
-
+
@@ -181150,7 +181464,7 @@
-
+
diff --git a/android/abi_gki_aarch64_trimble b/android/abi_gki_aarch64_trimble
index ea31389df078..be102c6c79c1 100644
--- a/android/abi_gki_aarch64_trimble
+++ b/android/abi_gki_aarch64_trimble
@@ -1,6 +1,15 @@
[abi_symbol_list]
# required by cdc_mbim.ko
in6_dev_finish_destroy
+ cdc_ncm_select_altsetting
+ cdc_ncm_bind_common
+ cdc_ncm_unbind
+ cdc_ncm_change_mtu
+ cdc_ncm_rx_verify_nth16
+ cdc_ncm_rx_verify_ndp16
+ cdc_ncm_fill_tx_frame
# required by qmi_wwan.ko
netdev_stats_to_stats64
netdev_upper_get_next_dev_rcu
+# required by qcserial
+ usb_disable_autosuspend
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 1afd67def3c1..fa54b36c8aeb 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -367,7 +367,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
}
start = vma->vm_start;
- end = vma->vm_end;
+ end = VMA_PAD_START(vma);
show_vma_header_prefix(m, start, end, flags, pgoff, dev, ino);
/*
@@ -420,13 +420,12 @@ done:
static int show_map(struct seq_file *m, void *v)
{
- struct vm_area_struct *pad_vma = get_pad_vma(v);
- struct vm_area_struct *vma = get_data_vma(v);
+ struct vm_area_struct *vma = v;
if (vma_pages(vma))
show_map_vma(m, vma);
- show_map_pad_vma(vma, pad_vma, m, show_map_vma, false);
+ show_map_pad_vma(vma, m, show_map_vma, false);
m_cache_vma(m, v);
return 0;
@@ -813,6 +812,8 @@ static const struct mm_walk_ops smaps_shmem_walk_ops = {
static void smap_gather_stats(struct vm_area_struct *vma,
struct mem_size_stats *mss)
{
+ unsigned long end = VMA_PAD_START(vma);
+
#ifdef CONFIG_SHMEM
/* In case of smaps_rollup, reset the value from previous vma */
mss->check_shmem_swap = false;
@@ -829,18 +830,27 @@ static void smap_gather_stats(struct vm_area_struct *vma,
*/
unsigned long shmem_swapped = shmem_swap_usage(vma);
- if (!shmem_swapped || (vma->vm_flags & VM_SHARED) ||
- !(vma->vm_flags & VM_WRITE)) {
+ if ((!shmem_swapped || (vma->vm_flags & VM_SHARED) ||
+ !(vma->vm_flags & VM_WRITE)) &&
+ /*
+ * Only if we don't have padding can we use the fast path
+ * shmem_inode_info->swapped for shmem_swapped.
+ *
+ * Else we'll walk the page table to calculate
+ * shmem_swapped, (excluding the padding region).
+ */
+ end == vma->vm_end) {
mss->swap += shmem_swapped;
} else {
mss->check_shmem_swap = true;
- walk_page_vma(vma, &smaps_shmem_walk_ops, mss);
+ walk_page_range(vma->vm_mm, vma->vm_start, end,
+ &smaps_shmem_walk_ops, mss);
return;
}
}
#endif
/* mmap_sem is held in m_start */
- walk_page_vma(vma, &smaps_walk_ops, mss);
+ walk_page_range(vma->vm_mm, vma->vm_start, end, &smaps_walk_ops, mss);
}
#define SEQ_PUT_DEC(str, val) \
@@ -901,7 +911,7 @@ static void show_smap_vma(struct seq_file *m, void *v)
seq_putc(m, '\n');
}
- SEQ_PUT_DEC("Size: ", vma->vm_end - vma->vm_start);
+ SEQ_PUT_DEC("Size: ", VMA_PAD_START(vma) - vma->vm_start);
SEQ_PUT_DEC(" kB\nKernelPageSize: ", vma_kernel_pagesize(vma));
SEQ_PUT_DEC(" kB\nMMUPageSize: ", vma_mmu_pagesize(vma));
seq_puts(m, " kB\n");
@@ -918,13 +928,12 @@ static void show_smap_vma(struct seq_file *m, void *v)
static int show_smap(struct seq_file *m, void *v)
{
- struct vm_area_struct *pad_vma = get_pad_vma(v);
- struct vm_area_struct *vma = get_data_vma(v);
+ struct vm_area_struct *vma = v;
if (vma_pages(vma))
show_smap_vma(m, vma);
- show_map_pad_vma(vma, pad_vma, m, show_smap_vma, true);
+ show_map_pad_vma(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 48672dbc84e9..359c1807ff1d 100644
--- a/include/linux/pgsize_migration.h
+++ b/include/linux/pgsize_migration.h
@@ -26,12 +26,7 @@ extern unsigned long vma_pad_pages(struct vm_area_struct *vma);
extern void madvise_vma_pad_pages(struct vm_area_struct *vma,
unsigned long start, unsigned long end);
-extern struct vm_area_struct *get_pad_vma(struct vm_area_struct *vma);
-
-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, void *func, bool smaps);
extern void split_pad_vma(struct vm_area_struct *vma, struct vm_area_struct *new,
@@ -57,18 +52,7 @@ static inline void madvise_vma_pad_pages(struct vm_area_struct *vma,
{
}
-static inline struct vm_area_struct *get_pad_vma(struct vm_area_struct *vma)
-{
- return NULL;
-}
-
-static inline struct vm_area_struct *get_data_vma(struct vm_area_struct *vma)
-{
- return vma;
-}
-
static inline void show_map_pad_vma(struct vm_area_struct *vma,
- struct vm_area_struct *pad,
struct seq_file *m, void *func, bool smaps)
{
}
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 013b9062c47c..da2f54b02d81 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -9685,8 +9685,14 @@ skip_full_check:
env->verification_time = ktime_get_ns() - start_time;
print_verification_stats(env);
- if (log->level && bpf_verifier_log_full(log))
- ret = -ENOSPC;
+ // ANDROID: Do not fail to load if log buffer passed in from userspace
+ // is too small. The bpf log logic is refactored in the 6.4 kernel
+ // acknowledging the shortcomings of this approch. Instead of backporting
+ // the significant changes, simply ignore the fact that the log is full.
+ // For more information see commit 121664093803: bpf: Switch BPF verifier
+ // log to be a rotating log by default
+ //if (log->level && bpf_verifier_log_full(log))
+ // ret = -ENOSPC;
if (log->level && !log->ubuf) {
ret = -EFAULT;
goto err_release_maps;
diff --git a/mm/pgsize_migration.c b/mm/pgsize_migration.c
index ad9e638ab3b6..15b053184b21 100644
--- a/mm/pgsize_migration.c
+++ b/mm/pgsize_migration.c
@@ -258,19 +258,11 @@ static const struct vm_operations_struct pad_vma_ops = {
};
/*
- * Returns a new VMA representing the padding in @vma, if no padding
- * in @vma returns NULL.
+ * Initialize @pad VMA fields with information from the original @vma.
*/
-struct vm_area_struct *get_pad_vma(struct vm_area_struct *vma)
+static void init_pad_vma(struct vm_area_struct *vma, struct vm_area_struct *pad)
{
- struct vm_area_struct *pad;
-
- if (!is_pgsize_migration_enabled() || !(vma->vm_flags & VM_PAD_MASK))
- return NULL;
-
- pad = kzalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
-
- *pad = *vma;
+ memcpy(pad, vma, sizeof(struct vm_area_struct));
/* Remove file */
pad->vm_file = NULL;
@@ -286,60 +278,34 @@ struct vm_area_struct *get_pad_vma(struct vm_area_struct *vma)
/* Remove padding bits */
pad->vm_flags &= ~VM_PAD_MASK;
-
- return pad;
}
/*
- * Returns a new VMA exclusing the padding from @vma; if no padding in
- * @vma returns @vma.
+ * Calls the show_pad_vma_fn on the @pad VMA.
*/
-struct vm_area_struct *get_data_vma(struct vm_area_struct *vma)
+void show_map_pad_vma(struct vm_area_struct *vma, struct seq_file *m,
+ void *func, bool smaps)
{
- struct vm_area_struct *data;
+ struct vm_area_struct pad;
if (!is_pgsize_migration_enabled() || !(vma->vm_flags & VM_PAD_MASK))
- return vma;
-
- data = kzalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
-
- *data = *vma;
-
- /* Adjust the end to the start of the padding section */
- data->vm_end = VMA_PAD_START(data);
-
- return data;
-}
-
-/*
- * Calls the show_pad_vma_fn on the @pad VMA, and frees the copies of @vma
- * and @pad.
- */
-void show_map_pad_vma(struct vm_area_struct *vma, struct vm_area_struct *pad,
- struct seq_file *m, void *func, bool smaps)
-{
- if (!pad)
return;
- /*
- * This cannot happen. If @pad vma was allocated the corresponding
- * @vma should have the VM_PAD_MASK bit(s) set.
- */
- BUG_ON(!(vma->vm_flags & VM_PAD_MASK));
+ init_pad_vma(vma, &pad);
- /*
- * This cannot happen. @pad is a section of the original VMA.
- * Therefore @vma cannot be null if @pad is not null.
- */
- BUG_ON(!vma);
+ /* The pad VMA should be anonymous. */
+ BUG_ON(pad.vm_file);
+
+ /* The pad VMA should be PROT_NONE. */
+ BUG_ON(pad.vm_flags & (VM_READ|VM_WRITE|VM_EXEC));
+
+ /* The pad VMA itself cannot have padding; infinite recursion */
+ BUG_ON(pad.vm_flags & VM_PAD_MASK);
if (smaps)
- ((show_pad_smaps_fn)func)(m, pad);
+ ((show_pad_smaps_fn)func)(m, &pad);
else
- ((show_pad_maps_fn)func)(m, pad);
-
- kfree(pad);
- kfree(vma);
+ ((show_pad_maps_fn)func)(m, &pad);
}
/*