Re: [PATCH v5 3/6] drm/xe/xe_vm: Add per VM pagefault info

2025-03-07 Thread Gwan-gyeong Mun
On 3/4/25 7:08 PM, Jonathan Cavitt wrote: Add additional information to each VM so they can report up to the last 50 seen pagefaults. Only failed pagefaults are saved this way, as successful pagefaults should recover and not need to be reported to userspace. The unrecoverable pagefault scena

Re: [PATCH v5 1/6] drm/xe/xe_gt_pagefault: Disallow writes to read-only VMAs

2025-03-07 Thread Gwan-gyeong Mun
On 3/4/25 7:08 PM, Jonathan Cavitt wrote: The page fault handler should reject write/atomic access to read only VMAs. Add code to handle this in handle_pagefault after the VMA lookup. Fixes: 3d420e9fa848 ("drm/xe: Rework GPU page fault handling") Signed-off-by: Jonathan Cavitt Suggested-by:

Re: [PATCH v5 05/32] drm/xe/bo: Introduce xe_bo_put_async

2025-02-20 Thread Gwan-gyeong Mun
struct work_struct async_free; + /** @async_list: List of BOs to be freed */ + struct llist_head async_list; + } bo_device; + /** @pmu: performance monitoring unit */ struct xe_pmu pmu; Looks good to me. Tested-by: Gwan-gyeong Mun Reviewed-by: Gwan-gyeong Mun

Re: [PATCH v5 04/32] drm/pagemap: Add DRM pagemap

2025-02-20 Thread Gwan-gyeong Mun
ng the device-private memory. + */ +struct drm_pagemap { + const struct drm_pagemap_ops *ops; + struct device *dev; +}; + +#endif Looks good to me. Reviewed-by: Gwan-gyeong Mun

Re: [PATCH v5 03/32] mm/migrate: Trylock device page in do_swap_page

2025-02-20 Thread Gwan-gyeong Mun
On 2/13/25 4:10 AM, Matthew Brost wrote: Avoid multiple CPU page faults to the same device page racing by trying to lock the page in do_swap_page before taking an extra reference to the page. This prevents scenarios where multiple CPU page faults each take an extra reference to a device page,

Re: [PATCH v4 02/33] mm/migrate: Add migrate_device_pfns

2025-01-30 Thread Gwan-gyeong Mun
nario for testing device memory pressure in the test cases mentioned in the cover letter. Do you plan to add this scenario as well? ( Please correct me if I misunderstood.) Reviewed-by: Gwan-gyeong Mun

Re: [PATCH v4 00/33] Introduce GPU SVM and Xe SVM implementation

2025-01-30 Thread Gwan-gyeong Mun
Hi Matt, I report this VM_WARN_ON_ONCE_FOLIO(), which also occurred when testing with v3, but also occurs in the same callstack when testing with this version. G.G. [ 249.486325] [IGT] xe_exec_system_allocator: executing [ 249.530682] [IGT] xe_exec_system_allocator: starting subtest once-

Re: [PATCH v4 23/33] drm/xe: Add drm_pagemap ops to SVM

2025-01-30 Thread Gwan-gyeong Mun
On 1/30/25 12:54 PM, Matthew Auld wrote: On 29/01/2025 19:52, Matthew Brost wrote: From: Thomas Hellström Add support for mapping device pages to Xe SVM by attaching drm_pagemap to a memory region, which is then linked to a GPU SVM devmem allocation. This enables GPU SVM to derive the devic

Re: [PATCH v4 06/33] drm/gpusvm: Add support for GPU Shared Virtual Memory

2025-01-30 Thread Gwan-gyeong Mun
On 1/30/25 1:17 PM, Matthew Auld wrote: On 29/01/2025 19:51, Matthew Brost wrote: This patch introduces support for GPU Shared Virtual Memory (SVM) in the Direct Rendering Manager (DRM) subsystem. SVM allows for seamless sharing of memory between the CPU and GPU, enhancing performance and fle

Re: [PATCH v3 04/30] drm/pagemap: Add DRM pagemap

2025-01-23 Thread Gwan-gyeong Mun
On 12/18/24 1:33 AM, Matthew Brost wrote: From: Thomas Hellström Introduce drm_pagemap ops to map and unmap dma to VRAM resources. In the local memory case it's a matter of merely providing an offset into the device's physical address. For future p2p the map and unmap functions may encode as

Re: [PATCH v3 05/30] drm/gpusvm: Add support for GPU Shared Virtual Memory

2025-01-23 Thread Gwan-gyeong Mun
On 12/18/24 1:33 AM, Matthew Brost wrote: This patch introduces support for GPU Shared Virtual Memory (SVM) in the Direct Rendering Manager (DRM) subsystem. SVM allows for seamless sharing of memory between the CPU and GPU, enhancing performance and flexibility in GPU computing tasks. The pat

