Merge keystone/android12-5.10-keystone-qcom-release.43+ (8b9da28) into msm-5.10

* refs/heads/tmp-8b9da28:
  FROMLIST: scsi: ufs: add quirk to enable host controller without interface configuration
  FROMLIST: scsi: ufs: add quirk to handle broken UIC command
  ANDROID: syscall_check: add vendor hook for bpf syscall
  ANDROID: syscall_check: add vendor hook for open syscall
  ANDROID: syscall_check: add vendor hook for mmap syscall
  ANDROID: GKI: Add symbol to symbol list
  ANDROID: vendor_hooks: Add vendor hook to the net
  FROMLIST: scsi: ufs: Fix the SCSI abort handler
  ANDROID: android: export kernel function vm_unmapped_area
  ANDROID: shmem: vendor hook in shmem_alloc_page
  FROMLIST: pstore/ram: Rework logic for detecting ramoops reserved memory region
  ANDROID: mm: add reclaim_shmem_address_space() for faster reclaims
  ANDROID: Update the generic ABI symbol list
  ANDROID: GKI: refresh ABI XML
  ANDROID: GKI: turn on TIDY_ABI
  ANDROID: Update symbol list for VIVO
  FROMGIT: net: cdc_ncm: switch to eth%d interface naming
  ANDROID: GKI: add allowed GKI symbol for Exynosauto SoC
  ANDROID: mm: add vendor hook for vmpressure
  ANDROID: fips140: adjust some log messages
  ANDROID: fips140: add missing static keyword to fips140_init()
  ANDROID: GKI: update allowed list for exynosauto SoC
  UPSTREAM: scsi: ufs: ufshcd: Fix some function doc-rot
  UPSTREAM: scsi: ufs: Adjust ufshcd_hold() during sending attribute requests

Conflicts:
	include/trace/hooks/net.h

