Commit Graph

976765 Commits

Author SHA1 Message Date
Andrey Konovalov
ccc8708bde FROMGIT: kasan, arm64: tests supports for HW_TAGS async mode
This change adds KASAN-KUnit tests support for the async HW_TAGS mode.

In async mode, tag fault aren't being generated synchronously when a
bad access happens, but are instead explicitly checked for by the kernel.

As each KASAN-KUnit test expect a fault to happen before the test is over,
check for faults as a part of the test handler.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-10-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit e80a76aa1a
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I45a6bc351bce937797b1b08e9220a137225f9d55
2021-04-27 10:40:13 +02:00
Vincenzo Frascino
d5a19199c7 FROMGIT: arm64: mte: Report async tag faults before suspend
When MTE async mode is enabled TFSR_EL1 contains the accumulative
asynchronous tag check faults for EL1 and EL0.

During the suspend/resume operations the firmware might perform some
operations that could change the state of the register resulting in
a spurious tag check fault report.

Report asynchronous tag faults before suspend and clear the TFSR_EL1
register after resume to prevent this to happen.

Cc: Will Deacon <will@kernel.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-9-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit eab0e6e17d
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I16efc3a886e57ac2f0a4f8a1bc70afcf17a86f26
2021-04-27 10:40:13 +02:00
Vincenzo Frascino
27ecc98407 FROMGIT: arm64: mte: Enable async tag check fault
MTE provides a mode that asynchronously updates the TFSR_EL1 register
when a tag check exception is detected.

To take advantage of this mode the kernel has to verify the status of
the register at:
  1. Context switching
  2. Return to user/EL0 (Not required in entry from EL0 since the kernel
  did not run)
  3. Kernel entry from EL1
  4. Kernel exit to EL1

If the register is non-zero a trace is reported.

Add the required features for EL1 detection and reporting.

Note: ITFSB bit is set in the SCTLR_EL1 register hence it guaranties that
the indirect writes to TFSR_EL1 are synchronized at exception entry to
EL1. On the context switch path the synchronization is guarantied by the
dsb() in __switch_to().
The dsb(nsh) in mte_check_tfsr_exit() is provisional pending
confirmation by the architects.

Cc: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-8-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit 65812c6921
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ia3e8df665b1fd88a50c649a6eda6ee790e28a7d4
2021-04-27 10:40:13 +02:00
Vincenzo Frascino
c3ca7ea141 FROMGIT: arm64: mte: Conditionally compile mte_enable_kernel_*()
mte_enable_kernel_*() are not needed if KASAN_HW is disabled.

Add ash defines around the functions to conditionally compile the
functions.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-7-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit d8969752cc
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: If6ce3c28e970efda838b5f0112c409953265d083
2021-04-27 10:40:12 +02:00
Will McVicker
a2f1f07ff4 ANDROID: ABI: Update the ABI xml
Leaf changes summary: 7 artifacts changed (1 filtered out)
Changed leaf types summary: 0 (1 filtered out) leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 6 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

6 Added functions:

  [A] 'function pwm_device* devm_pwm_get(device*, const char*)'
  [A] 'function int hid_add_device(hid_device*)'
  [A] 'function hid_device* hid_allocate_device()'
  [A] 'function void hid_destroy_device(hid_device*)'
  [A] 'function int hid_input_report(hid_device*, int, u8*, u32, int)'
  [A] 'function int hid_parse_report(hid_device*, __u8*, unsigned int)'

1 Added variable:

  [A] 'int hid_debug'

Bug: 186426346
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I328c02fcd832e00b5f06fe8cac354c3271b7a25b
2021-04-26 22:41:54 +00:00
Will McVicker
621d2bbc84 ANDROID: ABI: Update the generic symbol list
Add new symbols.

Bug: 186426346
Signed-off-by: Will McVicker <willmcvicker@google.com>
Change-Id: I6e87634a8f59fba90fa290c454bfef771feb3750
2021-04-26 22:41:43 +00:00
Kuan-Ying Lee
546252f29c ANDROID: selinux: add vendor hook in selinux
Add vendor hook for selinux_state, so we can know
if the selinux_state is initialized

Bug: 186363840

Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ideed051a1d53ed1bce7d7915e38366264a7d77eb
2021-04-26 10:27:58 -07:00
Vincenzo Frascino
4870b68f3f FROMGIT: arm64: mte: Enable TCO in functions that can read beyond buffer limits
load_unaligned_zeropad() and __get/put_kernel_nofault() functions can
read past some buffer limits which may include some MTE granule with a
different tag.

When MTE async mode is enabled, the load operation crosses the boundaries
and the next granule has a different tag the PE sets the TFSR_EL1.TF1 bit
as if an asynchronous tag fault is happened.

Enable Tag Check Override (TCO) in these functions  before the load and
disable it afterwards to prevent this to happen.

Note: The same condition can be hit in MTE sync mode but we deal with it
through the exception handling.
In the current implementation, mte_async_mode flag is set only at boot
time but in future kasan might acquire some runtime features that
that change the mode dynamically, hence we disable it when sync mode is
selected for future proof.

Cc: Will Deacon <will@kernel.org>
Reported-by: Branislav Rankov <Branislav.Rankov@arm.com>
Tested-by: Branislav Rankov <Branislav.Rankov@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-6-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit e60beb95c0
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Id1bf44c5f41bd6de4b2ddf286939cd35712f2299
2021-04-26 18:40:43 +02:00
JianMin Liu
f3f8d55011 ANDROID: sched: Add vendor hooks for update_load_avg
Add vh before and after __update_load_avg_se
  in order to collect load change of tasks.

Bug: 185557444

Change-Id: I210973f7e388164b68ed766074d1420cdf9d4c32
Signed-off-by: JianMin Liu <jian-min.liu@mediatek.com>
2021-04-26 13:29:25 +00:00
Quentin Perret
2f77dca33d ANDROID: Update ABI with __traceiter_*() additions
Leaf changes summary: 132 artifacts changed (1 filtered out)
Changed leaf types summary: 0 (1 filtered out) leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 132 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

