mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
Merge branch 'android13-5.10' into branch 'android13-5.10-lts'
Sync up with android13-5.10 for the following commits:800870b6d4ANDROID: Update the ABI representationb6a23be181ANDROID: Fix for kernelci !CONFIG_SMP break-breaks9bc66fe57cANDROID: fuse-bpf: set error_in to ENOENT in negative lookup92fc848ef5ANDROID: fuse-bpf: Add ability to run ranges of tests to fuse_testcd9914280aBACKPORT: NFC: netlink: fix sleep in atomic bug when firmware download timeoute56825d048ANDROID: KVM: arm64: Initialize ptr auth in protected modeab9c52146fANDROID: cgroup: Add vendor hook for rebuild_root_domains_bypass8015dd49c0FROMGIT: KVM: arm64: Ignore kvm-arm.mode if !is_hyp_mode_available()5495c19c30ANDROID: Update the ABI symbol list and xml9c24cb8704UPSTREAM: wifi: mac80211_hwsim: use 32-bit skb cookie80c59100daUPSTREAM: wifi: mac80211_hwsim: add back erroneously removed cast9fafd34f1dUPSTREAM: wifi: mac80211_hwsim: fix race condition in pending packetd91e7b80d8ANDROID: Update the ABI representation14e1028389ANDROID: sched: Fix off-by-one with cpupri MAX_RT_PRIO evaluation7a6ea55aa0Revert "ANDROID: workqueue: add vendor hook for wq lockup information"7b19b0064bUPSTREAM: kernel/irq: export irq_gc_set_wake1856a68952ANDROID: Update the ABI representation1bd5344779ANDROID: fuse-bpf: Add test for lookup postfilter494e7075c9ANDROID: fuse-bpf: readddir postfilter fixes8483cc3a75ANDROID: Enable BUILD_GKI_CERTIFICATION_TOOLS for x86_64 GKIf813694424ANDROID: force struct cgroup_taskset to be defined in KMI3dc6e416a1ANDROID: force struct blk_mq_alloc_data to be defined in KMIaf4d4153caBACKPORT: erofs: fix use-after-free of on-stack io[]aec8f79a0fANDROID: GKI: db845c: Update symbols list and ABI7b87b9ddb4ANDROID: kleaf: Explicit list of ABI files.d25aa0dbaeFROMLIST: f2fs: let FI_OPU_WRITE override FADVISE_COLD_BIT5625e355a9ANDROID: incfs: Add check for ATTR_KILL_SUID and ATTR_MODE in incfs_setattr0cf7d9ce9fRevert "UPSTREAM: scsi: ufs: core: Reduce the power mode change timeout"1d61c5b5a0Revert "FROMLIST: scsi: ufs: Fix deadlocks between power management and error handler"dd18c291f9BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}f68d040c31FROMLIST: scsi: ufs: Fix deadlocks between power management and error handler32934b542cUPSTREAM: ASoC: hdmi-codec: make hdmi_codec_controls static46a21348d6UPSTREAM: ASoC: hdmi-codec: Add a prepare hook21e97dfa19UPSTREAM: ASoC: hdmi-codec: Add iec958 controls9e9d26699dUPSTREAM: ASoC: hdmi-codec: Rework to support more controls8de9ae8605UPSTREAM: ALSA: iec958: Split status creation and fill92c209708aUPSTREAM: ALSA: doc: Clarify IEC958 controls iface6cc06d03bfUPSTREAM: ASoC: hdmi-codec: remove unused spk_mask member004a44b913UPSTREAM: ASoC: hdmi-codec: remove useless initializationa7633aa2d9UPSTREAM: ASoC: codec: hdmi-codec: Support IEC958 encoded PCM formatc584eb99bbUPSTREAM: ASoC: hdmi-codec: Fix return value in hdmi_codec_set_jack()f5a1cb7fd6UPSTREAM: ASoC: hdmi-codec: Add RX support6140082c11UPSTREAM: ASoC: hdmi-codec: Get ELD in before reporting plugged event185f60f2bbANDROID: add forward declaration vm_unmapped_area_infod1b29856caANDROID: net: export symbol for tracepoint_consume_skb952141fb92BACKPORT: dm verity: set DM_TARGET_IMMUTABLE feature flagb5fe8c470eBACKPORT: pipe: Fix missing lock in pipe_resize_ring()790fa51f7bBACKPORT: KVM: x86: avoid calling x86 emulator without a decoded instructionee742bccf6ANDROID: power: fix vendor hook in suspend.c7108d9d0e5ANDROID: remove inclusions from hook definition headersd6ab8e3ba2Revert "ANDROID: arm64: smp: fix Lockdep warning: RCU used illegally from idle CPU."aa381a5c71ANDROID: remove CONFIG_TRACEPOINTS from hook definition headersaff2309034BACKPORT: watchqueue: make sure to serialize 'wqueue->defunct' properly66047fb431ANDROID: Update the ABI representationd451b4eee2ANDROID: Update the ABI representation3d35c6b91dUPSTREAM: scsi: ufs: core: Reduce the power mode change timeout5c6d73ac2cBACKPORT: scsi: ufs: core: Increase fDeviceInit poll frequency2208908824FROMGIT: f2fs: increase the limit for reserve_root7af4b3ca30FROMGIT: f2fs: complete checkpoints during remount7a04671177FROMGIT: f2fs: flush pending checkpoints when freezing superf18d40369cFROMGIT: f2fs: remove gc_urgent_high_limited for cleanup68f703b19fFROMGIT: f2fs: fix wrong continue condition in GC8ecc3b8d53BACKPORT: f2fs: handle decompress only post processing in softirq23d664773fBACKPORT: f2fs: introduce memory mode1dd8074b61ANDROID: Update the ABI representation9bc5a118efRevert "ANDROID: usb: host: export additional xhci symbols for ring management"3743e36578Revert "ANDROID: GKI: signal: Export for __lock_task_sighand"7219ca326aRevert "ANDROID: Sched: Add restricted vendor hooks for scheduler"4e709a85e5ANDROID: fix kernelci issue for allnoconfig builds909d582d3aANDROID: sched: Introducing PELT multiplier9cfe2646f7Revert "ANDROID: vendor_hooks: FPSIMD save/restore by using vendor_hooks"c7afbeb17eRevert "ANDROID: mm: export zone_watermark_ok"e09aff6074ANDROID: softirq: Add EXPORT_SYMBOL_GPL for softirq and taskletdd04e189dfANDROID: Update the ABI representatione3b7e41f06ANDROID: vendor_hooks:vendor hook for __alloc_pages_slowpath.b5bf2997c3FROMLIST: xfrm: Ensure policy checked for nested ESP tunnels970e02667cFROMLIST: xfrm: Skip checking of already-verified secpath entries039f38f9aaRevert "ANDROID: mm: add vendor hook for vmpressure"fc6f47b6fcRevert "ANDROID: module: Add vendor hook"f509b285d7ANDROID: Update the ABI representationb8762fa265BACKPORT: mm: don't be stuck to rmap lock on reclaim path737a5314c9ANDROID: power: Add vendor hook for suspend19b9be6d35ANDROID: vendor_hooks:vendor hook for mmput4a84a59cb8ANDROID: vendor_hooks:vendor hook for pidfd_open571f9fff87ANDROID: Update the ABI representationa48ad117ecBACKPORT: f2fs: do not set compression bit if kernel doesn't support406e9b3d0bBACKPORT: f2fs: do not count ENOENT for error case0d59b2578aBACKPORT: f2fs: avoid infinite loop to flush node pages6d2d344c5fBACKPORT: f2fs: replace congestion_wait() calls with io_schedule_timeout()ffe2cbbff9BACKPORT: f2fs: fix wrong condition check when failing metapage read9f4fae40a9UPSTREAM: arm64: perf: Support new DT compatiblesbe08fd28caUPSTREAM: arm64: perf: Simplify registration boilerplate96dc76e1b1UPSTREAM: arm64: perf: Support Denver and Carmel PMUs5ac3e909a4UPSTREAM: arm64: perf: add support for Cortex-A78913113f05fUPSTREAM: binder: fix redefinition of seq_file attributes0c79c40888BACKPORT: drm/amdkfd: Use drm_priv to pass VM from KFD to amdgpu0a21a3eb9fBACKPORT: usb: gadget: rndis: prevent integer overflow in rndis_set_response()d9d8680e9fBACKPORT: KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID2f9fed9ce8BACKPORT: Bluetooth: L2CAP: Fix use-after-free caused by l2cap_chan_putbc80ea8a42BACKPORT: io_uring: always grab file table for deferred statx0380da7fd6FROMGIT: io_uring: Use original task for req identity in io_identity_cow()19bb609b45FROMLIST: binder: fix UAF of ref->proc caused by race condition999976097dANDROID: binder: fix pending prio state for early exitb5a6bcf9dcANDROID: Remove all but top-level OWNERS254dfc7e98ANDROID: Update the ABI representationfeb89f3850ANDROID: fix kernelci error in fs/fuse/dir.c3821e5b25cANDROID: power: add a vendor hook to log unfrozen tasksf2cf53322fANDROID: fuse-bpf: Fix RCU/reference issue1f44e4411fUPSTREAM: exfat: reduce block requests when zeroing a cluster885349f53dFROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctlseb4344203dFROMLIST: scsi: ufs: Fix a race condition related to device management commands561c270725ANDROID: vendor_hooks: tune reclaim scan type for specified mem_cgroupa6b9536c10ANDROID: KVM: arm64: Increase size of FF-A buffer094905c877ANDROID: fuse-bpf: Always call revalidate for backinga8b1cff534ANDROID: fuse-bpf: Adjust backing handle funcsa06f77a0ddANDROID: fuse-bpf: Fix revalidate error path and backing handling329650e3b9ANDROID: fuse: Don't use readdirplus w/ nodeid 055f267ee04ANDROID: fuse-bpf: Fix use of get_fuse_inode81a1ae6b43ANDROID: mm: unlock the page on speculative fault retry2957657ac3ANDROID: power: Add vendor hook for suspendace01eaf6bFROMGIT: Binder: add TF_UPDATE_TXN to replace outdated txnf6acdedf61ANDROID: GKI: forward declare struct tcpci_data in vendor hooks037c2b81acANDROID: Fix warning for undeclared struct acr_info825e1059b5ANDROID: KVM: arm64: Free shadow data vCPUs memcache And track more new symbols that were added to the 'android13-5.10' branch: 25 symbol(s) added 'GKI_struct_blk_mq_alloc_data' 'GKI_struct_cgroup_taskset' '__bitmap_xor' '__traceiter_android_vh_early_resume_begin' '__traceiter_android_vh_resume_end' '__traceiter_android_vh_try_to_freeze_todo_logging' '__tracepoint_android_vh_early_resume_begin' '__tracepoint_android_vh_resume_end' '__tracepoint_android_vh_try_to_freeze_todo_logging' '__xa_insert' 'dev_base_lock' 'devm_fwnode_gpiod_get_index' 'devm_gpiod_get_array_optional' 'drm_atomic_bridge_chain_disable' 'drm_mode_parse_command_line_for_connector' 'init_user_ns' 'iommu_dma_enable_best_fit_algo' 'kobject_rename' 'nf_register_net_hooks' 'nf_unregister_net_hooks' 'ns_capable_noaudit' 'regulator_set_active_discharge_regmap' 'snd_pcm_create_iec958_consumer_default' 'snd_pcm_fill_iec958_consumer' 'snd_pcm_fill_iec958_consumer_hw_params' Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ifb26d1c3de6f1ad3c3e6afc37d8acd61bdd8ac14
This commit is contained in:
29
BUILD.bazel
29
BUILD.bazel
@@ -19,8 +19,27 @@ package(
|
||||
|
||||
load("//build/kernel/kleaf:common_kernels.bzl", "define_common_kernels")
|
||||
|
||||
# This uses android/abi_gki_aarch64* in kmi_configs. If the list of
|
||||
# glob(["android/abi_gki_aarch64*"]) differs from
|
||||
# KMI_SYMBOL_LIST + ADDITIONAL_KMI_SYMBOL_LISTS in build.config.gki.aarch64,
|
||||
# or TRIM_NONLISTED_KMI changes, override kmi_configs here.
|
||||
define_common_kernels()
|
||||
_aarch64_additional_kmi_symbol_lists = [
|
||||
# keep sorted
|
||||
"android/abi_gki_aarch64_core",
|
||||
"android/abi_gki_aarch64_db845c",
|
||||
"android/abi_gki_aarch64_fips140",
|
||||
"android/abi_gki_aarch64_generic",
|
||||
"android/abi_gki_aarch64_hikey960",
|
||||
"android/abi_gki_aarch64_type_visibility",
|
||||
"android/abi_gki_aarch64_virtual_device",
|
||||
]
|
||||
|
||||
define_common_kernels(target_configs = {
|
||||
# Sync with build.config.gki.aarch64
|
||||
"kernel_aarch64": {
|
||||
"kmi_symbol_list": "android/abi_gki_aarch64",
|
||||
"additional_kmi_symbol_lists": _aarch64_additional_kmi_symbol_lists,
|
||||
"abi_definition": "android/abi_gki_aarch64.xml",
|
||||
},
|
||||
"kernel_aarch64_debug": {
|
||||
"kmi_symbol_list": "android/abi_gki_aarch64",
|
||||
"additional_kmi_symbol_lists": _aarch64_additional_kmi_symbol_lists,
|
||||
"abi_definition": "android/abi_gki_aarch64.xml",
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/Documentation/ABI/testing/OWNERS
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/Documentation/filesystems/OWNERS
|
||||
@@ -342,6 +342,11 @@ discard_unit=%s Control discard unit, the argument can be "block", "segment"
|
||||
default, it is helpful for large sized SMR or ZNS devices to
|
||||
reduce memory cost by getting rid of fs metadata supports small
|
||||
discard.
|
||||
memory=%s Control memory mode. This supports "normal" and "low" modes.
|
||||
"low" mode is introduced to support low memory devices.
|
||||
Because of the nature of low memory devices, in this mode, f2fs
|
||||
will try to save memory sometimes by sacrificing performance.
|
||||
"normal" mode is the default mode and same as before.
|
||||
======================== ============================================================
|
||||
|
||||
Debugfs Entries
|
||||
|
||||
@@ -3508,14 +3508,15 @@ field must be set, though).
|
||||
|
||||
“IEC958 Playback Con Mask” is used to return the bit-mask for the IEC958
|
||||
status bits of consumer mode. Similarly, “IEC958 Playback Pro Mask”
|
||||
returns the bitmask for professional mode. They are read-only controls,
|
||||
and are defined as MIXER controls (iface =
|
||||
``SNDRV_CTL_ELEM_IFACE_MIXER``).
|
||||
returns the bitmask for professional mode. They are read-only controls.
|
||||
|
||||
Meanwhile, “IEC958 Playback Default” control is defined for getting and
|
||||
setting the current default IEC958 bits. Note that this one is usually
|
||||
defined as a PCM control (iface = ``SNDRV_CTL_ELEM_IFACE_PCM``),
|
||||
although in some places it's defined as a MIXER control.
|
||||
setting the current default IEC958 bits.
|
||||
|
||||
Due to historical reasons, both variants of the Playback Mask and the
|
||||
Playback Default controls can be implemented on either a
|
||||
``SNDRV_CTL_ELEM_IFACE_PCM`` or a ``SNDRV_CTL_ELEM_IFACE_MIXER`` iface.
|
||||
Drivers should expose the mask and default on the same iface though.
|
||||
|
||||
In addition, you can define the control switches to enable/disable or to
|
||||
set the raw bit mode. The implementation will depend on the chip, but
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
# If we ever add another OWNERS above this directory, it's likely to be
|
||||
# more permissive, so don't inherit from it
|
||||
set noparent
|
||||
include kernel/common:android-mainline:/OWNERS_DrNo
|
||||
|
||||
# Downstream boards maintained directly in this manifest branch
|
||||
per-file abi_gki_aarch64_cuttlefish = adelva@google.com, rammuthiah@google.com
|
||||
per-file abi_gki_aarch64_goldfish = rkir@google.com
|
||||
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,6 @@
|
||||
cpumask_next
|
||||
cpu_number
|
||||
__cpu_online_mask
|
||||
crc32_le
|
||||
debugfs_create_dir
|
||||
debugfs_create_file
|
||||
debugfs_create_u32
|
||||
@@ -185,7 +184,6 @@
|
||||
free_irq
|
||||
generic_handle_irq
|
||||
get_device
|
||||
get_random_bytes
|
||||
gic_nonsecure_priorities
|
||||
gpiochip_add_data_with_key
|
||||
gpiochip_add_pin_range
|
||||
@@ -419,7 +417,6 @@
|
||||
preempt_schedule_notrace
|
||||
prepare_to_wait_event
|
||||
printk
|
||||
pskb_expand_head
|
||||
put_device
|
||||
__put_task_struct
|
||||
qcom_smem_state_register
|
||||
@@ -505,7 +502,6 @@
|
||||
simple_read_from_buffer
|
||||
single_open
|
||||
single_release
|
||||
skb_clone
|
||||
skb_dequeue
|
||||
skb_pull
|
||||
skb_push
|
||||
@@ -553,6 +549,7 @@
|
||||
strlen
|
||||
strncmp
|
||||
strncpy
|
||||
strnlen
|
||||
strpbrk
|
||||
strsep
|
||||
__sw_hweight32
|
||||
@@ -655,9 +652,11 @@
|
||||
cfg80211_vendor_cmd_reply
|
||||
cpu_latency_qos_add_request
|
||||
cpu_latency_qos_remove_request
|
||||
crc32_le
|
||||
device_get_mac_address
|
||||
device_set_wakeup_enable
|
||||
firmware_request_nowarn
|
||||
get_random_bytes
|
||||
guid_gen
|
||||
idr_for_each
|
||||
ieee80211_alloc_hw_nm
|
||||
@@ -710,11 +709,13 @@
|
||||
init_uts_ns
|
||||
__kfifo_alloc
|
||||
__kfifo_free
|
||||
ktime_get_with_offset
|
||||
__local_bh_enable_ip
|
||||
memmove
|
||||
__nla_parse
|
||||
nla_put
|
||||
param_ops_ulong
|
||||
pskb_expand_head
|
||||
regulatory_hint
|
||||
rfc1042_header
|
||||
skb_copy
|
||||
@@ -751,44 +752,6 @@
|
||||
devm_clk_bulk_get_optional
|
||||
iommu_map
|
||||
|
||||
# required by ax88179_178a.ko
|
||||
eth_platform_get_mac_address
|
||||
ethtool_op_get_link
|
||||
ethtool_op_get_ts_info
|
||||
eth_validate_addr
|
||||
generic_mii_ioctl
|
||||
mii_ethtool_get_link_ksettings
|
||||
mii_ethtool_gset
|
||||
mii_ethtool_set_link_ksettings
|
||||
mii_nway_restart
|
||||
netdev_err
|
||||
netdev_info
|
||||
netdev_warn
|
||||
netif_carrier_on
|
||||
usb_deregister
|
||||
usbnet_disconnect
|
||||
usbnet_get_endpoints
|
||||
usbnet_get_msglevel
|
||||
usbnet_get_stats64
|
||||
usbnet_link_change
|
||||
usbnet_nway_reset
|
||||
usbnet_open
|
||||
usbnet_probe
|
||||
usbnet_read_cmd
|
||||
usbnet_read_cmd_nopm
|
||||
usbnet_resume
|
||||
usbnet_set_msglevel
|
||||
usbnet_skb_return
|
||||
usbnet_start_xmit
|
||||
usbnet_stop
|
||||
usbnet_suspend
|
||||
usbnet_tx_timeout
|
||||
usbnet_update_max_qlen
|
||||
usbnet_write_cmd
|
||||
usbnet_write_cmd_async
|
||||
usbnet_write_cmd_nopm
|
||||
usb_register_driver
|
||||
|
||||
# required by bam_dma.ko
|
||||
dma_async_device_register
|
||||
dma_async_device_unregister
|
||||
@@ -1303,9 +1266,6 @@
|
||||
usb_put_hcd
|
||||
usb_remove_hcd
|
||||
|
||||
# required by pdr_interface.ko
|
||||
strnlen
|
||||
|
||||
# required by phy-qcom-qmp.ko
|
||||
of_clk_get_by_name
|
||||
__of_reset_control_get
|
||||
@@ -1489,6 +1449,7 @@
|
||||
refcount_dec_and_mutex_lock
|
||||
release_sock
|
||||
sk_alloc
|
||||
skb_clone
|
||||
skb_copy_bits
|
||||
skb_copy_datagram_iter
|
||||
skb_free_datagram
|
||||
@@ -1577,7 +1538,9 @@
|
||||
snd_ctl_add
|
||||
snd_ctl_new1
|
||||
snd_pcm_add_chmap_ctls
|
||||
snd_pcm_create_iec958_consumer_hw_params
|
||||
snd_pcm_create_iec958_consumer_default
|
||||
snd_pcm_fill_iec958_consumer
|
||||
snd_pcm_fill_iec958_consumer_hw_params
|
||||
snd_pcm_hw_constraint_eld
|
||||
|
||||
# required by snd-soc-qcom-common.ko
|
||||
@@ -1701,3 +1664,42 @@
|
||||
# required by wcd934x.ko
|
||||
mfd_add_devices
|
||||
mfd_remove_devices
|
||||
|
||||
# preserved by --additions-only
|
||||
eth_platform_get_mac_address
|
||||
ethtool_op_get_link
|
||||
ethtool_op_get_ts_info
|
||||
eth_validate_addr
|
||||
generic_mii_ioctl
|
||||
mii_ethtool_get_link_ksettings
|
||||
mii_ethtool_gset
|
||||
mii_ethtool_set_link_ksettings
|
||||
mii_nway_restart
|
||||
netdev_err
|
||||
netdev_info
|
||||
netdev_warn
|
||||
netif_carrier_on
|
||||
snd_pcm_create_iec958_consumer_hw_params
|
||||
usb_deregister
|
||||
usbnet_disconnect
|
||||
usbnet_get_endpoints
|
||||
usbnet_get_msglevel
|
||||
usbnet_get_stats64
|
||||
usbnet_link_change
|
||||
usbnet_nway_reset
|
||||
usbnet_open
|
||||
usbnet_probe
|
||||
usbnet_read_cmd
|
||||
usbnet_read_cmd_nopm
|
||||
usbnet_resume
|
||||
usbnet_set_msglevel
|
||||
usbnet_skb_return
|
||||
usbnet_start_xmit
|
||||
usbnet_stop
|
||||
usbnet_suspend
|
||||
usbnet_tx_timeout
|
||||
usbnet_update_max_qlen
|
||||
usbnet_write_cmd
|
||||
usbnet_write_cmd_async
|
||||
usbnet_write_cmd_nopm
|
||||
usb_register_driver
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
__bitmap_set
|
||||
bitmap_to_arr32
|
||||
__bitmap_weight
|
||||
__bitmap_xor
|
||||
blk_abort_request
|
||||
blk_alloc_queue
|
||||
blk_check_plugged
|
||||
@@ -332,6 +333,7 @@
|
||||
crypto_register_notifier
|
||||
crypto_register_scomp
|
||||
crypto_register_shash
|
||||
crypto_req_done
|
||||
crypto_shash_digest
|
||||
crypto_shash_final
|
||||
crypto_shash_finup
|
||||
@@ -374,6 +376,7 @@
|
||||
desc_to_gpio
|
||||
destroy_workqueue
|
||||
dev_alloc_name
|
||||
dev_base_lock
|
||||
dev_close
|
||||
_dev_crit
|
||||
dev_driver_string
|
||||
@@ -442,11 +445,13 @@
|
||||
devm_extcon_dev_allocate
|
||||
devm_extcon_dev_register
|
||||
devm_free_irq
|
||||
devm_fwnode_gpiod_get_index
|
||||
devm_fwnode_pwm_get
|
||||
devm_gen_pool_create
|
||||
devm_gpiochip_add_data_with_key
|
||||
devm_gpiod_get
|
||||
devm_gpiod_get_array
|
||||
devm_gpiod_get_array_optional
|
||||
devm_gpiod_get_optional
|
||||
devm_gpiod_put_array
|
||||
devm_gpio_free
|
||||
@@ -624,6 +629,7 @@
|
||||
drm_add_modes_noedid
|
||||
drm_atomic_add_affected_connectors
|
||||
drm_atomic_add_affected_planes
|
||||
drm_atomic_bridge_chain_disable
|
||||
drm_atomic_commit
|
||||
drm_atomic_get_connector_state
|
||||
drm_atomic_get_crtc_state
|
||||
@@ -749,6 +755,7 @@
|
||||
drm_mode_object_find
|
||||
drm_mode_object_get
|
||||
drm_mode_object_put
|
||||
drm_mode_parse_command_line_for_connector
|
||||
drm_mode_probed_add
|
||||
drm_modeset_acquire_fini
|
||||
drm_modeset_acquire_init
|
||||
@@ -959,6 +966,7 @@
|
||||
gpiod_get_raw_value_cansleep
|
||||
gpiod_get_value
|
||||
gpiod_get_value_cansleep
|
||||
gpiod_set_debounce
|
||||
gpiod_set_raw_value
|
||||
gpiod_set_raw_value_cansleep
|
||||
gpiod_set_value
|
||||
@@ -1047,6 +1055,7 @@
|
||||
__init_swait_queue_head
|
||||
init_task
|
||||
init_timer_key
|
||||
init_user_ns
|
||||
init_wait_entry
|
||||
__init_waitqueue_head
|
||||
input_alloc_absinfo
|
||||
@@ -1088,6 +1097,7 @@
|
||||
iommu_device_sysfs_remove
|
||||
iommu_device_unlink
|
||||
iommu_device_unregister
|
||||
iommu_dma_enable_best_fit_algo
|
||||
iommu_domain_alloc
|
||||
iommu_domain_free
|
||||
iommu_fwspec_add_ids
|
||||
@@ -1191,6 +1201,7 @@
|
||||
kobject_init
|
||||
kobject_init_and_add
|
||||
kobject_put
|
||||
kobject_rename
|
||||
kobject_uevent
|
||||
kobject_uevent_env
|
||||
kobj_sysfs_ops
|
||||
@@ -1351,6 +1362,8 @@
|
||||
netlink_kernel_release
|
||||
netlink_unicast
|
||||
net_ratelimit
|
||||
nf_register_net_hooks
|
||||
nf_unregister_net_hooks
|
||||
nla_append
|
||||
nla_memcpy
|
||||
__nla_parse
|
||||
@@ -1366,6 +1379,7 @@
|
||||
nr_cpu_ids
|
||||
nr_irqs
|
||||
ns_capable
|
||||
ns_capable_noaudit
|
||||
nsec_to_clock_t
|
||||
ns_to_timespec64
|
||||
__num_online_cpus
|
||||
@@ -1765,6 +1779,7 @@
|
||||
regulator_notifier_call_chain
|
||||
regulator_put
|
||||
regulator_register
|
||||
regulator_set_active_discharge_regmap
|
||||
regulator_set_load
|
||||
regulator_set_voltage
|
||||
regulator_set_voltage_sel_regmap
|
||||
@@ -2229,6 +2244,7 @@
|
||||
__traceiter_android_vh_cpu_idle_exit
|
||||
__traceiter_android_vh_dump_throttled_rt_tasks
|
||||
__traceiter_android_vh_dup_task_struct
|
||||
__traceiter_android_vh_early_resume_begin
|
||||
__traceiter_android_vh_enable_thermal_genl_check
|
||||
__traceiter_android_vh_ep_create_wakeup_source
|
||||
__traceiter_android_vh_get_user_pages
|
||||
@@ -2241,6 +2257,7 @@
|
||||
__traceiter_android_vh_of_i2c_get_board_info
|
||||
__traceiter_android_vh_pagecache_get_page
|
||||
__traceiter_android_vh_pin_user_pages
|
||||
__traceiter_android_vh_resume_end
|
||||
__traceiter_android_vh_rmqueue
|
||||
__traceiter_android_vh_sched_setaffinity_early
|
||||
__traceiter_android_vh_scheduler_tick
|
||||
@@ -2252,6 +2269,7 @@
|
||||
__traceiter_android_vh_thermal_pm_notify_suspend
|
||||
__traceiter_android_vh_timerfd_create
|
||||
__traceiter_android_vh_try_grab_compound_head
|
||||
__traceiter_android_vh_try_to_freeze_todo_logging
|
||||
__traceiter_android_vh_typec_store_partner_src_caps
|
||||
__traceiter_android_vh_typec_tcpci_override_toggling
|
||||
__traceiter_android_vh_typec_tcpm_get_timer
|
||||
@@ -2342,6 +2360,7 @@
|
||||
__tracepoint_android_vh_cpu_idle_exit
|
||||
__tracepoint_android_vh_dump_throttled_rt_tasks
|
||||
__tracepoint_android_vh_dup_task_struct
|
||||
__tracepoint_android_vh_early_resume_begin
|
||||
__tracepoint_android_vh_enable_thermal_genl_check
|
||||
__tracepoint_android_vh_ep_create_wakeup_source
|
||||
__tracepoint_android_vh_get_user_pages
|
||||
@@ -2354,6 +2373,7 @@
|
||||
__tracepoint_android_vh_of_i2c_get_board_info
|
||||
__tracepoint_android_vh_pagecache_get_page
|
||||
__tracepoint_android_vh_pin_user_pages
|
||||
__tracepoint_android_vh_resume_end
|
||||
__tracepoint_android_vh_rmqueue
|
||||
__tracepoint_android_vh_sched_setaffinity_early
|
||||
__tracepoint_android_vh_scheduler_tick
|
||||
@@ -2365,6 +2385,7 @@
|
||||
__tracepoint_android_vh_thermal_pm_notify_suspend
|
||||
__tracepoint_android_vh_timerfd_create
|
||||
__tracepoint_android_vh_try_grab_compound_head
|
||||
__tracepoint_android_vh_try_to_freeze_todo_logging
|
||||
__tracepoint_android_vh_typec_store_partner_src_caps
|
||||
__tracepoint_android_vh_typec_tcpci_override_toggling
|
||||
__tracepoint_android_vh_typec_tcpm_get_timer
|
||||
@@ -2656,6 +2677,7 @@
|
||||
xa_find
|
||||
xa_find_after
|
||||
xa_get_mark
|
||||
__xa_insert
|
||||
xa_load
|
||||
xa_set_mark
|
||||
xa_store
|
||||
|
||||
5
android/abi_gki_aarch64_type_visibility
Normal file
5
android/abi_gki_aarch64_type_visibility
Normal file
@@ -0,0 +1,5 @@
|
||||
[abi_symbol_list]
|
||||
|
||||
# for type visibility
|
||||
GKI_struct_blk_mq_alloc_data
|
||||
GKI_struct_cgroup_taskset
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/arch/arm/OWNERS
|
||||
@@ -76,10 +76,10 @@ CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)"
|
||||
CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)"
|
||||
|
||||
compress-$(CONFIG_KERNEL_GZIP) = gzip
|
||||
compress-$(CONFIG_KERNEL_LZO) = lzo
|
||||
compress-$(CONFIG_KERNEL_LZMA) = lzma
|
||||
compress-$(CONFIG_KERNEL_XZ) = xzkern
|
||||
compress-$(CONFIG_KERNEL_LZ4) = lz4
|
||||
compress-$(CONFIG_KERNEL_LZO) = lzo_with_size
|
||||
compress-$(CONFIG_KERNEL_LZMA) = lzma_with_size
|
||||
compress-$(CONFIG_KERNEL_XZ) = xzkern_with_size
|
||||
compress-$(CONFIG_KERNEL_LZ4) = lz4_with_size
|
||||
|
||||
libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/arch/arm64/OWNERS
|
||||
@@ -327,10 +327,27 @@ static inline unsigned long host_s2_pgtable_pages(void)
|
||||
|
||||
#define KVM_FFA_MBOX_NR_PAGES 1
|
||||
|
||||
/*
|
||||
* Maximum number of consitutents allowed in a descriptor. This number is
|
||||
* arbitrary, see comment below on SG_MAX_SEGMENTS in hyp_ffa_proxy_pages().
|
||||
*/
|
||||
#define KVM_FFA_MAX_NR_CONSTITUENTS 4096
|
||||
|
||||
static inline unsigned long hyp_ffa_proxy_pages(void)
|
||||
{
|
||||
size_t desc_max;
|
||||
|
||||
/*
|
||||
* SG_MAX_SEGMENTS is supposed to bound the number of elements in an
|
||||
* sglist, which should match the number of consituents in the
|
||||
* corresponding FFA descriptor. As such, the EL2 buffer needs to be
|
||||
* large enough to hold a descriptor with SG_MAX_SEGMENTS consituents
|
||||
* at least. But the kernel's DMA code doesn't enforce the limit, and
|
||||
* it is sometimes abused, so let's allow larger descriptors and hope
|
||||
* for the best.
|
||||
*/
|
||||
BUILD_BUG_ON(KVM_FFA_MAX_NR_CONSTITUENTS < SG_MAX_SEGMENTS);
|
||||
|
||||
/*
|
||||
* The hypervisor FFA proxy needs enough memory to buffer a fragmented
|
||||
* descriptor returned from EL3 in response to a RETRIEVE_REQ call.
|
||||
@@ -338,7 +355,7 @@ static inline unsigned long hyp_ffa_proxy_pages(void)
|
||||
desc_max = sizeof(struct ffa_mem_region) +
|
||||
sizeof(struct ffa_mem_region_attributes) +
|
||||
sizeof(struct ffa_composite_mem_region) +
|
||||
SG_MAX_SEGMENTS * sizeof(struct ffa_mem_region_addr_range);
|
||||
KVM_FFA_MAX_NR_CONSTITUENTS * sizeof(struct ffa_mem_region_addr_range);
|
||||
|
||||
/* Plus a page each for the hypervisor's RX and TX mailboxes. */
|
||||
return (2 * KVM_FFA_MBOX_NR_PAGES) + DIV_ROUND_UP(desc_max, PAGE_SIZE);
|
||||
|
||||
@@ -149,6 +149,11 @@ struct thread_struct {
|
||||
struct user_fpsimd_state fpsimd_state;
|
||||
} uw;
|
||||
|
||||
/*
|
||||
* Unused now that commit 74555f39924d ("ANDROID: vendor_hooks: FPSIMD
|
||||
* save/restore by using vendor_hooks") is reverted, but remains to
|
||||
* preserve the ABI in the android13-5.10 branch.
|
||||
*/
|
||||
ANDROID_VENDOR_DATA(1);
|
||||
|
||||
unsigned int fpsimd_cpu;
|
||||
|
||||
@@ -1116,17 +1116,32 @@ static int armv8_pmu_init_nogroups(struct arm_pmu *cpu_pmu, char *name,
|
||||
return armv8_pmu_init(cpu_pmu, name, map_event, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static int armv8_pmuv3_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_pmuv3",
|
||||
armv8_pmuv3_map_event);
|
||||
#define PMUV3_INIT_SIMPLE(name) \
|
||||
static int name##_pmu_init(struct arm_pmu *cpu_pmu) \
|
||||
{ \
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, #name, armv8_pmuv3_map_event);\
|
||||
}
|
||||
|
||||
static int armv8_a34_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a34",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
PMUV3_INIT_SIMPLE(armv8_pmuv3)
|
||||
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a34)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a55)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a65)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a75)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a76)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a77)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_a78)
|
||||
PMUV3_INIT_SIMPLE(armv9_cortex_a510)
|
||||
PMUV3_INIT_SIMPLE(armv9_cortex_a710)
|
||||
PMUV3_INIT_SIMPLE(armv8_cortex_x1)
|
||||
PMUV3_INIT_SIMPLE(armv9_cortex_x2)
|
||||
PMUV3_INIT_SIMPLE(armv8_neoverse_e1)
|
||||
PMUV3_INIT_SIMPLE(armv8_neoverse_n1)
|
||||
PMUV3_INIT_SIMPLE(armv9_neoverse_n2)
|
||||
PMUV3_INIT_SIMPLE(armv8_neoverse_v1)
|
||||
|
||||
PMUV3_INIT_SIMPLE(armv8_nvidia_carmel)
|
||||
PMUV3_INIT_SIMPLE(armv8_nvidia_denver)
|
||||
|
||||
static int armv8_a35_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
@@ -1140,24 +1155,12 @@ static int armv8_a53_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
armv8_a53_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a55_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a55",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a57_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a57",
|
||||
armv8_a57_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a65_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a65",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a72_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a72",
|
||||
@@ -1170,36 +1173,6 @@ static int armv8_a73_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
armv8_a73_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a75_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a75",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a76_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a76",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_a77_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cortex_a77",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_e1_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_neoverse_e1",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_n1_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_neoverse_n1",
|
||||
armv8_pmuv3_map_event);
|
||||
}
|
||||
|
||||
static int armv8_thunder_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
{
|
||||
return armv8_pmu_init_nogroups(cpu_pmu, "armv8_cavium_thunder",
|
||||
@@ -1213,22 +1186,31 @@ static int armv8_vulcan_pmu_init(struct arm_pmu *cpu_pmu)
|
||||
}
|
||||
|
||||
static const struct of_device_id armv8_pmu_of_device_ids[] = {
|
||||
{.compatible = "arm,armv8-pmuv3", .data = armv8_pmuv3_init},
|
||||
{.compatible = "arm,cortex-a34-pmu", .data = armv8_a34_pmu_init},
|
||||
{.compatible = "arm,armv8-pmuv3", .data = armv8_pmuv3_pmu_init},
|
||||
{.compatible = "arm,cortex-a34-pmu", .data = armv8_cortex_a34_pmu_init},
|
||||
{.compatible = "arm,cortex-a35-pmu", .data = armv8_a35_pmu_init},
|
||||
{.compatible = "arm,cortex-a53-pmu", .data = armv8_a53_pmu_init},
|
||||
{.compatible = "arm,cortex-a55-pmu", .data = armv8_a55_pmu_init},
|
||||
{.compatible = "arm,cortex-a55-pmu", .data = armv8_cortex_a55_pmu_init},
|
||||
{.compatible = "arm,cortex-a57-pmu", .data = armv8_a57_pmu_init},
|
||||
{.compatible = "arm,cortex-a65-pmu", .data = armv8_a65_pmu_init},
|
||||
{.compatible = "arm,cortex-a65-pmu", .data = armv8_cortex_a65_pmu_init},
|
||||
{.compatible = "arm,cortex-a72-pmu", .data = armv8_a72_pmu_init},
|
||||
{.compatible = "arm,cortex-a73-pmu", .data = armv8_a73_pmu_init},
|
||||
{.compatible = "arm,cortex-a75-pmu", .data = armv8_a75_pmu_init},
|
||||
{.compatible = "arm,cortex-a76-pmu", .data = armv8_a76_pmu_init},
|
||||
{.compatible = "arm,cortex-a77-pmu", .data = armv8_a77_pmu_init},
|
||||
{.compatible = "arm,neoverse-e1-pmu", .data = armv8_e1_pmu_init},
|
||||
{.compatible = "arm,neoverse-n1-pmu", .data = armv8_n1_pmu_init},
|
||||
{.compatible = "arm,cortex-a75-pmu", .data = armv8_cortex_a75_pmu_init},
|
||||
{.compatible = "arm,cortex-a76-pmu", .data = armv8_cortex_a76_pmu_init},
|
||||
{.compatible = "arm,cortex-a77-pmu", .data = armv8_cortex_a77_pmu_init},
|
||||
{.compatible = "arm,cortex-a78-pmu", .data = armv8_cortex_a78_pmu_init},
|
||||
{.compatible = "arm,cortex-a510-pmu", .data = armv9_cortex_a510_pmu_init},
|
||||
{.compatible = "arm,cortex-a710-pmu", .data = armv9_cortex_a710_pmu_init},
|
||||
{.compatible = "arm,cortex-x1-pmu", .data = armv8_cortex_x1_pmu_init},
|
||||
{.compatible = "arm,cortex-x2-pmu", .data = armv9_cortex_x2_pmu_init},
|
||||
{.compatible = "arm,neoverse-e1-pmu", .data = armv8_neoverse_e1_pmu_init},
|
||||
{.compatible = "arm,neoverse-n1-pmu", .data = armv8_neoverse_n1_pmu_init},
|
||||
{.compatible = "arm,neoverse-n2-pmu", .data = armv9_neoverse_n2_pmu_init},
|
||||
{.compatible = "arm,neoverse-v1-pmu", .data = armv8_neoverse_v1_pmu_init},
|
||||
{.compatible = "cavium,thunder-pmu", .data = armv8_thunder_pmu_init},
|
||||
{.compatible = "brcm,vulcan-pmu", .data = armv8_vulcan_pmu_init},
|
||||
{.compatible = "nvidia,carmel-pmu", .data = armv8_nvidia_carmel_pmu_init},
|
||||
{.compatible = "nvidia,denver-pmu", .data = armv8_nvidia_denver_pmu_init},
|
||||
{},
|
||||
};
|
||||
|
||||
@@ -1251,7 +1233,7 @@ static int __init armv8_pmu_driver_init(void)
|
||||
if (acpi_disabled)
|
||||
return platform_driver_register(&armv8_pmu_driver);
|
||||
else
|
||||
return arm_pmu_acpi_probe(armv8_pmuv3_init);
|
||||
return arm_pmu_acpi_probe(armv8_pmuv3_pmu_init);
|
||||
}
|
||||
device_initcall(armv8_pmu_driver_init)
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include <linux/percpu.h>
|
||||
#include <linux/thread_info.h>
|
||||
#include <linux/prctl.h>
|
||||
#include <trace/hooks/fpsimd.h>
|
||||
#include <trace/hooks/mpam.h>
|
||||
|
||||
#include <asm/alternative.h>
|
||||
@@ -588,8 +587,6 @@ __notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev,
|
||||
if (prev->thread.sctlr_user != next->thread.sctlr_user)
|
||||
update_sctlr_el1(next->thread.sctlr_user);
|
||||
|
||||
trace_android_vh_is_fpsimd_save(prev, next);
|
||||
|
||||
/* the actual thread switch */
|
||||
last = cpu_switch_to(prev, next);
|
||||
|
||||
|
||||
@@ -915,7 +915,7 @@ static void do_handle_IPI(int ipinr)
|
||||
break;
|
||||
|
||||
case IPI_CPU_STOP:
|
||||
trace_android_vh_ipi_stop_rcuidle(get_irq_regs());
|
||||
trace_android_vh_ipi_stop(get_irq_regs());
|
||||
local_cpu_stop();
|
||||
break;
|
||||
|
||||
|
||||
@@ -2286,6 +2286,16 @@ static int __init early_kvm_mode_cfg(char *arg)
|
||||
if (!arg)
|
||||
return -EINVAL;
|
||||
|
||||
if (strcmp(arg, "none") == 0) {
|
||||
kvm_mode = KVM_MODE_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!is_hyp_mode_available()) {
|
||||
pr_warn_once("KVM is not available. Ignoring kvm-arm.mode\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(arg, "protected") == 0) {
|
||||
if (!is_kernel_in_hyp_mode())
|
||||
kvm_mode = KVM_MODE_PROTECTED;
|
||||
@@ -2300,11 +2310,6 @@ static int __init early_kvm_mode_cfg(char *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcmp(arg, "none") == 0) {
|
||||
kvm_mode = KVM_MODE_NONE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
early_param("kvm-arm.mode", early_kvm_mode_cfg);
|
||||
|
||||
@@ -414,6 +414,15 @@ static int set_host_vcpus(struct shadow_vcpu_state *shadow_vcpus, int nr_vcpus,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int init_ptrauth(struct kvm_vcpu *shadow_vcpu)
|
||||
{
|
||||
int ret = 0;
|
||||
if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, shadow_vcpu->arch.features) ||
|
||||
test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, shadow_vcpu->arch.features))
|
||||
ret = kvm_vcpu_enable_ptrauth(shadow_vcpu);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm,
|
||||
struct kvm_vcpu **vcpu_array, int nr_vcpus)
|
||||
{
|
||||
@@ -438,6 +447,10 @@ static int init_shadow_structs(struct kvm *kvm, struct kvm_shadow_vm *vm,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = init_ptrauth(shadow_vcpu);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (test_bit(KVM_ARM_VCPU_SVE, shadow_vcpu->arch.features)) {
|
||||
size_t sve_state_size;
|
||||
void *sve_state;
|
||||
@@ -600,6 +613,25 @@ static int check_shadow_size(int nr_vcpus, size_t shadow_size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void drain_shadow_vcpus(struct shadow_vcpu_state *shadow_vcpus,
|
||||
unsigned int nr_vcpus,
|
||||
struct kvm_hyp_memcache *mc)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nr_vcpus; i++) {
|
||||
struct kvm_vcpu *shadow_vcpu = &shadow_vcpus[i].vcpu;
|
||||
struct kvm_hyp_memcache *vcpu_mc = &shadow_vcpu->arch.pkvm_memcache;
|
||||
void *addr;
|
||||
|
||||
while (vcpu_mc->nr_pages) {
|
||||
addr = pop_hyp_memcache(vcpu_mc, hyp_phys_to_virt);
|
||||
push_hyp_memcache(mc, addr, hyp_virt_to_phys);
|
||||
WARN_ON(__pkvm_hyp_donate_host(hyp_virt_to_pfn(addr), 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the shadow copy of the protected VM state using the memory
|
||||
* donated by the host.
|
||||
@@ -753,6 +785,7 @@ int __pkvm_teardown_shadow(int shadow_handle)
|
||||
/* Reclaim guest pages, and page-table pages */
|
||||
mc = &vm->host_kvm->arch.pkvm.teardown_mc;
|
||||
reclaim_guest_pages(vm, mc);
|
||||
drain_shadow_vcpus(vm->shadow_vcpus, vm->created_vcpus, mc);
|
||||
unpin_host_vcpus(vm->shadow_vcpus, vm->created_vcpus);
|
||||
|
||||
/* Push the metadata pages to the teardown memcache */
|
||||
@@ -831,14 +864,7 @@ void pkvm_reset_vcpu(struct kvm_vcpu *vcpu)
|
||||
|
||||
WARN_ON(!reset_state->reset);
|
||||
|
||||
if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) ||
|
||||
test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) {
|
||||
/*
|
||||
* This call should not fail since we've already checked for
|
||||
* feature support on initialization.
|
||||
*/
|
||||
WARN_ON(kvm_vcpu_enable_ptrauth(vcpu));
|
||||
}
|
||||
init_ptrauth(vcpu);
|
||||
|
||||
/* Reset core registers */
|
||||
memset(vcpu_gp_regs(vcpu), 0, sizeof(*vcpu_gp_regs(vcpu)));
|
||||
|
||||
@@ -30,9 +30,11 @@ $(obj)/vmlinux.bin: vmlinux FORCE
|
||||
|
||||
suffix-$(CONFIG_KERNEL_GZIP) := gzip
|
||||
suffix-$(CONFIG_KERNEL_LZO) := lzo
|
||||
compress-$(CONFIG_KERNEL_GZIP) := gzip
|
||||
compress-$(CONFIG_KERNEL_LZO) := lzo_with_size
|
||||
|
||||
$(obj)/vmlinux.bin.$(suffix-y): $(obj)/vmlinux.bin FORCE
|
||||
$(call if_changed,$(suffix-y))
|
||||
$(call if_changed,$(compress-y))
|
||||
|
||||
LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T
|
||||
OBJCOPYFLAGS := -O binary
|
||||
|
||||
@@ -71,12 +71,12 @@ $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
tool_$(CONFIG_KERNEL_GZIP) = gzip
|
||||
tool_$(CONFIG_KERNEL_BZIP2) = bzip2
|
||||
tool_$(CONFIG_KERNEL_LZ4) = lz4
|
||||
tool_$(CONFIG_KERNEL_LZMA) = lzma
|
||||
tool_$(CONFIG_KERNEL_LZO) = lzo
|
||||
tool_$(CONFIG_KERNEL_XZ) = xzkern
|
||||
tool_$(CONFIG_KERNEL_ZSTD) = zstd22
|
||||
tool_$(CONFIG_KERNEL_BZIP2) = bzip2_with_size
|
||||
tool_$(CONFIG_KERNEL_LZ4) = lz4_with_size
|
||||
tool_$(CONFIG_KERNEL_LZMA) = lzma_with_size
|
||||
tool_$(CONFIG_KERNEL_LZO) = lzo_with_size
|
||||
tool_$(CONFIG_KERNEL_XZ) = xzkern_with_size
|
||||
tool_$(CONFIG_KERNEL_ZSTD) = zstd22_with_size
|
||||
|
||||
targets += vmlinux.bin.z
|
||||
$(obj)/vmlinux.bin.z: $(obj)/vmlinux.bin FORCE
|
||||
|
||||
@@ -73,15 +73,15 @@ suffix-$(CONFIG_KERNEL_XZ) := xz
|
||||
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
|
||||
$(call if_changed,gzip)
|
||||
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
|
||||
$(call if_changed,bzip2)
|
||||
$(call if_changed,bzip2_with_size)
|
||||
$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
|
||||
$(call if_changed,lz4)
|
||||
$(call if_changed,lz4_with_size)
|
||||
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
|
||||
$(call if_changed,lzma)
|
||||
$(call if_changed,lzma_with_size)
|
||||
$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
|
||||
$(call if_changed,lzo)
|
||||
$(call if_changed,lzo_with_size)
|
||||
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
|
||||
$(call if_changed,xzkern)
|
||||
$(call if_changed,xzkern_with_size)
|
||||
|
||||
LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
|
||||
$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
|
||||
|
||||
@@ -49,15 +49,15 @@ suffix-$(CONFIG_KERNEL_XZ) := .xz
|
||||
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,gzip)
|
||||
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,bzip2)
|
||||
$(call if_changed,bzip2_with_size)
|
||||
$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lz4)
|
||||
$(call if_changed,lz4_with_size)
|
||||
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lzma)
|
||||
$(call if_changed,lzma_with_size)
|
||||
$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lzo)
|
||||
$(call if_changed,lzo_with_size)
|
||||
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,xzkern)
|
||||
$(call if_changed,xzkern_with_size)
|
||||
|
||||
OBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.bin.compressed
|
||||
$(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE
|
||||
|
||||
@@ -58,13 +58,13 @@ vmlinux.bin.all-y := $(obj)/vmlinux.bin
|
||||
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,gzip)
|
||||
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,bzip2)
|
||||
$(call if_changed,bzip2_with_size)
|
||||
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lzma)
|
||||
$(call if_changed,lzma_with_size)
|
||||
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,xzkern)
|
||||
$(call if_changed,xzkern_with_size)
|
||||
$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lzo)
|
||||
$(call if_changed,lzo_with_size)
|
||||
|
||||
OBJCOPYFLAGS += -R .empty_zero_page
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/arch/x86/OWNERS
|
||||
@@ -127,17 +127,17 @@ vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs
|
||||
$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,gzip)
|
||||
$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,bzip2)
|
||||
$(call if_changed,bzip2_with_size)
|
||||
$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lzma)
|
||||
$(call if_changed,lzma_with_size)
|
||||
$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,xzkern)
|
||||
$(call if_changed,xzkern_with_size)
|
||||
$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lzo)
|
||||
$(call if_changed,lzo_with_size)
|
||||
$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,lz4)
|
||||
$(call if_changed,lz4_with_size)
|
||||
$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE
|
||||
$(call if_changed,zstd22)
|
||||
$(call if_changed,zstd22_with_size)
|
||||
|
||||
suffix-$(CONFIG_KERNEL_GZIP) := gz
|
||||
suffix-$(CONFIG_KERNEL_BZIP2) := bz2
|
||||
|
||||
@@ -39,3 +39,4 @@ obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
|
||||
obj-$(CONFIG_BLK_PM) += blk-pm.o
|
||||
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o blk-crypto.o
|
||||
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
|
||||
obj-$(CONFIG_ANDROID_VENDOR_HOOKS) += vendor_hooks.o
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/block/OWNERS
|
||||
24
block/vendor_hooks.c
Normal file
24
block/vendor_hooks.c
Normal file
@@ -0,0 +1,24 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* vendor_hook.c
|
||||
*
|
||||
* Copyright 2022 Google LLC
|
||||
*/
|
||||
#include "blk.h"
|
||||
#include "blk-mq-tag.h"
|
||||
#include "blk-mq.h"
|
||||
#include <linux/blk-mq.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
#include <linux/tracepoint.h>
|
||||
#include <trace/hooks/block.h>
|
||||
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init);
|
||||
|
||||
/*
|
||||
* For type visibility
|
||||
*/
|
||||
const struct blk_mq_alloc_data *GKI_struct_blk_mq_alloc_data;
|
||||
EXPORT_SYMBOL_GPL(GKI_struct_blk_mq_alloc_data);
|
||||
|
||||
@@ -7,11 +7,11 @@ Image.lz4
|
||||
Image.gz
|
||||
"
|
||||
|
||||
# Sync with BUILD.bazel
|
||||
ABI_DEFINITION=android/abi_gki_aarch64.xml
|
||||
# Update BUILD.bazel, define_common_kernels() if the list differs from
|
||||
# android/abi_gki_aarch64* in the filesystem.
|
||||
KMI_SYMBOL_LIST=android/abi_gki_aarch64
|
||||
ADDITIONAL_KMI_SYMBOL_LISTS="
|
||||
android/abi_gki_aarch64_type_visibility
|
||||
android/abi_gki_aarch64_core
|
||||
android/abi_gki_aarch64_fips140
|
||||
android/abi_gki_aarch64_generic
|
||||
|
||||
@@ -5,5 +5,7 @@
|
||||
BUILD_SYSTEM_DLKM=1
|
||||
MODULES_LIST=${ROOT_DIR}/${KERNEL_DIR}/android/gki_system_dlkm_modules
|
||||
|
||||
BUILD_GKI_CERTIFICATION_TOOLS=1
|
||||
|
||||
BUILD_GKI_ARTIFACTS=1
|
||||
BUILD_GKI_BOOT_IMG_SIZE=67108864
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/crypto/OWNERS
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/drivers/OWNERS
|
||||
@@ -173,8 +173,32 @@ static inline void binder_stats_created(enum binder_stat_types type)
|
||||
atomic_inc(&binder_stats.obj_created[type]);
|
||||
}
|
||||
|
||||
struct binder_transaction_log binder_transaction_log;
|
||||
struct binder_transaction_log binder_transaction_log_failed;
|
||||
struct binder_transaction_log_entry {
|
||||
int debug_id;
|
||||
int debug_id_done;
|
||||
int call_type;
|
||||
int from_proc;
|
||||
int from_thread;
|
||||
int target_handle;
|
||||
int to_proc;
|
||||
int to_thread;
|
||||
int to_node;
|
||||
int data_size;
|
||||
int offsets_size;
|
||||
int return_error_line;
|
||||
uint32_t return_error;
|
||||
uint32_t return_error_param;
|
||||
char context_name[BINDERFS_MAX_NAME + 1];
|
||||
};
|
||||
|
||||
struct binder_transaction_log {
|
||||
atomic_t cur;
|
||||
bool full;
|
||||
struct binder_transaction_log_entry entry[32];
|
||||
};
|
||||
|
||||
static struct binder_transaction_log binder_transaction_log;
|
||||
static struct binder_transaction_log binder_transaction_log_failed;
|
||||
|
||||
static struct binder_transaction_log_entry *binder_transaction_log_add(
|
||||
struct binder_transaction_log *log)
|
||||
@@ -657,8 +681,13 @@ static void binder_do_set_priority(struct binder_thread *thread,
|
||||
bool has_cap_nice;
|
||||
unsigned int policy = desired->sched_policy;
|
||||
|
||||
if (task->policy == policy && task->normal_prio == desired->prio)
|
||||
if (task->policy == policy && task->normal_prio == desired->prio) {
|
||||
spin_lock(&thread->prio_lock);
|
||||
if (thread->prio_state == BINDER_PRIO_PENDING)
|
||||
thread->prio_state = BINDER_PRIO_SET;
|
||||
spin_unlock(&thread->prio_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
has_cap_nice = has_capability_noaudit(task, CAP_SYS_NICE);
|
||||
|
||||
@@ -2507,6 +2536,56 @@ static int binder_fixup_parent(struct binder_transaction *t,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* binder_can_update_transaction() - Can a txn be superseded by an updated one?
|
||||
* @t1: the pending async txn in the frozen process
|
||||
* @t2: the new async txn to supersede the outdated pending one
|
||||
*
|
||||
* Return: true if t2 can supersede t1
|
||||
* false if t2 can not supersede t1
|
||||
*/
|
||||
static bool binder_can_update_transaction(struct binder_transaction *t1,
|
||||
struct binder_transaction *t2)
|
||||
{
|
||||
if ((t1->flags & t2->flags & (TF_ONE_WAY | TF_UPDATE_TXN)) !=
|
||||
(TF_ONE_WAY | TF_UPDATE_TXN) || !t1->to_proc || !t2->to_proc)
|
||||
return false;
|
||||
if (t1->to_proc->tsk == t2->to_proc->tsk && t1->code == t2->code &&
|
||||
t1->flags == t2->flags && t1->buffer->pid == t2->buffer->pid &&
|
||||
t1->buffer->target_node->ptr == t2->buffer->target_node->ptr &&
|
||||
t1->buffer->target_node->cookie == t2->buffer->target_node->cookie)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* binder_find_outdated_transaction_ilocked() - Find the outdated transaction
|
||||
* @t: new async transaction
|
||||
* @target_list: list to find outdated transaction
|
||||
*
|
||||
* Return: the outdated transaction if found
|
||||
* NULL if no outdated transacton can be found
|
||||
*
|
||||
* Requires the proc->inner_lock to be held.
|
||||
*/
|
||||
static struct binder_transaction *
|
||||
binder_find_outdated_transaction_ilocked(struct binder_transaction *t,
|
||||
struct list_head *target_list)
|
||||
{
|
||||
struct binder_work *w;
|
||||
|
||||
list_for_each_entry(w, target_list, entry) {
|
||||
struct binder_transaction *t_queued;
|
||||
|
||||
if (w->type != BINDER_WORK_TRANSACTION)
|
||||
continue;
|
||||
t_queued = container_of(w, struct binder_transaction, work);
|
||||
if (binder_can_update_transaction(t_queued, t))
|
||||
return t_queued;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* binder_proc_transaction() - sends a transaction to a process and wakes it up
|
||||
* @t: transaction to send
|
||||
@@ -2532,6 +2611,7 @@ static int binder_proc_transaction(struct binder_transaction *t,
|
||||
struct binder_node *node = t->buffer->target_node;
|
||||
bool oneway = !!(t->flags & TF_ONE_WAY);
|
||||
bool pending_async = false;
|
||||
struct binder_transaction *t_outdated = NULL;
|
||||
|
||||
BUG_ON(!node);
|
||||
binder_node_lock(node);
|
||||
@@ -2569,6 +2649,17 @@ static int binder_proc_transaction(struct binder_transaction *t,
|
||||
} else if (!pending_async) {
|
||||
binder_enqueue_work_ilocked(&t->work, &proc->todo);
|
||||
} else {
|
||||
if ((t->flags & TF_UPDATE_TXN) && proc->is_frozen) {
|
||||
t_outdated = binder_find_outdated_transaction_ilocked(t,
|
||||
&node->async_todo);
|
||||
if (t_outdated) {
|
||||
binder_debug(BINDER_DEBUG_TRANSACTION,
|
||||
"txn %d supersedes %d\n",
|
||||
t->debug_id, t_outdated->debug_id);
|
||||
list_del_init(&t_outdated->work.entry);
|
||||
proc->outstanding_txns--;
|
||||
}
|
||||
}
|
||||
binder_enqueue_work_ilocked(&t->work, &node->async_todo);
|
||||
}
|
||||
|
||||
@@ -2579,6 +2670,22 @@ static int binder_proc_transaction(struct binder_transaction *t,
|
||||
binder_inner_proc_unlock(proc);
|
||||
binder_node_unlock(node);
|
||||
|
||||
/*
|
||||
* To reduce potential contention, free the outdated transaction and
|
||||
* buffer after releasing the locks.
|
||||
*/
|
||||
if (t_outdated) {
|
||||
struct binder_buffer *buffer = t_outdated->buffer;
|
||||
|
||||
t_outdated->buffer = NULL;
|
||||
buffer->transaction = NULL;
|
||||
trace_binder_transaction_update_buffer_release(buffer);
|
||||
binder_transaction_buffer_release(proc, NULL, buffer, 0, 0);
|
||||
binder_alloc_free_buf(&proc->alloc, buffer);
|
||||
kfree(t_outdated);
|
||||
binder_stats_deleted(BINDER_STAT_TRANSACTION);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -5988,8 +6095,7 @@ static void print_binder_proc_stats(struct seq_file *m,
|
||||
print_binder_stats(m, " ", &proc->stats);
|
||||
}
|
||||
|
||||
|
||||
int binder_state_show(struct seq_file *m, void *unused)
|
||||
static int state_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct binder_proc *proc;
|
||||
struct binder_node *node;
|
||||
@@ -6028,7 +6134,7 @@ int binder_state_show(struct seq_file *m, void *unused)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int binder_stats_show(struct seq_file *m, void *unused)
|
||||
static int stats_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct binder_proc *proc;
|
||||
|
||||
@@ -6044,7 +6150,7 @@ int binder_stats_show(struct seq_file *m, void *unused)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int binder_transactions_show(struct seq_file *m, void *unused)
|
||||
static int transactions_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct binder_proc *proc;
|
||||
|
||||
@@ -6100,7 +6206,7 @@ static void print_binder_transaction_log_entry(struct seq_file *m,
|
||||
"\n" : " (incomplete)\n");
|
||||
}
|
||||
|
||||
int binder_transaction_log_show(struct seq_file *m, void *unused)
|
||||
static int transaction_log_show(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct binder_transaction_log *log = m->private;
|
||||
unsigned int log_cur = atomic_read(&log->cur);
|
||||
@@ -6132,6 +6238,45 @@ const struct file_operations binder_fops = {
|
||||
.release = binder_release,
|
||||
};
|
||||
|
||||
DEFINE_SHOW_ATTRIBUTE(state);
|
||||
DEFINE_SHOW_ATTRIBUTE(stats);
|
||||
DEFINE_SHOW_ATTRIBUTE(transactions);
|
||||
DEFINE_SHOW_ATTRIBUTE(transaction_log);
|
||||
|
||||
const struct binder_debugfs_entry binder_debugfs_entries[] = {
|
||||
{
|
||||
.name = "state",
|
||||
.mode = 0444,
|
||||
.fops = &state_fops,
|
||||
.data = NULL,
|
||||
},
|
||||
{
|
||||
.name = "stats",
|
||||
.mode = 0444,
|
||||
.fops = &stats_fops,
|
||||
.data = NULL,
|
||||
},
|
||||
{
|
||||
.name = "transactions",
|
||||
.mode = 0444,
|
||||
.fops = &transactions_fops,
|
||||
.data = NULL,
|
||||
},
|
||||
{
|
||||
.name = "transaction_log",
|
||||
.mode = 0444,
|
||||
.fops = &transaction_log_fops,
|
||||
.data = &binder_transaction_log,
|
||||
},
|
||||
{
|
||||
.name = "failed_transaction_log",
|
||||
.mode = 0444,
|
||||
.fops = &transaction_log_fops,
|
||||
.data = &binder_transaction_log_failed,
|
||||
},
|
||||
{} /* terminator */
|
||||
};
|
||||
|
||||
static int __init init_binder_device(const char *name)
|
||||
{
|
||||
int ret;
|
||||
@@ -6177,36 +6322,18 @@ static int __init binder_init(void)
|
||||
atomic_set(&binder_transaction_log_failed.cur, ~0U);
|
||||
|
||||
binder_debugfs_dir_entry_root = debugfs_create_dir("binder", NULL);
|
||||
if (binder_debugfs_dir_entry_root)
|
||||
if (binder_debugfs_dir_entry_root) {
|
||||
const struct binder_debugfs_entry *db_entry;
|
||||
|
||||
binder_for_each_debugfs_entry(db_entry)
|
||||
debugfs_create_file(db_entry->name,
|
||||
db_entry->mode,
|
||||
binder_debugfs_dir_entry_root,
|
||||
db_entry->data,
|
||||
db_entry->fops);
|
||||
|
||||
binder_debugfs_dir_entry_proc = debugfs_create_dir("proc",
|
||||
binder_debugfs_dir_entry_root);
|
||||
|
||||
if (binder_debugfs_dir_entry_root) {
|
||||
debugfs_create_file("state",
|
||||
0444,
|
||||
binder_debugfs_dir_entry_root,
|
||||
NULL,
|
||||
&binder_state_fops);
|
||||
debugfs_create_file("stats",
|
||||
0444,
|
||||
binder_debugfs_dir_entry_root,
|
||||
NULL,
|
||||
&binder_stats_fops);
|
||||
debugfs_create_file("transactions",
|
||||
0444,
|
||||
binder_debugfs_dir_entry_root,
|
||||
NULL,
|
||||
&binder_transactions_fops);
|
||||
debugfs_create_file("transaction_log",
|
||||
0444,
|
||||
binder_debugfs_dir_entry_root,
|
||||
&binder_transaction_log,
|
||||
&binder_transaction_log_fops);
|
||||
debugfs_create_file("failed_transaction_log",
|
||||
0444,
|
||||
binder_debugfs_dir_entry_root,
|
||||
&binder_transaction_log_failed,
|
||||
&binder_transaction_log_fops);
|
||||
}
|
||||
|
||||
if (!IS_ENABLED(CONFIG_ANDROID_BINDERFS) &&
|
||||
|
||||
@@ -107,41 +107,19 @@ static inline int __init init_binderfs(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
int binder_stats_show(struct seq_file *m, void *unused);
|
||||
DEFINE_SHOW_ATTRIBUTE(binder_stats);
|
||||
|
||||
int binder_state_show(struct seq_file *m, void *unused);
|
||||
DEFINE_SHOW_ATTRIBUTE(binder_state);
|
||||
|
||||
int binder_transactions_show(struct seq_file *m, void *unused);
|
||||
DEFINE_SHOW_ATTRIBUTE(binder_transactions);
|
||||
|
||||
int binder_transaction_log_show(struct seq_file *m, void *unused);
|
||||
DEFINE_SHOW_ATTRIBUTE(binder_transaction_log);
|
||||
|
||||
struct binder_transaction_log_entry {
|
||||
int debug_id;
|
||||
int debug_id_done;
|
||||
int call_type;
|
||||
int from_proc;
|
||||
int from_thread;
|
||||
int target_handle;
|
||||
int to_proc;
|
||||
int to_thread;
|
||||
int to_node;
|
||||
int data_size;
|
||||
int offsets_size;
|
||||
int return_error_line;
|
||||
uint32_t return_error;
|
||||
uint32_t return_error_param;
|
||||
char context_name[BINDERFS_MAX_NAME + 1];
|
||||
struct binder_debugfs_entry {
|
||||
const char *name;
|
||||
umode_t mode;
|
||||
const struct file_operations *fops;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct binder_transaction_log {
|
||||
atomic_t cur;
|
||||
bool full;
|
||||
struct binder_transaction_log_entry entry[32];
|
||||
};
|
||||
extern const struct binder_debugfs_entry binder_debugfs_entries[];
|
||||
|
||||
#define binder_for_each_debugfs_entry(entry) \
|
||||
for ((entry) = binder_debugfs_entries; \
|
||||
(entry)->name; \
|
||||
(entry)++)
|
||||
|
||||
enum binder_stat_types {
|
||||
BINDER_STAT_PROC,
|
||||
@@ -617,6 +595,4 @@ struct binder_object {
|
||||
};
|
||||
};
|
||||
|
||||
extern struct binder_transaction_log binder_transaction_log;
|
||||
extern struct binder_transaction_log binder_transaction_log_failed;
|
||||
#endif /* _LINUX_BINDER_INTERNAL_H */
|
||||
|
||||
@@ -306,6 +306,10 @@ DEFINE_EVENT(binder_buffer_class, binder_transaction_failed_buffer_release,
|
||||
TP_PROTO(struct binder_buffer *buffer),
|
||||
TP_ARGS(buffer));
|
||||
|
||||
DEFINE_EVENT(binder_buffer_class, binder_transaction_update_buffer_release,
|
||||
TP_PROTO(struct binder_buffer *buffer),
|
||||
TP_ARGS(buffer));
|
||||
|
||||
TRACE_EVENT(binder_update_page_range,
|
||||
TP_PROTO(struct binder_alloc *alloc, bool allocate,
|
||||
void __user *start, void __user *end),
|
||||
|
||||
@@ -619,6 +619,7 @@ static int init_binder_features(struct super_block *sb)
|
||||
static int init_binder_logs(struct super_block *sb)
|
||||
{
|
||||
struct dentry *binder_logs_root_dir, *dentry, *proc_log_dir;
|
||||
const struct binder_debugfs_entry *db_entry;
|
||||
struct binderfs_info *info;
|
||||
int ret = 0;
|
||||
|
||||
@@ -629,43 +630,15 @@ static int init_binder_logs(struct super_block *sb)
|
||||
goto out;
|
||||
}
|
||||
|
||||
dentry = binderfs_create_file(binder_logs_root_dir, "stats",
|
||||
&binder_stats_fops, NULL);
|
||||
if (IS_ERR(dentry)) {
|
||||
ret = PTR_ERR(dentry);
|
||||
goto out;
|
||||
}
|
||||
|
||||
dentry = binderfs_create_file(binder_logs_root_dir, "state",
|
||||
&binder_state_fops, NULL);
|
||||
if (IS_ERR(dentry)) {
|
||||
ret = PTR_ERR(dentry);
|
||||
goto out;
|
||||
}
|
||||
|
||||
dentry = binderfs_create_file(binder_logs_root_dir, "transactions",
|
||||
&binder_transactions_fops, NULL);
|
||||
if (IS_ERR(dentry)) {
|
||||
ret = PTR_ERR(dentry);
|
||||
goto out;
|
||||
}
|
||||
|
||||
dentry = binderfs_create_file(binder_logs_root_dir,
|
||||
"transaction_log",
|
||||
&binder_transaction_log_fops,
|
||||
&binder_transaction_log);
|
||||
if (IS_ERR(dentry)) {
|
||||
ret = PTR_ERR(dentry);
|
||||
goto out;
|
||||
}
|
||||
|
||||
dentry = binderfs_create_file(binder_logs_root_dir,
|
||||
"failed_transaction_log",
|
||||
&binder_transaction_log_fops,
|
||||
&binder_transaction_log_failed);
|
||||
if (IS_ERR(dentry)) {
|
||||
ret = PTR_ERR(dentry);
|
||||
goto out;
|
||||
binder_for_each_debugfs_entry(db_entry) {
|
||||
dentry = binderfs_create_file(binder_logs_root_dir,
|
||||
db_entry->name,
|
||||
db_entry->fops,
|
||||
db_entry->data);
|
||||
if (IS_ERR(dentry)) {
|
||||
ret = PTR_ERR(dentry);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
proc_log_dir = binderfs_create_dir(binder_logs_root_dir, "proc");
|
||||
|
||||
@@ -5,13 +5,34 @@
|
||||
*
|
||||
* Copyright 2020 Google LLC
|
||||
*/
|
||||
#ifndef __GENKSYMS__
|
||||
#include <uapi/linux/hdreg.h>
|
||||
#include <net/addrconf.h>
|
||||
#include <linux/fsverity.h>
|
||||
#include <linux/ipc_namespace.h>
|
||||
#include <linux/key-type.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/pr.h>
|
||||
#include <linux/time_namespace.h>
|
||||
#include <net/macsec.h>
|
||||
#include <net/netfilter/nf_log.h>
|
||||
#include <net/raw.h>
|
||||
#include <net/smc.h>
|
||||
#include <../drivers/net/wireless/intel/ipw2x00/libipw.h>
|
||||
#include <../fs/mount.h>
|
||||
#include <../fs/kernfs/kernfs-internal.h>
|
||||
#include <../kernel/audit.h>
|
||||
#include <../net/can/af_can.h>
|
||||
#include <../net/tipc/bearer.h>
|
||||
#include <../net/xdp/xsk_queue.h>
|
||||
#include <../security/keys/internal.h>
|
||||
#endif
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
#include <linux/tracepoint.h>
|
||||
#include <trace/hooks/sched.h>
|
||||
#include <trace/hooks/cpu.h>
|
||||
#include <trace/hooks/fpsimd.h>
|
||||
#include <trace/hooks/binder.h>
|
||||
#include <trace/hooks/rwsem.h>
|
||||
#include <trace/hooks/futex.h>
|
||||
@@ -20,7 +41,6 @@
|
||||
#include <trace/hooks/topology.h>
|
||||
#include <trace/hooks/mpam.h>
|
||||
#include <trace/hooks/gic.h>
|
||||
#include <trace/hooks/wqlockup.h>
|
||||
#include <trace/hooks/debug.h>
|
||||
#include <trace/hooks/sysrqcrash.h>
|
||||
#include <trace/hooks/printk.h>
|
||||
@@ -41,14 +61,14 @@
|
||||
#include <trace/hooks/iommu.h>
|
||||
#include <trace/hooks/thermal.h>
|
||||
#include <trace/hooks/ufshcd.h>
|
||||
#include <trace/hooks/block.h>
|
||||
#ifdef __GENKSYMS__
|
||||
#include <trace/hooks/cgroup.h>
|
||||
#endif
|
||||
#include <trace/hooks/workqueue.h>
|
||||
#include <trace/hooks/sys.h>
|
||||
#include <trace/hooks/traps.h>
|
||||
#include <trace/hooks/avc.h>
|
||||
#include <trace/hooks/creds.h>
|
||||
#include <trace/hooks/module.h>
|
||||
#include <trace/hooks/memory.h>
|
||||
#include <trace/hooks/typec.h>
|
||||
#include <trace/hooks/gpiolib.h>
|
||||
@@ -75,6 +95,7 @@
|
||||
#include <trace/hooks/snd_compr.h>
|
||||
#include <trace/hooks/gup.h>
|
||||
#include <trace/hooks/pci.h>
|
||||
#include <trace/hooks/suspend.h>
|
||||
|
||||
/*
|
||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||
@@ -84,7 +105,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_fair);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_rt);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_dl);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_fallback_rq);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_refrigerator);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_scheduler_tick);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_task);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task);
|
||||
@@ -100,7 +120,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sk_free);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_nf_conn_alloc);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_nf_conn_free);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_arch_set_freq_scale);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_priority_skip);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_set_priority);
|
||||
@@ -128,7 +147,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpu_idle_exit);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mpam_set);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gic_resume);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_wq_lockup_pool);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dump_throttled_rt_tasks);
|
||||
@@ -162,21 +180,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_preempt_enable);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_irqs_disable);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_irqs_enable);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_task_cpu);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_try_to_wake_up);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_try_to_wake_up_success);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_fork);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_wake_up_new_task);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_new_task_stats);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_flush_task);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tick_entry);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_schedule);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_starting);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_dying);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_place_entity);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_build_perf_domains);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_misfit_status);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_can_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_cgroup_online);
|
||||
@@ -201,6 +206,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_balance_rt);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timer_calc_index);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_watchdog_timer_softlockup);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_freeze_todo);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_freeze_todo_logging);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_try_to_freeze_todo_unfrozen);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task_idle);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_die_kernel_fault);
|
||||
@@ -242,8 +248,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_eff_get);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_task_util);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_rq_util_with);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_set_task);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cgroup_force_kthread_migration);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_syscall_prctl_finished);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_create_worker);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_tick);
|
||||
@@ -262,8 +266,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_insert);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_delete);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_node_replace);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_avc_lookup);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_alloc_rqs);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_blk_rq_ctx_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_commit_creds);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_creds);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_override_creds);
|
||||
@@ -272,8 +274,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_x);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_nx);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_ro);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_rw);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_before_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_module_permit_after_init);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_util_est_update);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_meminfo_proc_show);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_exit_mm);
|
||||
@@ -312,7 +312,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_swappiness);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_slab_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_psi_event);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_psi_group);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_comm);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_setaffinity_early);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_task);
|
||||
@@ -330,7 +329,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_is_initialized);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_inactive_ratio);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_of_i2c_get_board_info);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cgroup_attach);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_dirty_limits);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_oom_check_panic);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_uninterruptible_tasks);
|
||||
@@ -344,7 +342,6 @@ 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);
|
||||
@@ -404,3 +401,12 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rt_rq_load_avg);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pci_d3_sleep);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rq_clock_pelt);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpumask_any_and_distribute);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_begin);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_resume_end);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_tune_memcg_scan_type);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_early_resume_begin);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rebuild_root_domains_bypass);
|
||||
|
||||
@@ -1253,6 +1253,7 @@ static struct target_type verity_target = {
|
||||
.name = "verity",
|
||||
.features = DM_TARGET_IMMUTABLE,
|
||||
.version = {1, 7, 0},
|
||||
.features = DM_TARGET_IMMUTABLE,
|
||||
.module = THIS_MODULE,
|
||||
.ctr = verity_ctr,
|
||||
.dtr = verity_dtr,
|
||||
|
||||
@@ -3016,37 +3016,58 @@ ufshcd_dev_cmd_completion(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
|
||||
static int ufshcd_wait_for_dev_cmd(struct ufs_hba *hba,
|
||||
struct ufshcd_lrb *lrbp, int max_timeout)
|
||||
{
|
||||
int err = 0;
|
||||
unsigned long time_left;
|
||||
unsigned long time_left = msecs_to_jiffies(max_timeout);
|
||||
unsigned long flags;
|
||||
bool pending;
|
||||
int err;
|
||||
|
||||
retry:
|
||||
time_left = wait_for_completion_timeout(hba->dev_cmd.complete,
|
||||
msecs_to_jiffies(max_timeout));
|
||||
time_left);
|
||||
|
||||
spin_lock_irqsave(hba->host->host_lock, flags);
|
||||
hba->dev_cmd.complete = NULL;
|
||||
if (likely(time_left)) {
|
||||
/*
|
||||
* The caller of this function still owns the @lrbp tag so the
|
||||
* code below does not trigger any race conditions.
|
||||
*/
|
||||
hba->dev_cmd.complete = NULL;
|
||||
err = ufshcd_get_tr_ocs(lrbp);
|
||||
if (!err)
|
||||
err = ufshcd_dev_cmd_completion(hba, lrbp);
|
||||
}
|
||||
spin_unlock_irqrestore(hba->host->host_lock, flags);
|
||||
|
||||
if (!time_left) {
|
||||
} else {
|
||||
err = -ETIMEDOUT;
|
||||
dev_dbg(hba->dev, "%s: dev_cmd request timedout, tag %d\n",
|
||||
__func__, lrbp->task_tag);
|
||||
if (!ufshcd_clear_cmds(hba, 1U << lrbp->task_tag))
|
||||
if (!ufshcd_clear_cmds(hba, 1U << lrbp->task_tag)) {
|
||||
/* successfully cleared the command, retry if needed */
|
||||
err = -EAGAIN;
|
||||
/*
|
||||
* in case of an error, after clearing the doorbell,
|
||||
* we also need to clear the outstanding_request
|
||||
* field in hba
|
||||
*/
|
||||
spin_lock_irqsave(&hba->outstanding_lock, flags);
|
||||
__clear_bit(lrbp->task_tag, &hba->outstanding_reqs);
|
||||
spin_unlock_irqrestore(&hba->outstanding_lock, flags);
|
||||
/*
|
||||
* Since clearing the command succeeded we also need to
|
||||
* clear the task tag bit from the outstanding_reqs
|
||||
* variable.
|
||||
*/
|
||||
spin_lock_irqsave(&hba->outstanding_lock, flags);
|
||||
pending = test_bit(lrbp->task_tag,
|
||||
&hba->outstanding_reqs);
|
||||
if (pending) {
|
||||
hba->dev_cmd.complete = NULL;
|
||||
__clear_bit(lrbp->task_tag,
|
||||
&hba->outstanding_reqs);
|
||||
}
|
||||
spin_unlock_irqrestore(&hba->outstanding_lock, flags);
|
||||
|
||||
if (!pending) {
|
||||
/*
|
||||
* A race occurred between this function and the
|
||||
* completion handler.
|
||||
*/
|
||||
time_left = 1;
|
||||
goto retry;
|
||||
}
|
||||
} else {
|
||||
dev_err(hba->dev, "%s: failed to clear tag %d\n", __func__,
|
||||
lrbp->task_tag);
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
@@ -4532,7 +4553,7 @@ static int ufshcd_complete_dev_init(struct ufs_hba *hba)
|
||||
QUERY_FLAG_IDN_FDEVICEINIT, 0, &flag_res);
|
||||
if (!flag_res)
|
||||
break;
|
||||
usleep_range(5000, 10000);
|
||||
usleep_range(500, 1000);
|
||||
} while (ktime_before(ktime_get(), timeout));
|
||||
|
||||
if (err) {
|
||||
|
||||
@@ -1836,7 +1836,6 @@ struct xhci_command *xhci_alloc_command(struct xhci_hcd *xhci,
|
||||
INIT_LIST_HEAD(&command->cmd_list);
|
||||
return command;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_alloc_command);
|
||||
|
||||
struct xhci_command *xhci_alloc_command_with_ctx(struct xhci_hcd *xhci,
|
||||
bool allocate_completion, gfp_t mem_flags)
|
||||
@@ -1870,7 +1869,6 @@ void xhci_free_command(struct xhci_hcd *xhci,
|
||||
kfree(command->completion);
|
||||
kfree(command);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_free_command);
|
||||
|
||||
int xhci_alloc_erst(struct xhci_hcd *xhci,
|
||||
struct xhci_ring *evt_ring,
|
||||
@@ -1901,7 +1899,6 @@ int xhci_alloc_erst(struct xhci_hcd *xhci,
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_alloc_erst);
|
||||
|
||||
void xhci_free_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
|
||||
{
|
||||
@@ -1915,7 +1912,6 @@ void xhci_free_erst(struct xhci_hcd *xhci, struct xhci_erst *erst)
|
||||
erst->erst_dma_addr);
|
||||
erst->entries = NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_free_erst);
|
||||
|
||||
static struct xhci_device_context_array *xhci_vendor_alloc_dcbaa(
|
||||
struct xhci_hcd *xhci, gfp_t flags)
|
||||
|
||||
@@ -79,7 +79,6 @@ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg,
|
||||
return 0;
|
||||
return seg->dma + (segment_offset * sizeof(*trb));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_trb_virt_to_dma);
|
||||
|
||||
static bool trb_is_noop(union xhci_trb *trb)
|
||||
{
|
||||
@@ -312,7 +311,6 @@ void xhci_ring_cmd_db(struct xhci_hcd *xhci)
|
||||
/* Flush PCI posted writes */
|
||||
readl(&xhci->dba->doorbell[0]);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_ring_cmd_db);
|
||||
|
||||
static bool xhci_mod_cmd_timer(struct xhci_hcd *xhci, unsigned long delay)
|
||||
{
|
||||
@@ -4414,7 +4412,6 @@ int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd,
|
||||
return queue_command(xhci, cmd, 0, 0, 0,
|
||||
trb_slot_id | trb_ep_index | type | trb_suspend, false);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(xhci_queue_stop_endpoint);
|
||||
|
||||
int xhci_queue_reset_ep(struct xhci_hcd *xhci, struct xhci_command *cmd,
|
||||
int slot_id, unsigned int ep_index,
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/fs/OWNERS
|
||||
@@ -770,12 +770,9 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io,
|
||||
|
||||
/* wake up the caller thread for sync decompression */
|
||||
if (sync) {
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&io->u.wait.lock, flags);
|
||||
if (!atomic_add_return(bios, &io->pending_bios))
|
||||
wake_up_locked(&io->u.wait);
|
||||
spin_unlock_irqrestore(&io->u.wait.lock, flags);
|
||||
complete(&io->u.done);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1186,7 +1183,7 @@ jobqueue_init(struct super_block *sb,
|
||||
} else {
|
||||
fg_out:
|
||||
q = fgq;
|
||||
init_waitqueue_head(&fgq->u.wait);
|
||||
init_completion(&fgq->u.done);
|
||||
atomic_set(&fgq->pending_bios, 0);
|
||||
}
|
||||
q->sb = sb;
|
||||
@@ -1360,8 +1357,7 @@ static void z_erofs_runqueue(struct super_block *sb,
|
||||
return;
|
||||
|
||||
/* wait until all bios are completed */
|
||||
io_wait_event(io[JQ_SUBMIT].u.wait,
|
||||
!atomic_read(&io[JQ_SUBMIT].pending_bios));
|
||||
wait_for_completion_io(&io[JQ_SUBMIT].u.done);
|
||||
|
||||
/* handle synchronous decompress queue in the caller context */
|
||||
z_erofs_decompress_queue(&io[JQ_SUBMIT], pagepool);
|
||||
|
||||
@@ -89,7 +89,7 @@ struct z_erofs_decompressqueue {
|
||||
z_erofs_next_pcluster_t head;
|
||||
|
||||
union {
|
||||
wait_queue_head_t wait;
|
||||
struct completion done;
|
||||
struct work_struct work;
|
||||
} u;
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/blk_types.h>
|
||||
|
||||
#include "exfat_raw.h"
|
||||
#include "exfat_fs.h"
|
||||
@@ -225,10 +226,10 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
|
||||
{
|
||||
struct super_block *sb = dir->i_sb;
|
||||
struct exfat_sb_info *sbi = EXFAT_SB(sb);
|
||||
struct buffer_head *bhs[MAX_BUF_PER_PAGE];
|
||||
int nr_bhs = MAX_BUF_PER_PAGE;
|
||||
struct buffer_head *bh;
|
||||
struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping;
|
||||
sector_t blknr, last_blknr;
|
||||
int err, i, n;
|
||||
int i;
|
||||
|
||||
blknr = exfat_cluster_to_sector(sbi, clu);
|
||||
last_blknr = blknr + sbi->sect_per_clus;
|
||||
@@ -242,30 +243,22 @@ int exfat_zeroed_cluster(struct inode *dir, unsigned int clu)
|
||||
}
|
||||
|
||||
/* Zeroing the unused blocks on this cluster */
|
||||
while (blknr < last_blknr) {
|
||||
for (n = 0; n < nr_bhs && blknr < last_blknr; n++, blknr++) {
|
||||
bhs[n] = sb_getblk(sb, blknr);
|
||||
if (!bhs[n]) {
|
||||
err = -ENOMEM;
|
||||
goto release_bhs;
|
||||
}
|
||||
memset(bhs[n]->b_data, 0, sb->s_blocksize);
|
||||
}
|
||||
for (i = blknr; i < last_blknr; i++) {
|
||||
bh = sb_getblk(sb, i);
|
||||
if (!bh)
|
||||
return -ENOMEM;
|
||||
|
||||
err = exfat_update_bhs(bhs, n, IS_DIRSYNC(dir));
|
||||
if (err)
|
||||
goto release_bhs;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
brelse(bhs[i]);
|
||||
memset(bh->b_data, 0, sb->s_blocksize);
|
||||
set_buffer_uptodate(bh);
|
||||
mark_buffer_dirty(bh);
|
||||
brelse(bh);
|
||||
}
|
||||
return 0;
|
||||
if (IS_DIRSYNC(dir))
|
||||
return filemap_write_and_wait_range(mapping,
|
||||
EXFAT_BLK_TO_B(blknr, sb),
|
||||
EXFAT_BLK_TO_B(last_blknr, sb) - 1);
|
||||
|
||||
release_bhs:
|
||||
exfat_err(sb, "failed zeroed sect %llu\n", (unsigned long long)blknr);
|
||||
for (i = 0; i < n; i++)
|
||||
bforget(bhs[i]);
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/fs/f2fs/OWNERS
|
||||
@@ -98,13 +98,7 @@ repeat:
|
||||
}
|
||||
|
||||
if (unlikely(!PageUptodate(page))) {
|
||||
if (page->index == sbi->metapage_eio_ofs &&
|
||||
sbi->metapage_eio_cnt++ == MAX_RETRY_META_PAGE_EIO) {
|
||||
set_ckpt_flags(sbi, CP_ERROR_FLAG);
|
||||
} else {
|
||||
sbi->metapage_eio_ofs = page->index;
|
||||
sbi->metapage_eio_cnt = 0;
|
||||
}
|
||||
f2fs_handle_page_eio(sbi, page->index, META);
|
||||
f2fs_put_page(page, 1);
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
@@ -1901,15 +1895,27 @@ int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi)
|
||||
void f2fs_stop_ckpt_thread(struct f2fs_sb_info *sbi)
|
||||
{
|
||||
struct ckpt_req_control *cprc = &sbi->cprc_info;
|
||||
struct task_struct *ckpt_task;
|
||||
|
||||
if (cprc->f2fs_issue_ckpt) {
|
||||
struct task_struct *ckpt_task = cprc->f2fs_issue_ckpt;
|
||||
if (!cprc->f2fs_issue_ckpt)
|
||||
return;
|
||||
|
||||
cprc->f2fs_issue_ckpt = NULL;
|
||||
kthread_stop(ckpt_task);
|
||||
ckpt_task = cprc->f2fs_issue_ckpt;
|
||||
cprc->f2fs_issue_ckpt = NULL;
|
||||
kthread_stop(ckpt_task);
|
||||
|
||||
flush_remained_ckpt_reqs(sbi, NULL);
|
||||
}
|
||||
f2fs_flush_ckpt_thread(sbi);
|
||||
}
|
||||
|
||||
void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi)
|
||||
{
|
||||
struct ckpt_req_control *cprc = &sbi->cprc_info;
|
||||
|
||||
flush_remained_ckpt_reqs(sbi, NULL);
|
||||
|
||||
/* Let's wait for the previous dispatched checkpoint. */
|
||||
while (atomic_read(&cprc->queued_ckpt))
|
||||
io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
}
|
||||
|
||||
void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi)
|
||||
|
||||
@@ -728,14 +728,19 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void f2fs_decompress_cluster(struct decompress_io_ctx *dic)
|
||||
static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic,
|
||||
bool pre_alloc);
|
||||
static void f2fs_release_decomp_mem(struct decompress_io_ctx *dic,
|
||||
bool bypass_destroy_callback, bool pre_alloc);
|
||||
|
||||
void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task)
|
||||
{
|
||||
struct f2fs_sb_info *sbi = F2FS_I_SB(dic->inode);
|
||||
struct f2fs_inode_info *fi = F2FS_I(dic->inode);
|
||||
const struct f2fs_compress_ops *cops =
|
||||
f2fs_cops[fi->i_compress_algorithm];
|
||||
bool bypass_callback = false;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
trace_f2fs_decompress_pages_start(dic->inode, dic->cluster_idx,
|
||||
dic->cluster_size, fi->i_compress_algorithm);
|
||||
@@ -745,41 +750,10 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic)
|
||||
goto out_end_io;
|
||||
}
|
||||
|
||||
dic->tpages = page_array_alloc(dic->inode, dic->cluster_size);
|
||||
if (!dic->tpages) {
|
||||
ret = -ENOMEM;
|
||||
goto out_end_io;
|
||||
}
|
||||
|
||||
for (i = 0; i < dic->cluster_size; i++) {
|
||||
if (dic->rpages[i]) {
|
||||
dic->tpages[i] = dic->rpages[i];
|
||||
continue;
|
||||
}
|
||||
|
||||
dic->tpages[i] = f2fs_compress_alloc_page();
|
||||
if (!dic->tpages[i]) {
|
||||
ret = -ENOMEM;
|
||||
goto out_end_io;
|
||||
}
|
||||
}
|
||||
|
||||
if (cops->init_decompress_ctx) {
|
||||
ret = cops->init_decompress_ctx(dic);
|
||||
if (ret)
|
||||
goto out_end_io;
|
||||
}
|
||||
|
||||
dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size);
|
||||
if (!dic->rbuf) {
|
||||
ret = -ENOMEM;
|
||||
goto out_destroy_decompress_ctx;
|
||||
}
|
||||
|
||||
dic->cbuf = f2fs_vmap(dic->cpages, dic->nr_cpages);
|
||||
if (!dic->cbuf) {
|
||||
ret = -ENOMEM;
|
||||
goto out_vunmap_rbuf;
|
||||
ret = f2fs_prepare_decomp_mem(dic, false);
|
||||
if (ret) {
|
||||
bypass_callback = true;
|
||||
goto out_release;
|
||||
}
|
||||
|
||||
dic->clen = le32_to_cpu(dic->cbuf->clen);
|
||||
@@ -787,7 +761,7 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic)
|
||||
|
||||
if (dic->clen > PAGE_SIZE * dic->nr_cpages - COMPRESS_HEADER_SIZE) {
|
||||
ret = -EFSCORRUPTED;
|
||||
goto out_vunmap_cbuf;
|
||||
goto out_release;
|
||||
}
|
||||
|
||||
ret = cops->decompress_pages(dic);
|
||||
@@ -808,17 +782,13 @@ void f2fs_decompress_cluster(struct decompress_io_ctx *dic)
|
||||
}
|
||||
}
|
||||
|
||||
out_vunmap_cbuf:
|
||||
vm_unmap_ram(dic->cbuf, dic->nr_cpages);
|
||||
out_vunmap_rbuf:
|
||||
vm_unmap_ram(dic->rbuf, dic->cluster_size);
|
||||
out_destroy_decompress_ctx:
|
||||
if (cops->destroy_decompress_ctx)
|
||||
cops->destroy_decompress_ctx(dic);
|
||||
out_release:
|
||||
f2fs_release_decomp_mem(dic, bypass_callback, false);
|
||||
|
||||
out_end_io:
|
||||
trace_f2fs_decompress_pages_end(dic->inode, dic->cluster_idx,
|
||||
dic->clen, ret);
|
||||
f2fs_decompress_end_io(dic, ret);
|
||||
f2fs_decompress_end_io(dic, ret, in_task);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -828,7 +798,7 @@ out_end_io:
|
||||
* (or in the case of a failure, cleans up without actually decompressing).
|
||||
*/
|
||||
void f2fs_end_read_compressed_page(struct page *page, bool failed,
|
||||
block_t blkaddr)
|
||||
block_t blkaddr, bool in_task)
|
||||
{
|
||||
struct decompress_io_ctx *dic =
|
||||
(struct decompress_io_ctx *)page_private(page);
|
||||
@@ -838,12 +808,12 @@ void f2fs_end_read_compressed_page(struct page *page, bool failed,
|
||||
|
||||
if (failed)
|
||||
WRITE_ONCE(dic->failed, true);
|
||||
else if (blkaddr)
|
||||
else if (blkaddr && in_task)
|
||||
f2fs_cache_compressed_page(sbi, page,
|
||||
dic->inode->i_ino, blkaddr);
|
||||
|
||||
if (atomic_dec_and_test(&dic->remaining_pages))
|
||||
f2fs_decompress_cluster(dic);
|
||||
f2fs_decompress_cluster(dic, in_task);
|
||||
}
|
||||
|
||||
static bool is_page_in_cluster(struct compress_ctx *cc, pgoff_t index)
|
||||
@@ -1503,9 +1473,7 @@ continue_unlock:
|
||||
if (IS_NOQUOTA(cc->inode))
|
||||
return 0;
|
||||
ret = 0;
|
||||
cond_resched();
|
||||
congestion_wait(BLK_RW_ASYNC,
|
||||
DEFAULT_IO_TIMEOUT);
|
||||
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
goto retry_write;
|
||||
}
|
||||
return ret;
|
||||
@@ -1553,16 +1521,85 @@ destroy_out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void f2fs_free_dic(struct decompress_io_ctx *dic);
|
||||
static inline bool allow_memalloc_for_decomp(struct f2fs_sb_info *sbi,
|
||||
bool pre_alloc)
|
||||
{
|
||||
return pre_alloc ^ f2fs_low_mem_mode(sbi);
|
||||
}
|
||||
|
||||
static int f2fs_prepare_decomp_mem(struct decompress_io_ctx *dic,
|
||||
bool pre_alloc)
|
||||
{
|
||||
const struct f2fs_compress_ops *cops =
|
||||
f2fs_cops[F2FS_I(dic->inode)->i_compress_algorithm];
|
||||
int i;
|
||||
|
||||
if (!allow_memalloc_for_decomp(F2FS_I_SB(dic->inode), pre_alloc))
|
||||
return 0;
|
||||
|
||||
dic->tpages = page_array_alloc(dic->inode, dic->cluster_size);
|
||||
if (!dic->tpages)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < dic->cluster_size; i++) {
|
||||
if (dic->rpages[i]) {
|
||||
dic->tpages[i] = dic->rpages[i];
|
||||
continue;
|
||||
}
|
||||
|
||||
dic->tpages[i] = f2fs_compress_alloc_page();
|
||||
if (!dic->tpages[i])
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
dic->rbuf = f2fs_vmap(dic->tpages, dic->cluster_size);
|
||||
if (!dic->rbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
dic->cbuf = f2fs_vmap(dic->cpages, dic->nr_cpages);
|
||||
if (!dic->cbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
if (cops->init_decompress_ctx) {
|
||||
int ret = cops->init_decompress_ctx(dic);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void f2fs_release_decomp_mem(struct decompress_io_ctx *dic,
|
||||
bool bypass_destroy_callback, bool pre_alloc)
|
||||
{
|
||||
const struct f2fs_compress_ops *cops =
|
||||
f2fs_cops[F2FS_I(dic->inode)->i_compress_algorithm];
|
||||
|
||||
if (!allow_memalloc_for_decomp(F2FS_I_SB(dic->inode), pre_alloc))
|
||||
return;
|
||||
|
||||
if (!bypass_destroy_callback && cops->destroy_decompress_ctx)
|
||||
cops->destroy_decompress_ctx(dic);
|
||||
|
||||
if (dic->cbuf)
|
||||
vm_unmap_ram(dic->cbuf, dic->nr_cpages);
|
||||
|
||||
if (dic->rbuf)
|
||||
vm_unmap_ram(dic->rbuf, dic->cluster_size);
|
||||
}
|
||||
|
||||
static void f2fs_free_dic(struct decompress_io_ctx *dic,
|
||||
bool bypass_destroy_callback);
|
||||
|
||||
struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc)
|
||||
{
|
||||
struct decompress_io_ctx *dic;
|
||||
pgoff_t start_idx = start_idx_of_cluster(cc);
|
||||
int i;
|
||||
struct f2fs_sb_info *sbi = F2FS_I_SB(cc->inode);
|
||||
int i, ret;
|
||||
|
||||
dic = f2fs_kmem_cache_alloc(dic_entry_slab, GFP_F2FS_ZERO,
|
||||
false, F2FS_I_SB(cc->inode));
|
||||
dic = f2fs_kmem_cache_alloc(dic_entry_slab, GFP_F2FS_ZERO, false, sbi);
|
||||
if (!dic)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -1588,32 +1625,43 @@ struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc)
|
||||
dic->nr_rpages = cc->cluster_size;
|
||||
|
||||
dic->cpages = page_array_alloc(dic->inode, dic->nr_cpages);
|
||||
if (!dic->cpages)
|
||||
if (!dic->cpages) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
for (i = 0; i < dic->nr_cpages; i++) {
|
||||
struct page *page;
|
||||
|
||||
page = f2fs_compress_alloc_page();
|
||||
if (!page)
|
||||
if (!page) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
f2fs_set_compressed_page(page, cc->inode,
|
||||
start_idx + i + 1, dic);
|
||||
dic->cpages[i] = page;
|
||||
}
|
||||
|
||||
ret = f2fs_prepare_decomp_mem(dic, true);
|
||||
if (ret)
|
||||
goto out_free;
|
||||
|
||||
return dic;
|
||||
|
||||
out_free:
|
||||
f2fs_free_dic(dic);
|
||||
return ERR_PTR(-ENOMEM);
|
||||
f2fs_free_dic(dic, true);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
static void f2fs_free_dic(struct decompress_io_ctx *dic)
|
||||
static void f2fs_free_dic(struct decompress_io_ctx *dic,
|
||||
bool bypass_destroy_callback)
|
||||
{
|
||||
int i;
|
||||
|
||||
f2fs_release_decomp_mem(dic, bypass_destroy_callback, true);
|
||||
|
||||
if (dic->tpages) {
|
||||
for (i = 0; i < dic->cluster_size; i++) {
|
||||
if (dic->rpages[i])
|
||||
@@ -1638,17 +1686,33 @@ static void f2fs_free_dic(struct decompress_io_ctx *dic)
|
||||
kmem_cache_free(dic_entry_slab, dic);
|
||||
}
|
||||
|
||||
static void f2fs_put_dic(struct decompress_io_ctx *dic)
|
||||
static void f2fs_late_free_dic(struct work_struct *work)
|
||||
{
|
||||
if (refcount_dec_and_test(&dic->refcnt))
|
||||
f2fs_free_dic(dic);
|
||||
struct decompress_io_ctx *dic =
|
||||
container_of(work, struct decompress_io_ctx, free_work);
|
||||
|
||||
f2fs_free_dic(dic, false);
|
||||
}
|
||||
|
||||
static void f2fs_put_dic(struct decompress_io_ctx *dic, bool in_task)
|
||||
{
|
||||
if (refcount_dec_and_test(&dic->refcnt)) {
|
||||
if (in_task) {
|
||||
f2fs_free_dic(dic, false);
|
||||
} else {
|
||||
INIT_WORK(&dic->free_work, f2fs_late_free_dic);
|
||||
queue_work(F2FS_I_SB(dic->inode)->post_read_wq,
|
||||
&dic->free_work);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Update and unlock the cluster's pagecache pages, and release the reference to
|
||||
* the decompress_io_ctx that was being held for I/O completion.
|
||||
*/
|
||||
static void __f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed)
|
||||
static void __f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed,
|
||||
bool in_task)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1669,7 +1733,7 @@ static void __f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed)
|
||||
unlock_page(rpage);
|
||||
}
|
||||
|
||||
f2fs_put_dic(dic);
|
||||
f2fs_put_dic(dic, in_task);
|
||||
}
|
||||
|
||||
static void f2fs_verify_cluster(struct work_struct *work)
|
||||
@@ -1686,14 +1750,15 @@ static void f2fs_verify_cluster(struct work_struct *work)
|
||||
SetPageError(rpage);
|
||||
}
|
||||
|
||||
__f2fs_decompress_end_io(dic, false);
|
||||
__f2fs_decompress_end_io(dic, false, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is called when a compressed cluster has been decompressed
|
||||
* (or failed to be read and/or decompressed).
|
||||
*/
|
||||
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed)
|
||||
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed,
|
||||
bool in_task)
|
||||
{
|
||||
if (!failed && dic->need_verity) {
|
||||
/*
|
||||
@@ -1705,7 +1770,7 @@ void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed)
|
||||
INIT_WORK(&dic->verity_work, f2fs_verify_cluster);
|
||||
fsverity_enqueue_verify_work(&dic->verity_work);
|
||||
} else {
|
||||
__f2fs_decompress_end_io(dic, failed);
|
||||
__f2fs_decompress_end_io(dic, failed, in_task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1714,12 +1779,12 @@ void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed)
|
||||
*
|
||||
* This is called when the page is no longer needed and can be freed.
|
||||
*/
|
||||
void f2fs_put_page_dic(struct page *page)
|
||||
void f2fs_put_page_dic(struct page *page, bool in_task)
|
||||
{
|
||||
struct decompress_io_ctx *dic =
|
||||
(struct decompress_io_ctx *)page_private(page);
|
||||
|
||||
f2fs_put_dic(dic);
|
||||
f2fs_put_dic(dic, in_task);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -122,7 +122,7 @@ struct bio_post_read_ctx {
|
||||
block_t fs_blkaddr;
|
||||
};
|
||||
|
||||
static void f2fs_finish_read_bio(struct bio *bio)
|
||||
static void f2fs_finish_read_bio(struct bio *bio, bool in_task)
|
||||
{
|
||||
struct bio_vec *bv;
|
||||
struct bvec_iter_all iter_all;
|
||||
@@ -136,8 +136,9 @@ static void f2fs_finish_read_bio(struct bio *bio)
|
||||
|
||||
if (f2fs_is_compressed_page(page)) {
|
||||
if (bio->bi_status)
|
||||
f2fs_end_read_compressed_page(page, true, 0);
|
||||
f2fs_put_page_dic(page);
|
||||
f2fs_end_read_compressed_page(page, true, 0,
|
||||
in_task);
|
||||
f2fs_put_page_dic(page, in_task);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -194,7 +195,7 @@ static void f2fs_verify_bio(struct work_struct *work)
|
||||
fsverity_verify_bio(bio);
|
||||
}
|
||||
|
||||
f2fs_finish_read_bio(bio);
|
||||
f2fs_finish_read_bio(bio, true);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -206,7 +207,7 @@ static void f2fs_verify_bio(struct work_struct *work)
|
||||
* can involve reading verity metadata pages from the file, and these verity
|
||||
* metadata pages may be encrypted and/or compressed.
|
||||
*/
|
||||
static void f2fs_verify_and_finish_bio(struct bio *bio)
|
||||
static void f2fs_verify_and_finish_bio(struct bio *bio, bool in_task)
|
||||
{
|
||||
struct bio_post_read_ctx *ctx = bio->bi_private;
|
||||
|
||||
@@ -214,7 +215,7 @@ static void f2fs_verify_and_finish_bio(struct bio *bio)
|
||||
INIT_WORK(&ctx->work, f2fs_verify_bio);
|
||||
fsverity_enqueue_verify_work(&ctx->work);
|
||||
} else {
|
||||
f2fs_finish_read_bio(bio);
|
||||
f2fs_finish_read_bio(bio, in_task);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +228,8 @@ static void f2fs_verify_and_finish_bio(struct bio *bio)
|
||||
* that the bio includes at least one compressed page. The actual decompression
|
||||
* is done on a per-cluster basis, not a per-bio basis.
|
||||
*/
|
||||
static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx)
|
||||
static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx,
|
||||
bool in_task)
|
||||
{
|
||||
struct bio_vec *bv;
|
||||
struct bvec_iter_all iter_all;
|
||||
@@ -240,7 +242,7 @@ static void f2fs_handle_step_decompress(struct bio_post_read_ctx *ctx)
|
||||
/* PG_error was set if decryption failed. */
|
||||
if (f2fs_is_compressed_page(page))
|
||||
f2fs_end_read_compressed_page(page, PageError(page),
|
||||
blkaddr);
|
||||
blkaddr, in_task);
|
||||
else
|
||||
all_compressed = false;
|
||||
|
||||
@@ -265,15 +267,16 @@ static void f2fs_post_read_work(struct work_struct *work)
|
||||
fscrypt_decrypt_bio(ctx->bio);
|
||||
|
||||
if (ctx->enabled_steps & STEP_DECOMPRESS)
|
||||
f2fs_handle_step_decompress(ctx);
|
||||
f2fs_handle_step_decompress(ctx, true);
|
||||
|
||||
f2fs_verify_and_finish_bio(ctx->bio);
|
||||
f2fs_verify_and_finish_bio(ctx->bio, true);
|
||||
}
|
||||
|
||||
static void f2fs_read_end_io(struct bio *bio)
|
||||
{
|
||||
struct f2fs_sb_info *sbi = F2FS_P_SB(bio_first_page_all(bio));
|
||||
struct bio_post_read_ctx *ctx;
|
||||
bool intask = in_task();
|
||||
|
||||
iostat_update_and_unbind_ctx(bio, 0);
|
||||
ctx = bio->bi_private;
|
||||
@@ -284,16 +287,29 @@ static void f2fs_read_end_io(struct bio *bio)
|
||||
}
|
||||
|
||||
if (bio->bi_status) {
|
||||
f2fs_finish_read_bio(bio);
|
||||
f2fs_finish_read_bio(bio, intask);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx && (ctx->enabled_steps & (STEP_DECRYPT | STEP_DECOMPRESS))) {
|
||||
INIT_WORK(&ctx->work, f2fs_post_read_work);
|
||||
queue_work(ctx->sbi->post_read_wq, &ctx->work);
|
||||
} else {
|
||||
f2fs_verify_and_finish_bio(bio);
|
||||
if (ctx) {
|
||||
unsigned int enabled_steps = ctx->enabled_steps &
|
||||
(STEP_DECRYPT | STEP_DECOMPRESS);
|
||||
|
||||
/*
|
||||
* If we have only decompression step between decompression and
|
||||
* decrypt, we don't need post processing for this.
|
||||
*/
|
||||
if (enabled_steps == STEP_DECOMPRESS &&
|
||||
!f2fs_low_mem_mode(sbi)) {
|
||||
f2fs_handle_step_decompress(ctx, intask);
|
||||
} else if (enabled_steps) {
|
||||
INIT_WORK(&ctx->work, f2fs_post_read_work);
|
||||
queue_work(ctx->sbi->post_read_wq, &ctx->work);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
f2fs_verify_and_finish_bio(bio, intask);
|
||||
}
|
||||
|
||||
static void f2fs_write_end_io(struct bio *bio)
|
||||
@@ -2228,7 +2244,7 @@ skip_reading_dnode:
|
||||
|
||||
if (f2fs_load_compressed_page(sbi, page, blkaddr)) {
|
||||
if (atomic_dec_and_test(&dic->remaining_pages))
|
||||
f2fs_decompress_cluster(dic);
|
||||
f2fs_decompress_cluster(dic, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2246,7 +2262,7 @@ submit_and_realloc:
|
||||
page->index, for_write);
|
||||
if (IS_ERR(bio)) {
|
||||
ret = PTR_ERR(bio);
|
||||
f2fs_decompress_end_io(dic, ret);
|
||||
f2fs_decompress_end_io(dic, ret, true);
|
||||
f2fs_put_dnode(&dn);
|
||||
*bio_ret = NULL;
|
||||
return ret;
|
||||
@@ -2533,7 +2549,7 @@ bool f2fs_should_update_inplace(struct inode *inode, struct f2fs_io_info *fio)
|
||||
return true;
|
||||
|
||||
/* if this is cold file, we should overwrite to avoid fragmentation */
|
||||
if (file_is_cold(inode))
|
||||
if (file_is_cold(inode) && !is_inode_flag_set(inode, FI_OPU_WRITE))
|
||||
return true;
|
||||
|
||||
return check_inplace_update_policy(inode, fio);
|
||||
@@ -3081,8 +3097,7 @@ result:
|
||||
} else if (ret == -EAGAIN) {
|
||||
ret = 0;
|
||||
if (wbc->sync_mode == WB_SYNC_ALL) {
|
||||
cond_resched();
|
||||
congestion_wait(BLK_RW_ASYNC,
|
||||
f2fs_io_schedule_timeout(
|
||||
DEFAULT_IO_TIMEOUT);
|
||||
goto retry_write;
|
||||
}
|
||||
|
||||
@@ -157,6 +157,7 @@ struct f2fs_mount_info {
|
||||
int fsync_mode; /* fsync policy */
|
||||
int fs_mode; /* fs mode: LFS or ADAPTIVE */
|
||||
int bggc_mode; /* bggc mode: off, on or sync */
|
||||
int memory_mode; /* memory mode */
|
||||
int discard_unit; /*
|
||||
* discard command's offset/size should
|
||||
* be aligned to this unit: block,
|
||||
@@ -577,8 +578,8 @@ enum {
|
||||
/* maximum retry quota flush count */
|
||||
#define DEFAULT_RETRY_QUOTA_FLUSH_COUNT 8
|
||||
|
||||
/* maximum retry of EIO'ed meta page */
|
||||
#define MAX_RETRY_META_PAGE_EIO 100
|
||||
/* maximum retry of EIO'ed page */
|
||||
#define MAX_RETRY_PAGE_EIO 100
|
||||
|
||||
#define F2FS_LINK_MAX 0xffffffff /* maximum link count per file */
|
||||
|
||||
@@ -1367,6 +1368,13 @@ enum {
|
||||
DISCARD_UNIT_SECTION, /* basic discard unit is section */
|
||||
};
|
||||
|
||||
enum {
|
||||
MEMORY_MODE_NORMAL, /* memory mode for normal devices */
|
||||
MEMORY_MODE_LOW, /* memory mode for low memry devices */
|
||||
};
|
||||
|
||||
|
||||
|
||||
static inline int f2fs_test_bit(unsigned int nr, char *addr);
|
||||
static inline void f2fs_set_bit(unsigned int nr, char *addr);
|
||||
static inline void f2fs_clear_bit(unsigned int nr, char *addr);
|
||||
@@ -1587,6 +1595,7 @@ struct decompress_io_ctx {
|
||||
void *private; /* payload buffer for specified decompression algorithm */
|
||||
void *private2; /* extra payload buffer */
|
||||
struct work_struct verity_work; /* work to verify the decompressed pages */
|
||||
struct work_struct free_work; /* work for late free this structure itself */
|
||||
};
|
||||
|
||||
#define NULL_CLUSTER ((unsigned int)(~0))
|
||||
@@ -1620,8 +1629,8 @@ struct f2fs_sb_info {
|
||||
/* keep migration IO order for LFS mode */
|
||||
struct f2fs_rwsem io_order_lock;
|
||||
mempool_t *write_io_dummy; /* Dummy pages */
|
||||
pgoff_t metapage_eio_ofs; /* EIO page offset */
|
||||
int metapage_eio_cnt; /* EIO count */
|
||||
pgoff_t page_eio_ofs[NR_PAGE_TYPE]; /* EIO page offset */
|
||||
int page_eio_cnt[NR_PAGE_TYPE]; /* EIO count */
|
||||
|
||||
/* for checkpoint */
|
||||
struct f2fs_checkpoint *ckpt; /* raw checkpoint pointer */
|
||||
@@ -1719,7 +1728,6 @@ struct f2fs_sb_info {
|
||||
unsigned int gc_mode; /* current GC state */
|
||||
unsigned int next_victim_seg[2]; /* next segment in victim section */
|
||||
spinlock_t gc_urgent_high_lock;
|
||||
bool gc_urgent_high_limited; /* indicates having limited trial count */
|
||||
unsigned int gc_urgent_high_remaining; /* remaining trial count for GC_URGENT_HIGH */
|
||||
|
||||
/* for skip statistic */
|
||||
@@ -3679,6 +3687,7 @@ static inline bool f2fs_need_rand_seg(struct f2fs_sb_info *sbi)
|
||||
* checkpoint.c
|
||||
*/
|
||||
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io);
|
||||
void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi);
|
||||
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index);
|
||||
@@ -4184,9 +4193,9 @@ void f2fs_compress_write_end_io(struct bio *bio, struct page *page);
|
||||
bool f2fs_is_compress_backend_ready(struct inode *inode);
|
||||
int f2fs_init_compress_mempool(void);
|
||||
void f2fs_destroy_compress_mempool(void);
|
||||
void f2fs_decompress_cluster(struct decompress_io_ctx *dic);
|
||||
void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task);
|
||||
void f2fs_end_read_compressed_page(struct page *page, bool failed,
|
||||
block_t blkaddr);
|
||||
block_t blkaddr, bool in_task);
|
||||
bool f2fs_cluster_is_empty(struct compress_ctx *cc);
|
||||
bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index);
|
||||
bool f2fs_all_cluster_page_loaded(struct compress_ctx *cc, struct pagevec *pvec,
|
||||
@@ -4205,8 +4214,9 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
|
||||
unsigned nr_pages, sector_t *last_block_in_bio,
|
||||
bool is_readahead, bool for_write);
|
||||
struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc);
|
||||
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed);
|
||||
void f2fs_put_page_dic(struct page *page);
|
||||
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed,
|
||||
bool in_task);
|
||||
void f2fs_put_page_dic(struct page *page, bool in_task);
|
||||
unsigned int f2fs_cluster_blocks_are_contiguous(struct dnode_of_data *dn);
|
||||
int f2fs_init_compress_ctx(struct compress_ctx *cc);
|
||||
void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse);
|
||||
@@ -4252,13 +4262,14 @@ static inline struct page *f2fs_compress_control_page(struct page *page)
|
||||
}
|
||||
static inline int f2fs_init_compress_mempool(void) { return 0; }
|
||||
static inline void f2fs_destroy_compress_mempool(void) { }
|
||||
static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic) { }
|
||||
static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic,
|
||||
bool in_task) { }
|
||||
static inline void f2fs_end_read_compressed_page(struct page *page,
|
||||
bool failed, block_t blkaddr)
|
||||
bool failed, block_t blkaddr, bool in_task)
|
||||
{
|
||||
WARN_ON_ONCE(1);
|
||||
}
|
||||
static inline void f2fs_put_page_dic(struct page *page)
|
||||
static inline void f2fs_put_page_dic(struct page *page, bool in_task)
|
||||
{
|
||||
WARN_ON_ONCE(1);
|
||||
}
|
||||
@@ -4284,8 +4295,9 @@ static inline void f2fs_update_extent_tree_range_compressed(struct inode *inode,
|
||||
unsigned int c_len) { }
|
||||
#endif
|
||||
|
||||
static inline void set_compress_context(struct inode *inode)
|
||||
static inline int set_compress_context(struct inode *inode)
|
||||
{
|
||||
#ifdef CONFIG_F2FS_FS_COMPRESSION
|
||||
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
|
||||
|
||||
F2FS_I(inode)->i_compress_algorithm =
|
||||
@@ -4308,6 +4320,10 @@ static inline void set_compress_context(struct inode *inode)
|
||||
stat_inc_compr_inode(inode);
|
||||
inc_compr_inode_stat(inode);
|
||||
f2fs_mark_inode_dirty_sync(inode, true);
|
||||
return 0;
|
||||
#else
|
||||
return -EOPNOTSUPP;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool f2fs_disable_compressed_file(struct inode *inode)
|
||||
@@ -4425,6 +4441,11 @@ static inline bool f2fs_lfs_mode(struct f2fs_sb_info *sbi)
|
||||
return F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS;
|
||||
}
|
||||
|
||||
static inline bool f2fs_low_mem_mode(struct f2fs_sb_info *sbi)
|
||||
{
|
||||
return F2FS_OPTION(sbi).memory_mode == MEMORY_MODE_LOW;
|
||||
}
|
||||
|
||||
static inline bool f2fs_may_compress(struct inode *inode)
|
||||
{
|
||||
if (IS_SWAPFILE(inode) || f2fs_is_pinned_file(inode) ||
|
||||
@@ -4540,6 +4561,27 @@ static inline bool f2fs_block_unit_discard(struct f2fs_sb_info *sbi)
|
||||
return F2FS_OPTION(sbi).discard_unit == DISCARD_UNIT_BLOCK;
|
||||
}
|
||||
|
||||
static inline void f2fs_io_schedule_timeout(long timeout)
|
||||
{
|
||||
set_current_state(TASK_UNINTERRUPTIBLE);
|
||||
io_schedule_timeout(timeout);
|
||||
}
|
||||
|
||||
static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs,
|
||||
enum page_type type)
|
||||
{
|
||||
if (unlikely(f2fs_cp_error(sbi)))
|
||||
return;
|
||||
|
||||
if (ofs == sbi->page_eio_ofs[type]) {
|
||||
if (sbi->page_eio_cnt[type]++ == MAX_RETRY_PAGE_EIO)
|
||||
set_ckpt_flags(sbi, CP_ERROR_FLAG);
|
||||
} else {
|
||||
sbi->page_eio_ofs[type] = ofs;
|
||||
sbi->page_eio_cnt[type] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#define EFSBADCRC EBADMSG /* Bad CRC detected */
|
||||
#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
|
||||
|
||||
|
||||
@@ -1881,8 +1881,8 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask)
|
||||
return -EINVAL;
|
||||
if (S_ISREG(inode->i_mode) && inode->i_size)
|
||||
return -EINVAL;
|
||||
|
||||
set_compress_context(inode);
|
||||
if (set_compress_context(inode))
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
10
fs/f2fs/gc.c
10
fs/f2fs/gc.c
@@ -93,14 +93,10 @@ static int gc_thread_func(void *data)
|
||||
*/
|
||||
if (sbi->gc_mode == GC_URGENT_HIGH) {
|
||||
spin_lock(&sbi->gc_urgent_high_lock);
|
||||
if (sbi->gc_urgent_high_limited) {
|
||||
if (!sbi->gc_urgent_high_remaining) {
|
||||
sbi->gc_urgent_high_limited = false;
|
||||
spin_unlock(&sbi->gc_urgent_high_lock);
|
||||
sbi->gc_mode = GC_NORMAL;
|
||||
continue;
|
||||
}
|
||||
if (sbi->gc_urgent_high_remaining) {
|
||||
sbi->gc_urgent_high_remaining--;
|
||||
if (!sbi->gc_urgent_high_remaining)
|
||||
sbi->gc_mode = GC_NORMAL;
|
||||
}
|
||||
spin_unlock(&sbi->gc_urgent_high_lock);
|
||||
}
|
||||
|
||||
@@ -1420,8 +1420,7 @@ repeat:
|
||||
|
||||
err = read_node_page(page, 0);
|
||||
if (err < 0) {
|
||||
f2fs_put_page(page, 1);
|
||||
return ERR_PTR(err);
|
||||
goto out_put_err;
|
||||
} else if (err == LOCKED_PAGE) {
|
||||
err = 0;
|
||||
goto page_hit;
|
||||
@@ -1447,19 +1446,23 @@ repeat:
|
||||
goto out_err;
|
||||
}
|
||||
page_hit:
|
||||
if (unlikely(nid != nid_of_node(page))) {
|
||||
f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
|
||||
if (likely(nid == nid_of_node(page)))
|
||||
return page;
|
||||
|
||||
f2fs_warn(sbi, "inconsistent node block, nid:%lu, node_footer[nid:%u,ino:%u,ofs:%u,cpver:%llu,blkaddr:%u]",
|
||||
nid, nid_of_node(page), ino_of_node(page),
|
||||
ofs_of_node(page), cpver_of_node(page),
|
||||
next_blkaddr_of_node(page));
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
err = -EINVAL;
|
||||
set_sbi_flag(sbi, SBI_NEED_FSCK);
|
||||
err = -EINVAL;
|
||||
out_err:
|
||||
ClearPageUptodate(page);
|
||||
f2fs_put_page(page, 1);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
return page;
|
||||
ClearPageUptodate(page);
|
||||
out_put_err:
|
||||
/* ENOENT comes from read_node_page which is not an error. */
|
||||
if (err != -ENOENT)
|
||||
f2fs_handle_page_eio(sbi, page->index, NODE);
|
||||
f2fs_put_page(page, 1);
|
||||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid)
|
||||
|
||||
@@ -314,8 +314,7 @@ next:
|
||||
skip:
|
||||
iput(inode);
|
||||
}
|
||||
congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT);
|
||||
cond_resched();
|
||||
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
if (gc_failure) {
|
||||
if (++looped >= count)
|
||||
return;
|
||||
@@ -809,8 +808,7 @@ int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
|
||||
do {
|
||||
ret = __submit_flush_wait(sbi, FDEV(i).bdev);
|
||||
if (ret)
|
||||
congestion_wait(BLK_RW_ASYNC,
|
||||
DEFAULT_IO_TIMEOUT);
|
||||
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
} while (ret && --count);
|
||||
|
||||
if (ret) {
|
||||
@@ -3143,7 +3141,7 @@ next:
|
||||
blk_finish_plug(&plug);
|
||||
mutex_unlock(&dcc->cmd_lock);
|
||||
trimmed += __wait_all_discard_cmd(sbi, NULL);
|
||||
congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT);
|
||||
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
goto next;
|
||||
}
|
||||
skip:
|
||||
|
||||
@@ -160,6 +160,7 @@ enum {
|
||||
Opt_gc_merge,
|
||||
Opt_nogc_merge,
|
||||
Opt_discard_unit,
|
||||
Opt_memory_mode,
|
||||
Opt_err,
|
||||
};
|
||||
|
||||
@@ -237,6 +238,7 @@ static match_table_t f2fs_tokens = {
|
||||
{Opt_gc_merge, "gc_merge"},
|
||||
{Opt_nogc_merge, "nogc_merge"},
|
||||
{Opt_discard_unit, "discard_unit=%s"},
|
||||
{Opt_memory_mode, "memory=%s"},
|
||||
{Opt_err, NULL},
|
||||
};
|
||||
|
||||
@@ -307,10 +309,10 @@ static void f2fs_destroy_casefold_cache(void) { }
|
||||
|
||||
static inline void limit_reserve_root(struct f2fs_sb_info *sbi)
|
||||
{
|
||||
block_t limit = min((sbi->user_block_count << 1) / 1000,
|
||||
block_t limit = min((sbi->user_block_count >> 3),
|
||||
sbi->user_block_count - sbi->reserved_blocks);
|
||||
|
||||
/* limit is 0.2% */
|
||||
/* limit is 12.5% */
|
||||
if (test_opt(sbi, RESERVE_ROOT) &&
|
||||
F2FS_OPTION(sbi).root_reserved_blocks > limit) {
|
||||
F2FS_OPTION(sbi).root_reserved_blocks = limit;
|
||||
@@ -1246,6 +1248,22 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
|
||||
}
|
||||
kfree(name);
|
||||
break;
|
||||
case Opt_memory_mode:
|
||||
name = match_strdup(&args[0]);
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
if (!strcmp(name, "normal")) {
|
||||
F2FS_OPTION(sbi).memory_mode =
|
||||
MEMORY_MODE_NORMAL;
|
||||
} else if (!strcmp(name, "low")) {
|
||||
F2FS_OPTION(sbi).memory_mode =
|
||||
MEMORY_MODE_LOW;
|
||||
} else {
|
||||
kfree(name);
|
||||
return -EINVAL;
|
||||
}
|
||||
kfree(name);
|
||||
break;
|
||||
default:
|
||||
f2fs_err(sbi, "Unrecognized mount option \"%s\" or missing value",
|
||||
p);
|
||||
@@ -1671,9 +1689,8 @@ static int f2fs_freeze(struct super_block *sb)
|
||||
if (is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY))
|
||||
return -EINVAL;
|
||||
|
||||
/* ensure no checkpoint required */
|
||||
if (!llist_empty(&F2FS_SB(sb)->cprc_info.issue_list))
|
||||
return -EINVAL;
|
||||
/* Let's flush checkpoints and stop the thread. */
|
||||
f2fs_flush_ckpt_thread(F2FS_SB(sb));
|
||||
|
||||
/* to avoid deadlock on f2fs_evict_inode->SB_FREEZE_FS */
|
||||
set_sbi_flag(F2FS_SB(sb), SBI_IS_FREEZING);
|
||||
@@ -2028,6 +2045,11 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
|
||||
else if (F2FS_OPTION(sbi).discard_unit == DISCARD_UNIT_SECTION)
|
||||
seq_printf(seq, ",discard_unit=%s", "section");
|
||||
|
||||
if (F2FS_OPTION(sbi).memory_mode == MEMORY_MODE_NORMAL)
|
||||
seq_printf(seq, ",memory=%s", "normal");
|
||||
else if (F2FS_OPTION(sbi).memory_mode == MEMORY_MODE_LOW)
|
||||
seq_printf(seq, ",memory=%s", "low");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2050,6 +2072,7 @@ static void default_options(struct f2fs_sb_info *sbi)
|
||||
F2FS_OPTION(sbi).compress_ext_cnt = 0;
|
||||
F2FS_OPTION(sbi).compress_mode = COMPR_MODE_FS;
|
||||
F2FS_OPTION(sbi).bggc_mode = BGGC_MODE_ON;
|
||||
F2FS_OPTION(sbi).memory_mode = MEMORY_MODE_NORMAL;
|
||||
|
||||
sbi->sb->s_flags &= ~SB_INLINECRYPT;
|
||||
|
||||
@@ -2156,8 +2179,7 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi)
|
||||
/* we should flush all the data to keep data consistency */
|
||||
do {
|
||||
sync_inodes_sb(sbi->sb);
|
||||
cond_resched();
|
||||
congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT);
|
||||
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
} while (get_pages(sbi, F2FS_DIRTY_DATA) && retry--);
|
||||
|
||||
if (unlikely(retry < 0))
|
||||
@@ -2171,6 +2193,9 @@ static void f2fs_enable_checkpoint(struct f2fs_sb_info *sbi)
|
||||
f2fs_up_write(&sbi->gc_lock);
|
||||
|
||||
f2fs_sync_fs(sbi->sb, 1);
|
||||
|
||||
/* Let's ensure there's no pending checkpoint anymore */
|
||||
f2fs_flush_ckpt_thread(sbi);
|
||||
}
|
||||
|
||||
static int f2fs_remount(struct super_block *sb, int *flags, char *data)
|
||||
@@ -2337,6 +2362,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
|
||||
f2fs_stop_ckpt_thread(sbi);
|
||||
need_restart_ckpt = true;
|
||||
} else {
|
||||
/* Flush if the prevous checkpoint, if exists. */
|
||||
f2fs_flush_ckpt_thread(sbi);
|
||||
|
||||
err = f2fs_start_ckpt_thread(sbi);
|
||||
if (err) {
|
||||
f2fs_err(sbi,
|
||||
@@ -2526,8 +2554,7 @@ retry:
|
||||
&page, &fsdata);
|
||||
if (unlikely(err)) {
|
||||
if (err == -ENOMEM) {
|
||||
congestion_wait(BLK_RW_ASYNC,
|
||||
DEFAULT_IO_TIMEOUT);
|
||||
f2fs_io_schedule_timeout(DEFAULT_IO_TIMEOUT);
|
||||
goto retry;
|
||||
}
|
||||
set_sbi_flag(F2FS_SB(sb), SBI_QUOTA_NEED_REPAIR);
|
||||
|
||||
@@ -513,7 +513,6 @@ out:
|
||||
|
||||
if (!strcmp(a->attr.name, "gc_urgent_high_remaining")) {
|
||||
spin_lock(&sbi->gc_urgent_high_lock);
|
||||
sbi->gc_urgent_high_limited = t != 0;
|
||||
sbi->gc_urgent_high_remaining = t;
|
||||
spin_unlock(&sbi->gc_urgent_high_lock);
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/fs/fuse/OWNERS
|
||||
@@ -23,6 +23,9 @@ struct fuse_bpf_aio_req {
|
||||
|
||||
static struct kmem_cache *fuse_bpf_aio_request_cachep;
|
||||
|
||||
static void fuse_stat_to_attr(struct fuse_conn *fc, struct inode *inode,
|
||||
struct kstat *stat, struct fuse_attr *attr);
|
||||
|
||||
static void fuse_file_accessed(struct file *dst_file, struct file *src_file)
|
||||
{
|
||||
struct inode *dst_inode;
|
||||
@@ -181,8 +184,10 @@ void *fuse_open_finalize(struct fuse_bpf_args *fa,
|
||||
struct fuse_file *ff = file->private_data;
|
||||
struct fuse_open_out *foo = fa->out_args[0].value;
|
||||
|
||||
if (ff)
|
||||
if (ff) {
|
||||
ff->fh = foo->fh;
|
||||
ff->nodeid = get_fuse_inode(inode)->nodeid;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -262,7 +267,7 @@ int fuse_create_open_backing(
|
||||
struct dentry *newent;
|
||||
int err = 0;
|
||||
const struct fuse_create_in *fci = fa->in_args[0].value;
|
||||
struct fuse_inode *fuse_inode = get_fuse_inode(entry->d_inode);
|
||||
struct inode *d_inode = entry->d_inode;
|
||||
u64 target_nodeid = 0;
|
||||
|
||||
if (!dir_fuse_inode || !dir_fuse_dentry)
|
||||
@@ -295,8 +300,8 @@ int fuse_create_open_backing(
|
||||
};
|
||||
path_get(&get_fuse_dentry(entry)->backing_path);
|
||||
|
||||
if (fuse_inode)
|
||||
target_nodeid = fuse_inode->nodeid;
|
||||
if (d_inode)
|
||||
target_nodeid = get_fuse_inode(d_inode)->nodeid;
|
||||
|
||||
inode = fuse_iget_backing(dir->i_sb, target_nodeid,
|
||||
get_fuse_dentry(entry)->backing_path.dentry->d_inode);
|
||||
@@ -1153,6 +1158,9 @@ int fuse_lookup_backing(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *dir_backing_entry = dir_fuse_entry->backing_path.dentry;
|
||||
struct inode *dir_backing_inode = dir_backing_entry->d_inode;
|
||||
struct dentry *backing_entry;
|
||||
struct fuse_entry_out *feo = (void *)fa->out_args[0].value;
|
||||
struct kstat stat;
|
||||
int err;
|
||||
|
||||
/* TODO this will not handle lookups over mount points */
|
||||
inode_lock_nested(dir_backing_inode, I_MUTEX_PARENT);
|
||||
@@ -1165,10 +1173,113 @@ int fuse_lookup_backing(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
|
||||
fuse_entry->backing_path = (struct path) {
|
||||
.dentry = backing_entry,
|
||||
.mnt = dir_fuse_entry->backing_path.mnt,
|
||||
.mnt = mntget(dir_fuse_entry->backing_path.mnt),
|
||||
};
|
||||
|
||||
mntget(fuse_entry->backing_path.mnt);
|
||||
if (d_is_negative(backing_entry)) {
|
||||
fa->error_in = -ENOENT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
err = vfs_getattr(&fuse_entry->backing_path, &stat,
|
||||
STATX_BASIC_STATS, 0);
|
||||
if (err) {
|
||||
path_put_init(&fuse_entry->backing_path);
|
||||
return err;
|
||||
}
|
||||
|
||||
fuse_stat_to_attr(get_fuse_conn(dir),
|
||||
backing_entry->d_inode, &stat, &feo->attr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fuse_handle_backing(struct fuse_entry_bpf *feb, struct inode **backing_inode,
|
||||
struct path *backing_path) {
|
||||
switch (feb->out.backing_action) {
|
||||
case FUSE_ACTION_KEEP:
|
||||
/* backing inode/path are added in fuse_lookup_backing */
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REMOVE:
|
||||
iput(*backing_inode);
|
||||
*backing_inode = NULL;
|
||||
path_put_init(backing_path);
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REPLACE: {
|
||||
struct file *backing_file = feb->backing_file;
|
||||
|
||||
if (!backing_file)
|
||||
return -EINVAL;
|
||||
if (IS_ERR(backing_file))
|
||||
return PTR_ERR(backing_file);
|
||||
|
||||
if (backing_inode)
|
||||
iput(*backing_inode);
|
||||
*backing_inode = backing_file->f_inode;
|
||||
ihold(*backing_inode);
|
||||
|
||||
path_put(backing_path);
|
||||
*backing_path = backing_file->f_path;
|
||||
path_get(backing_path);
|
||||
|
||||
fput(backing_file);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fuse_handle_bpf_prog(struct fuse_entry_bpf *feb, struct inode *parent,
|
||||
struct bpf_prog **bpf)
|
||||
{
|
||||
struct fuse_inode *pi;
|
||||
|
||||
// Parent isn't presented, but we want to keep
|
||||
// Don't touch bpf program at all in this case
|
||||
if (feb->out.bpf_action == FUSE_ACTION_KEEP && !parent) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (*bpf) {
|
||||
bpf_prog_put(*bpf);
|
||||
*bpf = NULL;
|
||||
}
|
||||
|
||||
switch (feb->out.bpf_action) {
|
||||
case FUSE_ACTION_KEEP:
|
||||
pi = get_fuse_inode(parent);
|
||||
*bpf = pi->bpf;
|
||||
if (*bpf)
|
||||
bpf_prog_inc(*bpf);
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REMOVE:
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REPLACE: {
|
||||
struct file *bpf_file = feb->bpf_file;
|
||||
struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL);
|
||||
|
||||
if (bpf_file && !IS_ERR(bpf_file))
|
||||
bpf_prog = fuse_get_bpf_prog(bpf_file);
|
||||
|
||||
if (IS_ERR(bpf_prog))
|
||||
return PTR_ERR(bpf_prog);
|
||||
|
||||
*bpf = bpf_prog;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1178,10 +1289,11 @@ struct dentry *fuse_lookup_finalize(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct fuse_dentry *fd;
|
||||
struct dentry *bd;
|
||||
struct inode *inode, *backing_inode;
|
||||
struct fuse_inode *fuse_inode = get_fuse_inode(entry->d_inode);
|
||||
struct inode *d_inode = entry->d_inode;
|
||||
struct fuse_entry_out *feo = fa->out_args[0].value;
|
||||
struct fuse_entry_bpf_out *febo = fa->out_args[1].value;
|
||||
struct fuse_entry_bpf *feb = container_of(febo, struct fuse_entry_bpf, out);
|
||||
int error = -1;
|
||||
u64 target_nodeid = 0;
|
||||
|
||||
fd = get_fuse_dentry(entry);
|
||||
@@ -1194,94 +1306,28 @@ struct dentry *fuse_lookup_finalize(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
if (!backing_inode)
|
||||
return 0;
|
||||
|
||||
if (fuse_inode)
|
||||
target_nodeid = fuse_inode->nodeid;
|
||||
if (d_inode)
|
||||
target_nodeid = get_fuse_inode(d_inode)->nodeid;
|
||||
|
||||
inode = fuse_iget_backing(dir->i_sb, target_nodeid, backing_inode);
|
||||
|
||||
if (IS_ERR(inode))
|
||||
return ERR_PTR(PTR_ERR(inode));
|
||||
|
||||
/* TODO Make sure this handles invalid handles */
|
||||
/* TODO Do we need the same code in revalidate */
|
||||
if (get_fuse_inode(inode)->bpf) {
|
||||
bpf_prog_put(get_fuse_inode(inode)->bpf);
|
||||
get_fuse_inode(inode)->bpf = NULL;
|
||||
}
|
||||
error = fuse_handle_bpf_prog(feb, dir, &get_fuse_inode(inode)->bpf);
|
||||
if (error)
|
||||
return ERR_PTR(error);
|
||||
|
||||
switch (febo->bpf_action) {
|
||||
case FUSE_ACTION_KEEP:
|
||||
get_fuse_inode(inode)->bpf = get_fuse_inode(dir)->bpf;
|
||||
if (get_fuse_inode(inode)->bpf)
|
||||
bpf_prog_inc(get_fuse_inode(inode)->bpf);
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REMOVE:
|
||||
get_fuse_inode(inode)->bpf = NULL;
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REPLACE: {
|
||||
struct file *bpf_file = feb->bpf_file;
|
||||
struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL);
|
||||
|
||||
if (bpf_file && !IS_ERR(bpf_file))
|
||||
bpf_prog = fuse_get_bpf_prog(bpf_file);
|
||||
|
||||
if (IS_ERR(bpf_prog))
|
||||
return ERR_PTR(PTR_ERR(bpf_prog));
|
||||
|
||||
get_fuse_inode(inode)->bpf = bpf_prog;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
|
||||
switch (febo->backing_action) {
|
||||
case FUSE_ACTION_KEEP:
|
||||
/* backing inode/path are added in fuse_lookup_backing */
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REMOVE:
|
||||
iput(get_fuse_inode(inode)->backing_inode);
|
||||
get_fuse_inode(inode)->backing_inode = NULL;
|
||||
path_put_init(&get_fuse_dentry(entry)->backing_path);
|
||||
break;
|
||||
|
||||
case FUSE_ACTION_REPLACE: {
|
||||
struct fuse_conn *fc;
|
||||
struct file *backing_file;
|
||||
|
||||
fc = get_fuse_mount(dir)->fc;
|
||||
backing_file = feb->backing_file;
|
||||
if (!backing_file || IS_ERR(backing_file))
|
||||
return ERR_PTR(-EIO);
|
||||
|
||||
iput(get_fuse_inode(inode)->backing_inode);
|
||||
get_fuse_inode(inode)->backing_inode =
|
||||
backing_file->f_inode;
|
||||
ihold(get_fuse_inode(inode)->backing_inode);
|
||||
|
||||
path_put(&get_fuse_dentry(entry)->backing_path);
|
||||
get_fuse_dentry(entry)->backing_path = backing_file->f_path;
|
||||
path_get(&get_fuse_dentry(entry)->backing_path);
|
||||
|
||||
fput(backing_file);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return ERR_PTR(-EIO);
|
||||
}
|
||||
error = fuse_handle_backing(feb, &get_fuse_inode(inode)->backing_inode, &fd->backing_path);
|
||||
if (error)
|
||||
return ERR_PTR(error);
|
||||
|
||||
get_fuse_inode(inode)->nodeid = feo->nodeid;
|
||||
|
||||
return d_splice_alias(inode, entry);
|
||||
}
|
||||
|
||||
int fuse_revalidate_backing(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *entry, unsigned int flags)
|
||||
int fuse_revalidate_backing(struct dentry *entry, unsigned int flags)
|
||||
{
|
||||
struct fuse_dentry *fuse_dentry = get_fuse_dentry(entry);
|
||||
struct dentry *backing_entry = fuse_dentry->backing_path.dentry;
|
||||
@@ -1298,12 +1344,6 @@ int fuse_revalidate_backing(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
return 1;
|
||||
}
|
||||
|
||||
void *fuse_revalidate_finalize(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *entry, unsigned int flags)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fuse_canonical_path_initialize(struct fuse_bpf_args *fa,
|
||||
struct fuse_dummy_io *fdi,
|
||||
const struct path *path,
|
||||
|
||||
145
fs/fuse/dir.c
145
fs/fuse/dir.c
@@ -173,6 +173,44 @@ static void fuse_lookup_init(struct fuse_conn *fc, struct fuse_args *args,
|
||||
args->out_args[1].value = bpf_outarg;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FUSE_BPF
|
||||
static bool backing_data_changed(struct fuse_inode *fi, struct dentry *entry,
|
||||
struct fuse_entry_bpf *bpf_arg)
|
||||
{
|
||||
struct path new_backing_path;
|
||||
struct inode *new_backing_inode;
|
||||
struct bpf_prog *bpf = NULL;
|
||||
int err;
|
||||
bool ret = true;
|
||||
|
||||
if (!entry)
|
||||
return false;
|
||||
|
||||
get_fuse_backing_path(entry, &new_backing_path);
|
||||
new_backing_inode = fi->backing_inode;
|
||||
ihold(new_backing_inode);
|
||||
|
||||
err = fuse_handle_backing(bpf_arg, &new_backing_inode, &new_backing_path);
|
||||
|
||||
if (err)
|
||||
goto put_inode;
|
||||
|
||||
err = fuse_handle_bpf_prog(bpf_arg, entry->d_parent->d_inode, &bpf);
|
||||
if (err)
|
||||
goto put_bpf;
|
||||
|
||||
ret = (bpf != fi->bpf || fi->backing_inode != new_backing_inode ||
|
||||
!path_equal(&get_fuse_dentry(entry)->backing_path, &new_backing_path));
|
||||
put_bpf:
|
||||
if (bpf)
|
||||
bpf_prog_put(bpf);
|
||||
put_inode:
|
||||
iput(new_backing_inode);
|
||||
path_put(&new_backing_path);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check whether the dentry is still valid
|
||||
*
|
||||
@@ -193,7 +231,20 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
|
||||
inode = d_inode_rcu(entry);
|
||||
if (inode && fuse_is_bad(inode))
|
||||
goto invalid;
|
||||
else if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) ||
|
||||
|
||||
#ifdef CONFIG_FUSE_BPF
|
||||
/* TODO: Do we need bpf support for revalidate?
|
||||
* If the lower filesystem says the entry is invalid, FUSE probably shouldn't
|
||||
* try to fix that without going through the normal lookup path...
|
||||
*/
|
||||
if (get_fuse_dentry(entry)->backing_path.dentry) {
|
||||
ret = fuse_revalidate_backing(entry, flags);
|
||||
if (ret <= 0) {
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (time_before64(fuse_dentry_time(entry), get_jiffies_64()) ||
|
||||
(flags & LOOKUP_REVAL)) {
|
||||
struct fuse_entry_out outarg;
|
||||
struct fuse_entry_bpf bpf_arg;
|
||||
@@ -208,61 +259,44 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
|
||||
ret = -ECHILD;
|
||||
if (flags & LOOKUP_RCU)
|
||||
goto out;
|
||||
#ifdef CONFIG_FUSE_BPF
|
||||
{
|
||||
struct fuse_err_ret fer;
|
||||
|
||||
fer = fuse_bpf_backing(entry->d_parent->d_inode,
|
||||
struct fuse_lookup_io,
|
||||
fuse_lookup_initialize,
|
||||
fuse_revalidate_backing,
|
||||
fuse_revalidate_finalize,
|
||||
d_inode(entry->d_parent), entry, flags);
|
||||
if (fer.ret)
|
||||
return PTR_ERR(fer.result);
|
||||
}
|
||||
#endif
|
||||
fm = get_fuse_mount(inode);
|
||||
|
||||
parent = dget_parent(entry);
|
||||
|
||||
#ifdef CONFIG_FUSE_BPF
|
||||
/* TODO: Once we're handling timeouts for backing inodes, do a
|
||||
* bpf based lookup_revalidate here.
|
||||
*/
|
||||
if (get_fuse_inode(parent->d_inode)->backing_inode) {
|
||||
dput(parent);
|
||||
ret = 1;
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
forget = fuse_alloc_forget();
|
||||
ret = -ENOMEM;
|
||||
if (!forget)
|
||||
if (!forget) {
|
||||
dput(parent);
|
||||
goto out;
|
||||
}
|
||||
|
||||
attr_version = fuse_get_attr_version(fm->fc);
|
||||
|
||||
parent = dget_parent(entry);
|
||||
|
||||
fuse_lookup_init(fm->fc, &args, get_node_id(d_inode(parent)),
|
||||
&entry->d_name, &outarg, &bpf_arg.out);
|
||||
ret = fuse_simple_request(fm, &args);
|
||||
dput(parent);
|
||||
|
||||
/*
|
||||
* TODO This doesn't seem sufficient, though we don't plan to
|
||||
* change the backing file ever, so not sure what is correct
|
||||
* here yet, especially as we can't return an error to user
|
||||
*/
|
||||
if (bpf_arg.out.backing_action == FUSE_ACTION_REPLACE) {
|
||||
struct file *file = bpf_arg.backing_file;
|
||||
|
||||
if (file && !IS_ERR(file))
|
||||
fput(file);
|
||||
}
|
||||
|
||||
if (bpf_arg.out.bpf_action == FUSE_ACTION_REPLACE) {
|
||||
struct file *file = bpf_arg.bpf_file;
|
||||
|
||||
if (file && !IS_ERR(file))
|
||||
fput(file);
|
||||
}
|
||||
|
||||
/* Zero nodeid is same as -ENOENT */
|
||||
if (!ret && !outarg.nodeid)
|
||||
ret = -ENOENT;
|
||||
if (!ret) {
|
||||
if (!ret || ret == sizeof(bpf_arg.out)) {
|
||||
fi = get_fuse_inode(inode);
|
||||
if (outarg.nodeid != get_node_id(inode) ||
|
||||
#ifdef CONFIG_FUSE_BPF
|
||||
(ret == sizeof(bpf_arg.out) &&
|
||||
backing_data_changed(fi, entry, &bpf_arg)) ||
|
||||
#endif
|
||||
(bool) IS_AUTOMOUNT(inode) != (bool) (outarg.attr.flags & FUSE_ATTR_SUBMOUNT)) {
|
||||
fuse_queue_forget(fm->fc, forget,
|
||||
outarg.nodeid, 1);
|
||||
@@ -528,7 +562,6 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
|
||||
#ifdef CONFIG_FUSE_BPF
|
||||
if (err == sizeof(bpf_arg.out)) {
|
||||
/* TODO Make sure this handles invalid handles */
|
||||
/* TODO Do we need the same code in revalidate */
|
||||
struct file *backing_file;
|
||||
struct inode *backing_inode;
|
||||
|
||||
@@ -537,37 +570,29 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
|
||||
goto out_queue_forget;
|
||||
|
||||
err = -EINVAL;
|
||||
if (bpf_arg.out.backing_action != FUSE_ACTION_REPLACE)
|
||||
backing_file = bpf_arg.backing_file;
|
||||
if (!backing_file)
|
||||
goto out_queue_forget;
|
||||
|
||||
backing_file = bpf_arg.backing_file;
|
||||
if (!backing_file || IS_ERR(backing_file))
|
||||
if (IS_ERR(backing_file)) {
|
||||
err = PTR_ERR(backing_file);
|
||||
goto out_queue_forget;
|
||||
}
|
||||
|
||||
backing_inode = backing_file->f_inode;
|
||||
*inode = fuse_iget_backing(sb, outarg->nodeid, backing_inode);
|
||||
if (!*inode)
|
||||
goto bpf_arg_out;
|
||||
|
||||
if (bpf_arg.out.bpf_action == FUSE_ACTION_REPLACE) {
|
||||
struct file *bpf_file = bpf_arg.bpf_file;
|
||||
struct bpf_prog *bpf_prog = ERR_PTR(-EINVAL);
|
||||
|
||||
if (bpf_file && !IS_ERR(bpf_file))
|
||||
bpf_prog = fuse_get_bpf_prog(bpf_file);;
|
||||
|
||||
if (IS_ERR(bpf_prog)) {
|
||||
iput(*inode);
|
||||
*inode = NULL;
|
||||
err = PTR_ERR(bpf_prog);
|
||||
goto bpf_arg_out;
|
||||
}
|
||||
get_fuse_inode(*inode)->bpf = bpf_prog;
|
||||
}
|
||||
|
||||
get_fuse_dentry(entry)->backing_path = backing_file->f_path;
|
||||
path_get(&get_fuse_dentry(entry)->backing_path);
|
||||
err = fuse_handle_backing(&bpf_arg,
|
||||
&get_fuse_inode(*inode)->backing_inode,
|
||||
&get_fuse_dentry(entry)->backing_path);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = fuse_handle_bpf_prog(&bpf_arg, NULL, &get_fuse_inode(*inode)->bpf);
|
||||
if (err)
|
||||
goto out;
|
||||
bpf_arg_out:
|
||||
fput(backing_file);
|
||||
} else
|
||||
|
||||
@@ -1597,16 +1597,18 @@ struct fuse_lookup_io {
|
||||
struct fuse_entry_bpf feb;
|
||||
};
|
||||
|
||||
int fuse_handle_backing(struct fuse_entry_bpf *feb, struct inode **backing_inode,
|
||||
struct path *backing_path);
|
||||
int fuse_handle_bpf_prog(struct fuse_entry_bpf *feb, struct inode *parent,
|
||||
struct bpf_prog **bpf);
|
||||
|
||||
int fuse_lookup_initialize(struct fuse_bpf_args *fa, struct fuse_lookup_io *feo,
|
||||
struct inode *dir, struct dentry *entry, unsigned int flags);
|
||||
int fuse_lookup_backing(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *entry, unsigned int flags);
|
||||
struct dentry *fuse_lookup_finalize(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *entry, unsigned int flags);
|
||||
int fuse_revalidate_backing(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *entry, unsigned int flags);
|
||||
void *fuse_revalidate_finalize(struct fuse_bpf_args *fa, struct inode *dir,
|
||||
struct dentry *entry, unsigned int flags);
|
||||
int fuse_revalidate_backing(struct dentry *entry, unsigned int flags);
|
||||
|
||||
int fuse_canonical_path_initialize(struct fuse_bpf_args *fa,
|
||||
struct fuse_dummy_io *fdi,
|
||||
|
||||
@@ -20,6 +20,8 @@ static bool fuse_use_readdirplus(struct inode *dir, struct dir_context *ctx)
|
||||
|
||||
if (!fc->do_readdirplus)
|
||||
return false;
|
||||
if (fi->nodeid == 0)
|
||||
return false;
|
||||
if (!fc->readdirplus_auto)
|
||||
return true;
|
||||
if (test_and_clear_bit(FUSE_I_ADVISE_RDPLUS, &fi->state))
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/fs/incfs/OWNERS
|
||||
@@ -1592,6 +1592,10 @@ static int incfs_setattr(struct dentry *dentry, struct iattr *ia)
|
||||
if (ia->ia_valid & ATTR_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
if ((ia->ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) &&
|
||||
(ia->ia_valid & ATTR_MODE))
|
||||
return -EINVAL;
|
||||
|
||||
if (!di)
|
||||
return -EINVAL;
|
||||
backing_dentry = di->backing_path.dentry;
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/include/OWNERS
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/include/linux/OWNERS
|
||||
@@ -515,6 +515,11 @@ static inline void i_mmap_unlock_write(struct address_space *mapping)
|
||||
up_write(&mapping->i_mmap_rwsem);
|
||||
}
|
||||
|
||||
static inline int i_mmap_trylock_read(struct address_space *mapping)
|
||||
{
|
||||
return down_read_trylock(&mapping->i_mmap_rwsem);
|
||||
}
|
||||
|
||||
static inline void i_mmap_lock_read(struct address_space *mapping)
|
||||
{
|
||||
down_read(&mapping->i_mmap_rwsem);
|
||||
|
||||
@@ -130,6 +130,11 @@ static inline void anon_vma_lock_read(struct anon_vma *anon_vma)
|
||||
down_read(&anon_vma->root->rwsem);
|
||||
}
|
||||
|
||||
static inline int anon_vma_trylock_read(struct anon_vma *anon_vma)
|
||||
{
|
||||
return down_read_trylock(&anon_vma->root->rwsem);
|
||||
}
|
||||
|
||||
static inline void anon_vma_unlock_read(struct anon_vma *anon_vma)
|
||||
{
|
||||
up_read(&anon_vma->root->rwsem);
|
||||
@@ -252,17 +257,14 @@ void try_to_munlock(struct page *);
|
||||
|
||||
void remove_migration_ptes(struct page *old, struct page *new, bool locked);
|
||||
|
||||
/*
|
||||
* Called by memory-failure.c to kill processes.
|
||||
*/
|
||||
struct anon_vma *page_lock_anon_vma_read(struct page *page);
|
||||
void page_unlock_anon_vma_read(struct anon_vma *anon_vma);
|
||||
int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
|
||||
|
||||
/*
|
||||
* rmap_walk_control: To control rmap traversing for specific needs
|
||||
*
|
||||
* arg: passed to rmap_one() and invalid_vma()
|
||||
* try_lock: bail out if the rmap lock is contended
|
||||
* contended: indicate the rmap traversal bailed out due to lock contention
|
||||
* rmap_one: executed on each vma where page is mapped
|
||||
* done: for checking traversing termination condition
|
||||
* anon_lock: for getting anon_lock by optimized way rather than default
|
||||
@@ -270,6 +272,8 @@ int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
|
||||
*/
|
||||
struct rmap_walk_control {
|
||||
void *arg;
|
||||
bool try_lock;
|
||||
bool contended;
|
||||
/*
|
||||
* Return false if page table scanning in rmap_walk should be stopped.
|
||||
* Otherwise, return true.
|
||||
@@ -277,13 +281,21 @@ struct rmap_walk_control {
|
||||
bool (*rmap_one)(struct page *page, struct vm_area_struct *vma,
|
||||
unsigned long addr, void *arg);
|
||||
int (*done)(struct page *page);
|
||||
struct anon_vma *(*anon_lock)(struct page *page);
|
||||
struct anon_vma *(*anon_lock)(struct page *page,
|
||||
struct rmap_walk_control *rwc);
|
||||
bool (*invalid_vma)(struct vm_area_struct *vma, void *arg);
|
||||
};
|
||||
|
||||
void rmap_walk(struct page *page, struct rmap_walk_control *rwc);
|
||||
void rmap_walk_locked(struct page *page, struct rmap_walk_control *rwc);
|
||||
|
||||
/*
|
||||
* Called by memory-failure.c to kill processes.
|
||||
*/
|
||||
struct anon_vma *page_lock_anon_vma_read(struct page *page,
|
||||
struct rmap_walk_control *rwc);
|
||||
void page_unlock_anon_vma_read(struct anon_vma *anon_vma);
|
||||
|
||||
#else /* !CONFIG_MMU */
|
||||
|
||||
#define anon_vma_init() do {} while (0)
|
||||
|
||||
@@ -92,6 +92,13 @@ int sysctl_numa_balancing(struct ctl_table *table, int write, void *buffer,
|
||||
int sysctl_schedstats(struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
extern unsigned int sysctl_sched_pelt_multiplier;
|
||||
|
||||
int sched_pelt_multiplier(struct ctl_table *table, int write, void *buffer,
|
||||
size_t *lenp, loff_t *ppos);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
|
||||
extern unsigned int sysctl_sched_energy_aware;
|
||||
int sched_energy_aware_handler(struct ctl_table *table, int write,
|
||||
|
||||
@@ -1034,6 +1034,7 @@ struct xfrm_offload {
|
||||
struct sec_path {
|
||||
int len;
|
||||
int olen;
|
||||
int verified_cnt;
|
||||
|
||||
struct xfrm_state *xvec[XFRM_MAX_DEPTH];
|
||||
struct xfrm_offload ovec[XFRM_MAX_OFFLOAD_DEPTH];
|
||||
|
||||
@@ -34,6 +34,11 @@ struct hdmi_codec_daifmt {
|
||||
unsigned int frame_clk_inv:1;
|
||||
unsigned int bit_clk_master:1;
|
||||
unsigned int frame_clk_master:1;
|
||||
/* bit_fmt could be standard PCM format or
|
||||
* IEC958 encoded format. ALSA IEC958 plugin will pass
|
||||
* IEC958_SUBFRAME format to the underneath driver.
|
||||
*/
|
||||
snd_pcm_format_t bit_fmt;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -60,12 +65,22 @@ struct hdmi_codec_ops {
|
||||
|
||||
/*
|
||||
* Configures HDMI-encoder for audio stream.
|
||||
* Mandatory
|
||||
* Having either prepare or hw_params is mandatory.
|
||||
*/
|
||||
int (*hw_params)(struct device *dev, void *data,
|
||||
struct hdmi_codec_daifmt *fmt,
|
||||
struct hdmi_codec_params *hparms);
|
||||
|
||||
/*
|
||||
* Configures HDMI-encoder for audio stream. Can be called
|
||||
* multiple times for each setup.
|
||||
*
|
||||
* Having either prepare or hw_params is mandatory.
|
||||
*/
|
||||
int (*prepare)(struct device *dev, void *data,
|
||||
struct hdmi_codec_daifmt *fmt,
|
||||
struct hdmi_codec_params *hparms);
|
||||
|
||||
/*
|
||||
* Shuts down the audio stream.
|
||||
* Mandatory
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
int snd_pcm_create_iec958_consumer_default(u8 *cs, size_t len);
|
||||
|
||||
int snd_pcm_fill_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
|
||||
size_t len);
|
||||
|
||||
int snd_pcm_fill_iec958_consumer_hw_params(struct snd_pcm_hw_params *params,
|
||||
u8 *cs, size_t len);
|
||||
|
||||
int snd_pcm_create_iec958_consumer(struct snd_pcm_runtime *runtime, u8 *cs,
|
||||
size_t len);
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# include OWNERS from the authoritative android-mainline branch
|
||||
include kernel/common:android-mainline:/include/trace/events/OWNERS
|
||||
@@ -10,7 +10,6 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct binder_alloc;
|
||||
struct binder_proc;
|
||||
struct binder_thread;
|
||||
@@ -18,18 +17,7 @@ struct binder_transaction;
|
||||
struct task_struct;
|
||||
struct seq_file;
|
||||
struct binder_transaction_data;
|
||||
#else
|
||||
/* struct binder_alloc */
|
||||
#include <../drivers/android/binder_alloc.h>
|
||||
/* struct binder_proc, struct binder_thread, struct binder_transaction */
|
||||
#include <../drivers/android/binder_internal.h>
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
/* struct seq_file */
|
||||
#include <linux/seq_file.h>
|
||||
/* struct binder_transaction_data */
|
||||
#include <uapi/linux/android/binder.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_binder_transaction_init,
|
||||
TP_PROTO(struct binder_transaction *t),
|
||||
TP_ARGS(t));
|
||||
|
||||
@@ -9,18 +9,9 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct blk_mq_tags;
|
||||
struct blk_mq_alloc_data;
|
||||
struct blk_mq_tag_set;
|
||||
#else
|
||||
/* struct blk_mq_tags */
|
||||
#include <../block/blk-mq-tag.h>
|
||||
/* struct blk_mq_alloc_data */
|
||||
#include <../block/blk-mq.h>
|
||||
/* struct blk_mq_tag_set */
|
||||
#include <linux/blk-mq.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_blk_alloc_rqs,
|
||||
TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set,
|
||||
|
||||
@@ -7,18 +7,10 @@
|
||||
#define _TRACE_HOOK_CGROUP_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct cgroup_taskset;
|
||||
struct cgroup_subsys;
|
||||
struct task_struct;
|
||||
#else
|
||||
/* Including ../kernel/cgroup/cgroup-internal.h breaks builds. */
|
||||
struct cgroup_taskset;
|
||||
/* struct cgroup_subsys */
|
||||
#include <linux/cgroup-defs.h>
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_cgroup_set_task,
|
||||
TP_PROTO(int ret, struct task_struct *task),
|
||||
TP_ARGS(ret, task));
|
||||
|
||||
@@ -6,10 +6,15 @@
|
||||
|
||||
#if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_CPUFREQ_H
|
||||
|
||||
#include <linux/cpufreq.h>
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
#include <linux/cpufreq.h>
|
||||
#endif
|
||||
|
||||
struct cpufreq_policy;
|
||||
struct task_struct;
|
||||
|
||||
DECLARE_HOOK(android_vh_show_max_freq,
|
||||
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
|
||||
TP_ARGS(policy, max_freq));
|
||||
|
||||
@@ -9,12 +9,7 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct cpuidle_device;
|
||||
#else
|
||||
/* struct cpuidle_device */
|
||||
#include <linux/cpuidle.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_cpu_idle_enter,
|
||||
TP_PROTO(int *state, struct cpuidle_device *dev),
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct cpuidle_device;
|
||||
#else
|
||||
/* struct cpuidle_device */
|
||||
#include <linux/cpuidle.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_cpuidle_psci_enter,
|
||||
TP_PROTO(struct cpuidle_device *dev, bool s2idle),
|
||||
TP_ARGS(dev, s2idle));
|
||||
|
||||
@@ -10,15 +10,9 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct cred;
|
||||
struct task_struct;
|
||||
#else
|
||||
/* struct cred */
|
||||
#include <linux/cred.h>
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_commit_creds,
|
||||
TP_PROTO(const struct task_struct *task, const struct cred *new),
|
||||
TP_ARGS(task, new));
|
||||
|
||||
@@ -9,21 +9,11 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
|
||||
#ifdef __GENKSYMS__
|
||||
struct pt_regs;
|
||||
#else
|
||||
/* struct pt_regs */
|
||||
#include <asm/ptrace.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_ipi_stop,
|
||||
TP_PROTO(struct pt_regs *regs),
|
||||
TP_ARGS(regs))
|
||||
#else
|
||||
#define trace_android_vh_ipi_stop(regs)
|
||||
#define trace_android_vh_ipi_stop_rcuidle(regs)
|
||||
#endif
|
||||
|
||||
#endif /* _TRACE_HOOK_DEBUG_H */
|
||||
/* This part must be outside protection */
|
||||
|
||||
@@ -10,21 +10,11 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct mutex;
|
||||
struct rt_mutex;
|
||||
struct rw_semaphore;
|
||||
struct task_struct;
|
||||
#else
|
||||
/* struct mutex */
|
||||
#include <linux/mutex.h>
|
||||
/* struct rt_mutex */
|
||||
#include <linux/rtmutex.h>
|
||||
/* struct rw_semaphore */
|
||||
#include <linux/rwsem.h>
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_mutex_wait_start,
|
||||
TP_PROTO(struct mutex *lock),
|
||||
TP_ARGS(lock));
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct pt_regs;
|
||||
#else
|
||||
/* struct pt_regs */
|
||||
#include <asm/ptrace.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_die_kernel_fault,
|
||||
TP_PROTO(struct pt_regs *regs, unsigned int esr, unsigned long addr, const char *msg),
|
||||
TP_ARGS(regs, esr, addr, msg), 1);
|
||||
|
||||
@@ -7,12 +7,7 @@
|
||||
#define _TRACE_HOOK_FIPS140_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct crypto_aes_ctx;
|
||||
#else
|
||||
/* struct crypto_aes_ctx */
|
||||
#include <crypto/aes.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
/*
|
||||
* These hooks exist only for the benefit of the FIPS140 crypto module, which
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM fpsimd
|
||||
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
|
||||
#if !defined(_TRACE_HOOK_FPSIMD_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_FPSIMD_H
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct task_struct;
|
||||
#else
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_is_fpsimd_save,
|
||||
TP_PROTO(struct task_struct *prev, struct task_struct *next),
|
||||
TP_ARGS(prev, next))
|
||||
|
||||
/* macro versions of hooks are no longer required */
|
||||
|
||||
#endif /* _TRACE_HOOK_FPSIMD_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
@@ -6,11 +6,14 @@
|
||||
|
||||
#if !defined(_TRACE_HOOK_FTRACE_DUMP_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_FTRACE_DUMP_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
#include <linux/trace_seq.h>
|
||||
#include <linux/trace_events.h>
|
||||
#endif
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
struct trace_seq;
|
||||
|
||||
DECLARE_HOOK(android_vh_ftrace_oops_enter,
|
||||
TP_PROTO(bool *ftrace_check),
|
||||
|
||||
@@ -9,15 +9,9 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct cpumask;
|
||||
struct irq_data;
|
||||
#else
|
||||
/* struct cpumask */
|
||||
#include <linux/cpumask.h>
|
||||
/* struct irq_data */
|
||||
#include <linux/irq.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_gic_v3_affinity_init,
|
||||
TP_PROTO(int irq, u32 offset, u64 *affinity),
|
||||
TP_ARGS(irq, offset, affinity));
|
||||
|
||||
@@ -8,15 +8,16 @@
|
||||
#define _TRACE_HOOK_GPIOLIB_H
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
#include "../drivers/gpio/gpiolib.h"
|
||||
|
||||
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
|
||||
#ifdef __GENKSYMS__
|
||||
#include "../drivers/gpio/gpiolib.h"
|
||||
#endif
|
||||
|
||||
struct gpio_device;
|
||||
|
||||
DECLARE_HOOK(android_vh_gpio_block_read,
|
||||
TP_PROTO(struct gpio_device *gdev, bool *block_gpio_read),
|
||||
TP_ARGS(gdev, block_gpio_read));
|
||||
#else
|
||||
#define trace_android_vh_gpio_block_read(gdev, block_gpio_read)
|
||||
#endif
|
||||
|
||||
#endif /* _TRACE_HOOK_GPIOLIB_H */
|
||||
/* This part must be outside protection */
|
||||
|
||||
@@ -7,12 +7,7 @@
|
||||
#define _TRACE_HOOK_GUP_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct page;
|
||||
#else
|
||||
/* struct page */
|
||||
#include <linux/mm_types.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_try_grab_compound_head,
|
||||
TP_PROTO(struct page *page, int refs, unsigned int flags, bool *ret),
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_iommu_setup_dma_ops,
|
||||
TP_PROTO(struct device *dev, u64 dma_base, u64 size),
|
||||
TP_ARGS(dev, dma_base, size), 1);
|
||||
@@ -23,13 +22,6 @@ DECLARE_HOOK(android_vh_iommu_alloc_iova,
|
||||
DECLARE_HOOK(android_vh_iommu_free_iova,
|
||||
TP_PROTO(dma_addr_t iova, size_t size),
|
||||
TP_ARGS(iova, size));
|
||||
#else
|
||||
|
||||
#define trace_android_rvh_iommu_setup_dma_ops(dev, dma_base, size)
|
||||
#define trace_android_vh_iommu_alloc_iova(dev, iova, size)
|
||||
#define trace_android_vh_iommu_free_iova(iova, size)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _TRACE_HOOK_IOMMU_H */
|
||||
|
||||
|
||||
@@ -9,13 +9,8 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct printk_record;
|
||||
struct printk_ringbuffer;
|
||||
#else
|
||||
/* struct printk_record, struct printk_ringbuffer */
|
||||
#include <../kernel/printk/printk_ringbuffer.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_logbuf,
|
||||
TP_PROTO(struct printk_ringbuffer *rb, struct printk_record *r),
|
||||
|
||||
@@ -8,31 +8,23 @@
|
||||
#define _TRACE_HOOK_MM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <linux/mm.h>
|
||||
#include <linux/oom.h>
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
#include <linux/mm.h>
|
||||
#include <linux/oom.h>
|
||||
#endif
|
||||
|
||||
struct oom_control;
|
||||
struct cma;
|
||||
struct acr_info;
|
||||
struct compact_control;
|
||||
struct slabinfo;
|
||||
struct cgroup_subsys_state;
|
||||
struct mem_cgroup;
|
||||
#else
|
||||
/* struct compact_control */
|
||||
#include <../mm/internal.h>
|
||||
/* struct slabinfo */
|
||||
#include <../mm/slab.h>
|
||||
/* struct cgroup_subsys_state */
|
||||
#include <linux/cgroup-defs.h>
|
||||
/* struct acr_info */
|
||||
#include <linux/gfp.h>
|
||||
/* struct mem_cgroup */
|
||||
#include <linux/memcontrol.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
struct cma;
|
||||
struct acr_info;
|
||||
struct vm_unmapped_area_info;
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
|
||||
TP_PROTO(gfp_t *flags),
|
||||
@@ -130,9 +122,6 @@ 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));
|
||||
DECLARE_HOOK(android_vh_vmpressure,
|
||||
TP_PROTO(struct mem_cgroup *memcg, bool *bypass),
|
||||
TP_ARGS(memcg, bypass));
|
||||
DECLARE_HOOK(android_vh_mem_cgroup_alloc,
|
||||
TP_PROTO(struct mem_cgroup *memcg),
|
||||
TP_ARGS(memcg));
|
||||
@@ -148,6 +137,14 @@ DECLARE_HOOK(android_vh_mem_cgroup_css_online,
|
||||
DECLARE_HOOK(android_vh_mem_cgroup_css_offline,
|
||||
TP_PROTO(struct cgroup_subsys_state *css, struct mem_cgroup *memcg),
|
||||
TP_ARGS(css, memcg));
|
||||
DECLARE_HOOK(android_vh_alloc_pages_reclaim_bypass,
|
||||
TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags,
|
||||
int migratetype, struct page **page),
|
||||
TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page));
|
||||
DECLARE_HOOK(android_vh_alloc_pages_failure_bypass,
|
||||
TP_PROTO(gfp_t gfp_mask, int order, int alloc_flags,
|
||||
int migratetype, struct page **page),
|
||||
TP_ARGS(gfp_mask, order, alloc_flags, migratetype, page));
|
||||
/* macro versions of hooks are no longer required */
|
||||
|
||||
#endif /* _TRACE_HOOK_MM_H */
|
||||
|
||||
@@ -9,18 +9,9 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct sdhci_host;
|
||||
struct mmc_card;
|
||||
struct mmc_host;
|
||||
#else
|
||||
/* struct sdhci_host */
|
||||
#include <../drivers/mmc/host/sdhci.h>
|
||||
/* struct mmc_card */
|
||||
#include <linux/mmc/card.h>
|
||||
/* struct mmc_host */
|
||||
#include <linux/mmc/host.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_mmc_blk_reset,
|
||||
TP_PROTO(struct mmc_host *host, int err, bool *allow),
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM module
|
||||
|
||||
#define TRACE_INCLUDE_PATH trace/hooks
|
||||
#if !defined(_TRACE_HOOK_MODULE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_MODULE_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
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct module;
|
||||
#else
|
||||
/* struct module */
|
||||
#include <linux/module.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
DECLARE_HOOK(android_vh_set_module_permit_before_init,
|
||||
TP_PROTO(const struct module *mod),
|
||||
TP_ARGS(mod));
|
||||
|
||||
DECLARE_HOOK(android_vh_set_module_permit_after_init,
|
||||
TP_PROTO(const struct module *mod),
|
||||
TP_ARGS(mod));
|
||||
|
||||
#endif /* _TRACE_HOOK_MODULE_H */
|
||||
/* This part must be outside protection */
|
||||
#include <trace/define_trace.h>
|
||||
@@ -10,12 +10,8 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
struct task_struct;
|
||||
#else
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_mpam_set,
|
||||
TP_PROTO(struct task_struct *prev, struct task_struct *next),
|
||||
TP_ARGS(prev, next));
|
||||
|
||||
@@ -8,24 +8,12 @@
|
||||
#define _TRACE_HOOK_NET_VH_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct packet_type;
|
||||
struct sk_buff;
|
||||
struct list_head;
|
||||
struct nf_conn;
|
||||
struct sock;
|
||||
#else
|
||||
/* struct packet_type */
|
||||
#include <linux/netdevice.h>
|
||||
/* struct sk_buff */
|
||||
#include <linux/skbuff.h>
|
||||
/* struct list_head */
|
||||
#include <linux/types.h>
|
||||
/* struct nf_conn */
|
||||
#include <net/netfilter/nf_conntrack.h>
|
||||
/* struct sock */
|
||||
#include <net/sock.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_ptype_head,
|
||||
TP_PROTO(const struct packet_type *pt, struct list_head *vendor_pt),
|
||||
TP_ARGS(pt, vendor_pt));
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#if !defined(_TRACE_HOOK_PCI_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_HOOK_PCI_H
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
struct pci_dev;
|
||||
|
||||
/*
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
|
||||
@@ -10,12 +10,8 @@
|
||||
|
||||
#include <trace/hooks/vendor_hooks.h>
|
||||
|
||||
#ifdef __GENKSYMS__
|
||||
struct generic_pm_domain;
|
||||
#else
|
||||
/* struct generic_pm_domain */
|
||||
#include <linux/pm_domain.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_allow_domain_state,
|
||||
TP_PROTO(struct generic_pm_domain *genpd, uint32_t idx, bool *allow),
|
||||
TP_ARGS(genpd, idx, allow))
|
||||
|
||||
@@ -10,21 +10,22 @@
|
||||
* Following tracepoints are not exported in tracefs and provide a
|
||||
* mechanism for vendor modules to hook and extend functionality
|
||||
*/
|
||||
#ifdef __GENKSYMS__
|
||||
enum freq_qos_req_type;
|
||||
|
||||
/* needed for enum freq_qos_req_types */
|
||||
#include <linux/pm_qos.h>
|
||||
|
||||
struct freq_constraints;
|
||||
struct freq_qos_request;
|
||||
struct task_struct;
|
||||
#else
|
||||
/* enum freq_qos_req_type, struct freq_constraints, struct freq_qos_request */
|
||||
#include <linux/pm_qos.h>
|
||||
/* struct task_struct */
|
||||
#include <linux/sched.h>
|
||||
#endif /* __GENKSYMS__ */
|
||||
|
||||
DECLARE_HOOK(android_vh_try_to_freeze_todo,
|
||||
TP_PROTO(unsigned int todo, unsigned int elapsed_msecs, bool wq_busy),
|
||||
TP_ARGS(todo, elapsed_msecs, wq_busy));
|
||||
|
||||
DECLARE_HOOK(android_vh_try_to_freeze_todo_logging,
|
||||
TP_PROTO(bool *logging_on),
|
||||
TP_ARGS(logging_on));
|
||||
|
||||
DECLARE_HOOK(android_vh_try_to_freeze_todo_unfrozen,
|
||||
TP_PROTO(struct task_struct *p),
|
||||
TP_ARGS(p));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user