Change-Id: Id3d44a9656199f6237535b6342bfe5b19bef84f7
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
This commit is contained in:
Ivaylo Georgiev 2021-07-11 23:55:38 -07:00
commit dba559445d
27 changed files with 115807 additions and 173658 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3,13 +3,16 @@
add_wait_queue
alloc_chrdev_region
__alloc_pages_nodemask
__alloc_percpu
alloc_workqueue
__arch_copy_from_user
__arch_copy_to_user
arm64_const_caps_ready
arm64_use_ng_mappings
__arm_smccc_smc
atomic_notifier_call_chain
atomic_notifier_chain_register
atomic_notifier_chain_unregister
__bitmap_and
blocking_notifier_call_chain
blocking_notifier_chain_register
@ -49,6 +52,8 @@
cpumask_next
cpu_number
__cpu_online_mask
cpu_pm_register_notifier
__cpu_possible_mask
crc32_le
__crypto_memneq
debugfs_create_dir
@ -60,7 +65,9 @@
del_timer
del_timer_sync
destroy_workqueue
_dev_crit
dev_driver_string
_dev_emerg
_dev_err
device_create
device_create_file
@ -172,6 +179,7 @@
free_irq
__free_pages
free_pages
free_percpu
freezing_slow_path
generic_file_llseek
generic_handle_irq
@ -197,6 +205,10 @@
handle_edge_irq
handle_level_irq
handle_nested_irq
hrtimer_cancel
hrtimer_forward
hrtimer_init
hrtimer_start_range_ns
i2c_add_numbered_adapter
i2c_del_driver
i2c_register_driver
@ -224,6 +236,7 @@
irq_set_chip_and_handler_name
irq_set_chip_data
irq_set_irq_wake
irq_to_desc
is_vmalloc_addr
jiffies
kasan_flag_enabled
@ -337,6 +350,7 @@
param_ops_int
param_ops_uint
PDE_DATA
__per_cpu_offset
perf_trace_buf_alloc
perf_trace_run_bpf_submit
phy_power_off
@ -439,11 +453,13 @@
simple_write_to_buffer
single_open
single_release
smp_call_function
snd_pcm_format_width
snd_soc_component_update_bits
snd_soc_component_write
snd_soc_dai_set_fmt
snd_soc_dai_set_tdm_slot
snd_soc_dai_set_tristate
snd_soc_info_volsw
snd_soc_of_get_dai_link_codecs
snd_soc_of_get_dai_name
@ -468,12 +484,14 @@
strncpy
strnlen
strstr
__sw_hweight64
sync_file_create
sync_file_get_fence
synchronize_irq
syscon_regmap_lookup_by_phandle
sysfs_create_file_ns
sysfs_create_group
sysfs_create_groups
sysfs_remove_file_ns
sysfs_remove_group
system_freezing_cnt
@ -581,12 +599,8 @@
kernel_kobj
# required by dss.ko
__alloc_percpu
android_debug_symbol
arch_timer_read_counter
atomic_notifier_call_chain
__cpu_possible_mask
_dev_emerg
dump_backtrace
init_task
input_close_device
@ -594,18 +608,14 @@
input_register_handle
input_register_handler
input_unregister_handle
irq_to_desc
kmsg_dump_get_line
kmsg_dump_rewind
kstat
nr_irqs
__per_cpu_offset
proc_create
register_die_notifier
return_address
rtc_time64_to_tm
smp_call_function
sysfs_create_groups
sys_tz
time64_to_tm
__traceiter_android_vh_ipi_stop
@ -664,6 +674,21 @@
soc_device_register
subsys_system_register
# required by exynos-coresight.ko
__cpuhp_setup_state_cpuslocked
cpu_pm_unregister_notifier
of_prop_next_u32
# required by exynos-debug-test.ko
_ctype
kstrtoll
remove_cpu
smp_call_function_single
strsep
# required by exynos-ehld.ko
sprint_symbol
# required by exynos-pd.ko
of_genpd_add_provider_simple
pm_genpd_add_subdomain
@ -867,6 +892,12 @@
mod_delayed_work_on
put_vaddr_frames
# required by hardlockup-watchdog.ko
__cpuhp_setup_state
cpus_read_lock
cpus_read_unlock
smp_call_on_cpu
# required by i2c-exynosauto.ko
i2c_del_adapter
@ -900,10 +931,6 @@
get_user_pages_fast
get_user_pages_remote
hrtimer_active
hrtimer_cancel
hrtimer_forward
hrtimer_init
hrtimer_start_range_ns
kstrtobool_from_user
ktime_get_raw
kvfree_call_rcu
@ -928,7 +955,6 @@
static_key_slow_inc
strncasecmp
__sw_hweight32
__sw_hweight64
synchronize_rcu
sysfs_streq
system_highpri_wq
@ -970,6 +996,15 @@
drm_panel_remove
# required by pcie-exynos-dw-ep.ko
dw_pcie_ep_init
dw_pcie_read_dbi
dw_pcie_write_dbi
pci_epc_clear_bar
pci_epc_map_addr
pci_epc_mem_alloc_addr
pci_epc_mem_free_addr
pci_epc_set_bar
pci_epc_unmap_addr
# required by pcie-exynos-dw-rc.ko
bitmap_find_free_region
@ -987,6 +1022,7 @@
irq_domain_set_info
irq_domain_update_bus_token
pcie_get_mps
pcie_set_mps
pci_find_bus
pci_generic_config_read
pci_generic_config_write
@ -995,12 +1031,15 @@
pci_msi_create_irq_domain
pci_msi_mask_irq
pci_msi_unmask_irq
pci_num_vf
pci_rescan_bus
pci_restore_state
pci_save_state
pci_store_saved_state
# required by pcs-xpcs.ko
mdiobus_read
mdiobus_write
# required by pinctrl-samsung-core.ko
devm_gpiochip_add_data_with_key
@ -1056,6 +1095,9 @@
kthread_destroy_worker
kthread_mod_delayed_work
kthread_queue_delayed_work
ktime_get_snapshot
posix_clock_register
posix_clock_unregister
# required by reboot-mode.ko
devres_free
@ -1074,7 +1116,6 @@
watchdog_unregister_device
# required by sam-is.ko
atomic_notifier_chain_unregister
get_task_pid
i2c_get_adapter
i2c_new_client_device
@ -1113,10 +1154,13 @@
__bitmap_andnot
consume_skb
dev_close
device_get_phy_mode
device_set_wakeup_capable
device_set_wakeup_enable
__dev_kfree_skb_any
dev_open
dql_completed
dql_reset
eth_mac_addr
ethtool_op_get_link
ethtool_op_get_ts_info
@ -1127,13 +1171,16 @@
jiffies_to_usecs
mdiobus_alloc_size
mdiobus_free
mdiobus_get_phy
__mdiobus_register
mdiobus_unregister
napi_complete_done
napi_disable
napi_gro_receive
__napi_schedule
__napi_schedule_irqoff
napi_schedule_prep
netdev_alert
__netdev_alloc_skb
netdev_err
netdev_info
@ -1149,9 +1196,32 @@
netif_set_real_num_tx_queues
netif_tx_wake_queue
net_ratelimit
of_get_mac_address
of_mdiobus_register
of_phy_deregister_fixed_link
of_phy_is_fixed_link
of_phy_register_fixed_link
phy_attached_info
phy_disconnect
phy_ethtool_get_eee
phy_ethtool_ksettings_get
phy_ethtool_ksettings_set
phy_ethtool_nway_reset
phy_ethtool_set_eee
phy_get_eee_err
phy_init_eee
phylink_connect_phy
phylink_create
phylink_destroy
phylink_of_phy_connect
phylink_set_port_modes
phylink_start
phy_mac_interrupt
phy_mii_ioctl
phy_resume
phy_start_aneg
phy_stop
phy_suspend
pinctrl_pm_select_default_state
pinctrl_pm_select_sleep_state
platform_get_irq_byname
@ -1262,6 +1332,7 @@
snd_pcm_lib_preallocate_free_for_all
snd_pcm_lib_preallocate_pages
snd_pcm_period_elapsed
snd_pcm_release_substream
snd_soc_component_init_regmap
snd_soc_component_read
snd_soc_dapm_add_routes
@ -1274,7 +1345,6 @@
snd_soc_unregister_component
# required by snd-soc-tas6424.ko
_dev_crit
regcache_cache_only
snd_soc_get_volsw
snd_soc_put_volsw
@ -1308,6 +1378,7 @@
ufshcd_config_pwr_mode
ufshcd_dme_get_attr
ufshcd_dme_set_attr
ufshcd_init
ufshcd_link_recovery
ufshcd_pltfrm_init
ufshcd_remove