132 Added functions:

  [A] 'function int __traceiter_android_rvh_account_irq(void*, task_struct*, int, s64)'
  [A] 'function int __traceiter_android_rvh_build_perf_domains(void*, bool*)'
  [A] 'function int __traceiter_android_rvh_can_migrate_task(void*, task_struct*, int, int*)'
  [A] 'function int __traceiter_android_rvh_check_preempt_wakeup(void*, rq*, task_struct*, bool*, bool*, int, sched_entity*, sched_entity*, int, unsigned int)'
  [A] 'function int __traceiter_android_rvh_cpu_cgroup_attach(void*, cgroup_taskset*)'
  [A] 'function int __traceiter_android_rvh_cpu_cgroup_can_attach(void*, cgroup_taskset*, int*)'
  [A] 'function int __traceiter_android_rvh_cpu_cgroup_online(void*, cgroup_subsys_state*)'
  [A] 'function int __traceiter_android_rvh_cpu_overutilized(void*, int, int*)'
  [A] 'function int __traceiter_android_rvh_cpufreq_transition(void*, cpufreq_policy*)'
  [A] 'function int __traceiter_android_rvh_dequeue_task(void*, rq*, task_struct*, int)'
  [A] 'function int __traceiter_android_rvh_enqueue_task(void*, rq*, task_struct*, int)'
  [A] 'function int __traceiter_android_rvh_find_busiest_queue(void*, int, sched_group*, cpumask*, rq**, int*)'
  [A] 'function int __traceiter_android_rvh_find_energy_efficient_cpu(void*, task_struct*, int, int, int*)'
  [A] 'function int __traceiter_android_rvh_find_lowest_rq(void*, task_struct*, cpumask*, int, int*)'
  [A] 'function int __traceiter_android_rvh_flush_task(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_irqs_disable(void*, unsigned long int, unsigned long int)'
  [A] 'function int __traceiter_android_rvh_irqs_enable(void*, unsigned long int, unsigned long int)'
  [A] 'function int __traceiter_android_rvh_migrate_queued_task(void*, rq*, rq_flags*, task_struct*, int, int*)'
  [A] 'function int __traceiter_android_rvh_new_task_stats(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_pick_next_entity(void*, cfs_rq*, sched_entity*, sched_entity**)'
  [A] 'function int __traceiter_android_rvh_place_entity(void*, cfs_rq*, sched_entity*, int, u64)'
  [A] 'function int __traceiter_android_rvh_preempt_disable(void*, unsigned long int, unsigned long int)'
  [A] 'function int __traceiter_android_rvh_preempt_enable(void*, unsigned long int, unsigned long int)'
  [A] 'function int __traceiter_android_rvh_replace_next_task_fair(void*, rq*, task_struct**, sched_entity**, bool*, bool, task_struct*)'
  [A] 'function int __traceiter_android_rvh_resume_cpus(void*, cpumask*, int*)'
  [A] 'function int __traceiter_android_rvh_sched_balance_rt(void*, rq*, task_struct*, int*)'
  [A] 'function int __traceiter_android_rvh_sched_cpu_dying(void*, int)'
  [A] 'function int __traceiter_android_rvh_sched_cpu_starting(void*, int)'
  [A] 'function int __traceiter_android_rvh_sched_exec(void*, bool*)'
  [A] 'function int __traceiter_android_rvh_sched_fork(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_sched_fork_init(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_sched_newidle_balance(void*, rq*, rq_flags*, int*, int*)'
  [A] 'function int __traceiter_android_rvh_sched_nohz_balancer_kick(void*, rq*, unsigned int*, int*)'
  [A] 'function int __traceiter_android_rvh_sched_rebalance_domains(void*, rq*, int*)'
  [A] 'function int __traceiter_android_rvh_sched_setaffinity(void*, task_struct*, const cpumask*, int*)'
  [A] 'function int __traceiter_android_rvh_schedule(void*, task_struct*, task_struct*, rq*)'
  [A] 'function int __traceiter_android_rvh_schedule_bug(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_select_fallback_rq(void*, int, task_struct*, int*)'
  [A] 'function int __traceiter_android_rvh_select_task_rq_fair(void*, task_struct*, int, int, int, int*)'
  [A] 'function int __traceiter_android_rvh_select_task_rq_rt(void*, task_struct*, int, int, int, int*)'
  [A] 'function int __traceiter_android_rvh_set_gfp_zone_flags(void*, gfp_t*)'
  [A] 'function int __traceiter_android_rvh_set_iowait(void*, task_struct*, int*)'
  [A] 'function int __traceiter_android_rvh_set_readahead_gfp_mask(void*, gfp_t*)'
  [A] 'function int __traceiter_android_rvh_set_skip_swapcache_flags(void*, gfp_t*)'
  [A] 'function int __traceiter_android_rvh_set_task_cpu(void*, task_struct*, unsigned int)'
  [A] 'function int __traceiter_android_rvh_tick_entry(void*, rq*)'
  [A] 'function int __traceiter_android_rvh_try_to_wake_up(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_try_to_wake_up_success(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_ttwu_cond(void*, bool*)'
  [A] 'function int __traceiter_android_rvh_typec_tcpci_chk_contaminant(void*, tcpci*, tcpci_data*, int*)'
  [A] 'function int __traceiter_android_rvh_typec_tcpci_get_vbus(void*, tcpci*, tcpci_data*, int*, int*)'
  [A] 'function int __traceiter_android_rvh_uclamp_eff_get(void*, task_struct*, uclamp_id, uclamp_se*, uclamp_se*, int*)'
  [A] 'function int __traceiter_android_rvh_update_cpu_capacity(void*, int, unsigned long int*)'
  [A] 'function int __traceiter_android_rvh_update_cpus_allowed(void*, task_struct*, cpumask*, const cpumask*, int*)'
  [A] 'function int __traceiter_android_rvh_update_misfit_status(void*, task_struct*, rq*, bool*)'
  [A] 'function int __traceiter_android_rvh_util_est_update(void*, cfs_rq*, task_struct*, bool, int*)'
  [A] 'function int __traceiter_android_rvh_wake_up_new_task(void*, task_struct*)'
  [A] 'function int __traceiter_android_vh_allow_domain_state(void*, generic_pm_domain*, uint32_t, bool*)'
  [A] 'function int __traceiter_android_vh_arch_set_freq_scale(void*, const cpumask*, unsigned long int, unsigned long int, unsigned long int*)'
  [A] 'function int __traceiter_android_vh_binder_restore_priority(void*, binder_transaction*, task_struct*)'
  [A] 'function int __traceiter_android_vh_binder_set_priority(void*, binder_transaction*, task_struct*)'
  [A] 'function int __traceiter_android_vh_binder_transaction_init(void*, binder_transaction*)'
  [A] 'function int __traceiter_android_vh_binder_wakeup_ilocked(void*, task_struct*, bool, binder_proc*)'
  [A] 'function int __traceiter_android_vh_cma_alloc_finish(void*, cma*, page*, unsigned long int, unsigned int, gfp_t, s64)'
  [A] 'function int __traceiter_android_vh_cma_alloc_start(void*, s64*)'
  [A] 'function int __traceiter_android_vh_cpu_idle_enter(void*, int*, cpuidle_device*)'
  [A] 'function int __traceiter_android_vh_cpu_idle_exit(void*, int, cpuidle_device*)'
  [A] 'function int __traceiter_android_vh_dump_throttled_rt_tasks(void*, int, u64, ktime_t, u64, s64)'
  [A] 'function int __traceiter_android_vh_enable_thermal_genl_check(void*, int, int, int*)'
  [A] 'function int __traceiter_android_vh_ep_create_wakeup_source(void*, char*, int)'
  [A] 'function int __traceiter_android_vh_freq_table_limits(void*, cpufreq_policy*, unsigned int, unsigned int)'
  [A] 'function int __traceiter_android_vh_ftrace_dump_buffer(void*, trace_seq*, bool*)'
  [A] 'function int __traceiter_android_vh_ftrace_format_check(void*, bool*)'
  [A] 'function int __traceiter_android_vh_ftrace_oops_enter(void*, bool*)'
  [A] 'function int __traceiter_android_vh_ftrace_oops_exit(void*, bool*)'
  [A] 'function int __traceiter_android_vh_ftrace_size_check(void*, unsigned long int, bool*)'
  [A] 'function int __traceiter_android_vh_gic_v3_set_affinity(void*, irq_data*, const cpumask*, u64*, bool, void*)'
  [A] 'function int __traceiter_android_vh_gpio_block_read(void*, gpio_device*, bool*)'
  [A] 'function int __traceiter_android_vh_iommu_setup_dma_ops(void*, device*, u64, u64)'
  [A] 'function int __traceiter_android_vh_ipi_stop(void*, pt_regs*)'
  [A] 'function int __traceiter_android_vh_jiffies_update(void*, void*)'
  [A] 'function int __traceiter_android_vh_logbuf(void*, printk_ringbuffer*, printk_record*)'
  [A] 'function int __traceiter_android_vh_pagecache_get_page(void*, address_space*, unsigned long int, int, gfp_t, page*)'
  [A] 'function int __traceiter_android_vh_printk_hotplug(void*, int*)'
  [A] 'function int __traceiter_android_vh_rmqueue(void*, zone*, zone*, unsigned int, gfp_t, unsigned int, int)'
  [A] 'function int __traceiter_android_vh_scheduler_tick(void*, rq*)'
  [A] 'function int __traceiter_android_vh_show_max_freq(void*, cpufreq_policy*, unsigned int*)'
  [A] 'function int __traceiter_android_vh_show_resume_epoch_val(void*, u64)'
  [A] 'function int __traceiter_android_vh_show_suspend_epoch_val(void*, u64, u64)'
  [A] 'function int __traceiter_android_vh_timer_calc_index(void*, unsigned int, unsigned long int*)'
  [A] 'function int __traceiter_android_vh_timerfd_create(void*, char*, int)'
  [A] 'function int __traceiter_android_vh_typec_store_partner_src_caps(void*, tcpm_port*, unsigned int*, u32[7]*)'
  [A] 'function int __traceiter_android_vh_typec_tcpci_override_toggling(void*, tcpci*, tcpci_data*, int*)'
  [A] 'function int __traceiter_android_vh_typec_tcpm_adj_current_limit(void*, const char*, u32, u32, bool, u32*, bool*)'
  [A] 'function int __traceiter_android_vh_typec_tcpm_get_timer(void*, const char*, typec_timer, unsigned int*)'
  [A] 'function int __traceiter_android_vh_ufs_check_int_errors(void*, ufs_hba*, bool)'
  [A] 'function int __traceiter_android_vh_ufs_compl_command(void*, ufs_hba*, ufshcd_lrb*)'
  [A] 'function int __traceiter_android_vh_ufs_fill_prdt(void*, ufs_hba*, ufshcd_lrb*, unsigned int, int*)'
  [A] 'function int __traceiter_android_vh_ufs_prepare_command(void*, ufs_hba*, request*, ufshcd_lrb*, int*)'
  [A] 'function int __traceiter_android_vh_ufs_send_command(void*, ufs_hba*, ufshcd_lrb*)'
  [A] 'function int __traceiter_android_vh_ufs_send_tm_command(void*, ufs_hba*, int, const char*)'
  [A] 'function int __traceiter_android_vh_ufs_send_uic_command(void*, ufs_hba*, uic_command*, const char*)'
  [A] 'function int __traceiter_android_vh_ufs_update_sysfs(void*, ufs_hba*)'
  [A] 'function int __traceiter_binder_transaction_received(void*, binder_transaction*)'
  [A] 'function int __traceiter_cpu_frequency_limits(void*, cpufreq_policy*)'
  [A] 'function int __traceiter_cpu_idle(void*, unsigned int, unsigned int)'
  [A] 'function int __traceiter_device_pm_callback_end(void*, device*, int)'
  [A] 'function int __traceiter_device_pm_callback_start(void*, device*, const char*, int)'
  [A] 'function int __traceiter_hrtimer_expire_entry(void*, hrtimer*, ktime_t*)'
  [A] 'function int __traceiter_hrtimer_expire_exit(void*, hrtimer*)'
  [A] 'function int __traceiter_ipi_entry(void*, const char*)'
  [A] 'function int __traceiter_ipi_exit(void*, const char*)'
  [A] 'function int __traceiter_ipi_raise(void*, const cpumask*, const char*)'
  [A] 'function int __traceiter_irq_handler_entry(void*, int, irqaction*)'
  [A] 'function int __traceiter_irq_handler_exit(void*, int, irqaction*, int)'
  [A] 'function int __traceiter_pelt_cfs_tp(void*, cfs_rq*)'
  [A] 'function int __traceiter_pelt_dl_tp(void*, rq*)'
  [A] 'function int __traceiter_pelt_irq_tp(void*, rq*)'
  [A] 'function int __traceiter_pelt_rt_tp(void*, rq*)'
  [A] 'function int __traceiter_pelt_se_tp(void*, sched_entity*)'
  [A] 'function int __traceiter_rwmmio_post_read(void*, unsigned long int, u64, u8, const volatile void*)'
  [A] 'function int __traceiter_rwmmio_read(void*, unsigned long int, u8, const volatile void*)'
  [A] 'function int __traceiter_rwmmio_write(void*, unsigned long int, u64, u8, volatile void*)'
  [A] 'function int __traceiter_sched_cpu_capacity_tp(void*, rq*)'
  [A] 'function int __traceiter_sched_overutilized_tp(void*, root_domain*, bool)'
  [A] 'function int __traceiter_sched_switch(void*, bool, task_struct*, task_struct*)'
  [A] 'function int __traceiter_sched_util_est_cfs_tp(void*, cfs_rq*)'
  [A] 'function int __traceiter_suspend_resume(void*, const char*, int, bool)'
  [A] 'function int __traceiter_workqueue_execute_end(void*, work_struct*, work_func_t)'
  [A] 'function int __traceiter_workqueue_execute_start(void*, work_struct*)'
  [A] 'function void mmc_crypto_prepare_req(mmc_queue_req*)'
  [A] 'function void mmc_crypto_setup_queue(request_queue*, mmc_host*)'

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: If5fc3c6ebffa6c326d1b8f227ce4f6ec016e32aa
2021-04-26 09:45:39 +00:00
Quentin Perret
6ac06f08b2 ANDROID: Update the cf symbol list
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I63789145dcfb0ab9d8411b236d797dc35a36b287
2021-04-26 08:54:09 +00:00
Quentin Perret
eef08d7dc9 ANDROID: Update the qcom symbol list
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I616df9b718f50a7ab261de9d9b1186aaee1b17fa
2021-04-26 08:54:09 +00:00
Quentin Perret
020f00a46d ANDROID: Update the hikey960 symbol list
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Id7efe0cee50d3969182b965ed51b8c1803c4b41a
2021-04-26 08:54:09 +00:00
Quentin Perret
2d2d6428cd ANDROID: Update the generic symbol list
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Id7f96b205c9daf9f4a1507a670cf351442bc5815
2021-04-26 08:54:08 +00:00
Quentin Perret
dbe96fb1b9 ANDROID: Update the exynos symbol list
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I9fabda88f22c364e4a6963638f2cb01d3e70e5ff
2021-04-26 08:54:08 +00:00
Quentin Perret
da07f99f19 ANDROID: Update the db845c symbol list
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.

Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I7481aec17bfa7c85f3f8f626d5c9baba472d251b
2021-04-26 08:54:08 +00:00
Catalin Marinas
c7d0729a2c UPSTREAM: arm64: Move PSTATE.TCO setting to separate functions
For consistency with __uaccess_{disable,enable}_hw_pan(), move the
PSTATE.TCO setting into dedicated __uaccess_{disable,enable}_tco()
functions.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit 83b5bd628f)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ib7374b4f2ae8353afd062f740a355248507efa01
2021-04-25 14:59:34 +02:00
Vincenzo Frascino
9a928af2cc FROMGIT: kasan: Add report for async mode
KASAN provides an asynchronous mode of execution.

