[PATCH 2/3] drm/amd: validate user pitch alignment

2018-12-21 Thread Yu Zhao
memory will cause memory corruption. Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index e309d26170db..755daa332f8a

[PATCH 3/3] drm/amd: validate user GEM object size

2018-12-21 Thread Yu Zhao
path because individual driver might have different requirement. Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index

[PATCH 1/3] drm/amd: fix race in page flip job

2018-12-21 Thread Yu Zhao
e job will eventually times out. Reverse the order of calling page_flip and setting pflip_status to fix the race. Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display

[PATCH v2 2/2] drm/amd: validate user GEM object size

2018-12-23 Thread Yu Zhao
path because individual driver might have different requirement. Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index

[PATCH v3 2/2] drm/amd: validate user GEM object size

2018-12-23 Thread Yu Zhao
path because individual driver might have different requirement. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd

Re: [PATCH 2/3] drm/amd: validate user pitch alignment

2018-12-23 Thread Yu Zhao
On Fri, Dec 21, 2018 at 10:07:26AM +0100, Michel Dänzer wrote: > On 2018-12-21 4:10 a.m., Yu Zhao wrote: > > Userspace may request pitch alignment that is not supported by GPU. > > Some requests 32, but GPU ignores it and uses default 64 when cpp is > > 4. If GEM object is a

[PATCH v3 1/2] drm/amd: validate user pitch alignment

2018-12-23 Thread Yu Zhao
memory will cause memory corruption. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

[PATCH v2 1/2] drm/amd: validate user pitch alignment

2018-12-23 Thread Yu Zhao
memory will cause memory corruption. Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 686a26de50f9..883a4df2386d

[PATCH v4 2/2] drm/amd: validate user GEM object size

2018-12-24 Thread Yu Zhao
path because individual driver might have different requirement. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd

[PATCH v4 1/2] drm/amd: validate user pitch alignment

2018-12-24 Thread Yu Zhao
memory will cause memory corruption. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Re: [PATCH 2/3] drm/amd: validate user pitch alignment

2018-12-24 Thread Yu Zhao
On Fri, Dec 21, 2018 at 10:07:26AM +0100, Michel Dänzer wrote: > On 2018-12-21 4:10 a.m., Yu Zhao wrote: > > Userspace may request pitch alignment that is not supported by GPU. > > Some requests 32, but GPU ignores it and uses default 64 when cpp is > > 4. If GEM object is a

[PATCH v5 2/2] drm/amd: validate user GEM object size

2019-01-01 Thread Yu Zhao
because individual driver might have different requirement. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu

[PATCH v5 1/2] drm/amd: validate user pitch alignment

2019-01-01 Thread Yu Zhao
Userspace may request pitch alignment that is not supported by GPU. Some requests 32, but GPU ignores it and uses default 64 when cpp is 4. If GEM object is allocated based on the smaller alignment, GPU DMA will go out of bound. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao

Re: [PATCH v5 1/2] drm/amd: validate user pitch alignment

2019-01-07 Thread Yu Zhao
On Thu, Jan 03, 2019 at 05:33:19PM +0100, Michel Dänzer wrote: > On 2018-12-30 2:00 a.m., Yu Zhao wrote: > > Userspace may request pitch alignment that is not supported by GPU. > > Some requests 32, but GPU ignores it and uses default 64 when cpp is > > 4. If GEM object is a

[PATCH v6 2/2] drm/amd: validate user GEM object size

2019-01-08 Thread Yu Zhao
because individual driver might have different requirement. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu

[PATCH v6 1/2] drm/amd: validate user pitch alignment

2019-01-08 Thread Yu Zhao
Userspace may request pitch alignment that is not supported by GPU. Some requests 32, but GPU ignores it and uses default 64 when cpp is 4. If GEM object is allocated based on the smaller alignment, GPU DMA will go out of bound. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao

Re: [PATCH] drm/ttm: properly unmap dma page upon failure

2019-07-06 Thread Yu Zhao
On Mon, Mar 25, 2019 at 02:22:50PM -0600, Yu Zhao wrote: > dma_unmap_page() must be called with exactly the same dma address > and size returned by dma_map_page(). Otherwise, the function may > fail. > > This is at least the case for debug_dma_unmap_page() and AMD iommu > unmap_

[PATCH] drm/ttm: properly unmap dma page upon failure

2019-03-26 Thread Yu Zhao
dma_unmap_page() must be called with exactly the same dma address and size returned by dma_map_page(). Otherwise, the function may fail. This is at least the case for debug_dma_unmap_page() and AMD iommu unmap_page callback. Signed-off-by: Yu Zhao --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 11

Re: [PATCHv3 11/11] mm: Rename PG_dropbehind to PG_reclaim

