mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-06 03:45:24 -04:00
Merge android11-5.4 into android11-5.4-lts
This merges the android11-5.4 branch into the -lts branch, catching it up with the latest changes in there. It contains the following commits: *4d9a721965Merge tag 'android11-5.4.296_r00' into android11-5.4 *e4601d0bb2ANDROID: 16K: Allocate pad vma on the stack *2f1e2df209ANDROID: 16K: Don't copy data vma for maps/smaps output *7802e7ac16ANDROID: GKI: update Trimble symbol list *1e81917710UPSTREAM: net/sched: Always pass notifications when child class becomes empty *387dbb9a99ANDROID: bpf: do not fail to load if log is full Change-Id: Ic8af8e819cb2543470bf2f1f239c32d92d74a60c Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
b2efed2e1d
6 changed files with 1226 additions and 938 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue