Commit Graph

1053545 Commits

Author SHA1 Message Date
Jack Pham
4dad64ab32 ANDROID: sound: usb: Export symbols for endpoint management
Export the following symbols which are needed to support
USB audio offload to a co-processor.

snd_usb_autoresume
snd_usb_autosuspend
snd_usb_endpoint_open
snd_usb_endpoint_close
snd_usb_endpoint_configure

Bug: 224904393
Change-Id: I8feaa225c7b869592b395815b3a7be47813c7aac
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
2022-04-08 15:32:49 -07:00
Jack Pham
982c7ee3e3 ANDROID: sound: usb: Add vendor hooks for connect & disconnect
Add vendor hooks to capture when a USB audio interface is probed
and disconnected.  These will allow for supporting offloading of
audio device handling to a co-processor.

The disconnect hook needs to be restricted as the additional
vendor handling may need to perform operations (such as
wait_for_completion) in non-atomic context.

Bug: 224904393
Change-Id: Idf1da95556814e0ffbdc5f9fb5a25563ebee9be2
Signed-off-by: Jack Pham <quic_jackp@quicinc.com>
2022-04-08 15:28:33 -07:00
Chun-Hung Wu
d5d14b8ff8 ANDROID: add initial symbol list for mtk
1. update mtk symbol list and abi.xml
2. update mtk entry in build.config.gki.aarch64

Leaf changes summary: 438 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 392 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 46 Added variables
Function symbols changes summary: 0 Removed, 0 Added function symbol not referenced by debug info
Variable symbols changes summary: 0 Removed, 1 Added variable symbol not referenced by debug info