2025-01-30 Thread Yu Zhao
On Thu, Jan 30, 2025 at 3:01 AM Kirill A. Shutemov wrote: > > Now as PG_reclaim is gone, its name can be reclaimed for better > use :) > > Rename PG_dropbehind to PG_reclaim and rename all helpers around it. > > Signed-off-by: Kirill A. Shutemov Acked-by: Yu Zhao

Re: [PATCHv3 05/11] mm/truncate: Use folio_set_dropbehind() instead of deactivate_file_folio()

2025-01-30 Thread Yu Zhao
s to replace whole deactivate_file_folio() machinery > with simple folio_set_dropbehind(). > > Signed-off-by: Kirill A. Shutemov Acked-by: Yu Zhao

Re: [PATCHv3 06/11] mm/vmscan: Use PG_dropbehind instead of PG_reclaim

2025-02-02 Thread Yu Zhao
On Sat, Feb 1, 2025 at 1:02 AM Kairui Song wrote: > > On Thu, Jan 30, 2025 at 6:02 PM Kirill A. Shutemov > wrote: > > > > The recently introduced PG_dropbehind allows for freeing folios > > immediately after writeback. Unlike PG_reclaim, it does not need vmscan > > to be involved to get the folio

Re: [PATCHv3 01/11] mm/migrate: Transfer PG_dropbehind to the new folio

2025-01-30 Thread Yu Zhao
gt; Signed-off-by: Kirill A. Shutemov Acked-by: Yu Zhao

Re: [PATCH 8/8] mm: Remove PG_reclaim

2025-01-14 Thread Yu Zhao
On Tue, Jan 14, 2025 at 1:30 AM Kirill A. Shutemov wrote: > > On Mon, Jan 13, 2025 at 03:28:43PM +, Matthew Wilcox wrote: > > On Mon, Jan 13, 2025 at 11:34:53AM +0200, Kirill A. Shutemov wrote: > > > diff --git a/mm/migrate.c b/mm/migrate.c > > > index caadbe393aa2..beba72da5e33 100644 > > > -

Re: [PATCH 4/8] mm/swap: Use PG_dropbehind instead of PG_reclaim

2025-01-14 Thread Yu Zhao
On Tue, Jan 14, 2025 at 11:03 AM Yosry Ahmed wrote: > > On Tue, Jan 14, 2025 at 12:12 AM Kirill A. Shutemov > wrote: > > > > On Mon, Jan 13, 2025 at 08:17:20AM -0800, Yosry Ahmed wrote: > > > On Mon, Jan 13, 2025 at 1:35 AM Kirill A. Shutemov > > > wrote: > > > > > > > > The recently introduced

Re: [PATCH 4/8] mm/swap: Use PG_dropbehind instead of PG_reclaim

2025-01-14 Thread Yu Zhao
On Tue, Jan 14, 2025 at 9:28 PM Yu Zhao wrote: > > On Tue, Jan 14, 2025 at 11:03 AM Yosry Ahmed wrote: > > > > On Tue, Jan 14, 2025 at 12:12 AM Kirill A. Shutemov > > wrote: > > > > > > On Mon, Jan 13, 2025 at 08:17:20AM -0800, Yosry Ahmed wrote: > &

Re: [PATCHv2 05/11] mm/truncate: Use folio_set_dropbehind() instead of deactivate_file_folio()

2025-01-15 Thread Yu Zhao
s to replace whole deactivate_file_folio() machinery > with simple folio_set_dropbehind(). > > Signed-off-by: Kirill A. Shutemov Acked-by: Yu Zhao

Re: [PATCHv2 09/11] mm: Remove PG_reclaim

2025-01-15 Thread Yu Zhao
On Wed, Jan 15, 2025 at 2:32 AM Kirill A. Shutemov wrote: > > Nobody sets the flag anymore. > > Remove the PG_reclaim, making PG_readhead exclusive user of the page > flag bit. > > Signed-off-by: Kirill A. Shutemov Acked-by: Yu Zhao

Re: [PATCHv2 11/11] mm: Rename PG_dropbehind to PG_reclaim

2025-01-15 Thread Yu Zhao
On Wed, Jan 15, 2025 at 2:32 AM Kirill A. Shutemov wrote: > > Now as PG_reclaim is gone, its name can be reclaimed for better > use :) > > Rename PG_dropbehind to PG_reclaim and rename all helpers around it. > > Signed-off-by: Kirill A. Shutemov Acked-by: Yu Zhao

Re: [PATCHv2 05/11] mm/truncate: Use folio_set_dropbehind() instead of deactivate_file_folio()

2025-01-15 Thread Yu Zhao
On Wed, Jan 15, 2025 at 2:35 PM Matthew Wilcox wrote: > > On Wed, Jan 15, 2025 at 11:31:29AM +0200, Kirill A. Shutemov wrote: > > -static void lru_deactivate_file(struct lruvec *lruvec, struct folio *folio) > > -{ > > - bool active = folio_test_active(folio) || lru_gen_enabled(); > > - lon