View File

@ -544,9 +544,11 @@
drm_atomic_normalize_zpos
drm_atomic_private_obj_fini
drm_atomic_private_obj_init
drm_atomic_set_crtc_for_connector
drm_atomic_set_crtc_for_plane
drm_atomic_set_fb_for_plane
drm_atomic_set_mode_for_crtc
drm_atomic_set_mode_prop_for_crtc
drm_atomic_state_alloc
drm_atomic_state_clear
__drm_atomic_state_free

View File

@ -53,12 +53,16 @@
bitmap_release_region
__bitmap_set
blk_alloc_queue
blk_bio_list_merge
blk_cleanup_queue
blk_execute_rq
blk_execute_rq_nowait
blk_get_request
blk_mq_debugfs_rq_show
blk_mq_rq_cpu
blk_mq_run_hw_queue
blk_mq_sched_mark_restart_hctx
blk_mq_sched_request_inserted
blk_put_request
blk_queue_flag_clear
blk_queue_flag_set
@ -73,13 +77,14 @@
blk_rq_map_user
blk_rq_map_user_iov
blk_rq_unmap_user
blk_stat_enable_accounting
blk_verify_command
blocking_notifier_call_chain
blocking_notifier_chain_register
blocking_notifier_chain_unregister
bpf_trace_run1
bpf_trace_run10
bpf_trace_run12
bpf_trace_run1
bpf_trace_run2
bpf_trace_run3
bpf_trace_run4
@ -498,6 +503,9 @@
edac_device_free_ctl_info
edac_device_handle_ce_count
edac_device_handle_ue_count
elevator_alloc
elv_register
elv_unregister
enable_irq
enable_percpu_irq
eventfd_ctx_fdget
@ -926,8 +934,8 @@
mempool_free
mempool_free_slab
memremap
memset64
memset
memset64
__memset_io
memstart_addr
memunmap
@ -963,8 +971,8 @@
__next_zones_zonelist
nla_find
nla_put
nla_reserve_64bit
nla_reserve
nla_reserve_64bit
__nla_validate
__nlmsg_put
no_llseek
@ -1403,7 +1411,16 @@
rtc_update_irq
rtc_valid_tm
runqueues
sbitmap_add_wait_queue
sbitmap_any_bit_set
sbitmap_del_wait_queue
sbitmap_init_node
sbitmap_queue_clear
__sbitmap_queue_get
sbitmap_queue_init_node
sbitmap_queue_min_shallow_depth
sbitmap_queue_resize
sbitmap_queue_show
sched_clock
sched_feat_keys
sched_feat_names
@ -1449,6 +1466,8 @@
sdhci_set_power_noreg
sdhci_setup_host
seq_buf_printf
seq_list_next
seq_list_start
seq_lseek
seq_open
seq_printf
@ -1553,6 +1572,7 @@
sscanf
__stack_chk_fail
__stack_chk_guard
stack_trace_save_tsk
static_key_disable
stop_machine
stop_one_cpu_nowait
@ -1634,6 +1654,7 @@
thermal_zone_of_sensor_unregister
tick_nohz_get_sleep_length
time64_to_tm
timer_reduce
topology_set_thermal_pressure
total_swapcache_pages
trace_array_get_by_name

View File