392 Added functions:

  [A] 'function void* __devm_alloc_percpu(device*, size_t, size_t)'
  [A] 'function int __devm_mdiobus_register(device*, mii_bus*, module*)'
  [A] 'function int __mdiobus_register(mii_bus*, module*)'
  [A] 'function int __scsi_execute(scsi_device*, const unsigned char*, int, void*, unsigned int, unsigned char*, scsi_sense_hdr*, int, int, u64, req_flags_t, int*)'
  [A] 'function int __traceiter_android_rvh_after_enqueue_task(void*, rq*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_commit_creds(void*, const task_struct*, const cred*)'
  [A] 'function int __traceiter_android_rvh_enqueue_task(void*, rq*, task_struct*, int)'
  [A] 'function int __traceiter_android_rvh_exit_creds(void*, const task_struct*, const cred*)'
  [A] 'function int __traceiter_android_rvh_find_busiest_group(void*, sched_group*, rq*, int*)'
  [A] 'function int __traceiter_android_rvh_finish_prio_fork(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_new_task_stats(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_override_creds(void*, const task_struct*, const cred*)'
  [A] 'function int __traceiter_android_rvh_prepare_prio_fork(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_revert_creds(void*, const task_struct*, const cred*)'
  [A] 'function int __traceiter_android_rvh_rtmutex_prepare_setprio(void*, task_struct*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_sched_newidle_balance(void*, rq*, rq_flags*, int*, int*)'
  [A] 'function int __traceiter_android_rvh_select_task_rq_fair(void*, task_struct*, int, int, int, int*)'
  [A] 'function int __traceiter_android_rvh_selinux_avc_insert(void*, const avc_node*)'
  [A] 'function int __traceiter_android_rvh_selinux_avc_lookup(void*, const avc_node*, u32, u32, u16)'
  [A] 'function int __traceiter_android_rvh_selinux_avc_node_delete(void*, const avc_node*)'
  [A] 'function int __traceiter_android_rvh_selinux_avc_node_replace(void*, const avc_node*, const avc_node*)'
  [A] 'function int __traceiter_android_rvh_selinux_is_initialized(void*, const selinux_state*)'
  [A] 'function int __traceiter_android_rvh_set_user_nice(void*, task_struct*, long int*, bool*)'
  [A] 'function int __traceiter_android_rvh_setscheduler(void*, task_struct*)'
  [A] 'function int __traceiter_android_rvh_tick_entry(void*, rq*)'
  [A] 'function int __traceiter_android_rvh_update_cpu_capacity(void*, int, unsigned long int*)'
  [A] 'function int __traceiter_android_vh_alter_futex_plist_add(void*, plist_node*, plist_head*, bool*)'
  [A] 'function int __traceiter_android_vh_alter_rwsem_list_add(void*, rwsem_waiter*, rw_semaphore*, bool*)'
  [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_cgroup_attach(void*, cgroup_subsys*, cgroup_taskset*)'
  [A] 'function int __traceiter_android_vh_cgroup_set_task(void*, int, task_struct*)'
  [A] 'function int __traceiter_android_vh_check_bpf_syscall(void*, int, const bpf_attr*, unsigned int)'
  [A] 'function int __traceiter_android_vh_check_file_open(void*, const file*)'
  [A] 'function int __traceiter_android_vh_check_mmap_file(void*, const file*, unsigned long int, unsigned long int, unsigned long int)'
  [A] 'function int __traceiter_android_vh_iommu_iovad_alloc_iova(void*, device*, iova_domain*, dma_addr_t, size_t)'
  [A] 'function int __traceiter_android_vh_iommu_iovad_free_iova(void*, iova_domain*, dma_addr_t, size_t)'
  [A] 'function int __traceiter_android_vh_is_fpsimd_save(void*, task_struct*, task_struct*)'
  [A] 'function int __traceiter_android_vh_logbuf(void*, printk_ringbuffer*, printk_record*)'
  [A] 'function int __traceiter_android_vh_rwsem_init(void*, rw_semaphore*)'
  [A] 'function int __traceiter_android_vh_rwsem_wake(void*, rw_semaphore*)'
  [A] 'function int __traceiter_android_vh_rwsem_write_finished(void*, rw_semaphore*)'
  [A] 'function int __traceiter_android_vh_scheduler_tick(void*, rq*)'
  [A] 'function int __traceiter_android_vh_set_memory_nx(void*, unsigned long int, int)'
  [A] 'function int __traceiter_android_vh_set_memory_rw(void*, unsigned long int, int)'
  [A] 'function int __traceiter_android_vh_set_module_permit_after_init(void*, const module*)'
  [A] 'function int __traceiter_android_vh_set_module_permit_before_init(void*, const module*)'
  [A] 'function int __traceiter_android_vh_set_wake_flags(void*, int*, 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_syscall_prctl_finished(void*, int, task_struct*)'
  [A] 'function int __traceiter_task_newtask(void*, task_struct*, unsigned long int)'
  [A] 'function int __v4l2_ctrl_modify_range(v4l2_ctrl*, s64, s64, u64, s64)'
  [A] 'function int __v4l2_ctrl_s_ctrl(v4l2_ctrl*, s32)'
  [A] 'function int __v4l2_ctrl_s_ctrl_compound(v4l2_ctrl*, v4l2_ctrl_type, void*)'
  [A] 'function int __v4l2_device_register_subdev_nodes(v4l2_device*, bool)'
  [A] 'function void* __v4l2_find_nearest_size(void*, size_t, size_t, size_t, size_t, s32, s32)'
  [A] 'function int _raw_read_trylock(rwlock_t*)'
  [A] 'function void alarm_start(alarm*, ktime_t)'
  [A] 'function void bitmap_free(const unsigned long int*)'
  [A] 'function unsigned long int* bitmap_zalloc(unsigned int, gfp_t)'
  [A] 'function int cfg80211_register_netdevice(net_device*)'
  [A] 'function int clocksource_mmio_init(void*, const char*, unsigned long int, int, unsigned int, typedef u64 (clocksource*)*)'
  [A] 'function u64 clocksource_mmio_readl_up(clocksource*)'
  [A] 'function int component_add_typed(device*, const component_ops*, int)'
  [A] 'function void component_match_add_typed(device*, component_match**, int (device*, int, void*)*, void*)'
  [A] 'function void cpu_hotplug_disable()'
  [A] 'function void cpu_hotplug_enable()'
  [A] 'function int cpufreq_frequency_table_get_index(cpufreq_policy*, unsigned int)'
  [A] 'function void cpufreq_update_limits(unsigned int)'
  [A] 'function void cpuidle_driver_state_disabled(cpuidle_driver*, int, bool)'
  [A] 'function cpuidle_driver* cpuidle_get_driver()'
  [A] 'function void cpuidle_pause_and_lock()'
  [A] 'function void cpuidle_resume_and_unlock()'
  [A] 'function int dapm_clock_event(snd_soc_dapm_widget*, snd_kcontrol*, int)'
  [A] 'function unsigned int dapm_kcontrol_get_value(const snd_kcontrol*)'
  [A] 'function dentry* debugfs_create_blob(const char*, umode_t, dentry*, debugfs_blob_wrapper*)'
  [A] 'function int dev_change_flags(net_device*, unsigned int, netlink_ext_ack*)'
  [A] 'function void dev_pm_clear_wake_irq(device*)'
  [A] 'function device* dev_pm_domain_attach_by_id(device*, unsigned int)'
  [A] 'function int dev_pm_set_dedicated_wake_irq(device*, int)'
  [A] 'function int dev_set_mac_address(net_device*, sockaddr*, netlink_ext_ack*)'
  [A] 'function int device_create_bin_file(device*, const bin_attribute*)'
  [A] 'function void device_link_remove(void*, device*)'
  [A] 'function void device_remove_bin_file(device*, const bin_attribute*)'
  [A] 'function int device_rename(device*, const char*)'
  [A] 'function void device_set_of_node_from_dev(device*, const device*)'
  [A] 'function ssize_t device_show_bool(device*, device_attribute*, char*)'
  [A] 'function ssize_t device_store_bool(device*, device_attribute*, const char*, size_t)'
  [A] 'function pwm_device* devm_fwnode_pwm_get(device*, fwnode_handle*, const char*)'
  [A] 'function iio_channel* devm_iio_channel_get_all(device*)'
  [A] 'function void devm_led_classdev_unregister(device*, led_classdev*)'
  [A] 'function mii_bus* devm_mdiobus_alloc_size(device*, int)'
  [A] 'function power_supply* devm_power_supply_get_by_phandle(device*, const char*)'
  [A] 'function rc_dev* devm_rc_allocate_device(device*, rc_driver_type)'
  [A] 'function int devm_rc_register_device(device*, rc_dev*)'
  [A] 'function int devm_regmap_field_bulk_alloc(device*, regmap*, regmap_field**, const reg_field*, int)'
  [A] 'function void devm_regulator_unregister_notifier(regulator*, notifier_block*)'
  [A] 'function int devm_rtc_nvmem_register(rtc_device*, nvmem_config*)'
  [A] 'function int dma_fence_signal_timestamp_locked(dma_fence*, ktime_t)'
  [A] 'function void dma_heap_buffer_free(dma_buf*)'
  [A] 'function void dma_run_dependencies(dma_async_tx_descriptor*)'
  [A] 'function int drm_atomic_helper_resume(drm_device*, drm_atomic_state*)'
  [A] 'function drm_atomic_state* drm_atomic_helper_suspend(drm_device*)'
  [A] 'function void drm_atomic_helper_wait_for_vblanks(drm_device*, drm_atomic_state*)'
  [A] 'function void drm_atomic_state_default_release(drm_atomic_state*)'
  [A] 'function int drm_atomic_state_init(drm_device*, drm_atomic_state*)'
  [A] 'function void drm_dp_aux_init(drm_dp_aux*)'
  [A] 'function edid* drm_edid_duplicate(const edid*)'
  [A] 'function int drm_edid_to_sad(edid*, cea_sad**)'
  [A] 'function void drm_framebuffer_cleanup(drm_framebuffer*)'
  [A] 'function drm_framebuffer* drm_framebuffer_lookup(drm_device*, drm_file*, uint32_t)'
  [A] 'function void drm_framebuffer_remove(drm_framebuffer*)'
  [A] 'function bool drm_is_current_master(drm_file*)'
  [A] 'function void drm_kms_helper_poll_disable(drm_device*)'
  [A] 'function void drm_kms_helper_poll_enable(drm_device*)'
  [A] 'function void drm_mode_set_crtcinfo(drm_display_mode*, int)'
  [A] 'function void drm_mode_set_name(drm_display_mode*)'
  [A] 'function em_perf_domain* em_cpu_get(int)'
  [A] 'function int em_dev_register_perf_domain(device*, unsigned int, em_data_callback*, cpumask_t*, bool)'
  [A] 'function int eth_header_cache(const neighbour*, hh_cache*, __be16)'
  [A] 'function void eth_header_cache_update(hh_cache*, const net_device*, const unsigned char*)'
  [A] 'function pid* find_pid_ns(int, pid_namespace*)'
  [A] 'function void for_each_kernel_tracepoint(void (tracepoint*, void*)*, void*)'
  [A] 'function int freq_qos_add_notifier(freq_constraints*, freq_qos_req_type, notifier_block*)'
  [A] 'function int freq_qos_remove_notifier(freq_constraints*, freq_qos_req_type, notifier_block*)'
  [A] 'function int fsg_common_create_luns(fsg_common*, fsg_config*)'
  [A] 'function int fsg_common_set_cdev(fsg_common*, usb_composite_dev*, bool)'
  [A] 'function void fsg_common_set_inquiry_string(fsg_common*, const char*, const char*)'
  [A] 'function void fsg_common_set_sysfs(fsg_common*, bool)'
  [A] 'function void fsg_config_from_params(fsg_config*, const fsg_module_parameters*, unsigned int)'
  [A] 'function bool fwnode_device_is_available(const fwnode_handle*)'
  [A] 'function fwnode_handle* fwnode_graph_get_next_endpoint(const fwnode_handle*, fwnode_handle*)'
  [A] 'function fwnode_handle* fwnode_graph_get_port_parent(const fwnode_handle*)'
  [A] 'function fwnode_handle* fwnode_graph_get_remote_endpoint(const fwnode_handle*)'
  [A] 'function fwnode_handle* fwnode_graph_get_remote_port_parent(const fwnode_handle*)'
  [A] 'function int fwnode_graph_parse_endpoint(const fwnode_handle*, fwnode_endpoint*)'
  [A] 'function int fwnode_property_get_reference_args(const fwnode_handle*, const char*, const char*, unsigned int, unsigned int, fwnode_reference_args*)'
  [A] 'function int fwnode_property_read_u64_array(const fwnode_handle*, const char*, u64*, size_t)'
  [A] 'function int genphy_resume(phy_device*)'
  [A] 'function s32 i2c_smbus_read_i2c_block_data(const i2c_client*, u8, u8, u8*)'
  [A] 'function s32 i2c_smbus_write_i2c_block_data(const i2c_client*, u8, u8, const u8*)'
  [A] 'function s32 i2c_smbus_write_word_data(const i2c_client*, u8, u16)'
  [A] 'function void icc_node_del(icc_node*)'
  [A] 'function void icc_node_destroy(int)'
  [A] 'function iio_poll_func* iio_alloc_pollfunc(typedef irqreturn_t (int, void*)*, typedef irqreturn_t (int, void*)*, int, iio_dev*, const char*, ...)'
  [A] 'function void iio_buffer_init(iio_buffer*)'
  [A] 'function void iio_buffer_put(iio_buffer*)'
  [A] 'function iio_channel* iio_channel_get(device*, const char*)'
  [A] 'function void iio_channel_release(iio_channel*)'
  [A] 'function void iio_dealloc_pollfunc(iio_poll_func*)'
  [A] 'function int iio_device_attach_buffer(iio_dev*, iio_buffer*)'
  [A] 'function int iio_device_id(iio_dev*)'
  [A] 'function int iio_get_channel_type(iio_channel*, iio_chan_type*)'
  [A] 'function s64 iio_get_time_ns(const iio_dev*)'
  [A] 'function int iio_push_to_buffers(iio_dev*, void*)'
  [A] 'function int iio_read_channel_attribute(iio_channel*, int*, int*, iio_chan_info_enum)'
  [A] 'function int iio_read_channel_raw(iio_channel*, int*)'
  [A] 'function void iio_trigger_notify_done(iio_trigger*)'
  [A] 'function int ipv6_skip_exthdr(const sk_buff*, int, u8*, __be16*)'
  [A] 'function int irq_domain_xlate_onetwocell(irq_domain*, device_node*, const u32*, unsigned int, unsigned long int*, unsigned int*)'
  [A] 'function int irq_set_chip(unsigned int, irq_chip*)'
  [A] 'function void irq_work_run()'
  [A] 'function u64 jiffies_64_to_clock_t(u64)'
  [A] 'function kernfs_node* kernfs_find_and_get_ns(kernfs_node*, const char*, void*)'
  [A] 'function void kernfs_notify(kernfs_node*)'
  [A] 'function int kernfs_path_from_node(kernfs_node*, kernfs_node*, char*, size_t)'
  [A] 'function void kernfs_put(kernfs_node*)'
  [A] 'function void ksys_sync_helper()'
  [A] 'function bool kthread_queue_delayed_work(kthread_worker*, kthread_delayed_work*, unsigned long int)'
  [A] 'function int led_get_flash_fault(led_classdev_flash*, u32*)'
  [A] 'function int led_set_brightness_sync(led_classdev*, unsigned int)'
  [A] 'function int led_set_flash_brightness(led_classdev_flash*, u32)'
  [A] 'function int led_set_flash_timeout(led_classdev_flash*, u32)'
  [A] 'function void led_sysfs_disable(led_classdev*)'
  [A] 'function void led_sysfs_enable(led_classdev*)'
  [A] 'function void led_trigger_remove(led_classdev*)'
  [A] 'function int led_update_brightness(led_classdev*)'
  [A] 'function int led_update_flash_brightness(led_classdev_flash*)'
  [A] 'function void linear_range_get_selector_within(const linear_range*, unsigned int, unsigned int*)'
  [A] 'function int linear_range_get_value(const linear_range*, unsigned int, unsigned int*)'
  [A] 'function int match_hex(substring_t*, int*)'
  [A] 'function int match_int(substring_t*, int*)'
  [A] 'function int match_token(char*, const match_token*, substring_t*)'
  [A] 'function mii_bus* mdiobus_alloc_size(size_t)'
  [A] 'function void mdiobus_free(mii_bus*)'
  [A] 'function void mdiobus_unregister(mii_bus*)'
  [A] 'function media_pad* media_entity_remote_pad(const media_pad*)'
  [A] 'function void media_entity_remove_links(media_entity*)'
  [A] 'function media_entity* media_graph_walk_next(media_graph*)'
  [A] 'function void media_graph_walk_start(media_graph*, media_entity*)'
  [A] 'function int media_pipeline_start(media_entity*, media_pipeline*)'
  [A] 'function void media_pipeline_stop(media_entity*)'
  [A] 'function media_request* media_request_get_by_fd(media_device*, int)'
  [A] 'function void media_request_object_complete(media_request_object*)'
  [A] 'function void media_request_put(media_request*)'
  [A] 'function unsigned int mii_check_media(mii_if_info*, unsigned int, unsigned int)'
  [A] 'function int mii_link_ok(mii_if_info*)'
  [A] 'function ssize_t mipi_dsi_dcs_write(mipi_dsi_device*, u8, void*, size_t)'
  [A] 'function ssize_t mipi_dsi_generic_read(mipi_dsi_device*, void*, size_t, void*, size_t)'
  [A] 'function ssize_t mipi_dsi_generic_write(mipi_dsi_device*, void*, size_t)'
  [A] 'function time64_t mktime64(const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int, const unsigned int)'
  [A] 'function bool mmc_can_gpio_cd(mmc_host*)'
  [A] 'function int mmc_cmdq_disable(mmc_card*)'
  [A] 'function int mmc_cmdq_enable(mmc_card*)'
  [A] 'function void mmc_detect_change(mmc_host*, unsigned long int)'
  [A] 'function void mmc_get_card(mmc_card*, mmc_ctx*)'
  [A] 'function void mmc_put_card(mmc_card*, mmc_ctx*)'
  [A] 'function void mmc_set_data_timeout(mmc_data*, const mmc_card*)'
  [A] 'function int mmc_switch(mmc_card*, u8, u8, u8, unsigned int)'
  [A] 'function int mod_timer_pending(timer_list*, unsigned long int)'
  [A] 'function u64 mul_u64_u64_div_u64(u64, u64, u64)'
  [A] 'function int mutex_lock_killable(mutex*)'
  [A] 'function int n_tty_ioctl_helper(tty_struct*, file*, unsigned int, unsigned long int)'
  [A] 'function void neigh_destroy(neighbour*)'
  [A] 'function neighbour* neigh_lookup(neigh_table*, void*, net_device*)'
  [A] 'function void net_selftest(net_device*, ethtool_test*, u64*)'
  [A] 'function int net_selftest_get_count()'
  [A] 'function void net_selftest_get_strings(u8*)'
  [A] 'function void netif_receive_skb_list(list_head*)'
  [A] 'function int nf_register_net_hooks(net*, const nf_hook_ops*, unsigned int)'
  [A] 'function void nf_unregister_net_hooks(net*, const nf_hook_ops*, unsigned int)'
  [A] 'function int nvmem_cell_read_u32(device*, const char*, u32*)'
  [A] 'function nvmem_device* nvmem_device_get(device*, const char*)'
  [A] 'function dma_chan* of_dma_xlate_by_chan_id(of_phandle_args*, of_dma*)'
  [A] 'function backlight_device* of_find_backlight_by_node(device_node*)'
  [A] 'function int of_genpd_add_device(of_phandle_args*, device*)'
  [A] 'function device_node* of_get_parent(const device_node*)'
  [A] 'function int of_irq_to_resource_table(device_node*, resource*, int)'
  [A] 'function int of_remove_property(device_node*, property*)'
  [A] 'function void on_each_cpu_cond_mask(smp_cond_func_t, smp_call_func_t, void*, bool, const cpumask*)'
  [A] 'function page* page_pool_alloc_pages(page_pool*, gfp_t)'
  [A] 'function page_pool* page_pool_create(const page_pool_params*)'
  [A] 'function void page_pool_put_page(page_pool*, page*, unsigned int, bool)'
  [A] 'function int param_get_bool(char*, const kernel_param*)'
  [A] 'function int param_get_charp(char*, const kernel_param*)'
  [A] 'function int param_get_uint(char*, const kernel_param*)'
  [A] 'function int param_get_ulong(char*, const kernel_param*)'
  [A] 'function int param_set_charp(const char*, const kernel_param*)'
  [A] 'function int param_set_uint(const char*, const kernel_param*)'
  [A] 'function int param_set_ulong(const char*, const kernel_param*)'
  [A] 'function pci_power_t pci_choose_state(pci_dev*, pm_message_t)'
  [A] 'function void pcim_iounmap_regions(pci_dev*, int)'
  [A] 'function void phy_attached_info(phy_device*)'
  [A] 'function phy_device* phy_connect(net_device*, const char*, void (net_device*)*, phy_interface_t)'
  [A] 'function void phy_disconnect(phy_device*)'
  [A] 'function int phy_do_ioctl_running(net_device*, ifreq*, int)'
  [A] 'function int phy_ethtool_get_link_ksettings(net_device*, ethtool_link_ksettings*)'
  [A] 'function int phy_ethtool_nway_reset(net_device*)'
  [A] 'function int phy_ethtool_set_link_ksettings(net_device*, const ethtool_link_ksettings*)'
  [A] 'function phy* phy_get(device*, const char*)'
  [A] 'function void phy_print_status(phy_device*)'
  [A] 'function void phy_put(device*, phy*)'
  [A] 'function void phy_start(phy_device*)'
  [A] 'function void phy_stop(phy_device*)'
  [A] 'function int phy_suspend(phy_device*)'
  [A] 'function int pinconf_generic_parse_dt_config(device_node*, pinctrl_dev*, unsigned long int**, unsigned int*)'
  [A] 'function int pinctrl_gpio_direction_input(unsigned int)'
  [A] 'function int pinctrl_gpio_direction_output(unsigned int)'
  [A] 'function void pinctrl_put(pinctrl*)'
  [A] 'function int pinctrl_utils_add_map_configs(pinctrl_dev*, pinctrl_map**, unsigned int*, unsigned int*, const char*, unsigned long int*, unsigned int, pinctrl_map_type)'
  [A] 'function int pinctrl_utils_reserve_map(pinctrl_dev*, pinctrl_map**, unsigned int*, unsigned int*, unsigned int)'
  [A] 'function int platform_get_irq_byname_optional(platform_device*, const char*)'
  [A] 'function int pm_genpd_add_device(generic_pm_domain*, device*)'
  [A] 'function int pm_genpd_remove_device(device*)'
  [A] 'function bool pm_suspend_default_s2idle()'
  [A] 'function void rcu_idle_enter()'
  [A] 'function void rcu_idle_exit()'
  [A] 'function device* rdev_get_dev(regulator_dev*)'
  [A] 'function regmap* rdev_get_regmap(regulator_dev*)'
  [A] 'function irq_domain* regmap_irq_get_domain(regmap_irq_chip_data*)'
  [A] 'function int regulator_list_voltage(regulator*, unsigned int)'
  [A] 'function int regulator_list_voltage_table(regulator_dev*, unsigned int)'
  [A] 'function int regulator_map_voltage_iterate(regulator_dev*, int, int)'
  [A] 'function int regulator_map_voltage_linear_range(regulator_dev*, int, int)'
  [A] 'function int regulator_set_active_discharge_regmap(regulator_dev*, bool)'
  [A] 'function int regulator_set_voltage_time_sel(regulator_dev*, unsigned int, unsigned int)'
  [A] 'function int regulator_sync_voltage(regulator*)'
  [A] 'function void release_pages(page**, int)'
  [A] 'function int reset_controller_register(reset_controller_dev*)'
  [A] 'function void rpmsg_destroy_ept(rpmsg_endpoint*)'
  [A] 'function rtc_time rtc_ktime_to_tm(ktime_t)'
  [A] 'function ktime_t rtc_tm_to_ktime(rtc_time)'
  [A] 'function void sched_clock_register(typedef u64 ()*, int, unsigned long int)'
  [A] 'function int scsi_device_quiesce(scsi_device*)'
  [A] 'function void scsi_print_sense_hdr(const scsi_device*, const char*, const scsi_sense_hdr*)'
  [A] 'function void sdio_claim_host(sdio_func*)'
  [A] 'function int sdio_claim_irq(sdio_func*, sdio_irq_handler_t*)'
  [A] 'function int sdio_disable_func(sdio_func*)'
  [A] 'function int sdio_enable_func(sdio_func*)'
  [A] 'function unsigned char sdio_f0_readb(sdio_func*, unsigned int, int*)'
  [A] 'function void sdio_f0_writeb(sdio_func*, unsigned char, unsigned int, int*)'
  [A] 'function mmc_pm_flag_t sdio_get_host_pm_caps(sdio_func*)'
  [A] 'function u8 sdio_readb(sdio_func*, unsigned int, int*)'
  [A] 'function u32 sdio_readl(sdio_func*, unsigned int, int*)'
  [A] 'function int sdio_readsb(sdio_func*, void*, unsigned int, int)'
  [A] 'function int sdio_register_driver(sdio_driver*)'
  [A] 'function void sdio_release_host(sdio_func*)'
  [A] 'function int sdio_release_irq(sdio_func*)'
  [A] 'function int sdio_set_block_size(sdio_func*, unsigned int)'
  [A] 'function int sdio_set_host_pm_flags(sdio_func*, mmc_pm_flag_t)'
  [A] 'function void sdio_signal_irq(mmc_host*)'
  [A] 'function void sdio_unregister_driver(sdio_driver*)'
  [A] 'function void sdio_writeb(sdio_func*, u8, unsigned int, int*)'
  [A] 'function void sdio_writel(sdio_func*, u32, unsigned int, int*)'
  [A] 'function int sdio_writesb(sdio_func*, unsigned int, void*, int)'
  [A] 'function int send_sig(int, task_struct*, int)'
  [A] 'function int seq_open_private(file*, const seq_operations*, int)'
  [A] 'function void serial8250_do_shutdown(uart_port*)'
  [A] 'function int serial8250_do_startup(uart_port*)'
  [A] 'function uart_8250_port* serial8250_get_port(int)'
  [A] 'function void serial8250_rpm_get(uart_8250_port*)'
  [A] 'function void serial8250_rpm_put(uart_8250_port*)'
  [A] 'function size_t sg_copy_from_buffer(scatterlist*, unsigned int, void*, size_t)'
  [A] 'function size_t sg_copy_to_buffer(scatterlist*, unsigned int, void*, size_t)'
  [A] 'function int snd_card_add_dev_attr(snd_card*, const attribute_group*)'
  [A] 'function void snd_pcm_lib_preallocate_free_for_all(snd_pcm*)'
  [A] 'function void snd_pcm_lib_preallocate_pages_for_all(snd_pcm*, int, void*, size_t, size_t)'
  [A] 'function void snd_soc_component_exit_regmap(snd_soc_component*)'
  [A] 'function int snd_soc_dapm_enable_pin(snd_soc_dapm_context*, const char*)'
  [A] 'function int snd_soc_dapm_get_pin_switch(snd_kcontrol*, snd_ctl_elem_value*)'
  [A] 'function int snd_soc_dapm_info_pin_switch(snd_kcontrol*, snd_ctl_elem_info*)'
  [A] 'function int snd_soc_dapm_new_widgets(snd_soc_card*)'
  [A] 'function int snd_soc_dapm_put_pin_switch(snd_kcontrol*, snd_ctl_elem_value*)'
  [A] 'function int snd_soc_poweroff(device*)'
  [A] 'function int snd_soc_resume(device*)'
  [A] 'function snd_soc_component* snd_soc_rtdcom_lookup(snd_soc_pcm_runtime*, const char*)'
  [A] 'function int spi_delay_to_ns(spi_delay*, spi_transfer*)'
  [A] 'function int sprint_symbol_no_offset(char*, unsigned long int)'
  [A] 'function regmap* syscon_regmap_lookup_by_compatible(const char*)'
  [A] 'function int sysfs_create_bin_file(kobject*, const bin_attribute*)'
  [A] 'function void sysfs_remove_bin_file(kobject*, const bin_attribute*)'
  [A] 'function int timer_of_init(device_node*, timer_of*)'
  [A] 'function void tty_driver_flush_buffer(tty_struct*)'
  [A] 'function void* typec_mux_get_drvdata(typec_mux*)'
  [A] 'function typec_mux* typec_mux_register(device*, const typec_mux_desc*)'
  [A] 'function int typec_mux_set(typec_mux*, typec_mux_state*)'
  [A] 'function void typec_mux_unregister(typec_mux*)'
  [A] 'function int typec_partner_set_identity(typec_partner*)'
  [A] 'function void typec_set_vconn_role(typec_port*, typec_role)'
  [A] 'function void ufshcd_delay_us(unsigned long int, unsigned long int)'
  [A] 'function int ufshcd_hba_enable(ufs_hba*)'
  [A] 'function int ufshcd_link_recovery(ufs_hba*)'
  [A] 'function int ufshcd_make_hba_operational(ufs_hba*)'
  [A] 'function void ufshcd_update_evt_hist(ufs_hba*, u32, u32)'
  [A] 'function int unregister_module_notifier(notifier_block*)'
  [A] 'function int usb_add_config(usb_composite_dev*, usb_configuration*, int (usb_configuration*)*)'
  [A] 'function int usb_composite_probe(usb_composite_driver*)'
  [A] 'function void usb_composite_unregister(usb_composite_driver*)'
  [A] 'function unsigned int usb_decode_interval(const usb_endpoint_descriptor*, usb_device_speed)'
  [A] 'function const char* usb_ep_type_string(int)'
  [A] 'function int usb_gadget_connect(usb_gadget*)'
  [A] 'function int usb_gadget_disconnect(usb_gadget*)'
  [A] 'function int usb_gadget_probe_driver(usb_gadget_driver*)'
  [A] 'function int usb_gadget_set_selfpowered(usb_gadget*)'
  [A] 'function usb_function* usb_get_function(usb_function_instance*)'
  [A] 'function usb_function_instance* usb_get_function_instance(const char*)'
  [A] 'function usb_device_speed usb_get_maximum_speed(device*)'
  [A] 'function usb_dr_mode usb_get_role_switch_default_mode(device*)'
  [A] 'function usb_string* usb_gstrings_attach(usb_composite_dev*, usb_gadget_strings**, unsigned int)'
  [A] 'function config_group* usb_os_desc_prepare_interf_dir(config_group*, int, usb_os_desc**, char**, module*)'
  [A] 'function void usb_put_function(usb_function*)'
  [A] 'function void usb_remove_function(usb_configuration*, usb_function*)'
  [A] 'function const char* usb_role_string(usb_role)'
  [A] 'function usb_role_switch* usb_role_switch_get(device*)'
  [A] 'function int usbnet_change_mtu(net_device*, int)'
  [A] 'function void usbnet_get_drvinfo(net_device*, ethtool_drvinfo*)'
  [A] 'function u32 usbnet_get_link(net_device*)'
  [A] 'function int usbnet_get_link_ksettings_mii(net_device*, ethtool_link_ksettings*)'
  [A] 'function int usbnet_set_link_ksettings_mii(net_device*, const ethtool_link_ksettings*)'
  [A] 'function void usbnet_unlink_rx_urbs(usbnet*)'
  [A] 'function long int v4l2_compat_ioctl32(file*, unsigned int, unsigned long int)'
  [A] 'function v4l2_ctrl* v4l2_ctrl_find(v4l2_ctrl_handler*, u32)'
  [A] 'function s32 v4l2_ctrl_g_ctrl(v4l2_ctrl*)'
  [A] 'function s64 v4l2_ctrl_g_ctrl_int64(v4l2_ctrl*)'
  [A] 'function v4l2_ctrl* v4l2_ctrl_new_std_menu_items(v4l2_ctrl_handler*, const v4l2_ctrl_ops*, u32, u8, u64, u8, const char* const*)'
  [A] 'function int v4l2_ctrl_subdev_subscribe_event(v4l2_subdev*, v4l2_fh*, v4l2_event_subscription*)'
  [A] 'function int v4l2_event_subdev_unsubscribe(v4l2_subdev*, v4l2_fh*, v4l2_event_subscription*)'
  [A] 'function const v4l2_format_info* v4l2_format_info(u32)'
  [A] 'function void v4l2_m2m_resume(v4l2_m2m_dev*)'
  [A] 'function void v4l2_m2m_suspend(v4l2_m2m_dev*)'
  [A] 'function int v4l2_pipeline_link_notify(media_link*, u32, unsigned int)'
  [A] 'function int v4l2_subdev_link_validate(media_link*)'
  [A] 'function int v4l2_subdev_link_validate_default(v4l2_subdev*, media_link*, v4l2_subdev_format*, v4l2_subdev_format*)'
  [A] 'function int vb2_ioctl_prepare_buf(file*, void*, v4l2_buffer*)'
  [A] 'function bool vb2_request_object_is_buffer(media_request_object*)'
  [A] 'function void vb2_request_queue(media_request*)'
  [A] 'function long int wait_for_completion_killable_timeout(completion*, unsigned long int)'
  [A] 'function void wakeup_source_remove(wakeup_source*)'
  [A] 'function long int work_on_cpu(int, long int (void*)*, void*)'
  [A] 'function int zlib_deflateEnd(z_streamp)'

46 Added variables:

  [A] 'tracepoint __tracepoint_android_rvh_commit_creds'
  [A] 'tracepoint __tracepoint_android_rvh_enqueue_task'
  [A] 'tracepoint __tracepoint_android_rvh_exit_creds'
  [A] 'tracepoint __tracepoint_android_rvh_find_busiest_group'
  [A] 'tracepoint __tracepoint_android_rvh_finish_prio_fork'
  [A] 'tracepoint __tracepoint_android_rvh_override_creds'
  [A] 'tracepoint __tracepoint_android_rvh_prepare_prio_fork'
  [A] 'tracepoint __tracepoint_android_rvh_revert_creds'
  [A] 'tracepoint __tracepoint_android_rvh_rtmutex_prepare_setprio'
  [A] 'tracepoint __tracepoint_android_rvh_selinux_avc_insert'
  [A] 'tracepoint __tracepoint_android_rvh_selinux_avc_lookup'
  [A] 'tracepoint __tracepoint_android_rvh_selinux_avc_node_delete'
  [A] 'tracepoint __tracepoint_android_rvh_selinux_avc_node_replace'
  [A] 'tracepoint __tracepoint_android_rvh_selinux_is_initialized'
  [A] 'tracepoint __tracepoint_android_rvh_set_user_nice'
  [A] 'tracepoint __tracepoint_android_rvh_setscheduler'
  [A] 'tracepoint __tracepoint_android_vh_alter_futex_plist_add'
  [A] 'tracepoint __tracepoint_android_vh_alter_rwsem_list_add'
  [A] 'tracepoint __tracepoint_android_vh_binder_transaction_init'
  [A] 'tracepoint __tracepoint_android_vh_cgroup_attach'
  [A] 'tracepoint __tracepoint_android_vh_cgroup_set_task'
  [A] 'tracepoint __tracepoint_android_vh_check_bpf_syscall'
  [A] 'tracepoint __tracepoint_android_vh_check_file_open'
  [A] 'tracepoint __tracepoint_android_vh_check_mmap_file'
  [A] 'tracepoint __tracepoint_android_vh_iommu_iovad_alloc_iova'
  [A] 'tracepoint __tracepoint_android_vh_iommu_iovad_free_iova'
  [A] 'tracepoint __tracepoint_android_vh_is_fpsimd_save'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_init'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_wake'
  [A] 'tracepoint __tracepoint_android_vh_rwsem_write_finished'
  [A] 'tracepoint __tracepoint_android_vh_set_memory_nx'
  [A] 'tracepoint __tracepoint_android_vh_set_memory_rw'
  [A] 'tracepoint __tracepoint_android_vh_set_module_permit_after_init'
  [A] 'tracepoint __tracepoint_android_vh_set_module_permit_before_init'
  [A] 'tracepoint __tracepoint_android_vh_set_wake_flags'
  [A] 'tracepoint __tracepoint_android_vh_syscall_prctl_finished'
  [A] 'tracepoint __tracepoint_task_newtask'
  [A] 'neigh_table arp_tbl'
  [A] 'rwlock_t dev_base_lock'
  [A] 'const font_desc font_vga_8x16'
  [A] 'const char hex_asc[17]'
  [A] 'neigh_table nd_tbl'
  [A] 'bus_type spi_bus_type'
  [A] 'workqueue_struct* system_freezable_power_efficient_wq'
  [A] 'const arch_timer_erratum_workaround* timer_unstable_counter_workaround'
  [A] 'const v4l2_subdev_ops v4l2_subdev_call_wrappers'

1 Added variable symbol not referenced by debug info:

  [A] console_drivers

Bug: 228415386
Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Change-Id: I6bff76e5f2c92465b03ab117de508b7f0eefbd99
2022-04-08 19:28:30 +00:00
Di Shen
12b8ef18b2 ANDROID: thermal: Add vendor hook to get thermal zone device
Need to get temperature data and config info from thermal zone device.

Bug: 208946028

Signed-off-by: Di Shen <di.shen@unisoc.com>
Signed-off-by: Jeson Gao <jeson.gao@unisoc.com>
Change-Id: I5945df5258181b4a441b6bbe09327099491418b3
(cherry picked from commit c53f0e3530)
2022-04-08 18:46:55 +00:00
Visweswara Tanuku
e21b6105a9 ANDROID: tty: serial: msm: geni: Do not access private data when console is disabled
uport private data is not initialized when console is disabled.

Prevent access of private data to avoid null pointer access in
system suspend/resume.

Bug: 228299196
Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
Change-Id: I288a24e2c6bee091fa7c479de520958ea0bb3d17
2022-04-08 15:35:51 +00:00
Jeson Gao
fbe6f8708d ANDROID: thermal: Add hook for cpufreq thermal
Add hook to get cpufreq policy data after registering and unregistering
cpufreq thermal for platform thermal requirement.

Bug: 228423762

Signed-off-by: Jeson Gao <jeson.gao@unisoc.com>
Change-Id: I9c6bc88f348f252c428560427bd8bca91092edfa
2022-04-08 15:20:47 +00:00
Gokul krishna Krishnakumar
3b928fe250 ANDROID: abi_gki_aarch64_qcom: Update qcom abi symbol list
Leaf changes summary: 21 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 17 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 4 Added variables

17 Added functions:

  [A] 'function int devm_regulator_register_notifier(regulator*, notifier_block*)'
  [A] 'function int edac_device_add_device(edac_device_ctl_info*)'
  [A] 'function edac_device_ctl_info* edac_device_alloc_ctl_info(unsigned int, char*, unsigned int, char*, unsigned int, unsigned int, edac_dev_sysfs_block_attribute*, unsigned int, int)'
  [A] 'function int edac_device_alloc_index()'
  [A] 'function edac_device_ctl_info* edac_device_del_device(device*)'
  [A] 'function void edac_device_free_ctl_info(edac_device_ctl_info*)'
  [A] 'function void edac_device_handle_ce_count(edac_device_ctl_info*, unsigned int, int, int, const char*)'
  [A] 'function void edac_device_handle_ue_count(edac_device_ctl_info*, unsigned int, int, int, const char*)'
  [A] 'function void gic_resume()'
  [A] 'function kobject* kset_find_obj(kset*, const char*)'
  [A] 'function void kset_unregister(kset*)'
  [A] 'function void rproc_coredump(rproc*)'
  [A] 'function void rproc_coredump_cleanup(rproc*)'
  [A] 'function char* strreplace(char*, char, char)'
  [A] 'function int ufshcd_uic_hibern8_enter(ufs_hba*)'
  [A] 'function int ufshcd_uic_hibern8_exit(ufs_hba*)'
  [A] 'function const char* usb_decode_ctrl(char*, size_t, __u8, __u8, __u16, __u16, __u16)'

4 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_cpuidle_psci_enter'
  [A] 'tracepoint __tracepoint_android_vh_cpuidle_psci_exit'
  [A] 'tracepoint __tracepoint_android_vh_gic_resume'
  [A] 'tracepoint __tracepoint_android_vh_rproc_recovery'

Bug: 211744078
Change-Id: I73a7ac503ba70ad7d8243bcfe573be7db3ee66a5
Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
2022-04-08 15:18:07 +00:00
Quentin Perret
0957aec081 ANDROID: KVM: arm64: Fix ToCToU issue when refilling the hyp memcache
Xiling reports that the hypervisor dereferences the host memcache struct
twice when refilling its own memcache. This allows the host to change its
memcache head after it has been admitted and before it is consumed,
leading to an arbitrary write in hypervisor memory.

Fix this by copying the host memcache on the stack before starting to
refill hence guaranteeing its stability.

Bug: 228435321
Reported-by: Xiling Gong <xiling@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Ib7c5db203e4a4a7f27eb9f0c0083f4b5c726b4d9
2022-04-08 12:35:02 +00:00
Gaofeng Sheng
7b084e6135 ANDROID: GKI: drm: add vendor hook for drm_atomic_helper_check_modeset
Just mode changed no need to display previous planes. Deleted by SPRD
for HWC SR function. There is no need to add all old planes for sprd drm
according to plane mask. Because the dpu driver will display extra
planes which reduce display abnormal.

Bug: 227721498
Signed-off-by: Gaofeng Sheng <gaofeng.sheng@unisoc.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I47048e430d2b2605b9111b6c9ee4958443dc7239
2022-04-07 23:11:29 +00:00
Gaofeng Sheng
a63a546b89 ANDROID: GKI: drm: add vendor hook for atomic_remove_fb
Deleted by SPRD for HWC performance. There is no need to
disable old planes for sprd drm. Because the dpu driver
will clean all the planes first before flip each time.

Bug: 227721498
Signed-off-by: Gaofeng Sheng <gaofeng.sheng@unisoc.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I81275ae86064d0b30163be17bce266120c90b130
2022-04-07 20:37:32 +00:00
Mathias Nyman
4e891ae8aa UPSTREAM: xhci: make xhci_handshake timeout for xhci_reset() adjustable
xhci_reset() timeout was increased from 250ms to 10 seconds in order to
give Renesas 720201 xHC enough time to get ready in probe.

xhci_reset() is called with interrupts disabled in other places, and
waiting for 10 seconds there is not acceptable.

Add a timeout parameter to xhci_reset(), and adjust it back to 250ms
when called from xhci_stop() or xhci_shutdown() where interrupts are
disabled, and successful reset isn't that critical.
This solves issues when deactivating host mode on platforms like SM8450.

For now don't change the timeout if xHC is reset in xhci_resume().
No issues are reported for it, and we need the reset to succeed.
Locking around that reset needs to be revisited later.

Additionally change the signed integer timeout parameter in
xhci_handshake() to a u64 to match the timeout value we pass to
readl_poll_timeout_atomic()

Fixes: 22ceac1912 ("xhci: Increase reset timeout for Renesas 720201 host.")
Cc: stable@vger.kernel.org
Reported-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Reported-by: Pavan Kondeti <quic_pkondeti@quicinc.com>
Tested-by: Pavan Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220303110903.1662404-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 14073ce951)
Bug: 218973924
Change-Id: I52c45bcdd5b19e7c905a1d91859887d55e8dc9d5
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2022-04-07 20:32:10 +00:00
Wei.Chen
7c380c0057 ANDROID: Add vendor hook to support audio usb offload
android_vh_audio_usb_offload_vendor_set:
	To set vendor data, used in sound/usb/card.c
android_vh_audio_usb_offload_ep_action:
	To start/stop offload ep, used in sound/usb/endpoiont.c
android_vh_audio_usb_offload_synctype:
	To ignore specific synctype usb device, used in sound/usb/pcm.c

Bug: 228276284
Test: build pass

Signed-off-by: Wei Chen <wei.chen3@unisoc.com>
Change-Id: I121ece1fee1934366c0b3b91b4f035ffac35d555
2022-04-07 19:30:41 +00:00
Greg Kroah-Hartman
0a77fca3aa ANDROID: GKI: set vfs-only exports into their own namespace
We have namespaces, so use them for all vfs-exported namespaces so that
filesystems can use them, but not anything else.

Some in-kernel drivers that do direct filesystem accesses (because they
serve up files) are also allowed access to these symbols to keep 'make
allmodconfig' builds working properly, but it is not needed for Android
kernel images.

Bug: 157965270
Bug: 210074446
Cc: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iaf6140baf3a18a516ab2d5c3966235c42f3f70de
2022-04-07 15:14:24 +02:00
David Brazdil
8b304ef274 ANDROID: KVM: arm64: iommu: Optimize snapshot_host_stage2
Currently the generic IOMMU code lets the driver initialize its PT and
then invokes callbacks to set the permissions across the entire PA
range. Optimize this by making it a requirement on the driver to
initialize its PTs to all memory owned by the host. snapshot_host_stage2
then only calls the driver's callback for memory regions not owned by
the host.

Bug: 190463801
Bug: 218012133
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I51ff38cb4f4e28e19903af942776b401504c363e
2022-04-07 13:56:59 +01:00
David Brazdil
b8a31a6030 ANDROID: KVM: arm64: s2mpu: Initialize MPTs to PROT_RW
Change the permissions that MPTs are initialized with from PROT_NONE to
PROT_RW. No functional change intended as the generic IOMMU code
sets permissions for the entire address space later. This will allow to
optimize boot time by only unmapping pages not available to host.

Bug: 190463801
Bug: 218012133
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: Ic29ec690a84cde22a2ce8fe33e7127711c6f0f3e
2022-04-07 13:56:59 +01:00
David Brazdil
58f8121600 ANDROID: KVM: arm64: iommu: Fix upper bound of PT walk
The second argument of the kvm_pgtable_walker callback was
misinterpreted as the end of the current entry, where in fact it is
the end of the walked memory region. Fix this by computing the end of
the current entry from the start and the level.

This did not affect correctness, as the code iterates linarly over
the entire address space, but it did affect boot time.

Bug: 190463801
Bug: 218012133
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I6d189b87645f47cd215a783c1bc9e1f032ff8c62
2022-04-07 13:56:59 +01:00
Greg Kroah-Hartman
ee6a26ce2c FROMLIST: export: fix string handling of namespace in EXPORT_SYMBOL_NS
Commit c3a6cf19e6 ("export: avoid code duplication in
include/linux/export.h") broke the ability for a defined string to be
used as a namespace value.  Fix this up by adding another layer of
indirection to preserve the previous functionality.

Fixes: c3a6cf19e6 ("export: avoid code duplication in include/linux/export.h")
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20220108140415.3360088-1-gregkh@linuxfoundation.org
Bug: 210074446
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ie43aa24f64b55cd1d70161c906b0ef32610430aa
2022-04-07 12:25:11 +02:00
Greg Kroah-Hartman
8a901b0051 UPSTREAM: module.h: allow #define strings to work with MODULE_IMPORT_NS
The MODULE_IMPORT_NS() macro does not allow defined strings to work
properly with it, so add a layer of indirection to allow this to happen.

Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Matthias Maennich <maennich@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
(cherry picked from commit ca321ec743)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ibd64ba139912ea10e81ac22490831129b23a31e1
2022-04-07 12:25:11 +02:00
Wesley Cheng
ef6a831b6d UPSTREAM: usb: dwc3: gadget: Avoid starting DWC3 gadget during UDC unbind
There is a race present where the DWC3 runtime resume runs in parallel
to the UDC unbind sequence.  This will eventually lead to a possible
scenario where we are enabling the run/stop bit, without a valid
composition defined.

Thread#1 (handling UDC unbind):
usb_gadget_remove_driver()
-->usb_gadget_disconnect()
  -->dwc3_gadget_pullup(0)
--> continue UDC unbind sequence
-->Thread#2 is running in parallel here

Thread#2 (handing next cable connect)
__dwc3_set_mode()
  -->pm_runtime_get_sync()
    -->dwc3_gadget_resume()
      -->dwc->gadget_driver is NOT NULL yet
      -->dwc3_gadget_run_stop(1)
      --> _dwc3gadget_start()
...

Fix this by tracking the pullup disable routine, and avoiding resuming
of the DWC3 gadget.  Once the UDC is re-binded, that will trigger the
pullup enable routine, which would handle enabling the DWC3 gadget.

Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Link: https://lore.kernel.org/r/20210917021852.2037-1-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 200287549
(cherry picked from commit 8217f07a50)
Change-Id: Ie7d378c5ae5637cca10f254fa403ef2cd3af7d50
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2022-04-06 20:07:31 -07:00
Yunfei Wang
7bf263ef84 FROMGIT: iommu/iova: Improve 32-bit free space estimate
For various reasons based on the allocator behaviour and typical
use-cases at the time, when the max32_alloc_size optimisation was
introduced it seemed reasonable to couple the reset of the tracked
size to the update of cached32_node upon freeing a relevant IOVA.
However, since subsequent optimisations focused on helping genuine
32-bit devices make best use of even more limited address spaces, it
is now a lot more likely for cached32_node to be anywhere in a "full"
32-bit address space, and as such more likely for space to become
available from IOVAs below that node being freed.

At this point, the short-cut in __cached_rbnode_delete_update() really
doesn't hold up any more, and we need to fix the logic to reliably
provide the expected behaviour. We still want cached32_node to only move
upwards, but we should reset the allocation size if *any* 32-bit space
has become available.

Reported-by: Yunfei Wang <yf.wang@mediatek.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Link: https://lore.kernel.org/r/033815732d83ca73b13c11485ac39336f15c3b40.1646318408.git.robin.murphy@arm.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>

Bug: 223712131
(cherry picked from commit 5b61343b50
 https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git core)
Signed-off-by: Yunfei Wang <yf.wang@mediatek.com>
Change-Id: I5026411dd022c6ddea5c0e4da6e69c7b14162c3f
(cherry picked from commit ec48b1892e)
2022-04-06 21:24:11 +00:00
Todd Kjos
0577882f78 ANDROID: GKI: 4/4/2022 KMI update
Set KMI_GENERATION=3 for 4/6 KMI update

Leaf changes summary: 3064 artifacts changed
Changed leaf types summary: 5 leaf types changed
Removed/Changed/Added functions summary: 11 Removed, 2960 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 88 Changed, 0 Added variable

11 Removed functions:

  [D] 'function void rndis_deregister(rndis_params*)'
  [D] 'function void rndis_free_response(rndis_params*, u8*)'
  [D] 'function u8* rndis_get_next_response(rndis_params*, u32*)'
  [D] 'function int rndis_msg_parser(rndis_params*, u8*)'
  [D] 'function rndis_params* rndis_register(void (void*)*, void*)'
  [D] 'function void rndis_set_host_mac(rndis_params*, const u8*)'
  [D] 'function int rndis_set_param_dev(rndis_params*, net_device*, u16*)'
  [D] 'function int rndis_set_param_medium(rndis_params*, u32, u32)'
  [D] 'function int rndis_set_param_vendor(rndis_params*, u32, const char*)'
  [D] 'function int rndis_signal_connect(rndis_params*)'
  [D] 'function void rndis_uninit(rndis_params*)'

2960 functions with some sub-type change:

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

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

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

  ... 2957 omitted; 2960 symbols have only CRC changes

88 Changed variables:

  [C] 'pglist_data contig_page_data' was changed at memblock.c:96:1:
    size of symbol changed from 5632 to 5760
    CRC (modversions) changed from 0xafbdb526 to 0x42a6e924
    type of variable changed:
      type size changed from 45056 to 46080 (in bits)
      1 data member insertion:
        'task_struct* mkswapd[16]', at offset 39680 (in bits) at mmzone.h:848:1
      there are data member changes:
        16 ('int kswapd_order' .. 'atomic_long_t vm_stat[40]') offsets changed (by +1024 bits)
      3276 impacted interfaces

  [C] 'rq runqueues' was changed at core.c:49:1:
    size of symbol changed from 4160 to 4416
    CRC (modversions) changed from 0x3be19baa to 0x6043515f
    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)
        65 ('cfs_rq cfs' .. 'u64 android_vendor_data1[96]') offsets changed (by +2048 bits)
      3276 impacted interfaces

  [C] 'tracepoint __tracepoint_android_vh_aes_decrypt' was changed at fips140.h:40:1:
    CRC (modversions) changed from 0xde5b1cc7 to 0x64eaf879

  [C] 'tracepoint __tracepoint_android_vh_aes_encrypt' was changed at fips140.h:33:1:
    CRC (modversions) changed from 0x10f648a3 to 0x85db9ebb

  [C] 'tracepoint __tracepoint_android_vh_aes_expandkey' was changed at fips140.h:26:1:
    CRC (modversions) changed from 0xf7274615 to 0x71396455

  ... 83 omitted; 86 symbols have only CRC changes

'struct pglist_data at mmzone.h:800:1' changed:
  details were reported earlier

'struct rq at sched.h:931:1' changed:
  details were reported earlier

'struct snd_pcm_runtime at pcm.h:344:1' changed:
  type size changed from 6144 to 6400 (in bits)
  1 data member insertion:
    'mutex buffer_mutex', at offset 2752 (in bits) at pcm.h:401:1
  there are data member changes:
    14 ('void* private_data' .. 'timespec64 driver_tstamp') offsets changed (by +256 bits)
  68 impacted interfaces

'struct uclamp_rq at sched.h:916: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
  3276 impacted interfaces

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

Bug: 228318757
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I72e72f07f1d6c95ecca451925d8aaf017db2d404
2022-04-06 08:55:02 -07:00
Quentin Perret
d95c0652de Revert "Revert "ANDROID: GKI: Change UCLAMP_BUCKETS_COUNT to 20""
This reverts commit 39111fc404.
The bug in uclamp has now been fixed, we can switch back to 20 buckets.

Bug: 186415778
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I4b780e45398318e70cd1ce6e0dcebed45747bdf1
(cherry picked from commit 70094f39c7)
2022-04-06 08:31:37 -07:00
Saravana Kannan
0ef21e1c1a ANDROID: vendor_hooks: Reduce pointless modversions CRC churn
When vendor hooks are added to a file that previously didn't have any
vendor hooks, we end up indirectly including linux/tracepoint.h.  This
causes some data types that used to be opaque (forward declared) to the
code to become visible to the code.

