summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-09trusty: fix kernel build warning with soc/gs dependencyandroid-u-qpr2-beta-3_r0.8android-u-qpr2-beta-3.1_r0.8android-u-qpr2-beta-2_r0.8android-14.0.0_r0.77android-14.0.0_r0.67android-14.0.0_r0.57android-gs-shusky-5.15-android14-qpr2-betaandroid-gs-shusky-5.15-android14-qpr2Ji Soo Shin
We get warning that "private/google-modules/soc/gs/Module.symvers" is missing, but this symbol should not be necessary after we removed the cyclic dependency. Bug: 309892219 Change-Id: I01cb2c61db387af505e65861a3238a6c13f58e30 Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-10-20trusty-log: dump Trusty log on kernel panic only if Trusty panicked.Mike McTernan
Reduce the amount of data being dumped into logs via the panic notifier if the Trusty kernel has not itself panicked. Bug: 306313274 Test: sys-rq crash with force option Test: sys-rq crash without force option Test: Trusty panic without force option Change-Id: I0d2622b905236f50388c2f5b00c17cbdbd0c2edb Signed-off-by: Michael McTernan <mikemcternan@google.com>
2023-07-09Merge android14-gs-pixel-5.15-udc-d1 into android14-gs-pixel-5.15-udc-qpr1android-u-qpr2-beta-1_r0.7android-u-qpr1-beta-2_r0.8android-u-qpr1-beta-2.2_r0.7android-u-qpr1-beta-2.1_r0.8android-14.0.0_r0.45android-14.0.0_r0.38android-gs-shusky-5.15-u-qpr1-beta2android-gs-shusky-5.15-android14-qpr1-betaandroid-gs-shusky-5.15-android14-qpr1PixelBot AutoMerger
SBMerger: 526756187 Change-Id: I108b65032f16ee47f2950da50aca01943a723c79 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2023-06-22trusty: add more tracepoints around smc8 call.android-14.0.0_r0.8android-14.0.0_r0.18android-gs-shusky-udc-d1android-gs-shusky-5.15-android14-d1android-gs-shusky--udc-d1Ji Soo Shin
trusty_transfer_memory itself can make multiple smc8 calls with different perimeters. We add tracepoints to breakdown more if any particular smc8 calls are taking a long time and if so to record their argument perimeters. Bug: 282074315 Change-Id: Ib21b97c3a1a807dea2adb2d1ab364be9212119fd Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-05-30Merge changes from topic "trusty-cyclic" into android14-gs-pixel-5.15Ji Soo Shin
* changes: ANDROID: trusty-ipc: correct data_source flag of struct iov_iter in filp_send_ioctl() ANDROID: trusty: fix use-after-free ANDROID: trusty: remove cyclic dependency
2023-05-26ANDROID: trusty-ipc: correct data_source flag of struct iov_iter in ↵Alexey Klimov
filp_send_ioctl() Upstream commit a41dad905e5a3 ("iov_iter: saner checks for attempt to copy to/from iterator") introduced a strict check of data_source flag when copy to/from iterator is done. This led to the following one-time warning in kernel logs: WARNING: CPU: 6 PID: 749 at lib/iov_iter.c:623 _copy_from_iter+0xe4/0x4f0 ... pc : _copy_from_iter+0xe4/0x4f0 lr : tipc_ioctl+0x6f8/0xb04 [trusty_ipc] sp : ffffffc012433b10 ... Call trace: _copy_from_iter+0xe4/0x4f0 tipc_ioctl+0x6f8/0xb04 [trusty_ipc] __arm64_sys_ioctl+0xb0/0xf0 invoke_syscall+0x60/0x130 el0_svc_common+0xbc/0x100 do_el0_svc+0x38/0xb0 el0_svc+0x34/0xc4 el0t_64_sync_handler+0x8c/0xfc el0t_64_sync+0x1a8/0x1ac ---[ end trace 0000000000000000 ]--- and not working communication with trusted application(s) in TEE. Drivers that rely on this also stopped working i.e. fingerprint. When copying from iterator we should use WRITE flag for data_source in filp_send_ioctl() which eventually calls txbuf_write_iter(). Bug: 267276067 Test: manually Change-Id: If3dc73737a03eb76b6e696dd976f58e73fe8de02 Signed-off-by: Alexey Klimov <klimova@google.com> (cherry picked from commit b05efd30832632617922ec172da4b4fb418b48be) (cherry picked from commit a6aab4231b5eb69b86c8d007a3d791ea6ec39c61)
2023-05-26ANDROID: trusty: fix use-after-freeJi Luo
rework the 'trace_trusty_ipc_read_end()' to accept 'buf_id' and 'shm_cnt' instead of the 'md' which could be invalid after free. This fixes the KFENCE dump: [ 4108.926665][ T254] BUG: KFENCE: use-after-free read in trace_event_raw_event_trusty_ipc_read_end+0xa8/0x11c [trusty_ipc] [ 4108.926665][ T254] [ 4108.939893][ T254] Use-after-free read at 0x00000000d5383753 (in kfence-#49): [ 4108.947125][ T254] trace_event_raw_event_trusty_ipc_read_end+0xa8/0x11c [trusty_ipc] [ 4108.955127][ T254] tipc_read_iter+0x3c4/0x434 [trusty_ipc] [ 4108.960869][ T254] do_iter_read+0x1e4/0x300 [ 4108.965243][ T254] do_readv+0xd4/0x190 [ 4108.969180][ T254] __arm64_sys_readv+0x24/0x38 [ 4108.973810][ T254] invoke_syscall+0x5c/0x11c [ 4108.978270][ T254] el0_svc_common+0xb8/0x104 [ 4108.982731][ T254] do_el0_svc+0x30/0xc0 [ 4108.986751][ T254] el0_svc+0x30/0xac [ 4108.990520][ T254] el0t_64_sync_handler+0x6c/0xbc [ 4108.995415][ T254] el0t_64_sync+0x1a0/0x1a4 [ 4108.999781][ T254] [ 4109.001975][ T254] kfence-#49: 0x00000000d990fc1e-0x00000000baff0d36, size=96, cache=kmalloc-128 [ 4109.001975][ T254] [ 4109.013030][ T254] allocated by task 8231 on cpu 3 at 4108.225632s: [ 4109.019554][ T254] __kmem_cache_alloc_node+0x238/0x294 [ 4109.024879][ T254] kmalloc_trace+0x54/0x180 [ 4109.029249][ T254] vds_alloc_msg_buf+0x6c/0x120 [trusty_ipc] [ 4109.035169][ T254] dn_handle_msg+0x58/0x1bc [trusty_ipc] [ 4109.040736][ T254] _rxvq_cb+0x14c/0x83c [trusty_ipc] [ 4109.045955][ T254] vring_interrupt+0xa4/0xc0 [ 4109.050412][ T254] check_all_vqs+0x64/0x88 [trusty_virtio] [ 4109.056100][ T254] process_one_work+0x244/0x50c [ 4109.060818][ T254] worker_thread+0x268/0x488 [ 4109.065276][ T254] kthread+0x110/0x158.513421: trusty_smc: smcnr=SC_NOP [ 4109.069209][ T254] ret_from_fork+0x10/0x20 [ 4109.076349][ T254] [ 4109.078543][ T254] freed by task 254 on cpu 2 at 4108.917154s: [ 4109.084489][ T254] tipc_read_iter+0x130/0x434 [trusty_ipc] [ 4109.090232][ T254] do_iter_read+0x1e4/0x300 [ 4109.094604][ T254] do_readv+0xd4/0x190 [ 4109.098538][ T254] __arm64_sys_readv+0x24/0x38 [ 4109.103170][ T254] invoke_syscall+0x5c/0x11c [ 4109.107630][ T254] el0_svc_common+0xb8/0x104 [ 4109.112088][ T254] do_el0_svc+0x30/0xc0 [ 4109.116111][ T254] el0_svc+0x30/0xac [ 4109.119873][ T254] el0t_64_sync_handler+0x6c/0xbc [ 4109.124767][ T254] el0t_64_sync+0x1a0/0x1a4 [ 4109.129136][ T254] [ 4109.131328][ T254] CPU: 2 PID: 254 Comm: android.hardwar Tainted: G B C OE 6.1.22-13799-g07571651e990-ab127 #1 Bug: 279270023 Test: run CtsKeystoreTestCases CTS module while enabling tracing. Change-Id: Ide61b535bb167cce8b25ff6f6670c96c0474c885 Signed-off-by: Ji Luo <ji.luo@nxp.com> (cherry picked from commit ec3670c83983dc14bbb23db15ff51ee40c42b537)
2023-05-26ANDROID: trusty: remove cyclic dependencyJi Soo Shin
Typically, other kernel modules depend on Trusty for claiming reserving secure buffer. Usually that same module is also responsible for providing dma buffer information through tipc. This results in cyclic dependency - and this caused more headaches across platforms than necessary to justify keeping current compile-time optimization. Bug: 284002500 Change-Id: Ib60f14b6b3731c0a6d1124c2c22fc963db9518bf Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-05-25ANDROID: add kernel doc for sched_share_stateBrandon Anderson
Two recently addded fields in the structure for sched share didn't have documentation. This patch adds it to avoid warning on later kernels that recommends documentation for each field. Bug: 283996923 Change-Id: I3860b2e02f076f57fb2c1b619cc12d7fb251fc79 Signed-off-by: Brandon Anderson <brandonand@google.com> (cherry picked from commit 7bd4f91dbaac9fbd8af64330c26f441f2049c07a)
2023-05-09ANDROID: trusty: move to external standalone repoJi Soo Shin
It does not make sense for Trusty repo to stay with SoC specific modules in soc/gs. Additionally following changes are required to build successfully and compile. Bug: 271907961 Change-Id: Ie7b37603531079fdda4421b3a35af5294ee1158f Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-05-02ANDROID: trusty: Make trusty-irq part of trusty-core module.Arve Hjønnevåg
The core trusty driver needs to make an std-call at init time. This might need interrupts, so merge these two modules, so loading the trusty module will never block waiting for the trusty-irq module to be loaded. Bug: 276729665 Change-Id: Iad3817b806ec18aeac1ea284a472466a4bc136db Signed-off-by: Arve Hjønnevåg <arve@android.com>
2023-04-27ANDROID: Delay sharing sched memory with TrustyBrandon Anderson
Sharing memory with Trusty before interrupts are registered will fail. This change allocates the structure in the Linux driver as before and now initializes to default priorities in case Trusty is unabled to use (failure to register share or unsupported by Trusty). With this change, sharing the memory structure with Trusty is delayed until after interrupts are enabled by the call to of_platform_populate() This also separates unregister from free to keep the structure available until threads finish and are no longer accessing. Bug: 276729665 Change-Id: If0c9518251cd7bbf21ef83d5510fb3dd9b345bb2 Signed-off-by: Brandon Anderson <brandonand@google.com>
2023-03-23ANDROID: trusty: park threads when cpu is offline (v2)Arve Hjønnevåg
If the thread is running when the cpu goes offline, it loses its affinity and gets migrated to another cpu. This in turn can cause trusty to stop responding as it might need to run on that specific cpu once it is back online. Park the thread while the cpu is offline to avoid this migration. The kernel also has apis to re-bind the thread to a specific cpu each time it is unparked, but none of those apis are exported to modules yet. (v2): Also call kthread_set_per_cpu since kthread_create_on_cpu no longer marks the created thread per-cpu Bug: 266595872 Bug: 274202992 Change-Id: I6f311a830e47c227d404a8da312adbab5e0c1acf Signed-off-by: Arve Hjønnevåg <arve@android.com>
2023-03-21Revert "ANDROID: trusty: park threads when cpu is offline"Jonglin Lee
This reverts commit f2787bd94c86ffd7f2134d20f25fa5a82712022a. Reason for revert: Causing Watchdogs and Suspend Timeouts Bug: 274202992 Bug: 274541609 Change-Id: I09158b556d327e5658f299c111f04eb3f1682aaf Signed-off-by: Jonglin Lee <jonglin@google.com>
2023-03-20ANDROID: trusty: fix unintended changesJi Soo Shin
While debugging presubmit failures, unintended changes went in. Fixing this back, so the code base matches AOSP. Bug: 270570684 Change-Id: I95d28b8a10d8894e4612e1a4c91621a9166b38d2
2023-03-16ANDROID: trusty: park threads when cpu is offlineArve Hjønnevåg
If the thread is running when the cpu goes offline, it loses its affinity and gets migrated to another cpu. This in turn can cause trusty to stop responding as it might need to run on that specific cpu once it is back online. Park the thread while the cpu is offline to avoid this migration. The kernel also has apis to re-bind the thread to a specific cpu each time it is unparked, but none of those apis are exported to modules yet. Bug: 266595872 Change-Id: Ie08894f1eb33b857b91a33630eaa3cbf74cc6c0a Signed-off-by: Arve Hjønnevåg <arve@android.com>
2023-03-16ANDROID: trusty: Print error message if trusty_nop_thread runs on wrong cpuArve Hjønnevåg
Trusty will not function correctly if the an interrupt for a specific cpu causes Linux to call into trusty on a different cpu. This change will print an error message when it detect the kthread has woken up on the wrong cpu, but it does not fix the problem that causes this. Bug: 266595872 Change-Id: I8918a4039830f5c1de55af6b507b366b0ea6c182 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2023-03-16ANDROID: improve trusty kthread priorityBrandon Anderson
Add 'signaled' flag that can be used by nop_work_func() on each processor to boost priority only when necessary. Slight rework to calculating the correct priority for kthread based on several factors. Add trace point for dequeue. Bug: 260619596 Change-Id: If0ae0f22132a41157b62a0f51f510aa05f141c63 Signed-off-by: Brandon Anderson <brandonand@google.com>
2023-03-16ANDROID: escalate kthread nice for TrustyBrandon Anderson
Trusty runs only when the Linux driver makes an SMC call into it; previously this was at a constant priority regardless of the priority of work running on the Trusty side. This patch escalates the priority via the nice value of the kthread. There are a few entry points: 1) All interrupts (including IPI) elevate the kthread that will run the nop work 2) Trusty can return to Linux when there is more work at a different priority level so that Linux can adjust and call back into Trusty Note that 'use_high_wq' switch now overrides the 2nd case above to always run at elevated priority. When this flag is set all Trusty work will run at elevated priority. Additionally, there is a new sysfs switch 'override_high_prio_nop' that allows for benchmarking the new elevated priority used for the 1st case above. Bug: 260619596 Signed-off-by: Brandon Anderson <bander9289@gmail.com> Change-Id: I113e3a09155f3f79c384a557557638f0d909d21f
2023-03-16ANDROID: Use kthread for trusty work instead of wqBrandon Anderson
Per CPU, create a kthread with a wait queue to pause it when there is no work to do. Instead of adding work to work queue, wake the wait queue for the current cpu so that the work can be completed. For now, the thread priority follows the use_high_wq flag as before: either normal or elevated. Bug: 260139140 Signed-off-by: Brandon Anderson <bander9289@gmail.com> Change-Id: I913c64d598f87e7c005f6702714c599da5a06da2
2023-03-15ANDROID: trusty: Create API for sharing trusty infoSudhin Mishra
Android Trusty-Driver and Trusty-Kernel need a shared-memory based data-structure for exchanging information in order to influence each other for improved performance. An API is required for the trusty-driver to register the presence of the shared-memory block with the trusty-kernel, after the trusty-driver has established it during probe(). Likewise, an API is also required to unregister the shared-memory and release resources during trusty-driver remove(). Bug: 251903627 Test: shpriotest Change-Id: I7670dcfd711f5cbeed32650dc13eac2cedc8e5db Signed-off-by: Sudhin Mishra <sudhin@google.com>
2023-03-15ANDROID: trusty: Add trace pointsJi Soo Shin
Bug: 179312495 Change-Id: I93c51b8e675c4b6faa231e51c681f82dd2c9a38f Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-03-15Revert "ANDROID: trusty: Add trusty OWNERS files uapi and docs"Ji Soo Shin
This reverts commit 1fde0d6e4a7d7a92c22660a80ec188d9e6d9a9b8. Bug: 273792628 Change-Id: I9d1c6504e5eaa65888280c3075a92ab1c0e77019 Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-03-15Revert "ANDROID: trusty: Add OWNERS files referring to the top level trusty ↵Ji Soo Shin
OWNERS" This reverts commit fec2d64563a76a4c3f9cfdf094983ddc9aa35322. Bug: 273792628 Change-Id: I7e0a9e0945d53ca7cf994835c4203c45b204701d Signed-off-by: Ji Soo Shin <jisshin@google.com>
2023-03-06ANDROID: trusty: Use high priority check WQ and regular nop WQTri Vo
Moving work items across different WQ invalidates non-reentrancy guarantees. So instead of having different WQs at different priorities, we only maintain one WQ. High priority WQ for check work, and non-high priority WQ for nop work. Keep trusty-virtio "use_high_wq" toggle for user space compatibility. Bug: 231003163 Test: echo 0 > /sys/module/trusty_core/parameters/use_high_wq time /data/nativetest64/vendor/tipc-test/tipc-test -t echo -r 10000 Times do not regress. Change-Id: I54b60cb370ffb727d2f56e28932c9ab841bd8366 Signed-off-by: Tri Vo <trong@google.com>
2023-03-06ANDROID: trusty-log: fix potential use-after-freeMarco Nelissen
Bug: 216130110 Test: unbind driver while in use Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: Ie1a43f90daea0e4c2d0cd7a1093640a26eb7dce2 (cherry picked from commit 435655cef705e1db72d44f4db05bf417eb21b54d) Signed-off-by: Will McVicker <willmcvicker@google.com>
2023-03-06ANDROID: trusty-log: fix poll check for data availability.Marco Nelissen
filp->f_pos may not match the position that is used internally by seq_file, which can then result in poll() returning immediately even when no data is available. Bug: 232472073 Test: boot, logcat Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: I4fdfafce354c9995b1dcc7e93084dd4732225454
2023-03-06ANDROID: trusty: Add trusty OWNERS files uapi and docsArve Hjønnevåg
Add OWNERS files for two more trusty specific directories Bug: 232018450 Signed-off-by: Arve Hjønnevåg <arve@android.com> Change-Id: If385cf728b8d878d1421c111b688fe134d502ec3
2023-03-06ANDROID: trusty: Add OWNERS files referring to the top level trusty OWNERSArve Hjønnevåg
Bug: 232018450 Signed-off-by: Arve Hjønnevåg <arve@android.com> Change-Id: I30dc1386a492611e068c7741fbfd4794c4b0a064
2023-03-06ANDROID: trusty-log: Optionally copy Trusty log to kernel logMarco Nelissen
Make the copying of Trusty logs to the linux kernel log configurable. Bug: 221867580 Test: boot with module parameter set, observe logs Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: If25fc6b4572dda0c256852f10aaaf4fcbd47be0b
2023-03-06Revert "ANDROID: trusty-log: Don't copy Trusty logs to linux kernel log"Marco Nelissen
This reverts commit 94a36a1374e7, thus restoring the copying of Trusty logs to the linux kernel log. A followup change will make this configurable. Bug: 221867580 Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: I6453c6cd3a30d424f8d0e695d02d6b8df54b1adc
2023-03-06ANDROID: trusty-log: make rate limit configurableMarco Nelissen
Expose the rate limit interval and burst values as module parameters. Set the interval parameter to zero to disable rate limiting. Bug: 228882651 Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: Ib7b645052de4b848a55a11c72d30c3718a4a8496
2022-06-02Merge 'android13-gs-pixel-5.15-gs101' into 'android13-gs-pixel-5.15'Will McVicker
* commit '5ff74e8ea23b6027946af60b485db4d45bf975b6': (494 commits) Slider: Add cfg80211 & mac80211 as vendor modules. soc: google: hardlockup-debug: Print Mem-Info when WDT kleaf: update dt-bindings to be generic kleaf: update the readme commands Revert "usb: typec: tcpci_max77759: stub for tcpm_is_debouncing()" Revert "slider_gki: enable CONFIG_VH_SCHED" Revert "Revert "scsi: ufs: ufs-exynos: update hba suspend vops"" Revert "drivers: thermal: update milliwatts references" Revert "scsi: ufs: ufs-exynos: update hba suspend vops" Revert "scsi: ufs: update to new wrapped key api" Revert "usb: dwc3: remove duplicated definitions" Revert "cpufreq: acme: flag updates to cpufreq_policy" Revert "iommu/samsung: drop IOVA cookie management" Revert "cpufreq: acme: fix thermal API for 5.17-rc2" Revert "Revert "tty: serial: exynos_tty: remove duplicated definitions"" Revert "soc/google/cpif: replace PDE_DATA as pde_data" Revert "ANDROID: Fixup spi_driver remove functions" Revert "media: mfc/smfc: Fix depends on VIDEO_V4L2" Revert "dma-buf-map: Rename to iosys-map" Revert "usb: dwc3: remove duplicate DWC3_GFLADJ_REFCLK_FLADJ_MASK" Revert "google/debug: update path to debug_kinfo.h" Revert "serial: exynos: update exynos_serial_console_putchar" Revert "iommu/samsung:remove aux-domain interfaces usage" Revert "dts/google: tpu: disable ssmt" Revert "Revert "dma-buf: Fix build for shrinker controlled page pool"" Revert "Revert "Revert "ANDROID: dma-buf: heaps: Add a shrinker controlled page pool""" Revert "Revert "dma-buf: Fix build for deferred-free-helper.h"" Revert "Revert "Revert "ANDROID: dma-buf: heaps: Add deferred-free-helper library code""" Revert "ANDROID: dma-buf: heaps: fix dma-buf heap pool pages stat" kleaf: Add kleaf tests for kernel_images kleaf: Move SLIDER_DTBOS to a global variable. kleaf: Move SLIDER_DTBOS to a global variable. kleaf: build abi for slider vendor_hook: sched: Add control for reduce_prefer_idle usb: dwc3: cancel gadget retry during device reboot arm64/dts: devfreq: add boot_info google/debug: ehld: handle hrtimers correctly in CPUHP and CPUPM Revert "google/debug: ehld: stop and restart hrtimer at CPU PM" google/debug: ehld: fix exynos_ehld_stop_cpu() devfreq: add sysfs node "cancel_boot_freq" aoc/alsa: dts: change the name for immersive playback aoc/alsa: dt-bindings: change the name for immersive playback arm64/dts: Add board_id and board_rev to aoc pcie: exynos: Skip PHY isloation on hot reset test Revert "vendor_hook: sched: Implement vendor group util" Revert "vendor_hook: sched: Check if cfs_rq->curr is a task" gvotable: export run_election API with force_callback parameter usb: have gvotable callback return an error code gvotable: have callback return an error code arm64/dts: enable battery pairing feature vendor_hook: sched: Add trace for compute_energy vh: sched: rt: prefer to overutilized CPU from unfit CPU soc/google/cpif: Keep DIT downstream netdev until removeDownstream vendor_hook: sched: revert back to use most_spare_cap_cpu media: mfc: move the mfc_alloc_codec_buffers() usb: dwc3: move the operation for burst mode setting arm64/dts: set bhi algo_ver and threshold vendor_hook: sched: Change the uclamp max of low prio tasks usb: phy: limit the string length in phy attribute google/debug: eat: use polling api for channel operations google/debug: eat: fix mbox ipc race condition media: mfc: fix KASAN use-after-free case misc: logbuffer: Fix a deadlock arm64/dts: gs101: Update default target_load for ALT DVFS ANDROID: trusty: add a toggle for running trusty work in higher priority Revert "trusty: add a toggle for using high prio WQ" pogo_transport: Configure USB_MUX_POGO_SEL Revert "vendor_hook: sched: Refine vendor group uclamp update" vendor_hook: sched: Refine RT util check usb: dwc3: disable INCR undefined length burst mode kleaf: build abi for slider tcpci_max77759: Reset the OVP if Vbus times out build.config.gs101: enable kunit kernel arg kleaf: Add log=info to slider. kleaf: Add log=info to slider. kleaf: Explicitly set build_initramfs. kleaf: Explicitly set build_initramfs. Add dw3000-core-tests.ko to the blocklist kleaf: re-enable the vendor_dlkm blocklist kleaf: add missing pixel_em.ko kleaf: Add slider_unstripped_modules_archive. kleaf: Move definitions to slider.bzl. kleaf: Add slider_unstripped_modules_archive. kleaf: Move definitions to slider.bzl. iommu/samsung: add missing unmap_pages op kleaf: update build command in README.md kleaf: Fix KCONFIG_EXT_MODULES_PREFIX for kleaf --config=local builds. Rename merge-from-mainline.sh build.config.gs101: drop the boot ramdisk PRE_DEFCONFIG_CMDS does not write to source tree. PRE_DEFCONFIG_CMDS does not write to source tree. merge-from-mainline: update the script to soc: google: bcm_dbg: check copy_to_user return value drivers: thermal: update milliwatts references google/debug: ehld: stop and restart hrtimer at CPU PM usb: dwc3: wait for pm suspend for USB host usb: dwc3: remove conditional operator usb: dwc3: release the lock if device is suspended usb: dwc3: wait for pm suspend when cable is plug-in vendor_hook: sched: Support RT task util ... Change-Id: I6f1ffd50ee4379247eef9319d1ff27dfe6599260 Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-05-26Merge 'partner/android-gs-pixel-mainline' into 'partner/android13-gs-pixel-5.15'Will McVicker
We are merging from android-gs-pixel-mainline since this branch has already taken the android13-gs-pixel-5.10 merge. This is a one time merge to get the 5.15 branch up-to-date. * 'android-gs-pixel-mainline' of sso://partner-android/kernel/private/google-modules/soc/gs: kleaf: Add kleaf tests for kernel_images kleaf: Move SLIDER_DTBOS to a global variable. kleaf: build abi for slider vendor_hook: sched: Add control for reduce_prefer_idle usb: dwc3: cancel gadget retry during device reboot arm64/dts: devfreq: add boot_info google/debug: ehld: handle hrtimers correctly in CPUHP and CPUPM Revert "google/debug: ehld: stop and restart hrtimer at CPU PM" google/debug: ehld: fix exynos_ehld_stop_cpu() devfreq: add sysfs node "cancel_boot_freq" aoc/alsa: dts: change the name for immersive playback aoc/alsa: dt-bindings: change the name for immersive playback arm64/dts: Add board_id and board_rev to aoc pcie: exynos: Skip PHY isloation on hot reset test Revert "vendor_hook: sched: Implement vendor group util" Revert "vendor_hook: sched: Check if cfs_rq->curr is a task" gvotable: export run_election API with force_callback parameter usb: have gvotable callback return an error code gvotable: have callback return an error code arm64/dts: enable battery pairing feature vendor_hook: sched: Add trace for compute_energy vh: sched: rt: prefer to overutilized CPU from unfit CPU soc/google/cpif: Keep DIT downstream netdev until removeDownstream vendor_hook: sched: revert back to use most_spare_cap_cpu media: mfc: move the mfc_alloc_codec_buffers() usb: dwc3: move the operation for burst mode setting arm64/dts: set bhi algo_ver and threshold vendor_hook: sched: Change the uclamp max of low prio tasks usb: phy: limit the string length in phy attribute google/debug: eat: use polling api for channel operations google/debug: eat: fix mbox ipc race condition media: mfc: fix KASAN use-after-free case misc: logbuffer: Fix a deadlock arm64/dts: gs101: Update default target_load for ALT DVFS ANDROID: trusty: add a toggle for running trusty work in higher priority Revert "trusty: add a toggle for using high prio WQ" pogo_transport: Configure USB_MUX_POGO_SEL Revert "vendor_hook: sched: Refine vendor group uclamp update" vendor_hook: sched: Refine RT util check usb: dwc3: disable INCR undefined length burst mode tcpci_max77759: Reset the OVP if Vbus times out build.config.gs101: enable kunit kernel arg kleaf: Add log=info to slider. kleaf: Explicitly set build_initramfs. Add dw3000-core-tests.ko to the blocklist kleaf: re-enable the vendor_dlkm blocklist kleaf: add missing pixel_em.ko kleaf: Add slider_unstripped_modules_archive. kleaf: Move definitions to slider.bzl. iommu/samsung: add missing unmap_pages op kleaf: update build command in README.md kleaf: Fix KCONFIG_EXT_MODULES_PREFIX for kleaf --config=local builds. Rename merge-from-mainline.sh Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: Ic03e8dee890d0f1d508bacb02ce4caae2a20f6dc
2022-05-17ANDROID: trusty: add a toggle for running trusty work in higher priorityWei Wang
For latency sensitive case, introduce a toggle controlled by userspace to make trusty work in a higher priority. This is considered as a short term solution before landing a full solution for priority inheritance or a proper API. Bug: 229350721 Test: UDFPS with stress Signed-off-by: Wei Wang <wvw@google.com> (cherry picked from commit fb3af060e851e93dc14090fcdc50404322fa1da5) (cherry picked from commit 395b59c9bee14b5993524f2bebb58d3cffd8dba4) Change-Id: Ie63f3c9821206250e10b0c5eca8d1611c5e2d7fb (cherry picked from commit 2ea3b081314f80e6d9eaeb04f1ed49fd0596bed6) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-05-17Revert "trusty: add a toggle for using high prio WQ"Wei Wang
This reverts commit 229137adb4627cb9341b7148bee797fbddad2e80. Bug: 229350721 Test: Build Signed-off-by: Wei Wang <wvw@google.com> (cherry picked from commit 55099c5eaf99f475978b49c763fc77f46a7cc325) Change-Id: Ie195905997b48a07d5ac6c7ff51ae278869c6a0b (cherry picked from commit 5f4ccd25962cb8699e126e063288445668aa4ed4) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-05-06Merge 'partner/mirror-pa-ripcurrent-device-android13-gs-pixel-5.15' into ↵Will McVicker
'partner/android13-gs-pixel-5.15 * partner/mirror-pa-ripcurrent-device-android13-gs-pixel-5.15: arm64/dts: add rgbp/yuvp ssmt base address arm64/dts: zuma: Create the PPMU device tree kleaf: Fix build broken by CORE_KERNEL_FRAGMENT_DEFCONFIG PRE_DEFCONFIG_CMDS does not write to source tree (zuma_gki & POST_DEFCONFIG_CMDS) build.config, kconfig and defconfig for Ripcurrent board arm64/dts: zuma: Add DT for Ripcurrent board arm64/dts: zuma: Update board_id, board_rev for Pixel PRE_DEFCONFIG_CMDS does not write to source tree. kleaf: Also build zuma_hybrid_dist. kleaf: Enable kleaf for zuma Fix build-tools path. arm64/dts: zuma: enable usi and pinctrl for zuma arm64/dts: zuma: add pinctrl dtsi for zuma arm64/dts: zuma: add usi dtsi for zuma arm64/configs: zuma_hybrid: Build virtio as a module build_zuma_zebu: Build modified version of GKI Update the path for the display external module Makefile.include: Update path to private/google-modules pinctrl: gs: Add __maybe_unused to avoid warnings build.config.zuma: Build as an external module zuma_gki.fragment: Disable signing of modules build_zuma_zebu.sh: use the GKI mixed build setup build.config.zuma: Simplify DEFCONFIG variable scsi: ufs: ufs-exynos: update hba suspend vops arm64/dts: Update LME event info in device tree build.config: Add LWIS to ext module google/debug: Define empty sjtag_is_locked() function arm64/dts: isp: Add PDMA block IDs in isp-fe node kleaf: Specify default args for --dist_dir. Add readme file for raviole building. soc: google: bcm_dbg: Use correct buffer size in sysfs read callbacks arm64/dts: Update irq-reg-space to 'isp-fe' kleaf: drop slider.mix kleaf: Accept --use_prebuilt_gki for P21 build. kleaf: add UAPI headers from external modules. kleaf: move kernel_images.deps to args with semantic names. kleaf: Move build_boot_images to build_boot and build_vendor_boot. kleaf: remove videobuf2-dma-sg.ko as an output kleaf: //build/kleaf -> //build/kernel/kleaf. slider_gki: enable CONFIG_VH_SCHED vendor_hook: sched: fix build issues with sched traces vendor_hook: sched: switch lockdep_assert_held to lockdep_assert_rq_held Update the DT include prefix path kleaf: run buildifier kleaf: remove aarch64_outs kleaf: fix error loading aarch64_outs Revert "kleaf: install test_stackinit.ko" arm64/dts: gs101: update setting for memory latency governor am64/dts: raviole: add inhibit pin arm64/dts: raviole: handles for WLC_RX->WLC_RX+GPIO arm64/dts: raviole: increase GPIO count for p9412 aoc/alsa: dts: add dt nodes for audio capture from eraser output aoc/alsa: dt-bindings: add support to capture eraser output s2mpg10-powermeter: fixed dsm_trim value for w/a arm64/dts: bcl: Use maxfg FG for capacity reading google/debug: itmon: do not panic on specific speculative accesses usb: dwc3: disable dwc3 irq after gadget mode off arm64/dts: gs101: increase panic_count to 2 driver: devfreq: google: Skip load calculation after resetting the load pcie: exynos: add spin_lock in dislink work drivers: devfreq: governor_simpleinteractive: really pin the timer to core0 media: mfc: fix the error handling when alloc fail zram: allocate zram memory from CMA area pcie: exynos: add protection when dumping pcie link state media: mfc: clear cache flush status when cmd failure bcl: Disable SOFT_OCP for TPU/CPU/GPU arm64/dts: bcl: Disable SOFT_OCP for TPU/CPU/GPU arm64/dts: gs101: Modify SSMT register space in ISP DT tcpci_max77759: Dump TCPC registers through sysfs usb_psy: Expedite charging notification for non-pd DCP chargers arm64/dts: oriole: qresiduals for cold temp misc:bbd: Fix suspend/resume for the bcm_spi driver drivers: thermal: support HW/SW shutdown thermal: add backup shutdown protection scsi: ufs: Log the SCSI request start time for SECURITY PROTOCOL OUT scsi/ufs: return event count by new structure elements arm64/dts: gs101: add g3aa core and cmu block to pdp misc:bbd: fix bcm_spi_shutdown issue and add flow control arm64/dts: update ttf parameters arm64/dts: gs101: add sensor power regulator for aoc pcie: exynos: move OC check routine before SW reset soc: google: dss: add one reason for SWRESET cases soc: google: dss: export in_panic status iommu/samsung: Use pm_runtime_get_sync in fault handler pcie: exynos: remove recover queue_work for CPL timeout Revert "Revert "arm64: dts: gs101-cpu: Increase CPU frequency during suspend/resume"" arm64/dts: update alignment parameters arm64/dts: Add sysreg dns in gs101-isp arm64/dts: updated Raven/Oriole INI data soc: google: dss: export in_reboot status misc: access_ramoops: Use memcpy_fromio()/memcpy_toio() Update path for the SoC project kleaf: install test_stackinit.ko slider_gki.fragment: Disable signing of modules Fix warnings cause by __must_check attribute build_slider.sh: use the GKI mixed build setup dma-buf: Fix build for shrinker controlled page pool Revert "ANDROID: dma-buf: heaps: Add a shrinker controlled page pool" dma-buf: Fix build for deferred-free-helper.h Add SPDX identifiers to Kconfig files Revert "ANDROID: dma-buf: heaps: Add deferred-free-helper library code" driver: keydebug: fix build issues and clean up drm: samsung: move the uapi headers out kbuild: add the headers_install target trace: remove edgetpu.h GKI: Fix TRACE_INCLUDE_PATH references Update the path for the display external module build.config.slider: Move UWB into EXT_MODULES kleaf: load the clang version from the tools kleaf: remove mkdtimg dependency kleaf: add dma-buf headers kleaf: switch to using kconfig_ext kbuild: Convert this project to an external module kleaf: add support for kernel_dtstree kleaf: copy_to_dist_dir flat=True. kleaf: Copy headers from ACK, not slider kernel_build. scsi: ufs: pixel: prevent UNIT ATTENTION for read/write BACKPORT: scsi: ufs: pixel: Fix dm-verity data corruption complaints scsi: ufs: pixel: let scsi retry to clear UNIT ATTENTION scsi: ufs: exynos: do not use UFSHCD_CAP_INTR_AGGR scsi: ufs: pixel: remove hack that ignores UNIT ATTENTION kleaf: move dtbos to implicit_outs dma-buf: heaps: move samsung-dma-heap.h under drivers/... tcpci_max77759: move max77759_export.h to include/linux/usb soc/cal-if: fix header references for external modules Don't copy kernel headers from GKI build. kleaf: add dtbo artifacts for the dtbo.img Revert "build.config.gs101: add DTC_FLAGS" build.config.slider: update DTBO support dts/google: update Makefile to support upstream dtbo format build.config.gs101: Remove DTC_OVERLAY_TEST_EXT, LIBUFDT_PREBUILTS_BIN kleaf: fix path for dtbs Remove unused kernel modules kleaf: update outputs to drop unused dtbos soc/google/cpif: fix stdarg.h header includes tty: serial: exynos_tty: remove duplicated definitions Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: I0f7538011871f2b3e1afec7b6ae1318f414cc77f
2022-04-29trusty: add a toggle for using high prio WQWei Wang
Bug: 229350721 Test: UDFPS with stress Signed-off-by: Wei Wang <wvw@google.com> (cherry picked from commit 229137adb4627cb9341b7148bee797fbddad2e80) Change-Id: I241a9a6ecd840577601dae7886fb212a2d46d71d (cherry picked from commit bc10c2f6eb1a3f51a814c7acd84ee07cba63e144) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty: Enforce only TRUSTY_SEND_SECURE can send secure memoryTri Vo
Bug: 224563842 Change-Id: I4a782404993f333e6882a9d30a85116e0f0ebec5 Signed-off-by: Tri Vo <trong@google.com> (cherry picked from commit 07055bfd3d810d41a38354693dfaa55a6f8c0025) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty-ipc: Allow registering multiple handlesTri Vo
Bug: 206813152 Change-Id: Ifb086ecc845fd7e79d326f00e2034b63d89e4052 Signed-off-by: Tri Vo <trong@google.com> (cherry picked from commit b60d55f33484d855a546f7cfc59a28a5771e8bee) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty: Support setting trusty_shared_mem_id_tTri Vo
This patch allows DMA heaps to allocate/release shared memory IDs and associate them with DMA buffers. If an trusty_shared_mem_id_t is specified, Trusty driver will not manage life cycle of the transaction associated with that ID. DMA buffers with trusty_shared_mem_id_t pre-allocated must be in secure memory, and newly added TRUSTY_SEND_SECURE should be used to transfer them to Trusty. For backwards compatibility, we only issue a warning if either TRUSTY_SHARE or TRUSTY_LEND is used to transfer a DMA buffer with an allocated trusty_shared_mem_id_t. Bug: 206813152 Change-Id: Ic651967fe66bd3f46bf36d34d3fda60a6399a6ac Signed-off-by: Tri Vo <trong@google.com> (cherry picked from commit 629a4d3318cc1234675f62b69fba8791592e8a83) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty-log: Don't copy Trusty logs to linux kernel logMarco Nelissen
Logd will consume Trusty logs from now on. Bug: 190050919 Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: I26b35acfc544b48e88246cf2f2f0a60ed3f9ffd4 (cherry picked from commit 94a36a1374e79fb3aa3539f8b99aa110fdc7b7a0) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty-log: rework buffer allocationMarco Nelissen
Use vzalloc() instead of alloc_pages() for the log buffer, since physically contiguous memory isn't needed for that as of Trusty api version TRUSTY_API_VERSION_MEM_OBJ Double the default log buffer size, since that can now be done at a cost of only one extra page because pages aren't being wasted anymore. Make the log buffer size configurable from 2 KB to 1 GB via module parameter trusty_log.log_size. Bug: 190050919 Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: Id8c2269afbb58fc361274d4f4cfca116ea3e4521 (cherry picked from commit efc21cced8af390cc69ebff636ec7399801611e5) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty-ipc: Fix lock protection of shared_handlesTri Vo
And move uses of shared_handles symbol to within critical sections protected by shared_handles_lock to improve readability. Bug: 206813152 Change-Id: I965dedaa1fafbf610620cf7dffe5665271099281 Signed-off-by: Tri Vo <trong@google.com> (cherry picked from commit 8cb1a07ca81495b954c2aca3f1074f2ff8e41250) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-04-22ANDROID: trusty-log: support poll()Marco Nelissen
Add support for poll()ing the log device file. Remove unused field in struct. Bug: 190050919 Signed-off-by: Marco Nelissen <marcone@google.com> Change-Id: I8524079d61754b3d35d2df8103f1ee373452007e (cherry picked from commit 52cdd137fae0b001197a51646289e3cbdda921d5) Signed-off-by: Will McVicker <willmcvicker@google.com>
2022-02-01GKI: fix import of DMA_BUF module namespaceCarlos Llamas
This patch fixes multiple build issues similar to this: ERROR: modpost: module samsung_dma_heap uses symbol dma_buf_export from namespace DMA_BUF, but does not import it. Bug: 215712060 Signed-off-by: Carlos Llamas <cmllamas@google.com> Change-Id: If77d4ebb2a82cd208813236d03229946c122b0d2
2021-12-29kbuild: Convert this project to an external moduleWill McVicker
This patch converts this project to an external modules. Here are the steps taken: 1) Rename all Makefiles to Kbuild: find . -name Makefile | xargs -n1 bash -c 'mv "$0" `dirname "$0"`/Kbuild' 2) Create a base Makefile with the targets: modules, modules_install, and clean. 3) Update all the Kconfig files to use KCONFIG_EXT_PREFIX which is a relative path from the KERNEL_SRC. This allows us to use slider_gki.fragment to define which drivers to compile. We also need to rename the base Kconfig to Kconfig.ext. 4) Add the following new properties to the BUILD_CONFIG file in order to compile the DT out-of-tree and include Kconfig support for this project: KCONFIG_EXT_PREFIX=/path/to/this/repo DTS_EXT_DIR=/path/to/this/repo/arch/arm64/boot/dts DTC_INCLUDE=/path/to/this/repo/scripts/dtc/include-prefixes 5) Update paths in the BUILD_CONFIG file to reflect this projects new path. 6) Drop CONFIG_DEVICE_MODULES since we don't need it anymore. We also need to update the other external modules to be able to find the necessary includes in this project as well as be able to link to the symbols defined in this project. To handle this, we can create the file Makefile.include that defines the necessary EXTRA_CFLAGS and EXTRA_SYMBOLS variables which then can be included in the Makefile of all the external modules that need to #include headers from this project or link to the modules compile by this project. Bug: 206700303 Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: I2442032d1dcf6179dbf665418f4c7613e882c867
2021-11-24trusty: add the TRUSTY virtio id to trusty-ipc.cWill McVicker
We can't modify upstream headers. So directly add the TRUSTY virtio id to the trusty source. This only works because trusty is re-using an existing virtio ID which is very bad. This needs to eventually be fixed! Bug: 207176288 Signed-off-by: Will McVicker <willmcvicker@google.com> Change-Id: I386c62da3d8e7e5479a6f68443b606605d9d27f2
2021-09-28Merge android12-gs-pixel-5.10-sc into android-gs-p21-mainlinePetri Gynther
Signed-off-by: Petri Gynther <pgynther@google.com> Change-Id: I22444b02022e707d2257221618c3d83362c33099
2021-09-09Merge android-mainline-p21-staging into android-gs-p21-mainlineWill McVicker
Bug: 199354250 Change-Id: I768f9b807c8a2dc80a0e0bd678a407de3d51cadf Signed-off-by: Carlos Llamas <cmllamas@google.com> Signed-off-by: Will McVicker <willmcvicker@google.com>