@ -7,6 +7,7 @@ Image.lz4
"
ABI_DEFINITION=android/abi_gki_aarch64.xml
TIDY_ABI=1
KMI_SYMBOL_LIST=android/abi_gki_aarch64
ADDITIONAL_KMI_SYMBOL_LISTS="
android/abi_gki_aarch64_core

View File

@ -250,8 +250,8 @@ static bool __init check_fips140_module_hmac(void)
textsize = &__fips140_text_end - &__fips140_text_start;
rodatasize = &__fips140_rodata_end - &__fips140_rodata_start;
pr_warn("text size : 0x%x\n", textsize);
pr_warn("rodata size: 0x%x\n", rodatasize);
pr_info("text size : 0x%x\n", textsize);
pr_info("rodata size: 0x%x\n", rodatasize);
textcopy = kmalloc(textsize + rodatasize, GFP_KERNEL);
if (!textcopy) {
@ -283,7 +283,7 @@ static bool __init check_fips140_module_hmac(void)
return false;
}
pr_warn("using '%s' for integrity check\n",
pr_info("using '%s' for integrity check\n",
crypto_shash_driver_name(desc->tfm));
err = crypto_shash_setkey(desc->tfm, fips140_integ_hmac_key,
@ -523,11 +523,12 @@ static bool update_fips140_library_routines(void)
* let's disable CFI locally when handling the initcall array, to avoid
* surpises.
*/
int __init __attribute__((__no_sanitize__("cfi"))) fips140_init(void)
static int __init __attribute__((__no_sanitize__("cfi")))
fips140_init(void)
{
const u32 *initcall;
pr_info("Loading FIPS 140 module\n");
pr_info("loading module\n");
unregister_existing_fips140_algos();
@ -563,12 +564,12 @@ int __init __attribute__((__no_sanitize__("cfi"))) fips140_init(void)
*/
if (!check_fips140_module_hmac()) {
pr_crit("FIPS 140 integrity check failed -- giving up!\n");
pr_crit("integrity check failed -- giving up!\n");
goto panic;
}
pr_info("integrity check passed\n");
pr_info("FIPS 140 integrity check successful\n");
pr_info("FIPS 140 module successfully loaded\n");
pr_info("module successfully loaded\n");
return 0;
panic:

View File

@ -64,6 +64,9 @@
#include <trace/hooks/cpuidle_psci.h>
#include <trace/hooks/fips140.h>
#include <trace/hooks/remoteproc.h>
#include <trace/hooks/shmem_fs.h>
#include <trace/hooks/net.h>
#include <trace/hooks/syscall_check.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@ -106,6 +109,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_read_wait_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_wait_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_show_task);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shmem_alloc_page);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_enter);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set);
@ -311,6 +315,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_gpio_cd_irqt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_vmalloc_stack);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_stack_hash);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_track_hash);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_vmpressure);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_task_comm);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_acct_update_power);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_typec_tcpm_log);
@ -340,3 +345,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_force_compatible_post);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_print_transaction_info);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_setscheduler_uclamp);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rproc_recovery);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ptype_head);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_kfree_skb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_mmap_file);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_file_open);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_bpf_syscall);

View File

