379ddcf6d2e3bd832595864c7afd128a11e9a162
Customer reported an issue where an unexpected GPU page fault happened due to Tiler trying to access the chunk that was already freed by the Userspace. The issue was root caused to cacheline sharing between the HeapContexts of 2 Tiler heaps of the same Kbase context. The page fault occurred for an Application that made use of more than 1 GPU queue group where one of the group, and its corresponding Tiler heap instance, is created and destroyed multiple times over the lifetime of Application. Kbase sub-allocates memory for a HeapContext from a 4KB page that is mapped as cached on GPU side, and the memory for HeapContext is zeroed on allocation through an uncached CPU mapping. Since the size of HeapContext is 32 bytes, 2 HeapContexts (corresponding to 2 Tiler heaps of the same context) can end up sharing the same GPU cacheline (which is 64 bytes in size). GPU page fault occurred as FW found a non NULL or stale value for the 'free_list_head' pointer in the HeapContext, even though the Heap was newly created, and so FW assumed a free chunk is available and passed the address of it to the Tiler and didn't raise an OoM event for Host. The stale value was found as the zeroing of new HeapContext's memory on allocation got lost due to the eviction of cacheline from L2 cache. The cacheline became dirty when FW had updated the contents of older HeapContext (sharing the cacheline with new HeapContext) on CSG suspend operation. This commit makes the GPU VA of HeapContext to be GPU cacheline aligned to avoid cacheline sharing. The alignment would suffice and there is no explicit cache flush needed when HeapContext is freed, as whole GPU cache would anyways be flushed on Odin & Turse GPUs when the initial chunks are freed just before the HeapContext is freed. Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/4724/ Test: Boot to home Bug: 259523790 Change-Id: Ie9e8bffcadbd2ca7705dcd44f9be76754e28138d Signed-off-by: Jeremy Kemp <jeremykemp@google.com>
…
Merge branch 'linux-4.19.y-cip' of https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip into android-4.19.y-mediatek
Merge branch 'linux-4.19.y-cip' of https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip into android-4.19.y-mediatek
…
…
…
…
…
…
…
Linux kernel
============
There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.
In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``. The formatted documentation can also be read online at:
https://www.kernel.org/doc/html/latest/
There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.
Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
Languages
C
98.2%
Assembly
1%
Makefile
0.4%
Perl
0.1%
Shell
0.1%