Modversions correctly catches this change in visibility, but we don't
really care about the data types made visible when linux/tracepoint.h is
included. So, hide this from modversions in the central vendor_hooks.h file
instead of having to fix this on a case by case basis.

This change itself will cause a one time CRC breakage/churn because it's
fixing the existing vendor hook headers, but should reduce unnecessary CRC
churns in the future.

To avoid future pointless CRC churn, vendor hook header files that include
vendor_hooks.h should not include linux/tracepoint.h directly.

Bug: 227513263
Bug: 226140073
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: Ia88e6af11dd94fe475c464eb30a6e5e1e24c938b
2022-04-06 08:31:36 -07:00
Charan Teja Reddy
d831f07038 ANDROID: vmscan: Support multiple kswapd threads per node
Page replacement is handled in the Linux Kernel in one of two ways:

1) Asynchronously via kswapd
2) Synchronously, via direct reclaim

At page allocation time the allocating task is immediately given a page
from the zone free list allowing it to go right back to work doing
whatever it was doing; Probably directly or indirectly executing business
logic.

Just prior to satisfying the allocation, free pages is checked to see if
it has reached the zone low watermark and if so, kswapd is awakened.
Kswapd will start scanning pages looking for inactive pages to evict to
make room for new page allocations. The work of kswapd allows tasks to
continue allocating memory from their respective zone free list without
incurring any delay.

When the demand for free pages exceeds the rate that kswapd tasks can
supply them, page allocation works differently. Once the allocating task
finds that the number of free pages is at or below the zone min watermark,
the task will no longer pull pages from the free list. Instead, the task
will run the same CPU-bound routines as kswapd to satisfy its own
allocation by scanning and evicting pages. This is called a direct reclaim.

The time spent performing a direct reclaim can be substantial, often
taking tens to hundreds of milliseconds for small order0 allocations to
half a second or more for order9 huge-page allocations. In fact, kswapd is
not actually required on a linux system. It exists for the sole purpose of
optimizing performance by preventing direct reclaims.

When memory shortfall is sufficient to trigger direct reclaims, they can
occur in any task that is running on the system. A single aggressive
memory allocating task can set the stage for collateral damage to occur in
small tasks that rarely allocate additional memory. Consider the impact of
injecting an additional 100ms of latency when nscd allocates memory to
facilitate caching of a DNS query.

The presence of direct reclaims 10 years ago was a fairly reliable
indicator that too much was being asked of a Linux system. Kswapd was
likely wasting time scanning pages that were ineligible for eviction.
Adding RAM or reducing the working set size would usually make the problem
go away. Since then hardware has evolved to bring a new struggle for
kswapd. Storage speeds have increased by orders of magnitude while CPU
clock speeds stayed the same or even slowed down in exchange for more
cores per package. This presents a throughput problem for a single
threaded kswapd that will get worse with each generation of new hardware.

Test Details

NOTE: The tests below were run with shadow entries disabled. See the
associated patch and cover letter for details

The tests below were designed with the assumption that a kswapd bottleneck
is best demonstrated using filesystem reads. This way, the inactive list
will be full of clean pages, simplifying the analysis and allowing kswapd
to achieve the highest possible steal rate. Maximum steal rates for kswapd
are likely to be the same or lower for any other mix of page types on the
system.

Tests were run on a 2U Oracle X7-2L with 52 Intel Xeon Skylake 2GHz cores,
756GB of RAM and 8 x 3.6 TB NVMe Solid State Disk drives. Each drive has
an XFS file system mounted separately as /d0 through /d7. SSD drives
require multiple concurrent streams to show their potential, so I created
eleven 250GB zero-filled files on each drive so that I could test with
parallel reads.

The test script runs in multiple stages. At each stage, the number of dd
tasks run concurrently is increased by 2. I did not include all of the
test output for brevity.

During each stage dd tasks are launched to read from each drive in a round
robin fashion until the specified number of tasks for the stage has been
reached. Then iostat, vmstat and top are started in the background with 10
second intervals. After five minutes, all of the dd tasks are killed and
the iostat, vmstat and top output is parsed in order to report the
following:

CPU consumption
- sy - aggregate kernel mode CPU consumption from vmstat output. The value
       doesn't tend to fluctuate much so I just grab the highest value.
       Each sample is averaged over 10 seconds
- dd_cpu - for all of the dd tasks averaged across the top samples since
           there is a lot of variation.

Throughput
- in Kbytes
- Command is iostat -x -d 10 -g total

This first test performs reads using O_DIRECT in order to show the maximum
throughput that can be obtained using these drives. It also demonstrates
how rapidly throughput scales as the number of dd tasks are increased.

The dd command for this test looks like this:

Command Used: dd iflag=direct if=/d${i}/$n of=/dev/null bs=4M