@ -1890,7 +1890,7 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
static const struct driver_info cdc_ncm_info = {
.description = "CDC NCM",
.flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET
| FLAG_LINK_INTR,
| FLAG_LINK_INTR | FLAG_ETHER,
.bind = cdc_ncm_bind,
.unbind = cdc_ncm_unbind,
.manage_power = usbnet_manage_power,

View File

@ -2323,6 +2323,9 @@ int ufshcd_send_uic_cmd(struct ufs_hba *hba, struct uic_command *uic_cmd)
int ret;
unsigned long flags;
if (hba->quirks & UFSHCD_QUIRK_BROKEN_UIC_CMD)
return 0;
ufshcd_hold(hba, false);
mutex_lock(&hba->uic_cmd_mutex);
ufshcd_add_delay_before_dme_cmd(hba);
@ -2732,15 +2735,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
WARN_ON(ufshcd_is_clkgating_allowed(hba) &&
(hba->clk_gating.state != CLKS_ON));
if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
if (hba->pm_op_in_progress)
set_host_byte(cmd, DID_BAD_TARGET);
else
err = SCSI_MLQUEUE_HOST_BUSY;
ufshcd_release(hba);
goto out;
}
lrbp = &hba->lrb[tag];
WARN_ON(lrbp->cmd);
lrbp->cmd = cmd;
@ -2953,11 +2947,6 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
req->timeout = msecs_to_jiffies(2 * timeout);
blk_mq_start_request(req);
if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
err = -EBUSY;
goto out;
}
init_completion(&wait);
lrbp = &hba->lrb[tag];
WARN_ON(lrbp->cmd);
@ -3120,14 +3109,14 @@ int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
BUG_ON(!hba);
ufshcd_hold(hba, false);
if (!attr_val) {
dev_err(hba->dev, "%s: attribute value required for opcode 0x%x\n",
__func__, opcode);
err = -EINVAL;
goto out;
return -EINVAL;
}
ufshcd_hold(hba, false);
mutex_lock(&hba->dev_cmd.lock);
ufshcd_init_query(hba, &request, &response, opcode, idn, index,
selector);
@ -3159,7 +3148,6 @@ int ufshcd_query_attr(struct ufs_hba *hba, enum query_opcode opcode,
out_unlock:
mutex_unlock(&hba->dev_cmd.lock);
out:
ufshcd_release(hba);
return err;
}
@ -3213,21 +3201,20 @@ static int __ufshcd_query_descriptor(struct ufs_hba *hba,
BUG_ON(!hba);
ufshcd_hold(hba, false);
if (!desc_buf) {
dev_err(hba->dev, "%s: descriptor buffer required for opcode 0x%x\n",
__func__, opcode);
err = -EINVAL;
goto out;
return -EINVAL;
}
if (*buf_len < QUERY_DESC_MIN_SIZE || *buf_len > QUERY_DESC_MAX_SIZE) {
dev_err(hba->dev, "%s: descriptor buffer size (%d) is out of range\n",
__func__, *buf_len);
err = -EINVAL;
goto out;
return -EINVAL;
}
ufshcd_hold(hba, false);
mutex_lock(&hba->dev_cmd.lock);
ufshcd_init_query(hba, &request, &response, opcode, idn, index,
selector);
@ -3262,7 +3249,6 @@ static int __ufshcd_query_descriptor(struct ufs_hba *hba,
out_unlock:
hba->dev_cmd.query.descriptor = NULL;
mutex_unlock(&hba->dev_cmd.lock);
out:
ufshcd_release(hba);
return err;
}
@ -6673,11 +6659,6 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
tag = req->tag;
WARN_ON_ONCE(!ufshcd_valid_tag(hba, tag));
if (unlikely(test_bit(tag, &hba->outstanding_reqs))) {
err = -EBUSY;
goto out;
}
init_completion(&wait);
lrbp = &hba->lrb[tag];
WARN_ON(lrbp->cmd);
@ -6745,7 +6726,6 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
}
}
out:
blk_put_request(req);
out_unlock:
up_read(&hba->clk_scaling_lock);
@ -6884,7 +6864,8 @@ static void ufshcd_set_req_abort_skip(struct ufs_hba *hba, unsigned long bitmap)
/**
* ufshcd_try_to_abort_task - abort a specific task
* @cmd: SCSI command pointer
* @hba: Pointer to adapter instance
* @tag: Task tag/index to be aborted
*
* Abort the pending command in device by sending UFS_ABORT_TASK task management
* command, and in host controller by clearing the door-bell register. There can
@ -6974,7 +6955,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
struct ufs_hba *hba;
unsigned long flags;
unsigned int tag;
int err = 0;
int err = FAILED, res;
struct ufshcd_lrb *lrbp;
u32 reg;
@ -6991,12 +6972,12 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
ufshcd_hold(hba, false);
reg = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
/* If command is already aborted/completed, return SUCCESS */
/* If command is already aborted/completed, return FAILED. */
if (!(test_bit(tag, &hba->outstanding_reqs))) {
dev_err(hba->dev,
"%s: cmd at tag %d already completed, outstanding=0x%lx, doorbell=0x%x\n",
__func__, tag, hba->outstanding_reqs, reg);
goto out;
goto release;
}
/* Print Transfer Request of aborted task */
@ -7025,7 +7006,8 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
dev_err(hba->dev,
"%s: cmd was completed, but without a notifying intr, tag = %d",
__func__, tag);
goto cleanup;
__ufshcd_transfer_req_compl(hba, 1UL << tag);
goto release;
}
/*
@ -7038,36 +7020,32 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
*/
if (lrbp->lun == UFS_UPIU_UFS_DEVICE_WLUN) {
ufshcd_update_evt_hist(hba, UFS_EVT_ABORT, lrbp->lun);
__ufshcd_transfer_req_compl(hba, (1UL << tag));
set_bit(tag, &hba->outstanding_reqs);
spin_lock_irqsave(host->host_lock, flags);
hba->force_reset = true;
ufshcd_schedule_eh_work(hba);
spin_unlock_irqrestore(host->host_lock, flags);
goto out;
goto release;
}
/* Skip task abort in case previous aborts failed and report failure */
if (lrbp->req_abort_skip)
err = -EIO;
else
err = ufshcd_try_to_abort_task(hba, tag);
if (!err) {
cleanup:
__ufshcd_transfer_req_compl(hba, (1UL << tag));
out:
err = SUCCESS;
} else {
dev_err(hba->dev, "%s: failed with err %d\n", __func__, err);
if (lrbp->req_abort_skip) {
dev_err(hba->dev, "%s: skipping abort\n", __func__);
ufshcd_set_req_abort_skip(hba, hba->outstanding_reqs);
err = FAILED;
goto release;
}
/*
* This ufshcd_release() corresponds to the original scsi cmd that got
* aborted here (as we won't get any IRQ for it).
*/
res = ufshcd_try_to_abort_task(hba, tag);
if (res) {
dev_err(hba->dev, "%s: failed with err %d\n", __func__, res);
ufshcd_set_req_abort_skip(hba, hba->outstanding_reqs);
goto release;
}
err = SUCCESS;
release:
/* Matches the ufshcd_hold() call at the start of this function. */
ufshcd_release(hba);
return err;
}
@ -7991,6 +7969,9 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool async)
if (ret)
goto out;
if (hba->quirks & UFSHCD_QUIRK_SKIP_INTERFACE_CONFIGURATION)
goto out;
/* Debug counters initialization */
ufshcd_clear_dbg_ufs_stats(hba);