Add reporting functionality for this mode.

Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/20210315132019.33202-5-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit 8f7b505475
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ida1f470c21f378034dfa201c2b392e8af6bddee3
2021-04-25 14:59:34 +02:00
Vincenzo Frascino
f47de37f1f FROMGIT: arm64: mte: Drop arch_enable_tagging()
arch_enable_tagging() was left in memory.h after the introduction of
async mode to not break the bysectability of the KASAN KUNIT tests.

Remove the function now that KASAN has been fully converted.

Cc: Will Deacon <will@kernel.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-4-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit c137c6145b
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ie497d187488a315be4d7b07803924dd4842fd32d
2021-04-25 14:59:34 +02:00
Todd Kjos
8bd9e809e9 ANDROID: GKI: 4/23 KMI update
Set KMI_GENERATION=2 for 4/23 KMI update

Bug: 186241007
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I5d07a9750c00e23c596a682d7d5b32b820b71f3f
2021-04-24 14:15:43 -07:00
Vincenzo Frascino
563c7d9596 FROMGIT: kasan: Add KASAN mode kernel parameter
Architectures supported by KASAN_HW_TAGS can provide a sync or async mode
of execution. On an MTE enabled arm64 hw for example this can be identified
with the synchronous or asynchronous tagging mode of execution.
In synchronous mode, an exception is triggered if a tag check fault occurs.
In asynchronous mode, if a tag check fault occurs, the TFSR_EL1 register is
updated asynchronously. The kernel checks the corresponding bits
periodically.