Test #1: Direct IO
dd sy dd_cpu throughput
6  0  2.33   14726026.40
10 1  2.95   19954974.80
16 1  2.63   24419689.30
22 1  2.63   25430303.20
28 1  2.91   26026513.20
34 1  2.53   26178618.00
40 1  2.18   26239229.20
46 1  1.91   26250550.40
52 1  1.69   26251845.60
58 1  1.54   26253205.60
64 1  1.43   26253780.80
70 1  1.31   26254154.80
76 1  1.21   26253660.80
82 1  1.12   26254214.80
88 1  1.07   26253770.00
90 1  1.04   26252406.40

Throughput was close to peak with only 22 dd tasks. Very little system CPU
was consumed as expected as the drives DMA directly into the user address
space when using direct IO.

In this next test, the iflag=direct option is removed and we only run the
test until the pgscan_kswapd from /proc/vmstat starts to increment. At
that point metrics are parsed and reported and the pagecache contents are
dropped prior to the next test. Lather, rinse, repeat.

Test #2: standard file system IO, no page replacement
dd sy dd_cpu throughput
6  2  28.78  5134316.40
10 3  31.40  8051218.40
16 5  34.73  11438106.80
22 7  33.65  14140596.40
28 8  31.24  16393455.20
34 10 29.88  18219463.60
40 11 28.33  19644159.60
46 11 25.05  20802497.60
52 13 26.92  22092370.00
58 13 23.29  22884881.20
64 14 23.12  23452248.80
70 15 22.40  23916468.00
76 16 22.06  24328737.20
82 17 20.97  24718693.20
88 16 18.57  25149404.40
90 16 18.31  25245565.60

Each read has to pause after the buffer in kernel space is populated while
those pages are added to the pagecache and copied into the user address
space. For this reason, more parallel streams are required to achieve peak
throughput. The copy operation consumes substantially more CPU than direct
IO as expected.

The next test measures throughput after kswapd starts running. This is the
same test only we wait for kswapd to wake up before we start collecting
metrics. The script actually keeps track of a few things that were not
mentioned earlier. It tracks direct reclaims and page scans by watching
the metrics in /proc/vmstat. CPU consumption for kswapd is tracked the
same way it is tracked for dd.

Since the test is 100% reads, you can assume that the page steal rate for
kswapd and direct reclaims is almost identical to the scan rate.

Test #3: 1 kswapd thread per node
dd sy dd_cpu kswapd0 kswapd1 throughput  dr    pgscan_kswapd pgscan_direct
10 4  26.07  28.56   27.03   7355924.40  0     459316976     0
16 7  34.94  69.33   69.66   10867895.20 0     872661643     0
22 10 36.03  93.99   99.33   13130613.60 489   1037654473    11268334
28 10 30.34  95.90   98.60   14601509.60 671   1182591373    15429142
34 14 34.77  97.50   99.23   16468012.00 10850 1069005644    249839515
40 17 36.32  91.49   97.11   17335987.60 18903 975417728     434467710
46 19 38.40  90.54   91.61   17705394.40 25369 855737040     582427973
52 22 40.88  83.97   83.70   17607680.40 31250 709532935     724282458
58 25 40.89  82.19   80.14   17976905.60 35060 657796473     804117540
64 28 41.77  73.49   75.20   18001910.00 39073 561813658     895289337
70 33 45.51  63.78   64.39   17061897.20 44523 379465571     1020726436
76 36 46.95  57.96   60.32   16964459.60 47717 291299464     1093172384
82 39 47.16  55.43   56.16   16949956.00 49479 247071062     1134163008
88 42 47.41  53.75   47.62   16930911.20 51521 195449924     1180442208
90 43 47.18  51.40   50.59   16864428.00 51618 190758156     1183203901

In the previous test where kswapd was not involved, the system-wide kernel
mode CPU consumption with 90 dd tasks was 16%. In this test CPU consumption
with 90 tasks is at 43%. With 52 cores, and two kswapd tasks (one per NUMA
node), kswapd can only be responsible for a little over 4% of the increase.
The rest is likely caused by 51,618 direct reclaims that scanned 1.2
billion pages over the five minute time period of the test.

Same test, more kswapd tasks:

Test #4: 4 kswapd threads per node
dd sy dd_cpu kswapd0 kswapd1 throughput  dr    pgscan_kswapd pgscan_direct
10 5  27.09  16.65   14.17   7842605.60  0     459105291     0
16 10 37.12  26.02   24.85   11352920.40 15    920527796     358515
22 11 36.94  37.13   35.82   13771869.60 0     1132169011     0
28 13 35.23  48.43   46.86   16089746.00 0     1312902070     0
34 15 33.37  53.02   55.69   18314856.40 0     1476169080     0
40 19 35.90  69.60   64.41   19836126.80 0     1629999149     0
46 22 36.82  88.55   57.20   20740216.40 0     1708478106     0
52 24 34.38  93.76   68.34   21758352.00 0     1794055559     0
58 24 30.51  79.20   82.33   22735594.00 0     1872794397     0
64 26 30.21  97.12   76.73   23302203.60 176   1916593721     4206821
70 33 32.92  92.91   92.87   23776588.00 3575  1817685086     85574159
76 37 31.62  91.20   89.83   24308196.80 4752  1812262569     113981763
82 29 25.53  93.23   92.33   24802791.20 306   2032093122     7350704
88 43 37.12  76.18   77.01   25145694.40 20310 1253204719     487048202
90 42 38.56  73.90   74.57   22516787.60 22774 1193637495     545463615

By increasing the number of kswapd threads, throughput increased by ~50%
while kernel mode CPU utilization decreased or stayed the same, likely due
to a decrease in the number of parallel tasks at any given time doing page
replacement.

Signed-off-by: Buddy Lumpkin <buddy.lumpkin@oracle.com>
Bug: 201263306
Link: https://lore.kernel.org/lkml/1522661062-39745-1-git-send-email-buddy.lumpkin@oracle.com
[charante@codeaurora.org]: Changes made to select number of kswapds through uapi
Change-Id: I8425cab7f40cbeaf65af0ea118c1a9ac7da0930e
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
[quic_vjitta@quicinc.com]: Changes made to move multiple kswapd threads logic to vendor hooks
Signed-off-by: Vijayanand Jitta <quic_vjitta@quicinc.com>
(cherry picked from commit 0d61a651e4)
2022-04-06 08:31:35 -07:00
Greg Kroah-Hartman
e82eff62b1 Revert "Revert "ALSA: pcm: Fix races among concurrent prealloc proc writes""
This reverts commit 07566786dc.

It fixes CVE-2022-1048 and it had to originally be reverted due to ABI
issues.  Add it back now as the ABI "break" is allowed and we want to
fix this real problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2989057ebdab8269c2f98702a9afb01d4814285b
2022-04-06 08:31:34 -07:00
Greg Kroah-Hartman
a9ac889b4c Revert "Revert "ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls""
This reverts commit f9e40dc812.

It fixes CVE-2022-1048 and it had to originally be reverted due to ABI
issues.  Add it back now as the ABI "break" is allowed and we want to
fix this real problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ife1c36ac31c25f77aab42b7d96e9552d4acc3184
2022-04-06 08:31:34 -07:00
Greg Kroah-Hartman
750d586555 Revert "Revert "ALSA: pcm: Fix races among concurrent read/write and buffer changes""
This reverts commit 9f368dfefd.

It fixes CVE-2022-1048 and it had to originally be reverted due to ABI
issues.  Add it back now as the ABI "break" is allowed and we want to
fix this real problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I00cdc5c3d932a882ec759f455024a3e14d311032
2022-04-06 08:31:33 -07:00
Greg Kroah-Hartman
ebe4f5f49f Revert "Revert "ALSA: pcm: Fix races among concurrent hw_params and hw_free calls""
This reverts commit 162cbdd807.

It fixes CVE-2022-1048 and it had to originally be reverted due to ABI
issues.  Add it back now as the ABI "break" is allowed and we want to
fix this real problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I230096f0f827d4a49b0574a5cf27667ef132d5d9
2022-04-06 08:31:32 -07:00
Greg Kroah-Hartman
0ea619fbd3 ANDROID: GKI: disable rndis USB gadget driver
It's obsolete and only works for unsupported Windows hosts and is
totally insecure and should never be used.  Remove it in order to remove
a potential attack vector on Android systems.

NCM is a much better interface to use and it also works on other
operating system hosts.

Bug: 157965270
Bug: 226303025
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I45acc8b894220cdc9f170f9d5428aca195e9af38
2022-04-06 08:31:31 -07:00
weidong guan
5168caa32a ANDROID: Add vendor hook for tk_based_time_sync
android_rvh_tk_based_time_sync:
	to get vendor-specific time sync func

Bug: 223950152
Test: build pass

Signed-off-by: weidong guan <weidong.guan@unisoc.com>
Change-Id: I4c540e077668bff548c55d4afba3a7bd6725497e
2022-04-06 08:31:30 -07:00
Marc Zyngier
d35bf8afbf ANDROID: KVM: arm64: pkvm: Track the SVE state in the shadow vcpu
When dealing with a guest with SVE enabled, we don't populate
the shadow SVE state, nor pin the SVE state at S1 EL2.

Fix both issues in one go.

Bug: 227292021
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Marc Zyngier <mzyngier@google.com>
Change-Id: I88dc7e9c84e5970ec2466a0aa98ad4e3c94711a0
2022-04-06 10:12:44 +00:00
Marc Zyngier
0b9114c308 ANDROID: KVM: arm64: Make the use of host or shadow vcpu less error prone
It isn't always obvious what vcpu (host or shadow) should be used
in which context, nor whether the provided vcpu is valid or not.

To make this less error prone, provide a helper that will always
return a vcpu in the HYP address space as well as the corresponding
shadow state if we're in protected mode. If the host-provided vcpu
doesn't match the loaded vcpu, NULL is returned for both pointers.

In non-protected mode, no state is provided, of course, but the vcpu
is converted to its HYP pointer.

Bug: 227292021
Bug: 227768863
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Marc Zyngier <mzyngier@google.com>
Change-Id: Idcfc4e042ff05d97ae52f7991666935c1c570f10
2022-04-06 10:12:36 +00:00
Nick Desaulniers
44d0f0db58 ANDROID: configs: enable UAPI_HEADER_TEST
Now that we have a bionic based sysroot available from the NDK, we can
build the header tests.