View File

@ -565,6 +565,18 @@ enum ufshcd_quirks {
*/
UFSHCD_QUIRK_ALIGN_SG_WITH_PAGE_SIZE = 1 << 14,
/*
* This quirk needs to be enabled if the host controller does not
* support UIC command
*/
UFSHCD_QUIRK_BROKEN_UIC_CMD = 1 << 15,
/*
* This quirk needs to be enabled if the host controller cannot
* support interface configuration.
*/
UFSHCD_QUIRK_SKIP_INTERFACE_CONFIGURATION = 1 << 16,
/*
* This quirk needs to be enabled if the host controller supports inline
* encryption, but it needs to initialize the crypto capabilities in a

View File

@ -3933,6 +3933,7 @@ include/trace/hooks/mmc_core.h
include/trace/hooks/mm.h
include/trace/hooks/module.h
include/trace/hooks/mpam.h
include/trace/hooks/net.h
include/trace/hooks/pm_domain.h
include/trace/hooks/power.h
include/trace/hooks/preemptirq.h
@ -3943,8 +3944,10 @@ include/trace/hooks/rwsem.h
include/trace/hooks/sched.h
include/trace/hooks/scmi.h
include/trace/hooks/selinux.h
include/trace/hooks/shmem_fs.h
include/trace/hooks/signal.h
include/trace/hooks/softlockup.h
include/trace/hooks/syscall_check.h
include/trace/hooks/sys.h
include/trace/hooks/sysrqcrash.h
include/trace/hooks/thermal.h

View File

@ -34,6 +34,7 @@
#include <linux/compat.h>
#include "internal.h"
#include <trace/hooks/syscall_check.h>
int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
struct file *filp)
@ -800,6 +801,7 @@ static int do_dentry_open(struct file *f,
error = -ENODEV;
goto cleanup_all;
}
trace_android_vh_check_file_open(f);
error = security_file_open(f);
if (error)

View File

@ -21,6 +21,7 @@
#include <linux/pstore_ram.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_reserved_mem.h>
#include "internal.h"
#define RAMOOPS_KERNMSG_HDR "===="
@ -633,21 +634,21 @@ static int ramoops_parse_dt(struct platform_device *pdev,
{
struct device_node *of_node = pdev->dev.of_node;
struct device_node *parent_node;
struct resource *res;
struct reserved_mem *rmem;
u32 value;
int ret;
dev_dbg(&pdev->dev, "using Device Tree\n");
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
rmem = of_reserved_mem_lookup(of_node);
if (!rmem) {
dev_err(&pdev->dev,
"failed to locate DT /reserved-memory resource\n");
return -EINVAL;
}
pdata->mem_size = resource_size(res);
pdata->mem_address = res->start;
pdata->mem_size = rmem->size;
pdata->mem_address = rmem->base;
/*
* Setting "unbuffered" is deprecated and will be ignored if
* "mem_type" is also specified.

View File

@ -3355,6 +3355,8 @@ unsigned long wp_shared_mapping_range(struct address_space *mapping,
extern int sysctl_nr_trim_pages;
extern bool pte_map_lock_addr(struct vm_fault *vmf, unsigned long addr);
extern int reclaim_shmem_address_space(struct address_space *mapping);
extern int reclaim_pages_from_list(struct list_head *page_list);
/**
* seal_check_future_write - Check for F_SEAL_FUTURE_WRITE flag and handle it

View File

@ -97,6 +97,10 @@ DECLARE_HOOK(android_vh_show_stack_hash,
DECLARE_HOOK(android_vh_save_track_hash,
TP_PROTO(bool alloc, unsigned long p),
TP_ARGS(alloc, p));
struct mem_cgroup;
DECLARE_HOOK(android_vh_vmpressure,
TP_PROTO(struct mem_cgroup *memcg, bool *bypass),
TP_ARGS(memcg, bypass));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_MM_H */

View File

@ -9,7 +9,6 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
struct packet_type;
struct list_head;
struct sk_buff;
@ -18,10 +17,9 @@ DECLARE_HOOK(android_vh_ptype_head,
TP_ARGS(pt, vendor_pt));
DECLARE_HOOK(android_vh_kfree_skb,
TP_PROTO(struct sk_buff *skb), TP_ARGS(skb));
#else
#define trace_android_vh_ptype_head(pt, vendor_pt)
#define trace_android_vh_kfree_skb(skb)
#endif
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_NET_VH_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -0,0 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM shmem_fs
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_SHMEM_FS_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_SHMEM_FS_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
struct page;
DECLARE_HOOK(android_vh_shmem_alloc_page,
TP_PROTO(struct page **page),
TP_ARGS(page));
#endif /* _TRACE_HOOK_SHMEM_FS_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -0,0 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM syscall_check
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_SYSCALL_CHECK_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_SYSCALL_CHECK_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
/*
* Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality
*/
struct file;
union bpf_attr;
DECLARE_HOOK(android_vh_check_mmap_file,
TP_PROTO(const struct file *file, unsigned long prot,
unsigned long flag, unsigned long ret),
TP_ARGS(file, prot, flag, ret));
DECLARE_HOOK(android_vh_check_file_open,
TP_PROTO(const struct file *file),
TP_ARGS(file));
DECLARE_HOOK(android_vh_check_bpf_syscall,
TP_PROTO(int cmd, const union bpf_attr *attr, unsigned int size),
TP_ARGS(cmd, attr, size));
#endif /* _TRACE_HOOK_SYSCALL_CHECK_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -32,6 +32,8 @@
#include <linux/bpf-netns.h>
#include <linux/rcupdate_trace.h>
#include <trace/hooks/syscall_check.h>
#define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \
(map)->map_type == BPF_MAP_TYPE_CGROUP_ARRAY || \
(map)->map_type == BPF_MAP_TYPE_ARRAY_OF_MAPS)
@ -4374,6 +4376,8 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz
if (copy_from_user(&attr, uattr, size) != 0)
return -EFAULT;
trace_android_vh_check_bpf_syscall(cmd, &attr, size);
err = security_bpf(cmd, &attr, size);
if (err < 0)
return err;