Re: [PATCH v3 00/30] Introduce GPU SVM and Xe SVM implementation

2025-01-17 Thread Gwan-gyeong Mun
tions were built in the form of empty functions. ) This issue disappeared after proper patch modifications were applied. So please ignore the previously reported this kernel oops. Br, G.G. On 1/7/25 2:19 PM, Gwan-gyeong Mun wrote: Hi Matthew Brost, After applying this patch series and the follow

Re: [PATCH v3 05/30] drm/gpusvm: Add support for GPU Shared Virtual Memory

2025-01-17 Thread Gwan-gyeong Mun
On 12/18/24 1:33 AM, Matthew Brost wrote: This patch introduces support for GPU Shared Virtual Memory (SVM) in the Direct Rendering Manager (DRM) subsystem. SVM allows for seamless sharing of memory between the CPU and GPU, enhancing performance and flexibility in GPU computing tasks. The pat

Re: [PATCH v3 01/30] drm/xe: Retry BO allocation

2025-01-07 Thread Gwan-gyeong Mun
if (IS_ERR(bo)) { err = PTR_ERR(bo); + if (xe_vm_validate_should_retry(NULL, err, &end)) + goto retry; goto out_vm; } looks good to me. Reviewed-by: Gwan-gyeong Mun

Re: [PATCH v3 00/30] Introduce GPU SVM and Xe SVM implementation

2025-01-07 Thread Gwan-gyeong Mun
Hi Matthew Brost, After applying this patch series and the following to the latest drm-tip, while testing[1] with the mentioned IGT, I faced a kernel oops[3]. It makes prevent progressing of the mentioned igt tests. Could you please check the following oops log? (1) apply comments of "[v3,05/3

Re: [PATCH v2 17/29] drm/xe: Add SVM device memory mirroring