KASAN requires a specific kernel command line parameter to make use of this
hw features.

Add KASAN HW execution mode kernel command line parameter.

Note: This patch adds the kasan.mode kernel parameter and the
sync/async kernel command line options to enable the described features.

[ Add a new var instead of exposing kasan_arg_mode to be consistent with
  flags for other command line arguments. ]

Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/20210315132019.33202-3-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit 2603f8a78d
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I193e9eb0c016abc525ef69a1b9b2bb7254856162
2021-04-24 19:37:58 +02:00
Vincenzo Frascino
433b85479b FROMGIT: arm64: mte: Add asynchronous mode support
MTE provides an asynchronous mode for detecting tag exceptions. In
particular instead of triggering a fault the arm64 core updates a
register which is checked by the kernel after the asynchronous tag
check fault has occurred.

Add support for MTE asynchronous mode.

The exception handling mechanism will be added with a future patch.

Note: KASAN HW activates async mode via kasan.mode kernel parameter.
The default mode is set to synchronous.
The code that verifies the status of TFSR_EL1 will be added with a
future patch.

Cc: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-2-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 170327579
Bug: 172318110
(cherry picked from commit f3b7deef8d
 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
 for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I5a2778bbb03595c24eb6cddb6c2b2dcb383b7907
2021-04-24 19:37:58 +02:00
Todd Kjos
ea97f39295 ANDROID: GKI: update ABI description
Update ABI description in prperation for 4/23 KMI update

Leaf changes summary: 3103 artifacts changed
Changed leaf types summary: 15 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 3030 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 58 Changed, 0 Added variable

3030 functions with some sub-type change:

  [C] 'function int dev_pm_genpd_set_next_wakeup(device*, ktime_t)' at domain.c:441:1 has some sub-type changes:
    CRC (modversions) changed from 0x5f5fcb7c to 0xf61e0895
    return type changed:
      type name changed from 'int' to 'void'
      type size changed from 32 to 0 (in bits)

  [C] 'function void* PDE_DATA(const inode*)' at generic.c:799:1 has some sub-type changes:
    CRC (modversions) changed from 0x44ca679 to 0xcab3cd66

  [C] 'function void __ClearPageMovable(page*)' at compaction.c:138:1 has some sub-type changes:
    CRC (modversions) changed from 0x44484f05 to 0x9fa7085b

  [C] 'function void __SetPageMovable(page*, address_space*)' at compaction.c:130:1 has some sub-type changes:
    CRC (modversions) changed from 0x8978c2df to 0x41b1ba1a

  ... 3026 omitted; 3029 symbols have only CRC changes

58 Changed variables:

  [C] 'static_key_false cpu_hwcap_keys[61]' was changed to 'static_key_false cpu_hwcap_keys[76]' at cpufeature.c:150:1:
    size of symbol changed from 976 to 1216
    CRC (modversions) changed from 0x4c98d79b to 0xec2fc692
    type of variable changed:
      type name changed from 'static_key_false[61]' to 'static_key_false[76]'
      array type size changed from 7808 to 9728
      array type subrange 1 changed length from 61 to 76

  [C] 'unsigned long int cpu_hwcaps[1]' was changed to 'unsigned long int cpu_hwcaps[2]' at cpufeature.c:100:1:
    size of symbol changed from 8 to 16
    CRC (modversions) changed from 0xaebd1b18 to 0x8b9f70c7
    type of variable changed:
      type name changed from 'unsigned long int[1]' to 'unsigned long int[2]'
      array type size changed from 64 to 128
      array type subrange 1 changed length from 1 to 2

  [C] 'const vm_operations_struct drm_gem_cma_vm_ops' was changed at drm_gem_cma_helper.c:263:1:
    size of symbol changed from 136 to 144
    CRC (modversions) changed from 0xafd38045 to 0xc092767b
    type of variable changed:

  [C] 'net init_net' was changed at net_namespace.c:47:1:
    CRC (modversions) changed from 0x75836cf9 to 0x8c00edd2
    type of variable changed:
      type size hasn't changed
      there are data member changes:
        type 'struct netns_xfrm' of 'net::xfrm' changed:
          type size hasn't changed
          1 data member insertion:
            'seqcount_t xfrm_state_hash_generation', at offset 6176 (in bits) at xfrm.h:76:1
          there are data member changes:
            'spinlock_t xfrm_policy_lock' offset changed (by +32 bits)
            'mutex xfrm_cfg_mutex' offset changed (by +64 bits)
          3361 impacted interfaces
      3361 impacted interfaces

  [C] 'rq runqueues' was changed at core.c:49:1:
    size of symbol changed from 4160 to 4416
    CRC (modversions) changed from 0xfbaeea47 to 0x5137fc66
    type of variable changed:
      type size changed from 33280 to 35328 (in bits)
      there are data member changes:
        'uclamp_rq uclamp[2]' size changed from 768 to 2688 (in bits) (by +1920 bits)
        'unsigned int uclamp_flags' offset changed (by +1920 bits)
        61 ('cfs_rq cfs' .. 'u64 android_kabi_reserved4') offsets changed (by +2048 bits)
      3361 impacted interfaces

  [C] 'const vm_operations_struct vb2_common_vm_ops' was changed at videobuf2-memops.c:122:1:
    size of symbol changed from 136 to 144
    CRC (modversions) changed from 0x18a6cc01 to 0xfde2ba08
    type of variable changed:

  [C] 'vm_event_state vm_event_states' was changed at vmstat.c:108:1:
    size of symbol changed from 720 to 728
    CRC (modversions) changed from 0x85d767b0 to 0x62cac127
    type of variable changed:
      type size changed from 5760 to 5824 (in bits)
      there are data member changes:
        type 'unsigned long int[90]' of 'vm_event_state::event' changed:
          type name changed from 'unsigned long int[90]' to 'unsigned long int[91]'
          array type size changed from 5760 to 5824
          array type subrange 1 changed length from 90 to 91
      one impacted interface

  [C] 'bus_type amba_bustype' was changed at bus.c:215:1:
    CRC (modversions) changed from 0xbbb1e519 to 0x84856996

  [C] 'const address_space_operations balloon_aops' was changed at balloon_compaction.c:253:1:
    CRC (modversions) changed from 0x7769d265 to 0x807e3fab

  [C] 'const clk_ops clk_fixed_factor_ops' was changed at clk-fixed-factor.c:60:1:
    CRC (modversions) changed from 0x8a6ece13 to 0x26b088f0

  ... 48 omitted; 51 symbols have only CRC changes

'struct dma_buf at dma-buf.h:397:1' changed (indirectly):
  type size changed from 3328 to 3392 (in bits)
  there are data member changes:
    type 'struct vm_operations_struct' of 'dma_buf::vm_ops' changed:
      type size changed from 1088 to 1152 (in bits)
      1 data member insertion:
        'typedef bool ()* allow_speculation', at offset 832 (in bits) at mm.h:651:1
      there are data member changes:
        4 ('u64 android_kabi_reserved1' .. 'u64 android_kabi_reserved4') offsets changed (by +64 bits)
      3361 impacted interfaces
  421 impacted interfaces

'struct dma_slave_config at dmaengine.h:434:1' changed:
  type size changed from 448 to 576 (in bits)
  2 data member insertions:
    'void* peripheral_config', at offset 448 (in bits) at dmaengine.h:449:1
    'size_t peripheral_size', at offset 512 (in bits) at dmaengine.h:450:1
  33 impacted interfaces

'struct dwc3 at core.h:1079:1' changed:
  type size hasn't changed
  1 data member insertion:
    'unsigned int usb2_gadget_lpm_disable', at offset 16 (in bits) at core.h:1250:1
  there are data member changes:
    21 ('unsigned int dis_tx_ipgap_linecheck_quirk' .. 'unsigned int dis_u2_freeclk_exists_quirk') offsets changed (by +1 bits)
    'unsigned int dis_del_phy_power_chg_quirk' offset changed (by -31 bits)
  2 impacted interfaces

'struct net at net_namespace.h:56:1' changed (indirectly):
  details were reported earlier

'struct netns_xfrm at xfrm.h:32:1' changed:
  details were reported earlier

'struct rq at sched.h:907:1' changed (indirectly):
  details were reported earlier

'struct snd_soc_component_driver at soc-component.h:67:1' changed:
  type size changed from 2752 to 2816 (in bits)
  1 data member insertion:
    'int (snd_soc_component*, snd_pcm_substream*)* ack', at offset 2304 (in bits) at soc-component.h:149:1
  there are data member changes:
    8 ('const snd_compress_ops* compress_ops' .. 'int be_pcm_base') offsets changed (by +64 bits)
  65 impacted interfaces

'struct snd_soc_dai_link at soc.h:749:1' changed:
  type size changed from 1088 to 1600 (in bits)
  1 data member insertion:
    'snd_soc_dobj dobj', at offset 1088 (in bits) at soc.h:847:1
  65 impacted interfaces

'struct soc_enum at soc.h:1257:1' changed:
  type size changed from 320 to 832 (in bits)
  1 data member insertion:
    'snd_soc_dobj dobj', at offset 320 (in bits) at soc.h:1267:1
  one impacted interface

'struct tcpm_port at tcpm.c:297:1' changed:
  type size hasn't changed
  1 data member insertion:
    'bool slow_charger_loop', at offset 32080 (in bits) at tcpm.c:471:1
  13 impacted interfaces

'struct uclamp_rq at sched.h:892:1' changed:
  type size changed from 384 to 1344 (in bits)
  there are data member changes:
    type 'uclamp_bucket[5]' of 'uclamp_rq::bucket' changed:
      type name changed from 'uclamp_bucket[5]' to 'uclamp_bucket[20]'
      array type size changed from 320 to 1280
      array type subrange 1 changed length from 5 to 20
  3361 impacted interfaces

'struct uclamp_se at sched.h:623:1' changed (indirectly):
  type size hasn't changed
  there are data member changes:
    2 ('unsigned int active' .. 'unsigned int user_defined') offsets changed (by +2 bits)
  3361 impacted interfaces

'struct user_struct at user.h:13:1' changed:
  type size changed from 960 to 1088 (in bits)
  1 data member insertion:
    'u64 android_oem_data1[2]', at offset 960 (in bits) at user.h:45:1
  3361 impacted interfaces

'struct vm_event_state at vmstat.h:54:1' changed:
  details were reported earlier

'struct vm_operations_struct at mm.h:589:1' changed:
  details were reported earlier

Bug: 186241007
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I9725b5164da30547176b67b96cb1cef66ef2bfdc
2021-04-24 05:12:08 +00:00
Siddharth Gupta
4ccc2a6dbc FROMLIST: remoteproc: core: Move cdev add before device add
When cdev_add is called after device_add has been called there is no
way for the userspace to know about the addition of a cdev as cdev_add
itself doesn't trigger a uevent notification, or for the kernel to
know about the change to devt. This results in two problems:
 - mknod is never called for the cdev and hence no cdev appears on
   devtmpfs.
 - sysfs links to the new cdev are not established.

Based on how cdev_device_add[1] is written, it appears that the correct
way to use these APIs is to call cdev_add before device_add is called.
Since the cdev is an optional feature for remoteproc we cannot directly
use the existing API. Hence moving rproc_char_device_add() before
device_add() in rproc_add().

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/char_dev.c#n537

Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>

Bug: 185924092
Change-Id: Iad8a45f564996d73cd3f33ed124427cb73497dad
Link: https://lore.kernel.org/linux-remoteproc/1618946805-26970-1-git-send-email-sidgup@codeaurora.org/
Signed-off-by: Siddharth Gupta <quic_sidgup@quicinc.com>
2021-04-23 18:42:39 -07:00
Vinayak Menon
35eacb5c87 ANDROID: mm: allow vmas with vm_ops to be speculatively handled
Right now only anonymous page faults are speculatively handled,
thus leaving out a large percentage of faults still requiring to
take mmap_sem. These were left out since there can be fault
handlers mainly in the fs layer which may use vma in unknown ways.
This patch enables speculative fault for ext4, f2fs and shmem. The
feature is disabled by default and enabled via allow_file_spec_access
kernel param.

Bug: 171954515
Change-Id: I0d23ebf299000e4ac5e2c71bc0b7fc9006e98da9
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
2021-04-23 18:42:39 -07:00
lijianzhong
77e791866b ANDROID: sched: Add ANDROID_OEM_DATA_ARRAY in user_struct.
add ANDROID_OEM_DATA_ARRAY for implement of oem gki.

Bug: 183674818
Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: I418293391bc62a68207eae51a79bd45a7f6cd2ed
2021-04-23 18:42:38 -07:00
lijianzhong
54f66141a8 ANDROID: sched: Add vendor hooks for sched.
Add vendor hooks in sched to support oem's feature.

Bug: 183674818

Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: I8415958749948b3702e411f835c227ad4f8d8e92
2021-04-23 18:42:38 -07:00
lijianzhong
58b10706f3 ANDROID: sched: Add vendor hooks to compute new cpu freq.
add vendor hooks to compute new cpu freq for oem feature.

Bug: 183674818

Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: I232d2e1ae885d6736eca9e4709870f4272b4873d
2021-04-23 18:42:38 -07:00
Greg Kroah-Hartman
a629454175 Revert "Revert "net: xfrm: Localize sequence counter per network namespace""
This reverts commit 1aff922933 as we are
free to update the ABI at this point in time.

Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iba293953586fd78503ef5f47db40ccdc03b098f5
2021-04-23 18:42:38 -07:00
Badhri Jagan Sridharan
2d9841f98d FROMGIT: usb: typec: tcpm: Allow slow charging loops to comply to pSnkStby
When a PD charger advertising Rp-3.0 is connected to a sink port, the
sink port current limit would 3A, during SNK_DISCOVERY, till power
negotiation starts. Once the negotiation starts the power limit needs
to drop down to pSnkStby(500mA @ 5V) and to negotiated current limit
once the explicit contract is in place. Not all charging loops can ramp
up to 3A and drop down to 500mA within tSnkStdby which is 15ms. The port
partner might hard reset if tSnkStdby is not met.

To solve this problem, this patch introduces slow-charger-loop which
when set makes the port request PD_P_SNK_STDBY_MW upon entering
SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the
actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during
SNK_READY for non-pd link.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210414024000.4175263-2-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1373fefc62
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I811b7f9ec732da0cab715837737ea09ea4a5bbbf
2021-04-23 18:42:38 -07:00
Thinh Nguyen
4e2ca165ba FROMGIT: usb: dwc3: gadget: Check for disabled LPM quirk
If the device doesn't support LPM, make sure to disable the LPM
capability and don't advertise to the host that it supports it.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/9e68527ff932b1646f92a7593d4092a903754666.1618366071.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 475e8be53d
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I917918988617cfe892d3555022616a0254afa0b7
2021-04-23 18:42:38 -07:00
Mukesh Ojha
a6b8e73972 ANDROID: GKI: arm64: reserve space in cpu_hwcaps and cpu_hwcap_keys arrays
Since cpu_hwcaps and cpu_hwcap_keys are exported symbols, reserve
space in them for any future cpu capabilities or erratas.

Bug: 183169515
Change-Id: I85ebab5ee0eaeabaa2f2856aaae8730c77b16177
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
2021-04-23 18:42:37 -07:00
Quentin Perret
0f9bfa0e99 FROMLIST: export: Make CRCs robust to symbol trimming
The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types, and uses that as the input for the CRC calculation. In the case
of forward-declared structs, the type expands to 'UNKNOWN'. Next, the
result of the expansion of each type is cached, and is re-used when/if
the same type is seen again for another exported symbol in the file.

Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:

    struct foo;

    int bar(struct foo *arg)
    {
	/* Do work ... */
    }
    EXPORT_SYMBOL_GPL(bar);

    /* This contains struct foo's definition */
    #include "foo.h"

    int baz(struct foo *arg)
    {
	/* Do more work ... */
    }
    EXPORT_SYMBOL_GPL(baz);

Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.

This can cause annoying issues for distro kernel (such as the Android
Generic Kernel Image) which use CONFIG_UNUSED_KSYMS_WHITELIST. Indeed,
as per the above, adding a symbol to the whitelist can change the CRC of
symbols that are already kept exported. As such, modules built against a
kernel with a trimmed ABI may not load against the same kernel built
with an extended whitelist, even though they are still strictly binary
compatible. While rebuilding the modules would obviously solve the
issue, I believe this classifies as an odd genksyms corner case, and it
gets in the way of kernel updates in the GKI context.

To work around the issue, make sure to keep issuing the
__GENKSYMS_EXPORT_SYMBOL macros for all trimmed symbols, hence making
the genksyms parsing insensitive to symbol trimming.

Bug: 184275771
Bug: 167230325
Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210408180105.2496212-1-qperret@google.com
Change-Id: Id94085d446d5648943d4fe4f79e3177bc4f98093
2021-04-23 18:42:37 -07:00
Gyeongtaek Lee
e67935d786 ANDROID: Kconfig.gki Add SND_SOC_TOPOLOGY
Enable hidden config SND_SOC_TOPOLOGY need by SND_SOC=m

Bug: 153682187
Change-Id: I47dabfaa6f0d138f78fbc1c9fc0d4ac3c7c73986
Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
2021-04-23 18:42:37 -07:00
Rick Yiu
327402e1e9 ANDROID: GKI: Change UCLAMP_BUCKETS_COUNT to 20
Using the default setting 5 means the first bucket contains the
uclamp values from 0 to 19 (in percentage), in this case, if the
uclamp.min setting of a group is under 20, it will fall into this
bucket with other groups that have uclamp.min set to 0, which
increase the possibility of over boost. By setting the bucket
count to 20 will ease this situation, while a uclamp.min greater
than 4 will fall into a different bucket.

Bug: 170487162
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Ife96b199bee36faedc8e129ade17e475cdbe44e0
2021-04-23 18:42:37 -07:00
Shengjiu Wang
8451e2e48e FROMGIT: ASoC: soc-component: Add snd_soc_pcm_component_ack
Add snd_soc_pcm_component_ack back, which can be used to get an
updated buffer pointer in the platform driver.
On Asymmetric multiprocessor, this pointer can be sent to Cortex-M
core for audio processing.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 159736148
(cherry picked from commit 8bdfc0455e
https: //git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git sound/for-5.13)
Change-Id: I16f49ea140b9b9185313814fce3f3d9ef4c1a44a
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2021-04-23 18:42:37 -07:00
Shengjiu Wang
ce1a244af8 UPSTREAM: ASoC: dmaengine_pcm: add peripheral configuration
The commit e7bbb7acab ("dmaengine: add peripheral configuration")
adds peripheral configuration for dma_slave_config.

This configuration is useful for some audio peripherals, for
example, the peripheral supports multi fifos, we can
let the DMA know which fifos are selected. So also add
this configuration for snd_dmaengine_dai_dma_data.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1612509985-11063-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>

Bug: 159736148
(cherry picked from commit 500c9f8c58)
Change-Id: Ib8fd722b382e8d605db9edee65ab16df014d63db
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2021-04-23 18:42:37 -07:00
Vinod Koul
1dbf9d8dbc UPSTREAM: dmaengine: add peripheral configuration
Some complex dmaengine controllers have capability to program the
peripheral device, so pass on the peripheral configuration as part of
dma_slave_config

Link: https://lore.kernel.org/r/20201109085450.24843-3-vkoul@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

Bug: 159736148
(cherry picked from commit e7bbb7acab)
Change-Id: Id12675fe9b79781310d99e1aec6d323dc4f360f5
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
2021-04-23 18:42:37 -07:00
Lina Iyer
fb8304fcb8 UPSTREAM: PM: domains: use device's next wakeup to determine domain idle state
Currently, a PM domain's idle state is determined based on whether the
QoS requirements are met. However, even entering an idle state may waste
power if the minimum residency requirements aren't fulfilled.

CPU PM domains use the next timer wakeup for the CPUs in the domain to
determine the sleep duration of the domain. This is compared with the
idle state residencies to determine the optimal idle state. For other PM
domains, determining the sleep length is not that straight forward. But
if the device's next_event is available, we can use that to determine
the sleep duration of the PM domain.

Let's update the domain governor logic to check for idle state residency
based on the next wakeup of devices as well as QoS constraints. But
since, not all domains may contain devices capable of specifying the
next wakeup, let's enable this additional check only if specified by the
domain's flags when initializing the domain.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit c79aa080fb)
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I70714c4d5840034771b2b4a6b1d38eb4c73d1f85
2021-04-23 18:42:36 -07:00
Lina Iyer
e049d04424 UPSTREAM: PM: domains: inform PM domain of a device's next wakeup
Some devices may have a predictable interrupt pattern while executing
usecases. An example would be the VSYNC interrupt associated with
display devices. A 60 Hz display could cause a interrupt every 16 ms. If
the device were in a PM domain, the domain would need to be powered up
for device to resume and handle the interrupt.

Entering a domain idle state saves power, only if the residency of the
idle state is met. Without knowing the idle duration of the domain, the
governor would just choose the deepest idle state that matches the QoS
requirements. The domain might be powered off just as the device is
expecting to wake up. If devices could inform PM frameworks of their
next event, the parent PM domain's idle duration can be determined.

So let's add the dev_pm_genpd_set_next_wakeup() API for the device to
inform PM domains of the impending wakeup. This information will be the
domain governor to determine the best idle state given the wakeup.

Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 67e3242ee2)
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Id0b4c3a3d0f6223a24d94ae953777ff8c8f160f3
2021-04-23 18:42:36 -07:00
Carlos Llamas
98de9de261 Revert "FROMLIST: PM / Domains: add domain feature flag for next wakeup"
This reverts commit e6c313525b.

Drop [v6] patches in favor of upstream backports.

Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Iafa2cb1397ff033efe1c6d1c963e58d0478eed23
2021-04-23 18:42:36 -07:00
Carlos Llamas
14f2208945 Revert "FROMLIST: PM / domains: inform PM domain of a device's next wakeup"
This reverts commit 7a9d53c2ea.

Drop [v6] patches in favor of upstream backports.

Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I1ed4debfe724940b4c11c18f87ef97d046975918
2021-04-23 18:42:36 -07:00
Carlos Llamas
f316415fb2 Revert "FROMLIST: PM / Domains: use device's next wakeup to determine domain idle state"
This reverts commit 283e327164.

Drop [v6] patches in favor of upstream backports.

Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I82b8117cc6c6bf6b28af666f34257775ade428fa
2021-04-23 18:42:36 -07:00
Minchan Kim
76782b5633 FROMGIT: mm: cma: add the CMA instance name to cma trace events
There were missing places to add cma instance name.  To identify each CMA
instance, let's add the name for every cma trace.  This patch also changes
the existing cma_trace_alloc to cma_trace_finish since we have
cma_alloc_start[1].

[1] https://lore.kernel.org/linux-mm/20210324160740.15901-1-georgi.djakov@linaro.org

Link: https://lkml.kernel.org/r/20210330220237.748899-1-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Liam Mark <lmark@codeaurora.org>
Cc: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 178721512
(cherry picked from commit 952ef40541f8 https://github.com/hnaz/linux-mm tags/v5.12-rc7-mmots-2021-04-11-20-49)
Change-Id: Ic1a8572c45dd6d9dfa7cdf7ecb46a1f296c7b0c6
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2021-04-23 22:41:43 +00:00
Georgi Djakov
1cfa9bc019 FROMGIT: mm: cma: Add the CMA instance name to the cma_alloc_start trace event
During CMA allocation, print also the name to identify the CMA instance.

Link: https://lkml.kernel.org/r/20210326155414.25006-1-georgi.djakov@linaro.org
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Suggested-by: Minchan Kim <minchan@kernel.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 178721512
(cherry picked from commit dd9767786e02 https://github.com/hnaz/linux-mm tags/v5.12-rc7-mmots-2021-04-11-20-49)
Change-Id: I64a27ce16feed2ba66489c2839aefbd9e86c08fd
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2021-04-23 22:41:35 +00:00
Liam Mark
c453643efa FROMGIT: mm: cma: add trace events for CMA alloc perf testing
Add cma and migrate trace events to enable CMA allocation performance to
be measured via ftrace.

Link: https://lkml.kernel.org/r/20210324160740.15901-1-georgi.djakov@linaro.org
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Cc: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Bug: 178721512
(cherry picked from commit e0240efc7034 https://github.com/hnaz/linux-mm tags/v5.12-rc7-mmots-2021-04-11-20-49)
Change-Id: I72b61ce8b827c582e4d90717f4dd2ae5c34cd90b
Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
2021-04-23 22:41:28 +00:00
Carlos Llamas
48b3f756ed ANDROID: mm: compaction: fix isolate_and_split_free_page() redefinition
Guard isolate_and_split_free_page() with CONFIG_COMPACTION. This fixes
the follwoing build error as the function collides with its inline stub
from the header file:

mm/compaction.c:766:15: error: redefinition of ‘isolate_and_split_free_page’
  766 | unsigned long isolate_and_split_free_page(struct page *page,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mm/compaction.c:14:
./include/linux/compaction.h:241:29: note: previous definition of ‘isolate_and_split_free_page’ was here
  241 | static inline unsigned long isolate_and_split_free_page(struct page *page,
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Bug: 186243330
Fixes: 8cd9aa93b7 ("ANDROID: implement wrapper for reverse migration")
Reported-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Ie8f3fedcc9d4af5cfdcfd5829377671745ab77d6
2021-04-23 21:54:18 +00:00
Jindong Yue
2ead8661c3 ANDROID: vendor_hooks: Fix build-break due to psi_event
Fix build-break on non-GKI builds:
  kernel/sched/psi.c:538:3: error: implicit declaration
      of function 'trace_android_vh_psi_event'
  kernel/sched/psi.c:546:2: error: implicit declaration
      of function 'trace_android_vh_psi_group'

Bug: 178721511
Fixes: commit b79d1815c4 ("ANDROID: psi: Add vendor hooks for PSI tracing")
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Change-Id: Ife54bfbc035783614bebd442b86017e83c6d23a4
2021-04-23 19:12:27 +00:00
Vijayanand Jitta
d651e1d63c ANDROID: GKI: Update abi_gki_aarch64_qcom list for kprobe module
Update allowed list with symbols required for kprobe module.

Leaf changes summary: 3 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 3 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

3 Added functions:

  [A] 'function int synth_event_create(const char*, synth_field_desc*, unsigned int, module*)'
  [A] 'function int synth_event_delete(const char*)'
  [A] 'function trace_event_file* trace_get_event_file(const char*, const char*, const char*)'

Bug: 185726490
Change-Id: I85e9fbdde727d703327f2ea709e3f03af50e5689
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
2021-04-23 19:08:29 +00:00
Vijayanand Jitta
9b4e02e2ee ANDROID: GKI: Enable CONFIG_HIST_TRIGGERS
Enable CONFIG_HIST_TRIGGERS which will be useful
in various perf evaluations.

Bug: 185890730
Change-Id: Ia4c140863ce248fea0dd235ca8a9cdee1176f8ed
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
2021-04-23 19:08:03 +00:00