View File

@ -2214,6 +2214,7 @@ unsigned long vm_unmapped_area(struct vm_unmapped_area_info *info)
trace_vm_unmapped_area(addr, info);
return addr;
}
EXPORT_SYMBOL_GPL(vm_unmapped_area);
#ifndef arch_get_mmap_end
#define arch_get_mmap_end(addr) (TASK_SIZE)

View File

@ -38,9 +38,13 @@
#include <linux/hugetlb.h>
#include <linux/frontswap.h>
#include <linux/fs_parser.h>
#include <linux/mm_inline.h>
#include <asm/tlbflush.h> /* for arch/microblaze update_mmu_cache() */
#undef CREATE_TRACE_POINTS
#include <trace/hooks/shmem_fs.h>
static struct vfsmount *shm_mnt;
#ifdef CONFIG_SHMEM
@ -1559,7 +1563,11 @@ static struct page *shmem_alloc_page(gfp_t gfp,
struct shmem_inode_info *info, pgoff_t index)
{
struct vm_area_struct pvma;
struct page *page;
struct page *page = NULL;
trace_android_vh_shmem_alloc_page(&page);
if (page)
return page;
shmem_pseudo_vma_init(&pvma, info, index);
page = alloc_page_vma(gfp, &pvma, 0);
@ -4290,3 +4298,41 @@ void shmem_mark_page_lazyfree(struct page *page)
mark_page_lazyfree_movetail(page);
}
EXPORT_SYMBOL_GPL(shmem_mark_page_lazyfree);
int reclaim_shmem_address_space(struct address_space *mapping)
{
pgoff_t start = 0;
struct page *page;
LIST_HEAD(page_list);
int reclaimed;
XA_STATE(xas, &mapping->i_pages, start);
if (!shmem_mapping(mapping))
return -EINVAL;
lru_add_drain();
rcu_read_lock();
xas_for_each(&xas, page, ULONG_MAX) {
if (xas_retry(&xas, page))
continue;
if (xa_is_value(page))
continue;
if (isolate_lru_page(page))
continue;
list_add(&page->lru, &page_list);
inc_node_page_state(page, NR_ISOLATED_ANON +
page_is_file_lru(page));
if (need_resched()) {
xas_pause(&xas);
cond_resched_rcu();
}
}
rcu_read_unlock();
reclaimed = reclaim_pages_from_list(&page_list);
return reclaimed;
}
EXPORT_SYMBOL_GPL(reclaim_shmem_address_space);