2024-11-19 Thread Gwan-gyeong Mun
On 10/16/24 6:25 AM, Matthew Brost wrote: +/** + * xe_devm_add: Remap and provide memmap backing for device memory + * @tile: tile that the memory region belongs to + * @mr: memory region to remap + * + * This remap device memory to host physical address space and create + * struct page to bac

Re: [PATCH v2 05/29] drm/gpusvm: Add support for GPU Shared Virtual Memory

2024-11-19 Thread Gwan-gyeong Mun
On 10/16/24 6:24 AM, Matthew Brost wrote: + +/** + * drm_gpusvm_get_devmem_page - Get a reference to a device memory page + * @page: Pointer to the page + * @zdd: Pointer to the GPU SVM zone device data + * + * This function associates the given page with the specified GPU SVM zone + * device

Re: [Intel-gfx] [PATCH v3 0/2] Fix error propagation amongst request

2023-03-06 Thread Gwan-gyeong Mun
Hi Andi, After applying these two patches, deadlock is being detected in the call stack below. Please review whether the patch to update the intel_context_migrate_copy() part affected the deadlock. https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_114451v1/bat-dg2-8/igt@i915_module_l...@loa

Re: [Intel-gfx] [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle

2023-02-02 Thread Gwan-gyeong Mun
On 2/2/23 11:28 AM, Andi Shyti wrote: Hi GG, On Thu, Feb 02, 2023 at 10:22:30AM +0200, Gwan-gyeong Mun wrote: Hi Andi, You gave a lot of explanations, and confirmed that this patch solves the problem, but the root cause of this problem still seems to be unclear. In the logs where this

Re: [PATCH] drm/i915/hwmon: Enable PL1 power limit

2023-02-02 Thread Gwan-gyeong Mun
looks good to me, but could you please add bpsec# to commit log? Reviewed-by: Gwan-gyeong Mun On 2/2/23 4:52 AM, Ashutosh Dixit wrote: Previous documentation suggested that PL1 power limit is always enabled. However we now find this not to be the case on some platforms (such as ATSM

Re: [Intel-gfx] [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle

2023-02-02 Thread Gwan-gyeong Mun
Hi Andi, You gave a lot of explanations, and confirmed that this patch solves the problem, but the root cause of this problem still seems to be unclear. In the logs where this problem was reported, the logs were output in the following order. link : https://intel-gfx-ci.01.org/tree/drm-ti

Re: [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle

2023-01-27 Thread Gwan-gyeong Mun
On 1/27/23 11:00 AM, Andi Shyti wrote: Hi Gwan-gyeong, thanks for the review and the thorough explanation. On Fri, Jan 27, 2023 at 08:50:26AM +0200, Gwan-gyeong Mun wrote: On 1/11/23 5:36 PM, Andi Shyti wrote: On Wed, Jan 11, 2023 at 03:18:38PM +0200, Jani Nikula wrote: On Wed, 11 Jan

Re: [PATCH] drm/i915/pcode: Wait 10 seconds for pcode to settle

2023-01-26 Thread Gwan-gyeong Mun
On 1/11/23 5:36 PM, Andi Shyti wrote: On Wed, Jan 11, 2023 at 03:18:38PM +0200, Jani Nikula wrote: On Wed, 11 Jan 2023, Andi Shyti wrote: From: Aravind Iddamsetty During module load not all the punit transaction have completed and we might end up timing out, as shown by the following warn

Re: [Intel-gfx] [PATCH] drm/i915: Use "%zu" to format size_t

2023-01-02 Thread Gwan-gyeong Mun
Nirmoy, thanks for fixing it Reviewed-by: Gwan-gyeong Mun On 12/30/22 8:35 PM, Nirmoy Das wrote: Switch to %zu for printing size_t which will fix compilation warning for 32-bit build. Reported-by: kernel test robot Signed-off-by: Nirmoy Das --- drivers/gpu/drm/i915/gem/i915_gem_shmem.c

Re: [Intel-gfx] [PATCH] drm/i915/gt: Reset twice

2022-12-22 Thread Gwan-gyeong Mun
re get proper WA guidance as a next step. Reviewed-by: Gwan-gyeong Mun Br, G.G. Thank you, Andi

Re: [Intel-gfx] [PATCH] drm/i915/gt: Reset twice

2022-12-22 Thread Gwan-gyeong Mun
On 12/15/22 10:07 PM, Rodrigo Vivi wrote: On Wed, Dec 14, 2022 at 11:37:19PM +0100, Andi Shyti wrote: Hi Rodrigo, On Tue, Dec 13, 2022 at 01:18:48PM +, Vivi, Rodrigo wrote: On Tue, 2022-12-13 at 00:08 +0100, Andi Shyti wrote: Hi Rodrigo, On Mon, Dec 12, 2022 at 11:55:10AM -0500, Rodri

Re: [PATCH v5] overflow: Introduce overflows_type() and castable_to_type()

2022-11-02 Thread Gwan-gyeong Mun
On 11/2/22 1:06 AM, Kees Cook wrote: On Sat, Oct 29, 2022 at 11:01:38AM +0300, Gwan-gyeong Mun wrote: On 10/29/22 10:32 AM, Kees Cook wrote: On Sat, Oct 29, 2022 at 08:55:43AM +0300, Gwan-gyeong Mun wrote: Hi Kees, Hi! :) I've updated to v5 with the last comment of Nathan. Coul

Re: [PATCH v5] overflow: Introduce overflows_type() and castable_to_type()

2022-10-29 Thread Gwan-gyeong Mun
On 10/29/22 10:32 AM, Kees Cook wrote: On Sat, Oct 29, 2022 at 08:55:43AM +0300, Gwan-gyeong Mun wrote: Hi Kees, Hi! :) I've updated to v5 with the last comment of Nathan. Could you please kindly review what more is needed as we move forward with this patch? It looks fine to me

Re: [PATCH v5] overflow: Introduce overflows_type() and castable_to_type()

2022-10-28 Thread Gwan-gyeong Mun
Hi Kees, I've updated to v5 with the last comment of Nathan. Could you please kindly review what more is needed as we move forward with this patch? Br, G.G. On 10/24/22 11:11 PM, Gwan-gyeong Mun wrote: From: Kees Cook Implement a robust overflows_type() macro to test if a variab

[PATCH v5] overflow: Introduce overflows_type() and castable_to_type()

2022-10-24 Thread Gwan-gyeong Mun
ab Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-by: Gwan-gyeong Mun Signed-off-by: Gwan-gyeong Mun Signed-off-by: Kees Cook --- v5: drop the cc-disable-warning and just disable the warning directly (Nathan) v4: - move version v2 changelog commit message to under t

[PATCH v4] overflow: Introduce overflows_type() and castable_to_type()

2022-10-21 Thread Gwan-gyeong Mun
ab Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-by: Gwan-gyeong Mun Signed-off-by: Gwan-gyeong Mun Signed-off-by: Kees Cook --- v4: - move version v2 changelog commit message to under the --- marker (Mauro) - remove the #pragma addition in the code and modify the Ma

[PATCH v3] overflow: Introduce overflows_type() and castable_to_type()

2022-10-12 Thread Gwan-gyeong Mun
assaru Iha Cc: "Gustavo A. R. Silva" Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-by: Gwan-gyeong Mun Signed-off-by: Gwan-gyeong Mun Signed-off-by: Kees Cook --- drivers/gpu/drm/i915/i915_user_extensions.c | 2 +- drivers/gpu/drm/i915/i915_utils.h

Re: [PATCH v13 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-10-07 Thread Gwan-gyeong Mun
On 9/28/22 8:09 PM, Linus Torvalds wrote: On Wed, Sep 28, 2022 at 1:15 AM Gwan-gyeong Mun wrote: + if (check_assign(obj->base.size >> PAGE_SHIFT, &npages)) + return -E2BIG; I have to say, I find that new "check_assign()" macro use to be disgust

Re: [PATCH v13 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-10-07 Thread Gwan-gyeong Mun
Linus and Kees, I also understood that I should not make and use the macro that performs assignment and checking at the same time, and I will drop it and update it. Kees, the overflows_type() macro had several updates as input from you and the community, and there is an advantage when moving t

Re: [PATCH v13 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-10-07 Thread Gwan-gyeong Mun
On 9/28/22 11:51 AM, Jani Nikula wrote: On Wed, 28 Sep 2022, Gwan-gyeong Mun wrote: diff --git a/drivers/gpu/drm/i915/i915_scatterlist.h b/drivers/gpu/drm/i915/i915_scatterlist.h index 9ddb3e743a3e..1d1802beb42b 100644 --- a/drivers/gpu/drm/i915/i915_scatterlist.h +++ b/drivers/gpu/drm

Re: [PATCH v2] overflow: Introduce overflows_type() and castable_to_type()

2022-09-28 Thread Gwan-gyeong Mun
d_overflow (type1 a, type2 b, Cc: Luc Van Oostenryck Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: Daniel Latypov Cc: Vitor Massaru Iha Cc: "Gustavo A. R. Silva" Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-by: Gwan-gyeong Mun Signed-off

[PATCH v13 9/9] drm/i915: Remove truncation warning for large objects

2022-09-28 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v13 8/9] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-09-28 Thread Gwan-gyeong Mun
: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/gem

[PATCH v13 7/9] drm/i915: Check if the size is too big while creating shmem file

2022-09-28 Thread Gwan-gyeong Mun
32, size > MAX_LFS_FILESIZE is always false, so it checks only when BITS_PER_LONG is 64. Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reported-by: kernel test robot Reviewed-by: Andr

[PATCH v13 6/9] drm/i915: Check for integer truncation on the configuration of ttm place

2022-09-28 Thread Gwan-gyeong Mun
() macro call from safe_conversion_gem_bug_on() v6: Fix to follow general use case for GEM_BUG_ON(). (Jani) v7: Fix to use WARN_ON() macro where GEM_BUG_ON() macro was used. (Jani) v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew

[PATCH v13 4/9] drm/i915/gem: Typecheck page lookups

2022-09-28 Thread Gwan-gyeong Mun
ve an unnecessary header include line. (G.G) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Matthew Auld Cc: Thomas Hellström Cc: Kees Cook Reviewed-by: Nirmoy Das (v2) Reviewed-by: Mauro Carvalho Chehab (v3) Reviewed-by: Andrzej Hajda (v5) --- drivers/gpu/drm

[PATCH v13 2/9] overflow: Introduce check_assign() and check_assign_user_ptr()

2022-09-28 Thread Gwan-gyeong Mun
_type() macro will be added in a subsequent patch (G.G) Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula Cc: Andi Shyti Cc: Andrzej Hajda Cc: Mauro Carvalho Chehab Cc: Kees Cook Reviewed-by: Mauro Carvalho Chehab (v5) Reviewed-by: An

[PATCH v13 1/9] overflow: Allow mixed type arguments

2022-09-28 Thread Gwan-gyeong Mun
org Signed-off-by: Kees Cook Signed-off-by: Gwan-gyeong Mun Reviewed-by: Andrzej Hajda Reviewed-by: Gwan-gyeong Mun Tested-by: Gwan-gyeong Mun --- include/linux/overflow.h | 72 lib/overflow_kunit.c | 101 --- 2 files ch

[PATCH v13 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-09-28 Thread Gwan-gyeong Mun
macro into drm_util header (Jani N) v5: Fix macros to be enclosed in parentheses for complex values Fix too long line warning v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld

[PATCH v13 3/9] overflow: Introduce overflows_type() and castable_to_type()

2022-09-28 Thread Gwan-gyeong Mun
.@lists.linux.dev Co-developed-by: Gwan-gyeong Mun Signed-off-by: Gwan-gyeong Mun Signed-off-by: Kees Cook --- drivers/gpu/drm/i915/i915_utils.h | 4 - include/linux/compiler.h | 1 + include/linux/overflow.h | 48 lib/overflow_kunit.c | 388 +

[PATCH v13 0/9] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation

2022-09-28 Thread Gwan-gyeong Mun
5/gem: Typecheck page lookups drm/i915: Check for integer truncation on scatterlist creation drm/i915: Remove truncation warning for large objects Gwan-gyeong Mun (4): overflow: Introduce check_assign() and check_assign_user_ptr() drm/i915: Check for integer truncation on the configuration o

Re: [PATCH v2] overflow: Introduce overflows_type() and castable_to_type()

2022-09-27 Thread Gwan-gyeong Mun
Built-in Function: bool __builtin_add_overflow (type1 a, type2 b, Cc: Luc Van Oostenryck Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: Daniel Latypov Cc: Vitor Massaru Iha Cc: "Gustavo A. R. Silva" Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-b

Re: [PATCH v11.5] overflow: Introduce overflows_type() and __castable_to_type()

2022-09-26 Thread Gwan-gyeong Mun
atypov Cc: Vitor Massaru Iha Cc: "Gustavo A. R. Silva" Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-by: Gwan-gyeong Mun Signed-off-by: Gwan-gyeong Mun Signed-off-by: Kees Cook --- include/linux/compiler.h | 1 + include/linux/overflow.h | 48 +

[PATCH v12 9/9] drm/i915: Remove truncation warning for large objects

2022-09-26 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v12 6/9] drm/i915: Check for integer truncation on the configuration of ttm place

2022-09-26 Thread Gwan-gyeong Mun
() macro call from safe_conversion_gem_bug_on() v6: Fix to follow general use case for GEM_BUG_ON(). (Jani) v7: Fix to use WARN_ON() macro where GEM_BUG_ON() macro was used. (Jani) v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew

[PATCH v12 7/9] drm/i915: Check if the size is too big while creating shmem file

2022-09-26 Thread Gwan-gyeong Mun
32, size > MAX_LFS_FILESIZE is always false, so it checks only when BITS_PER_LONG is 64. Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reported-by: kernel test robot Reviewed-by: Andr

[PATCH v12 8/9] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-09-26 Thread Gwan-gyeong Mun
: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/gem

[PATCH v12 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-09-26 Thread Gwan-gyeong Mun
macro into drm_util header (Jani N) v5: Fix macros to be enclosed in parentheses for complex values Fix too long line warning v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld

[PATCH v12 4/9] drm/i915/gem: Typecheck page lookups

2022-09-26 Thread Gwan-gyeong Mun
off_t() macro. (Kees) v11: Change the use of assert_typable to assert_same_typable (G.G) v12: Change to use static_assert(__castable_to_type(n ,T)) style since the assert_same_typable() macro has been dropped. (G.G) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursuli

[PATCH v12 3/9] overflow: Introduce overflows_type() and __castable_to_type()

2022-09-26 Thread Gwan-gyeong Mun
Cc: Nick Desaulniers Cc: Tom Rix Cc: Daniel Latypov Cc: Vitor Massaru Iha Cc: "Gustavo A. R. Silva" Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Andi Shyti Cc: Andrzej Hajda Cc: Mauro Carvalho Chehab Co-developed

[PATCH v12 2/9] overflow: Introduce check_assign() and check_assign_user_ptr()

2022-09-26 Thread Gwan-gyeong Mun
_type() macro will be added in a subsequent patch (G.G) Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula Cc: Andi Shyti Cc: Andrzej Hajda Cc: Mauro Carvalho Chehab Cc: Kees Cook Reviewed-by: Mauro Carvalho Chehab (v5) Reviewed-by: An

[PATCH v12 1/9] overflow: Allow mixed type arguments

2022-09-26 Thread Gwan-gyeong Mun
org Signed-off-by: Kees Cook Signed-off-by: Gwan-gyeong Mun Reviewed-by: Andrzej Hajda Reviewed-by: Gwan-gyeong Mun Tested-by: Gwan-gyeong Mun --- include/linux/overflow.h | 72 lib/overflow_kunit.c | 101 --- 2 files ch

[PATCH v12 0/9] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation

2022-09-26 Thread Gwan-gyeong Mun
emove temporal SAFE_CONVERSION() macro. (G.G.) Chris Wilson (3): drm/i915/gem: Typecheck page lookups drm/i915: Check for integer truncation on scatterlist creation drm/i915: Remove truncation warning for large objects Gwan-gyeong Mun (4): overflow: Introduce check_assign() and check_as

Re: [PATCH v11.5] overflow: Introduce overflows_type() and __castable_to_type()

2022-09-26 Thread Gwan-gyeong Mun
a, type2 b, type3 *res) Cc: Luc Van Oostenryck Cc: Nathan Chancellor Cc: Nick Desaulniers Cc: Tom Rix Cc: Daniel Latypov Cc: Vitor Massaru Iha Cc: "Gustavo A. R. Silva" Cc: linux-harden...@vger.kernel.org Cc: l...@lists.linux.dev Co-developed-by: Gwan-gyeon

[PATCH v11 7/9] drm/i915: Check if the size is too big while creating shmem file

2022-09-23 Thread Gwan-gyeong Mun
32, size > MAX_LFS_FILESIZE is always false, so it checks only when BITS_PER_LONG is 64. Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reported-by: kernel test robot Reviewed-by: Andr

[PATCH v11 9/9] drm/i915: Remove truncation warning for large objects

2022-09-23 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v11 3/9] compiler_types.h: Add assert_same_type to catch type mis-match while compiling

2022-09-23 Thread Gwan-gyeong Mun
Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula Cc: Andi Shyti Cc: Mauro Carvalho Chehab Cc: Andrzej Hajda Cc: Kees Cook Cc: Rasmus Villemoes --- include/linux/compiler.h | 1 + include/linux/compiler_types.h | 43 + include

[PATCH v11 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-09-23 Thread Gwan-gyeong Mun
macro into drm_util header (Jani N) v5: Fix macros to be enclosed in parentheses for complex values Fix too long line warning v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld

[PATCH v11 6/9] drm/i915: Check for integer truncation on the configuration of ttm place

2022-09-23 Thread Gwan-gyeong Mun
() macro call from safe_conversion_gem_bug_on() v6: Fix to follow general use case for GEM_BUG_ON(). (Jani) v7: Fix to use WARN_ON() macro where GEM_BUG_ON() macro was used. (Jani) v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew

[PATCH v11 8/9] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-09-23 Thread Gwan-gyeong Mun
: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/gem

[PATCH v11 4/9] drm/i915/gem: Typecheck page lookups

2022-09-23 Thread Gwan-gyeong Mun
off_t() macro. (Kees) v11: Change the use of assert_typable to assert_same_typable (G.G) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Matthew Auld Cc: Thomas Hellström Cc: Kees Cook Reviewed-by: Nirmoy Das (v2) Reviewed-by: Mauro Carvalho Chehab (v3) Review

[PATCH v11 2/9] overflow: Move and add few utility macros into overflow

2022-09-23 Thread Gwan-gyeong Mun
macro and drop overflows_ptr() macro(Kees) v11: Fix incorrect type assignment between different address spaces caused by the wrong use of __user macro. (kernel test robot) Update macro description (G.G) Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Da

[PATCH v11 1/9] overflow: Allow mixed type arguments

2022-09-23 Thread Gwan-gyeong Mun
org Signed-off-by: Kees Cook Signed-off-by: Gwan-gyeong Mun Reviewed-by: Andrzej Hajda --- include/linux/overflow.h | 72 lib/overflow_kunit.c | 101 --- 2 files changed, 113 insertions(+), 60 deletions(-) diff --git a/inc

[PATCH v11 0/9] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation

2022-09-23 Thread Gwan-gyeong Mun
terlist creation drm/i915: Remove truncation warning for large objects Gwan-gyeong Mun (5): overflow: Move and add few utility macros into overflow compiler_types.h: Add assert_same_type to catch type mis-match while compiling drm/i915: Check for integer truncation on the configuration of ttm

Re: [PATCH v10 3/9] compiler_types.h: Add assert_type to catch type mis-match while compiling

2022-09-21 Thread Gwan-gyeong Mun
On 9/13/22 3:01 PM, Kees Cook wrote: On Fri, Sep 09, 2022 at 07:59:07PM +0900, Gwan-gyeong Mun wrote: It adds assert_type and assert_typable macros to catch type mis-match while compiling. The existing typecheck() macro outputs build warnings, but the newly added assert_type() macro uses the

Re: [Intel-gfx] [PATCH v3 01/37] drm/i915: fix kernel-doc trivial warnings on i915/*.[ch] files

2022-09-16 Thread Gwan-gyeong Mun
en7_append_oa_reports - Copies all buffered OA reports into * userspace read() buffer. If there is no problem when using the same form as gen8_append_oa_reports when generating kernel-doc, it seems to be indented to match the existing i915 style. However, if there is a

Re: [Intel-gfx] [PATCH v3 02/37] drm/i915: display: fix kernel-doc markup warnings

2022-09-16 Thread Gwan-gyeong Mun
Looks good to me. Reviewed-by: Gwan-gyeong Mun On 9/9/22 10:34 AM, Mauro Carvalho Chehab wrote: There are a couple of issues at i915 display kernel-doc markups: drivers/gpu/drm/i915/display/intel_display_debugfs.c:2238: warning: Function parameter or member 'intel_connector

Re: [Intel-gfx] [PATCH v3 2/2] drm/i915/gem: Really move i915_gem_context.link under ref protection

2022-09-16 Thread Gwan-gyeong Mun
Reviewed-by: Gwan-gyeong Mun On 9/16/22 12:24 PM, Janusz Krzysztofik wrote: From: Chris Wilson i915_perf assumes that it can use the i915_gem_context reference to protect its i915->gem.contexts.list iteration. However, this requires that we do not remove the context from the list until af

Re: [Intel-gfx] [PATCH v3 1/2] drm/i915/gem: Flush contexts on driver release

2022-09-16 Thread Gwan-gyeong Mun
Reviewed-by: Gwan-gyeong Mun On 9/16/22 12:24 PM, Janusz Krzysztofik wrote: Due to i915_perf assuming that it can use the i915_gem_context reference to protect its i915->gem.contexts.list iteration, we need to defer removal of the context from the list until last reference to the context

[PATCH v10 5/9] drm/i915: Check for integer truncation on scatterlist creation

2022-09-09 Thread Gwan-gyeong Mun
macro into drm_util header (Jani N) v5: Fix macros to be enclosed in parentheses for complex values Fix too long line warning v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld

[PATCH v10 6/9] drm/i915: Check for integer truncation on the configuration of ttm place

2022-09-09 Thread Gwan-gyeong Mun
() macro call from safe_conversion_gem_bug_on() v6: Fix to follow general use case for GEM_BUG_ON(). (Jani) v7: Fix to use WARN_ON() macro where GEM_BUG_ON() macro was used. (Jani) v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew

[PATCH v10 9/9] drm/i915: Remove truncation warning for large objects

2022-09-09 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v10 7/9] drm/i915: Check if the size is too big while creating shmem file

2022-09-09 Thread Gwan-gyeong Mun
32, size > MAX_LFS_FILESIZE is always false, so it checks only when BITS_PER_LONG is 64. Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reported-by: kernel test robot Reviewed-by: Andr

[PATCH v10 8/9] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-09-09 Thread Gwan-gyeong Mun
: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/gem

[PATCH v10 1/9] overflow: Allow mixed type arguments

2022-09-09 Thread Gwan-gyeong Mun
-effects. [1] https://git.kernel.org/linus/4eb6bd55cfb22ffc20652732340c4962f3ac9a91 [2] https://lore.kernel.org/lkml/20220824084514.2261614-2-gwan-gyeong@intel.com Cc: Rasmus Villemoes Cc: Gwan-gyeong Mun Cc: Andrzej Hajda Cc: "Gustavo A. R. Silva" Cc: Nick Desaulniers Cc: li

[PATCH v10 4/9] drm/i915/gem: Typecheck page lookups

2022-09-09 Thread Gwan-gyeong Mun
off_t() macro. (Kees) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Matthew Auld Cc: Thomas Hellström Cc: Kees Cook Reviewed-by: Nirmoy Das (v2) Reviewed-by: Mauro Carvalho Chehab (v3) Reviewed-by: Andrzej Hajda (v5) --- drivers/gpu/drm/i91

[PATCH v10 3/9] compiler_types.h: Add assert_type to catch type mis-match while compiling

2022-09-09 Thread Gwan-gyeong Mun
different and can be used to detect explicit build errors. Unlike the assert_type() macro, assert_typable() macro allows a constant value as the second argument. Suggested-by: Kees Cook Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula Cc: Andi Shyti

[PATCH v10 2/9] overflow: Move and add few utility macros into overflow

2022-09-09 Thread Gwan-gyeong Mun
r_ptr() macro and drop overflows_ptr() macro(Kees) Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula Cc: Andi Shyti Cc: Andrzej Hajda Cc: Mauro Carvalho Chehab Cc: Kees Cook Reviewed-by: Mauro Carvalho Chehab (v5) Reviewed-by: Andrzej Hajda

[PATCH v10 0/9] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation

2022-09-09 Thread Gwan-gyeong Mun
ation drm/i915: Remove truncation warning for large objects Gwan-gyeong Mun (5): overflow: Move and add few utility macros into overflow compiler_types.h: Add assert_type to catch type mis-match while compiling drm/i915: Check for integer truncation on the configuration of ttm place

Re: [PATCH v9 2/8] util_macros: Add exact_type macro to catch type mis-match while compiling

2022-09-09 Thread Gwan-gyeong Mun
On 8/26/22 2:19 AM, Kees Cook wrote: On Wed, Aug 24, 2022 at 05:45:08PM +0900, Gwan-gyeong Mun wrote: It adds exact_type and exactly_pgoff_t macro to catch type mis-match while compiling. The existing typecheck() macro outputs build warnings, but the newly added exact_type() macro uses the

Re: [Intel-gfx] [PATCH v9 1/8] overflow: Move and add few utility macros into overflow

2022-09-09 Thread Gwan-gyeong Mun
On 8/26/22 10:44 PM, Andrzej Hajda wrote: On 25.08.2022 18:47, Kees Cook wrote: On Wed, Aug 24, 2022 at 05:45:07PM +0900, Gwan-gyeong Mun wrote: It moves overflows_type utility macro into overflow header from i915_utils header. The overflows_type can be used to catch the truncaion

Re: [PATCH v9 1/8] overflow: Move and add few utility macros into overflow

2022-09-09 Thread Gwan-gyeong Mun
On 8/26/22 1:47 AM, Kees Cook wrote: On Wed, Aug 24, 2022 at 05:45:07PM +0900, Gwan-gyeong Mun wrote: It moves overflows_type utility macro into overflow header from i915_utils header. The overflows_type can be used to catch the truncaion (overflow) between different data types. And it adds

Re: [Intel-gfx] [PATCH v9 2/8] util_macros: Add exact_type macro to catch type mis-match while compiling

2022-08-25 Thread Gwan-gyeong Mun
Hi Bartosz Golaszewski, would you mind taking a look at this patch? Thanks, G.G. On 8/24/22 5:45 PM, Gwan-gyeong Mun wrote: It adds exact_type and exactly_pgoff_t macro to catch type mis-match while compiling. The existing typecheck() macro outputs build warnings, but the newly added

[PATCH v8 8/8] drm/i915: Remove truncation warning for large objects

2022-08-24 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v6 8/8] drm/i915: Remove truncation warning for large objects

2022-08-24 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v6 5/8] drm/i915: Check for integer truncation on the configuration of ttm place

2022-08-24 Thread Gwan-gyeong Mun
() macro call from safe_conversion_gem_bug_on() v6: Fix to follow general use case for GEM_BUG_ON(). (Jani) Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Cc: Jani Nikula Reviewed-by: Nirmoy Das (v2) Reviewed-by: Mauro Carvalho Chehab (v3) Reported-by

Re: [Intel-gfx] [PATCH v8 1/8] overflow: Move and add few utility macros into overflow

2022-08-24 Thread Gwan-gyeong Mun
On 8/23/22 9:35 PM, Andrzej Hajda wrote: On 23.08.2022 12:17, Gwan-gyeong Mun wrote: It moves overflows_type utility macro into overflow header from i915_utils header. The overflows_type can be used to catch the truncaion (overflow) between different data types. And it adds check_assign

[PATCH v9 1/8] overflow: Move and add few utility macros into overflow

2022-08-24 Thread Gwan-gyeong Mun
.) v9: Fix overflows_type() to use __builtin_add_overflow() instead of __builtin_add_overflow_p() (Andrzej) Fix overflows_ptr() to use overflows_type() with the unsigned long type (Andrzej) Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula

[PATCH v9 6/8] drm/i915: Check if the size is too big while creating shmem file

2022-08-24 Thread Gwan-gyeong Mun
32, size > MAX_LFS_FILESIZE is always false, so it checks only when BITS_PER_LONG is 64. Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reported-by: kernel test robot Reviewed-by: Andr

[PATCH v9 7/8] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-08-24 Thread Gwan-gyeong Mun
: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/gem

[PATCH v9 8/8] drm/i915: Remove truncation warning for large objects

2022-08-24 Thread Gwan-gyeong Mun
warning put in place to remind us to complete the review. Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld Cc: Thomas Hellström Testcase: igt@gem_create@create-massive Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4991

[PATCH v9 4/8] drm/i915: Check for integer truncation on scatterlist creation

2022-08-24 Thread Gwan-gyeong Mun
macro into drm_util header (Jani N) v5: Fix macros to be enclosed in parentheses for complex values Fix too long line warning v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Chris Wilson Signed-off-by: Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Brian Welty Cc: Matthew Auld

[PATCH v9 3/8] drm/i915/gem: Typecheck page lookups

2022-08-24 Thread Gwan-gyeong Mun
Gwan-gyeong Mun Cc: Tvrtko Ursulin Cc: Matthew Auld Cc: Thomas Hellström Reviewed-by: Nirmoy Das Reviewed-by: Mauro Carvalho Chehab Reviewed-by: Andrzej Hajda --- drivers/gpu/drm/i915/gem/i915_gem_object.c| 7 +- drivers/gpu/drm/i915/gem/i915_gem_object.h| 293 -- dr

[PATCH v9 5/8] drm/i915: Check for integer truncation on the configuration of ttm place

2022-08-24 Thread Gwan-gyeong Mun
() macro call from safe_conversion_gem_bug_on() v6: Fix to follow general use case for GEM_BUG_ON(). (Jani) v7: Fix to use WARN_ON() macro where GEM_BUG_ON() macro was used. (Jani) v8: Replace safe_conversion() with check_assign() (Kees) Signed-off-by: Gwan-gyeong Mun Cc: Chris Wilson Cc: Matthew

[PATCH v9 2/8] util_macros: Add exact_type macro to catch type mis-match while compiling

2022-08-24 Thread Gwan-gyeong Mun
explicit build errors. v6: Move macro addition location so that it can be used by other than drm subsystem (Jani, Mauro, Andi) Signed-off-by: Gwan-gyeong Mun Cc: Thomas Hellström Cc: Matthew Auld Cc: Nirmoy Das Cc: Jani Nikula Cc: Andi Shyti Cc: Mauro Carvalho Chehab --- include/linux

  1   2   3   4   5   >