summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-22Fix kernel build warningsVamsidhar reddy Gaddam
Address kernel-doc warnings in pixel gpu components Bug: 302343291 Test: Local build Change-Id: Ia5a654f5acd1c6ee5245472792553d0d2e2d9e49 Signed-off-by: Vamsidhar reddy Gaddam <gvamsi@google.com>
2023-10-23Merge android13-gs-pixel-5.10-udc-qpr1 into android13-gs-pixel-5.10-24Q1android-u-qpr2-beta-2_r0.7android-u-qpr2-beta-2_r0.5android-u-qpr2-beta-2_r0.4android-u-qpr2-beta-2_r0.3android-u-qpr2-beta-2_r0.2android-u-qpr2-beta-2_r0.1PixelBot AutoMerger
Bug: 300854197 SBMerger: 571992243 Change-Id: Idcd27a05bcccb9738bb0e4d8216b062c9d834062 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2023-10-18Add firmware core dump error code in sscdYunju Lee
Bug: 277090000 Test: Trigger sscd Change-Id: I6ca23cc74806efc364b10ee17e654f4252d3ec1f Signed-off-by: Yunju Lee <yunjulee@google.com>
2023-10-16Merge android13-gs-pixel-5.10-udc-qpr1 into android13-gs-pixel-5.10-24Q1PixelBot AutoMerger
Bug: 300854197 SBMerger: 571992243 Change-Id: Ie9096d3afd31c2e5959618fb2f1354bca8be3cfd Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2023-10-13GPUCORE-39469 Error handling for invalid slot when parsing trace dataandroid-u-qpr1-beta-2.2_r0.6android-u-qpr1-beta-2.2_r0.5android-u-qpr1-beta-2.2_r0.4android-u-qpr1-beta-2.2_r0.3android-14.0.0_r0.44android-14.0.0_r0.43android-14.0.0_r0.42android-14.0.0_r0.41android-14.0.0_r0.40android-14.0.0_r0.39android-14.0.0_r0.37android-14.0.0_r0.36android-14.0.0_r0.35android-14.0.0_r0.34android-14.0.0_r0.33android-14.0.0_r0.31android-14.0.0_r0.25android-14.0.0_r0.23android-14.0.0_r0.21android-gs-tangorpro-5.10-android14-qpr1-betaandroid-gs-tangorpro-5.10-android14-qpr1android-gs-raviole-5.10-android14-qpr1android-gs-pantah-5.10-android14-qpr1-betaandroid-gs-pantah-5.10-android14-qpr1android-gs-lynx-5.10-android14-qpr1-betaandroid-gs-lynx-5.10-android14-qpr1android-gs-felix-5.10-android14-qpr1-betaandroid-gs-felix-5.10-android14-qpr1android-gs-bluejay-5.10-android14-qpr1Kevin Park
If a slot number parsed from trace data exceeds the number of supported CSG slots, the trace data must be discarded. Otherwise the access to the invalid memory address could happen. Bug: 304341806 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/6057 Signed-off-by: Jörg Wagner <jorwag@google.com> Change-Id: I8e702e7487f2bea3618f2fe8ad696a1b546f10f2
2023-10-11Merge android13-gs-pixel-5.10-udc-qpr1 into android13-gs-pixel-5.10-24Q1PixelBot AutoMerger
Bug: 300854197 SBMerger: 558810260 Change-Id: I1fd011faa1af3472ac4ef0b70560f44da49cdf2d Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2023-10-08mali_kbase: platform: Add missing bounds checkandroid-u-qpr1-beta-2.2_r0.2android-u-qpr1-beta-2.2_r0.1android-14.0.0_r0.22android-14.0.0_r0.19android-gs-raviole-5.10-android14-qpr1-betaandroid-gs-bluejay-5.10-android14-qpr1-betaGuus Sliepen
Fix potential out-of-bounds read due to missing bounds check. Bug: 298264460 Signed-off-by: Guus Sliepen <gsliepen@google.com> Change-Id: I57b67a4177e4fe6d84a261eeb00b6b833da5486b Merged-In: I57b67a4177e4fe6d84a261eeb00b6b833da5486b
2023-10-04mali_kbase: Zero-initialize the dump_bufs_meta arrayandroid-u-qpr1-beta-2.1_r0.7android-u-qpr1-beta-2.1_r0.5android-u-qpr1-beta-2.1_r0.4android-u-qpr1-beta-2.1_r0.3android-u-qpr1-beta-2.1_r0.2android-u-qpr1-beta-2.1_r0.1android-gs-tangorpro-5.10-u-qpr1-beta2android-gs-raviole-5.10-u-qpr1-beta2android-gs-pantah-5.10-u-qpr1-beta2android-gs-lynx-5.10-u-qpr1-beta2android-gs-felix-5.10-u-qpr1-beta2android-gs-bluejay-5.10-u-qpr1-beta2Guus Sliepen
Bug: 299948695 Change-Id: I28bde3744a365fb5a8b7794c26b5adf507041eec
2023-10-04mali_kbase: Fix OOB write in kbase_csf_cpu_queue_dump()android-u-qpr2-beta-1_r0.6android-u-qpr2-beta-1_r0.5android-u-qpr2-beta-1_r0.4android-u-qpr2-beta-1_r0.3android-u-qpr2-beta-1_r0.2android-u-qpr2-beta-1_r0.1Guus Sliepen
Bug: 299991153 Change-Id: I63342d7ca91f4150d7e5e376d8e91f0accf22dd4
2023-10-02Merge android13-gs-pixel-5.10-udc-qpr1 into android13-gs-pixel-5.10-24Q1PixelBot AutoMerger
Bug: 300854197 SBMerger: 558810260 Change-Id: I2533a7f40800e1b5c32633543af66d1a58d66a43 Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2023-09-29mali_kbase: Move epoll-consumed waitqueue to struct kbase_fileVarad Gautam
Storing the waitqueue in struct kbase_context leaves epoll holding a stale pointer to it, which it later attempts to deref and crashes the kernel in: [*][T15976] remove_wait_queue+0x64/0x190 [40350.510681][T15976] ep_unregister_pollwait+0x98/0xe8 Move this waitqueue to struct kbase_file to ensure that it lives long enough during process termination that the ep_unregister_pollwait access is valid (b/302281297). Bug: 300750575 Test: SST: b/302324090#comment4, repro: b/300750575#comment26 Change-Id: Ib161a7d7d4314bb6951bddbd87183a7dc71d5ac0 Signed-off-by: Varad Gautam <varadgautam@google.com>
2023-09-28Integrate firmware core dump into sscdYunju Lee
Move macros, struct, and functions required by sscd from source file to header file. Add firmware core dump segment to sscd. Implement firmware core dump in sscd. Bug: 277090000 Test: Trigger sscd manually Change-Id: I3546e74e647e60f13f18c5e9ef6a4a24413f02fb
2023-09-26MIDCET-4870: Fix GPU page fault issue due to reclaiming of Tiler heap chunksAkash Goel
Bug: 296839414 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/5965 Change-Id: I1c8a13de1e0abfff4e3cd7ec069fb139524c59db
2023-09-26Merge "Merge android13-gs-pixel-5.10-udc-qpr1 into ↵Pindar Yang
android13-gs-pixel-5.10-24Q1" into android13-gs-pixel-5.10-24Q1
2023-09-25Merge android13-gs-pixel-5.10-udc-qpr1 into android13-gs-pixel-5.10-24Q1PixelBot AutoMerger
Bug: 300854197 SBMerger: 558810260 Change-Id: Ia28e47cbbe05c916007afaa7d0528972ae735e8c Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
2023-09-20mali_kbase: platform: Fix integer overflowJack Diver
Fix potential integer overflow within buffer liveness ioctl. Bug: 296984851 Test: N/A Change-Id: Ib1c9ee25a89b0a39ec905f109ee2c57c502428db (cherry picked from https://partner-android-review.googlesource.com/q/commit:02e5329e2e3f4af00f51560895b5bbe87fe824ef) Signed-off-by: Jack Diver <diverj@google.com>
2023-09-20mali_kbase: Tracepoints for governor recommendationVarad Gautam
Record the freq recommended by the governor before it's clamped via a new `gpu_gov_rec` clock tracepoint. Also record a new tracepoint `gpu_gov_rec_violate` if this freq is outside of the level lock window. Bug: 291855615 Test: Manual trace Signed-off-by: Varad Gautam <varadgautam@google.com> Change-Id: I45d0ffbebb6fa83d1a47b9d2afc8d96ce420afce
2023-09-19mali_kbase: Add tracepoints to hint_min_freq / hint_max_freqVarad Gautam
Bug: 291855615 Test: Record manual trace. Signed-off-by: Varad Gautam <varadgautam@google.com> Change-Id: Id4341c3809b2e3b147122adaabaa01ac7b265dfc
2023-09-11mali_kbase: Enable mali_kutf_clk_rate_trace_test_portal buildandroid-u-qpr1-beta-2_r0.7android-u-qpr1-beta-2_r0.5android-u-qpr1-beta-2_r0.4android-u-qpr1-beta-2_r0.3android-u-qpr1-beta-2_r0.2android-u-qpr1-beta-2_r0.1Siddharth Kapoor
Bug: 290882327 Change-Id: Ifb843070d65bdf4148b29c6d1a92bdf3a6f3aa89 Signed-off-by: Siddharth Kapoor <ksiddharth@google.com>
2023-09-11mali_kbase: restore CSF ftrace eventsDebarshi Dutta
This line was re-added accidentally as part of the merge of r44p1-00dev3 in b6fd708b3a. Removed this line to restore exposure of the ftrace events. Bug: 290882327 Change-Id: Ibf3215bab6d4699d905027cce3412b49e205f9fb Signed-off-by: Debarshi Dutta <debarshid@google.com>
2023-09-11Refactor helpers for creating RT threadsJörg Wagner
Split functionality to allow creation of arbitrary thread tasks and kthread_worker_fn workers, while sharing the promotion to RT scheduling policies for both. Finally use this functionality to elevate "mali-gpuq-kthread" to RT priority. Bug: 290882327 Change-Id: Icf2c07849cdd0ca47bcfc06700853ac1856d0a87
2023-09-11Merge "Merge r44p1-00dev3 from partner/upstream into ↵Debarshi Dutta
android13-gs-pixel-5.10-udc-qpr1" into android13-gs-pixel-5.10-udc-qpr1
2023-09-05Merge android13-gs-pixel-5.10-udc into android13-gs-pixel-5.10-udc-qpr1android-u-qpr1-beta-1_r0.7android-u-qpr1-beta-1_r0.5android-u-qpr1-beta-1_r0.4android-u-qpr1-beta-1_r0.3android-u-qpr1-beta-1_r0.2android-u-qpr1-beta-1_r0.1Pindar Yang
Conflict files: mali_kbase/context/mali_kbase_context.c mali_kbase/csf/mali_kbase_csf_defs.h Bug: 292447561 SBMerger: 558810260 Change-Id: I3460f177e640d109891b9950359dabda85f607a6
2023-09-05Merge android13-gs-pixel-5.10-tm-qpr3 into android13-gs-pixel-5.10-udcandroid-14.0.0_r0.17android-14.0.0_r0.16android-14.0.0_r0.15android-14.0.0_r0.14android-14.0.0_r0.13android-14.0.0_r0.11android-gs-tangorpro-android14-releaseandroid-gs-raviole-android14-releaseandroid-gs-pantah-android14-releaseandroid-gs-lynx-android14-releaseandroid-gs-felix-android14-releaseandroid-gs-bluejay-android14-releasePindar Yang
Conflict files: mali_kbase/context/mali_kbase_context.c Bug: 292447561 SBMerger: 558810260 Change-Id: Ie51c66a74401c1d5660cd0845d5442d33e01ca39
2023-09-01Merge r44p1-00dev3 from partner/upstream into android13-gs-pixel-5.10-udc-qpr1Jörg Wagner
Bug: 290882327 Change-Id: I90723cbaa3f294431087587fd8025f0688e51bf2
2023-08-31Update KMD to 'mini release: update r44p1-00dev2 to r44p1-00dev3'Jörg Wagner
Provenance: ipdelivery@5c8fdf6c071d63537e87949cfb4845079a669a0b Change-Id: Icc06581f804bf59be5fe923349318e703f02d5a3
2023-08-31mali_kbase: Use kthread for protm_event_workerMattias Simonsson
protm_event_worker is responsible for triggering protected mode entry, but it currently runs in a default priority workqueue, which results in occasional long stalls for protected mode work. The workload of this task is very light, typically only running for a few tens of microseconds each invocation, so converting it to a kthread should have no significant impact on overall system performance. Bug: 297019294 Test: Manual Netflix PiP perfetto trace inspection Change-Id: Ica9e744bd390ae6b88a701bf2d390f82937581d0
2023-08-30GPUCORE-34589 jit_lock all JIT operationsTu Vuong
This commit protects all JIT operations with the KCPU queues context jit_lock. TI2: 893173 Type: Fix Change-Id: If500064c18827e0071651274ccba541a68168ac2 Merged-In: I84fb19e7ce5f28e735d44a4993d51bd985aac80b (cherry picked from commit 1b3511e3f68a01459d7c8c09711a8aabd374853c) (cherry picked from commit bbabc5947dcd1fa21d3a0d8cb996238153bd57d1) Bug: 298157271 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/5448
2023-08-30[Official] MIDCET-4458, GPUCORE-36765: Stop the use of tracking page for GPU ↵android-13.0.0_r0.127android-13.0.0_r0.126android-13.0.0_r0.125android-13.0.0_r0.124android-13.0.0_r0.123android-13.0.0_r0.121android-gs-tangorpro-5.10-android13-qpr3android-gs-raviole-5.10-android13-qpr3android-gs-pantah-5.10-android13-qpr3android-gs-lynx-5.10-android13-qpr3android-gs-felix-5.10-android13-qpr3-candroid-gs-bluejay-5.10-android13-qpr3Suzanne Candanedo
memory accounting Kbase accounts the GPU memory allocated for a context under the memory footprint of a process, so that kernel's low memory killer or OoM killer can kill the suitable process to free up decent amount of system memory. For accounting, Kbase updates the 'MM_FILEPAGES' counter inside the 'mm_struct' corresponding to the process that created the Kbase context. To ensure 'mm_struct' can always be safely accessed, a tracking page was used which Kbase mandated to be mapped right after the opening of '/dev/mali0' file. When the mapping was closed Kbase updated the kernel counter to subtract all the GPU memory allocated so far for a context but the actual freeing of GPU memory was done later. This was usually not a problem as the mapping is closed by DDK Userspace just before the context termination. But the Userspace is allowed to close it at will. Malicious Userspace could have exploited this Kbase quirk by closing the mapping which would have mislead the OoM killer in killing the innocent processes before it gets around to the culprit process. This commit removes the use of tracking page and uses mmgrab() to take a reference on 'mm_struct' for User created Kbase context. The reference doesn't prevent the freeing of address space on process exit, it merely keeps the 'mm_struct' alive. The reference is dropped on context termination. For backward compatibility, the call from Base to create the mapping for tracking page isn't rejected by Kbase. The Base code has been updated to skip the mapping of tracking page only for newer Kbase so as to maintain forward compatibility with the older Kbase. BASE_UK_VERSION_MINOR has been incremented as the requirement to create a mapping for tracking page is relaxed by Kbase. Change-Id: I37407809d7187cb5c8fac63e6c10f72cc3bd762d Bug: 275853921 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/5165 (cherry picked from commit b29f4a639e0863c09e72d7e34c0a6ad57f9572a6)
2023-08-30Merge "Merge android13-gs-pixel-5.10-udc into ↵Pindar Yang
android13-gs-pixel-5.10-udc-qpr1" into android13-gs-pixel-5.10-udc-qpr1
2023-08-28mali_kbase: Unmask RESET_COMPLETED irq before resetting the GPUVarad Gautam
This reverts commit e8fa58acd3f48031ac6297e64ae996d430fa31d4. b/290409680 shows RESET_COMPLETED irq being missed in the absence of this patch. The original patch (pa/I2dcec3ef431) was found to not cause the stability problems for which it was reverted (pa/I6ee1b26063a). Reintroduce it. Test: Boot to home. ARM Upstreaming: Pending in https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/4835 Bug: 290409680 Change-Id: Iada51bb1d9c88dd0d3b0fdab5961c85699221b47 Signed-off-by: Varad Gautam <varadgautam@google.com>
2023-08-28Merge android13-gs-pixel-5.10-udc into android13-gs-pixel-5.10-udc-qpr1PixelBot AutoMerger
Bug: 292447561 SBMerger: 558810260 Change-Id: Ic618ad7008dfa915ff71de71bc205d9e219b7c34 Signed-off-by: Pindar Yang <pindaryang@google.com>
2023-08-25[Official] MIDCET-4820,GPUCORE-36255 Sync whole USER_BUFFER pages upon GPU ↵Rivaldo Hong
mapping As a result of this change now the whole of each of the pages underlying a memory region imported as a USER_BUFFER region are synchronized and the driver disables automatic CPU cache synchronization upon DMA map/unmap operations. (cherry picked from commit 0c2790fb2b006edb3e648a8a9a732e3aadcf2436) Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/5829 Bug: 295897369 Change-Id: Ifbd656b78e49ae614ca87e156321d0ccd6dd8887
2023-08-24mali_kbase: Use rt_mutex for scheduler lockMattias Simonsson
We use pm_runtime for handling suspends, which means that an internal linux power workqueue will take and hold the CSF scheduler lock while performing suspend operations. This workqueue runs at default priority and so might not be scheduled fast enough if there is high CPU load, which results in missed frames. By promoting the CSF scheduler lock to an rt_mutex we ensure that the GPU wakes up faster when there is work that needs to be done, since our other internal realtime threads will be waiting on the scheduler lock in these cases. Bug: 296862283 Test: CUJ close camera Change-Id: Ibe81ad7e26a75acb1640b2820902eb8144a48fdd Merged-In: I0e81a45e3d65f60337250d35c53ef6447c876051
2023-08-23mali_kbase: fix incorrect auto-merger changeDebarshi Dutta
The change ca522e4491584d5a2a5f122ee90e3edb3581182b was added by the automerger. It changed the sequence of the mutex_unlock Restore it according to bce5281a0408a175137c08dc93028e2a2c0fb69b [upstream R43P0 merge] Bug 294759508 Change-Id: Ie9ed80e48237111e190a070f0615fad47cfb8f3a Signed-off-by: Debarshi Dutta <debarshid@google.com>
2023-08-22mali_pixel: Disable mgm debugfs by defaultJack Diver
Implicit SLC caching results in a high volume of PTE updates. Tracking the number of updates shows up when profiling. Disable these nodes and the associated tracking by default. Bug: 294167925 Test: gfxbench sweep, genshin (cherry picked from https://partner-android-review.googlesource.com/q/commit:82d0547845919e91b27196dccc0202fe7e7e40de) Merged-In: I551b8f58f633ba6cfb74b0651bbbe30a6909eeb2 Change-Id: I551b8f58f633ba6cfb74b0651bbbe30a6909eeb2 Signed-off-by: Jack Diver <diverj@google.com>
2023-08-22mali_kbase: platform: Batch MMU flushes after liveness updateJack Diver
Test: Boot to home, gfx-bench sweep Bug: 294167925 (cherry picked from https://partner-android-review.googlesource.com/q/commit:3143995156d9372ca6af0be57aa29dd0ec14cce1) Merged-In: I4a122fe023b43c3763884fda99cfed17048a3eb0 Change-Id: I4a122fe023b43c3763884fda99cfed17048a3eb0 Signed-off-by: Jack Diver <diverj@google.com>
2023-08-22mali_kbase: refactor kbase_mmu_update_pagesJack Diver
Refactor kbase_mmu_update_pages, extracting flush/invalidate into new function. Expose no-flush variant. Test: Build, boot Bug: 294167925 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:b36ce28e0779c27e57dad90d98c5e202eb654013) Merged-In: I4d1fce75d6ccf352ee54935138d6c92cdc609049 Change-Id: I4d1fce75d6ccf352ee54935138d6c92cdc609049
2023-08-22[Official] MIDCET-4806,GPUCORE-38732 Continue FLUSH_MEM after power ↵Kevin Park
transition timeout This patch continues FLUSH_MEM operation at function caller and increases the timeout value for the core power transition. Change-Id: I8cf5417976ab31b8d1e9e33e6359a91455d37144 (cherry picked from commit 71f7017252aabbb0013a2f151d894959b7c7c226) Bug: 295942377 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/5812
2023-08-21mali_pixel: mgm: Compensate for group migrationJack Diver
Pages in the SLC group were often 'migrated' there from the reserved group. This leads to unbalanced accounting as at alloc time the reserved group counter is incremented, but at free time the SLC group counter is decremented. Add custom logic to detect this, but plan to remove it soon when memory groups are decoupled from SLC partitions (b/290354607). Bug: 289501175 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:7bb27d3d29f850315d0b7ee103fbdfe75e9403da) Merged-In: Ia878a05c4d8dd7db7969f7089c6b93bf90c17f8e Change-Id: Ia878a05c4d8dd7db7969f7089c6b93bf90c17f8e
2023-08-21mali_pixel: mgm: Remove race conditionJack Diver
Remove window where mismanagement of counters could be missed. Bug: 289501175 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:b6b86cbf708df94173f9a5152229a39c043e8909) Merged-In: I6d17726667c2d1fda4cd928e10d5143405ecd38f Change-Id: I6d17726667c2d1fda4cd928e10d5143405ecd38f
2023-08-21mali_pixel: mgm: Refactor update_sizeJack Diver
Bug: 289501175 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:252edb03c91ebb738377caf5fe0c4cef52c36fb1) Merged-In: Ib66717ef8acc13ede87b4e324fdc3489c119865f Change-Id: Ib66717ef8acc13ede87b4e324fdc3489c119865f
2023-08-15Merge "Merge android13-gs-pixel-5.10-udc into ↵Pindar Yang
android13-gs-pixel-5.10-udc-qpr1" into android13-gs-pixel-5.10-udc-qpr1
2023-08-14mali_kbase: add missing deinitializationDebarshi Dutta
Invoke kbase_csf_tiler_heap_context_term() after an unsuccessful call to kbasep_ctx_user_reg_page_mapping_init(). Bug 294759508 Change-Id: I6ef97a6e69042ab9e2351939d23e09cf4ec83216 Signed-off-by: Debarshi Dutta <debarshid@google.com>
2023-08-14Merge android13-gs-pixel-5.10-udc into android13-gs-pixel-5.10-udc-qpr1PixelBot AutoMerger
Conflict files: mali_kbase/context/mali_kbase_context.c mali_kbase/mali_kbase_mem.h SBMerger: 526756187 Change-Id: I6e2a522d8735896f970cac1157943fa2670664c7
2023-08-10Merge "r43p0 KMD update: Re-merge goog/upstream@bce5281a0408a17" into ↵Debarshi Dutta
android13-gs-pixel-5.10-udc-qpr1
2023-08-07[Official] MIDCET-4458, GPUCORE-36765: Stop the use of tracking page for GPU ↵android-u-beta-5.3_r0.7android-u-beta-5.3_r0.5android-u-beta-5.3_r0.4android-u-beta-5.3_r0.2android-u-beta-5.3_r0.1android-14.0.0_r0.7android-14.0.0_r0.6android-14.0.0_r0.5android-14.0.0_r0.4android-14.0.0_r0.3android-14.0.0_r0.2android-gs-tangorpro-5.10-u-beta5.3android-gs-tangorpro-5.10-android14android-gs-raviole-5.10-u-beta5.3android-gs-raviole-5.10-android14android-gs-pantah-5.10-u-beta5.3android-gs-pantah-5.10-android14android-gs-lynx-5.10-android14android-gs-felix-5.10-u-beta5.3android-gs-felix-5.10-android14android-gs-bluejay-5.10-u-beta5.3android-gs-bluejay-5.10-android14Suzanne Candanedo
memory accounting Kbase accounts the GPU memory allocated for a context under the memory footprint of a process, so that kernel's low memory killer or OoM killer can kill the suitable process to free up decent amount of system memory. For accounting, Kbase updates the 'MM_FILEPAGES' counter inside the 'mm_struct' corresponding to the process that created the Kbase context. To ensure 'mm_struct' can always be safely accessed, a tracking page was used which Kbase mandated to be mapped right after the opening of '/dev/mali0' file. When the mapping was closed Kbase updated the kernel counter to subtract all the GPU memory allocated so far for a context but the actual freeing of GPU memory was done later. This was usually not a problem as the mapping is closed by DDK Userspace just before the context termination. But the Userspace is allowed to close it at will. Malicious Userspace could have exploited this Kbase quirk by closing the mapping which would have mislead the OoM killer in killing the innocent processes before it gets around to the culprit process. This commit removes the use of tracking page and uses mmgrab() to take a reference on 'mm_struct' for User created Kbase context. The reference doesn't prevent the freeing of address space on process exit, it merely keeps the 'mm_struct' alive. The reference is dropped on context termination. For backward compatibility, the call from Base to create the mapping for tracking page isn't rejected by Kbase. The Base code has been updated to skip the mapping of tracking page only for newer Kbase so as to maintain forward compatibility with the older Kbase. BASE_UK_VERSION_MINOR has been incremented as the requirement to create a mapping for tracking page is relaxed by Kbase. Change-Id: I37407809d7187cb5c8fac63e6c10f72cc3bd762d Bug: 275853921 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/5165 (cherry picked from commit b29f4a639e0863c09e72d7e34c0a6ad57f9572a6)
2023-08-07mali_kbase: restore hysteresis time.Debarshi Dutta
An accidental change back to a lower hysteresis time as a part of the R43P0 merge commit resulted in GPU powering on and off more frequently and regressing previously established perf. Restore the same to a value that was previously determined and set in our downstream driver. Bug 292157710 Bug 278174418 Change-Id: Id44337bc1fd672722a5edaf27aaca16f320b7ad0 Signed-off-by: Debarshi Dutta <debarshid@google.com>
2023-08-07r43p0 KMD update: Re-merge goog/upstream@bce5281a0408a17Jörg Wagner
Restore the history relationship between our side and Arm's (goog/upstream) which was left decoupled by 20fff721667a22. Bug: 294759508 Change-Id: I21dc645bb7376c7e659ad879d8ad2f5d683eb944
2023-08-03Update KMD to 'mini release: update r44p1-01bet1 to r44p1-00dev2'Jörg Wagner
Provenance: ipdelivery@d10c137c7691a470b8b33786aec4965315db4561 Change-Id: I4fbcc669d3b8e36c8288c91fdddd8b79258b6635