View File

@ -27,6 +27,9 @@
#include <linux/uaccess.h>
#include "internal.h"
#ifndef __GENKSYMS__
#include <trace/hooks/syscall_check.h>
#endif
/**
* kfree_const - conditionally free memory
@ -511,6 +514,7 @@ unsigned long vm_mmap_pgoff(struct file *file, unsigned long addr,
if (populate)
mm_populate(ret, populate);
}
trace_android_vh_check_mmap_file(file, prot, flag, ret);
return ret;
}

View File

@ -21,6 +21,8 @@
#include <linux/printk.h>
#include <linux/vmpressure.h>
#include <trace/hooks/mm.h>
/*
* The window size (vmpressure_win) is the number of scanned pages before
* we try to analyze scanned/reclaimed ratio. So the window is used as a
@ -241,6 +243,11 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
unsigned long scanned, unsigned long reclaimed)
{
struct vmpressure *vmpr = memcg_to_vmpressure(memcg);
bool bypass = false;
trace_android_vh_vmpressure(memcg, &bypass);
if (unlikely(bypass))
return;
/*
* Here we only want to account pressure that userland is able to

View File

@ -1562,6 +1562,36 @@ unsigned int reclaim_clean_pages_from_list(struct zone *zone,
return nr_reclaimed;
}
int reclaim_pages_from_list(struct list_head *page_list)
{
struct scan_control sc = {
.gfp_mask = GFP_KERNEL,
.priority = DEF_PRIORITY,
.may_writepage = 1,
.may_unmap = 1,
.may_swap = 1,
};
unsigned long nr_reclaimed;
struct reclaim_stat dummy_stat;
struct page *page;
list_for_each_entry(page, page_list, lru)
ClearPageActive(page);
nr_reclaimed = shrink_page_list(page_list, NULL, &sc,
&dummy_stat, false);
while (!list_empty(page_list)) {
page = lru_to_page(page_list);
list_del(&page->lru);
dec_node_page_state(page, NR_ISOLATED_ANON +
page_is_file_lru(page));
putback_lru_page(page);
}
return nr_reclaimed;
}
/*
* Attempt to remove the specified page from its LRU. Only take this page
* if it is of the appropriate PageActive status. Pages which are being

View File

@ -146,6 +146,7 @@
#include <net/devlink.h>
#include <linux/pm_runtime.h>
#include <linux/prandom.h>
#include <trace/hooks/net.h>
#include "net-sysfs.h"
@ -510,6 +511,12 @@ static inline void netdev_set_addr_lockdep_class(struct net_device *dev)
static inline struct list_head *ptype_head(const struct packet_type *pt)
{
struct list_head vendor_pt = { .next = NULL, };
trace_android_vh_ptype_head(pt, &vendor_pt);
if (vendor_pt.next)
return vendor_pt.next;
if (pt->type == htons(ETH_P_ALL))
return pt->dev ? &pt->dev->ptype_all : &ptype_all;
else

View File

@ -76,6 +76,7 @@
#include <linux/capability.h>
#include <linux/user_namespace.h>
#include <linux/indirect_call_wrapper.h>
#include <trace/hooks/net.h>
#include "datagram.h"
@ -701,6 +702,7 @@ void kfree_skb(struct sk_buff *skb)
if (!skb_unref(skb))
return;
trace_android_vh_kfree_skb(skb);
trace_kfree_skb(skb, __builtin_return_address(0));
__kfree_skb(skb);
}

View File

@ -80,6 +80,7 @@
#include <linux/jump_label_ratelimit.h>
#include <net/busy_poll.h>
#include <net/mptcp.h>
#include <trace/hooks/net.h>
int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
@ -4618,6 +4619,7 @@ static bool tcp_ooo_try_coalesce(struct sock *sk,
static void tcp_drop(struct sock *sk, struct sk_buff *skb)
{
trace_android_vh_kfree_skb(skb);
sk_drops_add(sk, skb);
__kfree_skb(skb);
}