Bug: 190019968
Change-Id: I661851b1215fa75e39bd0874bf777299b73fe12e
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2022-04-05 17:31:52 -07:00
Nick Desaulniers
14f39157c9 ANDROID: build.config: set NDK_TRIPLE
In order to support CONFIG_UAPI_HEADER_TEST=y with a bionic sysroot
using prebuilt bionic from the NDK, we need to set a different target
triple for USERCFLAGS than what's used when cross compiling the kernel
(so that the correct headers and libc.{a|so} are found+used).

Bug: 190019968
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: Ib3e60c41b862cda9f79ff8d2c812aaa8bfb571af
2022-04-05 17:31:51 -07:00
Nick Desaulniers
7321041909 ANDROID: disable SAMPLES and BPFILTER for allmodconfigs
These aren't portable yet when building with a Bionic based sysroot.

Disable building them for now so that we can land support for
UAPI_HEADER_TEST.

Bug: 190019968
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Change-Id: Ice3d3c55bbf79dd08265f168e49e2058231c181d
2022-04-05 17:31:51 -07:00
Nick Desaulniers
51a926e914 FROMLIST: net, uapi: remove inclusion of arpa/inet.h
In include/uapi/linux/tipc_config.h, there's a comment that it includes
arpa/inet.h for ntohs; but ntohs is not defined in any UAPI header. For
now, reuse the definitions from include/linux/byteorder/generic.h, since
the various conversion functions do exist in UAPI headers:
include/uapi/linux/byteorder/big_endian.h
include/uapi/linux/byteorder/little_endian.h

We would like to get to the point where we can build UAPI header tests
with -nostdinc, meaning that kernel UAPI headers should not have a
circular dependency on libc headers.

Link: https://android-review.googlesource.com/c/platform/bionic/+/2048127
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/netdev/20220404175448.46200-1-ndesaulniers@google.com/
Bug: 190019968
Change-Id: I5c45248fb88f03024da809b503ff3b9cd4ed66a9
2022-04-05 17:31:51 -07:00
Masahiro Yamada
e6cb41be83 UPSTREAM: kbuild: add --target to correctly cross-compile UAPI headers with Clang
When you compile-test UAPI headers (CONFIG_UAPI_HEADER_TEST=y) with
Clang, they are currently compiled for the host target (likely x86_64)
regardless of the given ARCH=.

In fact, some exported headers include libc headers. For example,
include/uapi/linux/agpgart.h includes <stdlib.h> after being exported.
The header search paths should match to the target we are compiling
them for.

Pick up the --target triple from KBUILD_CFLAGS in the same ways as
commit 7f58b487e9 ("kbuild: make Clang build userprogs for target
architecture").

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Bug: 190019968
Change-Id: I9f4867b4fc1d0c4cf1af2bb3d6f53c3a8a8f4437
(cherry picked from commit 9fbed27a7a)
2022-04-05 17:31:51 -07:00
Shiraz Hashim
d9f210a14d ANDROID: kunit: Provision kunit as a vendor module
'kunit_test' member variable in task_struct is defined
under CONFIG_KUNIT. Besides there are supportive functions
in slub and kasan which gets conditionally compiled out.

Allow kunit to be build as vendor module by removing
compile time dependencies.

Bug: 215096354
Change-Id: If57b1df6e479aa0388aabc53af5ae10e20a844b2
Signed-off-by: Shiraz Hashim <quic_shashim@quicinc.com>
2022-04-05 16:52:37 +00:00
David Brazdil
e8bca85bc1 ANDROID: Update the ABI symbol list
Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 2 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

2 Added functions:

  [A] 'function int pkvm_iommu_finalize()'
  [A] 'function int pkvm_iommu_sysmmu_sync_register(device*, phys_addr_t, device*)'

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: Ibc7bf50b9b68c0334ea786b603f40c04b8ccea5b
2022-04-05 12:56:22 +01:00
David Brazdil
6c8043376f ANDROID: Add new pkvm_iommu_* functions to aarch64 ABI
Add two new symbols to aarch64 kernel ABI:
  * pkvm_iommu_sysmmu_sync_register
  * pkvm_iommu_finalize

The former allows vendor modules to register a SYSMMU_SYNC device with
the hypervisor, and the latter tells the hypervisor to stop acception
new device registrations.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I6c6948d94cb6494f07d52b4e2b7e91db40e2fcd6
2022-04-05 11:37:29 +01:00
David Brazdil
d2e71e529b ANDROID: KVM: arm64: iommu: Add pkvm_iommu_finalize
Add new hypercall that the host can use to inform the hypervisor that
all hypervisor-controlled IOMMUs have been registered and no new
registrations should be allowed. This will typically be called at the
end of kernel module initialization phase.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I8c175310d5b262a67947443c5a0154056a8ebf3e
2022-04-05 11:37:28 +01:00
David Brazdil
2c05ff981a ANDROID: KVM: arm64: iommu: No powered check in DABT handler
The IOMMU DABT handler currently checks if the device is considered
powered by hyp before resolving the request. If the power tracking does
not reflect reality, the IOMMU may trigger issues in the host but the
incorrect state prevents it from diagnosing the issue.

Drop the powered check from the generic IOMMU code. The host accessing
the device's SFR means that it assumes it is powered, and individual
drivers can choose to reject that DABT request.

Bug: 224891559
Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I1c132c4030a61a90be4675867c9658e3bc696118
2022-04-05 11:37:16 +01:00
David Brazdil
611c9a2a4a ANDROID: KVM: arm64: s2mpu: Create SysMMU_SYNC driver
SysMMU_SYNC devices expose an interface to start a sync counter and
poll its SFR until the device signals that all memory transactions in
flight at the start have drained. This gives the hypervisor a reliable
indicator that S2MPU invalidation has fully completed and all new
transactions will use the new MPTs.

Add a new pKVM IOMMU driver that the host can use to register
SysMMU_SYNCs. Each device is expected to be a supplier to exactly one
S2MPU (parent), but multiple SYNCs can supply a single S2MPU.

To keep things simple, the SYNCs do not implement suspend/resume and are
assumed to follow the power transitions of their parent.

Following an invalidation, the S2MPU driver iterates over its children
and waits for each SYNC to signal that its transactions have drained.
The algorithm currently waits on each SYNC in turn. If latency proves to
be an issue, this could be optimized to initiate a SYNC on all powered
devices before starting to poll.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I45b832fd11d76b65987935c8548e2a214ee2fa2a
2022-04-05 11:37:16 +01:00
David Brazdil
d5bc119656 ANDROID: KVM: arm64: iommu: Create parent/child relation
In preparation for adding new IOMMU devices that act as suppliers to
others, add the notion of a parent IOMMU device. Such device must be
registered after its parent and the driver of the parent device must
validate the addition.

The relation has no generic implications, it is up to drivers to make
use of it.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I4ee3675e5529bb73ad4546fa32380f237f054177
2022-04-05 11:37:16 +01:00
David Brazdil
db89d65f69 ANDROID: KVM: arm64: iommu: Run validate() on struct pkvm_iommu
In preparation for needing to validate more aspects of a device that is
about to be registered, change the callback to accept the to-be-added
'struct pkvm_iommu' rather than individual inputs.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I3fb911e4280c220ddd779cf6a5fc9c302a5617f7
2022-04-05 11:36:55 +01:00
David Brazdil
c690c2e305 ANDROID: KVM: arm64: iommu: Create private mapping last
Private EL2 mappings currently cannot be removed. Move the creation of
IOMMU device mappings at the end of the registration function so that
other errors do not result in unnecessary mappings.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I3139e9af3345f157295eb72441a7cf3cc055116d
2022-04-05 11:36:49 +01:00
David Brazdil
597558ad5b ANDROID: KVM: arm64: iommu: Free memory on registration error
Memory for IOMMU device entries gets allocated from a pool donated by
the host. It is possible for pkvm_iommu_register() to allocate the
memory and then fail, in which case the memory remains unused but not
freed.

Refactor the code such that the host lock covers the entire section
where the memory is allocated. This way we can return the memory back to
the linear allocator if an error is returned.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I8c1650ba3e545741144d793de506e93c4066896f
2022-04-05 11:36:43 +01:00
David Brazdil
0c292fa8d6 ANDROID: KVM: arm64: iommu: Harden __pkvm_iommu_pm_notify
Currently __pkvm_iommu_pm_notify always changes the value of
dev->powered following a suspend/resume attempt. This could potentially
be abused to force the hypervisor to stop issuing updates to an S2MPU
and preserving an old/invalid state.

Modify to only update the power state if suspend/resume was successful.

Bug: 190463801
Signed-off-by: David Brazdil <dbrazdil@google.com>
Change-Id: I285fc822e9fc926c49b9b5e69446790e1edccafb
2022-04-05 11:34:42 +01:00
Pradeep P V K
5de2ef69b6 FROMLIST: fuse: give wakeup hints to the scheduler
The synchronous wakeup interface is available only for the
interruptible wakeup. Add it for normal wakeup and use this
synchronous wakeup interface to wakeup the userspace daemon.
Scheduler can make use of this hint to find a better CPU for
the waker task.

With this change the performance numbers for compress, decompress
and copy use-cases on /sdcard path has improved by ~30%.

Use-case details:
1. copy 10000 files of each 4k size into /sdcard path
2. use any File explorer application that has compress/decompress
support
3. start compress/decompress and capture the time.

-------------------------------------------------
| Default   | wakeup support | Improvement/Diff |
-------------------------------------------------
| 13.8 sec  | 9.9 sec        | 3.9 sec (28.26%) |
-------------------------------------------------

Co-developed-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com>
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>

Bug: 216261533
Link: https://lore.kernel.org/lkml/1638780405-38026-1-git-send-email-quic_pragalla@quicinc.com/
Change-Id: I9ac89064e34b1e0605064bf4d2d3a310679cb605
Signed-off-by: Pradeep P V K <quic_pragalla@quicinc.com>
Signed-off-by: Alessio Balsini <balsini@google.com>
2022-04-04 10:18:55 +00:00
Shengjiu Wang
754bb029c8 FROMGIT: ASoC: soc-generic-dmaengine-pcm: separate max_buffer_size assignment
The config->pcm_hardware may be NULL when config->prealloc_buffer_size
is not zero, so it is better to move max_buffer_size assignment under
a separate condition.

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

Bug: 226635564
(cherry picked from commit 88c62b1628
 https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next)
Change-Id: Ib5c5540afcb79665bb0daf684954365747439ad8
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
2022-04-01 19:10:09 +00:00