* [PATCH v6.1.y 0/2] drm/ttm: fixes for vmwgfx when SEV enabled @ 2024-12-09 9:49 Ajay Kaher 2024-12-09 9:49 ` [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed Ajay Kaher 2024-12-09 9:49 ` [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once Ajay Kaher 0 siblings, 2 replies; 7+ messages in thread From: Ajay Kaher @ 2024-12-09 9:49 UTC (permalink / raw) To: stable, gregkh Cc: zack.rusin, thomas.hellstrom, christian.koenig, ray.huang, airlied, daniel, dri-devel, linux-kernel, ajay.kaher, alexey.makhalov, vasavi.sirnapalli drm/ttm patches for v6.1.y to fix vmwgfx when SEV enabled. Zack Rusin (2): drm/ttm: Make sure the mapped tt pages are decrypted when needed drm/ttm: Print the memory decryption status just once drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++++++-- drivers/gpu/drm/ttm/ttm_tt.c | 12 ++++++++++++ include/drm/ttm/ttm_tt.h | 7 +++++++ 3 files changed, 30 insertions(+), 2 deletions(-) -- 2.39.4 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed 2024-12-09 9:49 [PATCH v6.1.y 0/2] drm/ttm: fixes for vmwgfx when SEV enabled Ajay Kaher @ 2024-12-09 9:49 ` Ajay Kaher 2024-12-09 14:35 ` Sasha Levin 2024-12-12 12:40 ` Patch "drm/ttm: Make sure the mapped tt pages are decrypted when needed" has been added to the 6.1-stable tree gregkh 2024-12-09 9:49 ` [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once Ajay Kaher 1 sibling, 2 replies; 7+ messages in thread From: Ajay Kaher @ 2024-12-09 9:49 UTC (permalink / raw) To: stable, gregkh Cc: zack.rusin, thomas.hellstrom, christian.koenig, ray.huang, airlied, daniel, dri-devel, linux-kernel, ajay.kaher, alexey.makhalov, vasavi.sirnapalli, Sasha Levin, Ye Li From: Zack Rusin <zack.rusin@broadcom.com> commit 71ce046327cfd3aef3f93d1c44e091395eb03f8f upstream. Some drivers require the mapped tt pages to be decrypted. In an ideal world this would have been handled by the dma layer, but the TTM page fault handling would have to be rewritten to able to do that. A side-effect of the TTM page fault handling is using a dma allocation per order (via ttm_pool_alloc_page) which makes it impossible to just trivially use dma_mmap_attrs. As a result ttm has to be very careful about trying to make its pgprot for the mapped tt pages match what the dma layer thinks it is. At the ttm layer it's possible to deduce the requirement to have tt pages decrypted by checking whether coherent dma allocations have been requested and the system is running with confidential computing technologies. This approach isn't ideal but keeping TTM matching DMAs expectations for the page properties is in general fragile, unfortunately proper fix would require a rewrite of TTM's page fault handling. Fixes vmwgfx with SEV enabled. v2: Explicitly include cc_platform.h v3: Use CC_ATTR_GUEST_MEM_ENCRYPT instead of CC_ATTR_MEM_ENCRYPT to limit the scope to guests and log when memory decryption is enabled. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Fixes: 3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem") Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Acked-by: Christian König <christian.koenig@amd.com> Cc: Huang Rui <ray.huang@amd.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: <stable@vger.kernel.org> # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20230926040359.3040017-1-zack@kde.org Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ye Li <ye.li@broadcom.com> Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com> --- drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++++++-- drivers/gpu/drm/ttm/ttm_tt.c | 12 ++++++++++++ include/drm/ttm/ttm_tt.h | 7 +++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index fa04e62..dcb2c23 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -274,7 +274,13 @@ pgprot_t ttm_io_prot(struct ttm_buffer_object *bo, struct ttm_resource *res, enum ttm_caching caching; man = ttm_manager_type(bo->bdev, res->mem_type); - caching = man->use_tt ? bo->ttm->caching : res->bus.caching; + if (man->use_tt) { + caching = bo->ttm->caching; + if (bo->ttm->page_flags & TTM_TT_FLAG_DECRYPTED) + tmp = pgprot_decrypted(tmp); + } else { + caching = res->bus.caching; + } return ttm_prot_from_caching(caching, tmp); } @@ -317,6 +323,8 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo, .no_wait_gpu = false }; struct ttm_tt *ttm = bo->ttm; + struct ttm_resource_manager *man = + ttm_manager_type(bo->bdev, bo->resource->mem_type); pgprot_t prot; int ret; @@ -326,7 +334,8 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo, if (ret) return ret; - if (num_pages == 1 && ttm->caching == ttm_cached) { + if (num_pages == 1 && ttm->caching == ttm_cached && + !(man->use_tt && (ttm->page_flags & TTM_TT_FLAG_DECRYPTED))) { /* * We're mapping a single page, and the desired * page protection is consistent with the bo. diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index d505603..91e1797 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -31,11 +31,13 @@ #define pr_fmt(fmt) "[TTM] " fmt +#include <linux/cc_platform.h> #include <linux/sched.h> #include <linux/shmem_fs.h> #include <linux/file.h> #include <linux/module.h> #include <drm/drm_cache.h> +#include <drm/drm_device.h> #include <drm/ttm/ttm_bo_driver.h> #include "ttm_module.h" @@ -59,6 +61,7 @@ static atomic_long_t ttm_dma32_pages_allocated; int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) { struct ttm_device *bdev = bo->bdev; + struct drm_device *ddev = bo->base.dev; uint32_t page_flags = 0; dma_resv_assert_held(bo->base.resv); @@ -80,6 +83,15 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) pr_err("Illegal buffer object type\n"); return -EINVAL; } + /* + * When using dma_alloc_coherent with memory encryption the + * mapped TT pages need to be decrypted or otherwise the drivers + * will end up sending encrypted mem to the gpu. + */ + if (bdev->pool.use_dma_alloc && cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { + page_flags |= TTM_TT_FLAG_DECRYPTED; + drm_info(ddev, "TT memory decryption enabled."); + } bo->ttm = bdev->funcs->ttm_tt_create(bo, page_flags); if (unlikely(bo->ttm == NULL)) diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h index b7d3f38..9cbdf8c 100644 --- a/include/drm/ttm/ttm_tt.h +++ b/include/drm/ttm/ttm_tt.h @@ -79,6 +79,12 @@ struct ttm_tt { * page_flags = TTM_TT_FLAG_EXTERNAL | * TTM_TT_FLAG_EXTERNAL_MAPPABLE; * + * TTM_TT_FLAG_DECRYPTED: The mapped ttm pages should be marked as + * not encrypted. The framework will try to match what the dma layer + * is doing, but note that it is a little fragile because ttm page + * fault handling abuses the DMA api a bit and dma_map_attrs can't be + * used to assure pgprot always matches. + * * TTM_TT_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE. This is * set by TTM after ttm_tt_populate() has successfully returned, and is * then unset when TTM calls ttm_tt_unpopulate(). @@ -87,6 +93,7 @@ struct ttm_tt { #define TTM_TT_FLAG_ZERO_ALLOC (1 << 1) #define TTM_TT_FLAG_EXTERNAL (1 << 2) #define TTM_TT_FLAG_EXTERNAL_MAPPABLE (1 << 3) +#define TTM_TT_FLAG_DECRYPTED (1 << 4) #define TTM_TT_FLAG_PRIV_POPULATED (1U << 31) uint32_t page_flags; -- 2.39.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed 2024-12-09 9:49 ` [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed Ajay Kaher @ 2024-12-09 14:35 ` Sasha Levin 2024-12-12 12:40 ` Patch "drm/ttm: Make sure the mapped tt pages are decrypted when needed" has been added to the 6.1-stable tree gregkh 1 sibling, 0 replies; 7+ messages in thread From: Sasha Levin @ 2024-12-09 14:35 UTC (permalink / raw) To: stable; +Cc: Ajay Kaher, Sasha Levin [ Sasha's backport helper bot ] Hi, The upstream commit SHA1 provided is correct: 71ce046327cfd3aef3f93d1c44e091395eb03f8f WARNING: Author mismatch between patch and upstream commit: Backport author: Ajay Kaher <ajay.kaher@broadcom.com> Commit author: Zack Rusin <zack.rusin@broadcom.com> Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: de125efb3bae) 6.1.y | Not found Note: The patch differs from the upstream commit: --- 1: 71ce046327cfd ! 1: fcdf2063a135c drm/ttm: Make sure the mapped tt pages are decrypted when needed @@ Metadata ## Commit message ## drm/ttm: Make sure the mapped tt pages are decrypted when needed + commit 71ce046327cfd3aef3f93d1c44e091395eb03f8f upstream. + Some drivers require the mapped tt pages to be decrypted. In an ideal world this would have been handled by the dma layer, but the TTM page fault handling would have to be rewritten to able to do that. @@ Commit message Cc: linux-kernel@vger.kernel.org Cc: <stable@vger.kernel.org> # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20230926040359.3040017-1-zack@kde.org + Signed-off-by: Sasha Levin <sashal@kernel.org> + Signed-off-by: Ye Li <ye.li@broadcom.com> + Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com> ## drivers/gpu/drm/ttm/ttm_bo_util.c ## @@ drivers/gpu/drm/ttm/ttm_bo_util.c: pgprot_t ttm_io_prot(struct ttm_buffer_object *bo, struct ttm_resource *res, @@ drivers/gpu/drm/ttm/ttm_tt.c #include <linux/module.h> #include <drm/drm_cache.h> +#include <drm/drm_device.h> - #include <drm/drm_util.h> - #include <drm/ttm/ttm_bo.h> - #include <drm/ttm/ttm_tt.h> + #include <drm/ttm/ttm_bo_driver.h> + + #include "ttm_module.h" @@ drivers/gpu/drm/ttm/ttm_tt.c: static atomic_long_t ttm_dma32_pages_allocated; int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) { @@ include/drm/ttm/ttm_tt.h: struct ttm_tt { * set by TTM after ttm_tt_populate() has successfully returned, and is * then unset when TTM calls ttm_tt_unpopulate(). @@ include/drm/ttm/ttm_tt.h: struct ttm_tt { - #define TTM_TT_FLAG_ZERO_ALLOC BIT(1) - #define TTM_TT_FLAG_EXTERNAL BIT(2) - #define TTM_TT_FLAG_EXTERNAL_MAPPABLE BIT(3) -+#define TTM_TT_FLAG_DECRYPTED BIT(4) + #define TTM_TT_FLAG_ZERO_ALLOC (1 << 1) + #define TTM_TT_FLAG_EXTERNAL (1 << 2) + #define TTM_TT_FLAG_EXTERNAL_MAPPABLE (1 << 3) ++#define TTM_TT_FLAG_DECRYPTED (1 << 4) --#define TTM_TT_FLAG_PRIV_POPULATED BIT(4) -+#define TTM_TT_FLAG_PRIV_POPULATED BIT(5) + #define TTM_TT_FLAG_PRIV_POPULATED (1U << 31) uint32_t page_flags; - /** @num_pages: Number of pages in the page array. */ - uint32_t num_pages; --- Results of testing on various branches: | Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success | ^ permalink raw reply [flat|nested] 7+ messages in thread
* Patch "drm/ttm: Make sure the mapped tt pages are decrypted when needed" has been added to the 6.1-stable tree 2024-12-09 9:49 ` [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed Ajay Kaher 2024-12-09 14:35 ` Sasha Levin @ 2024-12-12 12:40 ` gregkh 1 sibling, 0 replies; 7+ messages in thread From: gregkh @ 2024-12-12 12:40 UTC (permalink / raw) To: airlied, ajay.kaher, alexey.makhalov, christian.koenig, daniel, dri-devel, gregkh, ray.huang, sashal, thomas.hellstrom, vasavi.sirnapalli, ye.li, zack.rusin Cc: stable-commits This is a note to let you know that I've just added the patch titled drm/ttm: Make sure the mapped tt pages are decrypted when needed to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-ttm-make-sure-the-mapped-tt-pages-are-decrypted-when-needed.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@vger.kernel.org> know about it. From stable+bounces-100113-greg=kroah.com@vger.kernel.org Mon Dec 9 10:49:51 2024 From: Ajay Kaher <ajay.kaher@broadcom.com> Date: Mon, 9 Dec 2024 09:49:03 +0000 Subject: drm/ttm: Make sure the mapped tt pages are decrypted when needed To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: zack.rusin@broadcom.com, thomas.hellstrom@linux.intel.com, christian.koenig@amd.com, ray.huang@amd.com, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ajay.kaher@broadcom.com, alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com, Sasha Levin <sashal@kernel.org>, Ye Li <ye.li@broadcom.com> Message-ID: <20241209094904.2547579-2-ajay.kaher@broadcom.com> From: Zack Rusin <zack.rusin@broadcom.com> commit 71ce046327cfd3aef3f93d1c44e091395eb03f8f upstream. Some drivers require the mapped tt pages to be decrypted. In an ideal world this would have been handled by the dma layer, but the TTM page fault handling would have to be rewritten to able to do that. A side-effect of the TTM page fault handling is using a dma allocation per order (via ttm_pool_alloc_page) which makes it impossible to just trivially use dma_mmap_attrs. As a result ttm has to be very careful about trying to make its pgprot for the mapped tt pages match what the dma layer thinks it is. At the ttm layer it's possible to deduce the requirement to have tt pages decrypted by checking whether coherent dma allocations have been requested and the system is running with confidential computing technologies. This approach isn't ideal but keeping TTM matching DMAs expectations for the page properties is in general fragile, unfortunately proper fix would require a rewrite of TTM's page fault handling. Fixes vmwgfx with SEV enabled. v2: Explicitly include cc_platform.h v3: Use CC_ATTR_GUEST_MEM_ENCRYPT instead of CC_ATTR_MEM_ENCRYPT to limit the scope to guests and log when memory decryption is enabled. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Fixes: 3bf3710e3718 ("drm/ttm: Add a generic TTM memcpy move for page-based iomem") Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Acked-by: Christian König <christian.koenig@amd.com> Cc: Huang Rui <ray.huang@amd.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: <stable@vger.kernel.org> # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20230926040359.3040017-1-zack@kde.org Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ye Li <ye.li@broadcom.com> Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++++++-- drivers/gpu/drm/ttm/ttm_tt.c | 12 ++++++++++++ include/drm/ttm/ttm_tt.h | 7 +++++++ 3 files changed, 30 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -274,7 +274,13 @@ pgprot_t ttm_io_prot(struct ttm_buffer_o enum ttm_caching caching; man = ttm_manager_type(bo->bdev, res->mem_type); - caching = man->use_tt ? bo->ttm->caching : res->bus.caching; + if (man->use_tt) { + caching = bo->ttm->caching; + if (bo->ttm->page_flags & TTM_TT_FLAG_DECRYPTED) + tmp = pgprot_decrypted(tmp); + } else { + caching = res->bus.caching; + } return ttm_prot_from_caching(caching, tmp); } @@ -317,6 +323,8 @@ static int ttm_bo_kmap_ttm(struct ttm_bu .no_wait_gpu = false }; struct ttm_tt *ttm = bo->ttm; + struct ttm_resource_manager *man = + ttm_manager_type(bo->bdev, bo->resource->mem_type); pgprot_t prot; int ret; @@ -326,7 +334,8 @@ static int ttm_bo_kmap_ttm(struct ttm_bu if (ret) return ret; - if (num_pages == 1 && ttm->caching == ttm_cached) { + if (num_pages == 1 && ttm->caching == ttm_cached && + !(man->use_tt && (ttm->page_flags & TTM_TT_FLAG_DECRYPTED))) { /* * We're mapping a single page, and the desired * page protection is consistent with the bo. --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -31,11 +31,13 @@ #define pr_fmt(fmt) "[TTM] " fmt +#include <linux/cc_platform.h> #include <linux/sched.h> #include <linux/shmem_fs.h> #include <linux/file.h> #include <linux/module.h> #include <drm/drm_cache.h> +#include <drm/drm_device.h> #include <drm/ttm/ttm_bo_driver.h> #include "ttm_module.h" @@ -59,6 +61,7 @@ static atomic_long_t ttm_dma32_pages_all int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) { struct ttm_device *bdev = bo->bdev; + struct drm_device *ddev = bo->base.dev; uint32_t page_flags = 0; dma_resv_assert_held(bo->base.resv); @@ -80,6 +83,15 @@ int ttm_tt_create(struct ttm_buffer_obje pr_err("Illegal buffer object type\n"); return -EINVAL; } + /* + * When using dma_alloc_coherent with memory encryption the + * mapped TT pages need to be decrypted or otherwise the drivers + * will end up sending encrypted mem to the gpu. + */ + if (bdev->pool.use_dma_alloc && cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { + page_flags |= TTM_TT_FLAG_DECRYPTED; + drm_info(ddev, "TT memory decryption enabled."); + } bo->ttm = bdev->funcs->ttm_tt_create(bo, page_flags); if (unlikely(bo->ttm == NULL)) --- a/include/drm/ttm/ttm_tt.h +++ b/include/drm/ttm/ttm_tt.h @@ -79,6 +79,12 @@ struct ttm_tt { * page_flags = TTM_TT_FLAG_EXTERNAL | * TTM_TT_FLAG_EXTERNAL_MAPPABLE; * + * TTM_TT_FLAG_DECRYPTED: The mapped ttm pages should be marked as + * not encrypted. The framework will try to match what the dma layer + * is doing, but note that it is a little fragile because ttm page + * fault handling abuses the DMA api a bit and dma_map_attrs can't be + * used to assure pgprot always matches. + * * TTM_TT_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE. This is * set by TTM after ttm_tt_populate() has successfully returned, and is * then unset when TTM calls ttm_tt_unpopulate(). @@ -87,6 +93,7 @@ struct ttm_tt { #define TTM_TT_FLAG_ZERO_ALLOC (1 << 1) #define TTM_TT_FLAG_EXTERNAL (1 << 2) #define TTM_TT_FLAG_EXTERNAL_MAPPABLE (1 << 3) +#define TTM_TT_FLAG_DECRYPTED (1 << 4) #define TTM_TT_FLAG_PRIV_POPULATED (1U << 31) uint32_t page_flags; Patches currently in stable-queue which might be from ajay.kaher@broadcom.com are queue-6.1/drm-ttm-print-the-memory-decryption-status-just-once.patch queue-6.1/drm-ttm-make-sure-the-mapped-tt-pages-are-decrypted-when-needed.patch queue-6.1/ptp-add-error-handling-for-adjfine-callback-in-ptp_c.patch ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once 2024-12-09 9:49 [PATCH v6.1.y 0/2] drm/ttm: fixes for vmwgfx when SEV enabled Ajay Kaher 2024-12-09 9:49 ` [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed Ajay Kaher @ 2024-12-09 9:49 ` Ajay Kaher 2024-12-09 14:35 ` Sasha Levin 2024-12-12 12:40 ` Patch "drm/ttm: Print the memory decryption status just once" has been added to the 6.1-stable tree gregkh 1 sibling, 2 replies; 7+ messages in thread From: Ajay Kaher @ 2024-12-09 9:49 UTC (permalink / raw) To: stable, gregkh Cc: zack.rusin, thomas.hellstrom, christian.koenig, ray.huang, airlied, daniel, dri-devel, linux-kernel, ajay.kaher, alexey.makhalov, vasavi.sirnapalli, Ye Li From: Zack Rusin <zack.rusin@broadcom.com> commit 27906e5d78248b19bcdfdae72049338c828897bb upstream. Stop printing the TT memory decryption status info each time tt is created and instead print it just once. Reduces the spam in the system logs when running guests with SEV enabled. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Fixes: 71ce046327cf ("drm/ttm: Make sure the mapped tt pages are decrypted when needed") Reviewed-by: Christian König <christian.koenig@amd.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: <stable@vger.kernel.org> # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20240408155605.1398631-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ye Li <ye.li@broadcom.com> Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com> --- drivers/gpu/drm/ttm/ttm_tt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 91e1797..d3190aa 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -90,7 +90,7 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) */ if (bdev->pool.use_dma_alloc && cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { page_flags |= TTM_TT_FLAG_DECRYPTED; - drm_info(ddev, "TT memory decryption enabled."); + drm_info_once(ddev, "TT memory decryption enabled."); } bo->ttm = bdev->funcs->ttm_tt_create(bo, page_flags); -- 2.39.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once 2024-12-09 9:49 ` [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once Ajay Kaher @ 2024-12-09 14:35 ` Sasha Levin 2024-12-12 12:40 ` Patch "drm/ttm: Print the memory decryption status just once" has been added to the 6.1-stable tree gregkh 1 sibling, 0 replies; 7+ messages in thread From: Sasha Levin @ 2024-12-09 14:35 UTC (permalink / raw) To: stable; +Cc: Ajay Kaher, Sasha Levin [ Sasha's backport helper bot ] Hi, The upstream commit SHA1 provided is correct: 27906e5d78248b19bcdfdae72049338c828897bb WARNING: Author mismatch between patch and upstream commit: Backport author: Ajay Kaher <ajay.kaher@broadcom.com> Commit author: Zack Rusin <zack.rusin@broadcom.com> Status in newer kernel trees: 6.12.y | Present (exact SHA1) 6.6.y | Present (different SHA1: 306e99777886) 6.1.y | Not found Note: The patch differs from the upstream commit: --- Failed to apply patch cleanly, falling back to interdiff... --- Results of testing on various branches: | Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.1.y | Success | Success | ^ permalink raw reply [flat|nested] 7+ messages in thread
* Patch "drm/ttm: Print the memory decryption status just once" has been added to the 6.1-stable tree 2024-12-09 9:49 ` [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once Ajay Kaher 2024-12-09 14:35 ` Sasha Levin @ 2024-12-12 12:40 ` gregkh 1 sibling, 0 replies; 7+ messages in thread From: gregkh @ 2024-12-12 12:40 UTC (permalink / raw) To: airlied, ajay.kaher, alexey.makhalov, christian.koenig, daniel, dri-devel, gregkh, ray.huang, thomas.hellstrom, vasavi.sirnapalli, ye.li, zack.rusin Cc: stable-commits This is a note to let you know that I've just added the patch titled drm/ttm: Print the memory decryption status just once to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-ttm-print-the-memory-decryption-status-just-once.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@vger.kernel.org> know about it. From stable+bounces-100114-greg=kroah.com@vger.kernel.org Mon Dec 9 10:50:05 2024 From: Ajay Kaher <ajay.kaher@broadcom.com> Date: Mon, 9 Dec 2024 09:49:04 +0000 Subject: drm/ttm: Print the memory decryption status just once To: stable@vger.kernel.org, gregkh@linuxfoundation.org Cc: zack.rusin@broadcom.com, thomas.hellstrom@linux.intel.com, christian.koenig@amd.com, ray.huang@amd.com, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ajay.kaher@broadcom.com, alexey.makhalov@broadcom.com, vasavi.sirnapalli@broadcom.com, Ye Li <ye.li@broadcom.com> Message-ID: <20241209094904.2547579-3-ajay.kaher@broadcom.com> From: Zack Rusin <zack.rusin@broadcom.com> commit 27906e5d78248b19bcdfdae72049338c828897bb upstream. Stop printing the TT memory decryption status info each time tt is created and instead print it just once. Reduces the spam in the system logs when running guests with SEV enabled. Signed-off-by: Zack Rusin <zack.rusin@broadcom.com> Fixes: 71ce046327cf ("drm/ttm: Make sure the mapped tt pages are decrypted when needed") Reviewed-by: Christian König <christian.koenig@amd.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org Cc: <stable@vger.kernel.org> # v5.14+ Link: https://patchwork.freedesktop.org/patch/msgid/20240408155605.1398631-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ye Li <ye.li@broadcom.com> Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- drivers/gpu/drm/ttm/ttm_tt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -90,7 +90,7 @@ int ttm_tt_create(struct ttm_buffer_obje */ if (bdev->pool.use_dma_alloc && cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) { page_flags |= TTM_TT_FLAG_DECRYPTED; - drm_info(ddev, "TT memory decryption enabled."); + drm_info_once(ddev, "TT memory decryption enabled."); } bo->ttm = bdev->funcs->ttm_tt_create(bo, page_flags); Patches currently in stable-queue which might be from ajay.kaher@broadcom.com are queue-6.1/drm-ttm-print-the-memory-decryption-status-just-once.patch queue-6.1/drm-ttm-make-sure-the-mapped-tt-pages-are-decrypted-when-needed.patch queue-6.1/ptp-add-error-handling-for-adjfine-callback-in-ptp_c.patch ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-12-12 12:41 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-12-09 9:49 [PATCH v6.1.y 0/2] drm/ttm: fixes for vmwgfx when SEV enabled Ajay Kaher 2024-12-09 9:49 ` [PATCH v6.1.y 1/2] drm/ttm: Make sure the mapped tt pages are decrypted when needed Ajay Kaher 2024-12-09 14:35 ` Sasha Levin 2024-12-12 12:40 ` Patch "drm/ttm: Make sure the mapped tt pages are decrypted when needed" has been added to the 6.1-stable tree gregkh 2024-12-09 9:49 ` [PATCH v6.1.y 2/2] drm/ttm: Print the memory decryption status just once Ajay Kaher 2024-12-09 14:35 ` Sasha Levin 2024-12-12 12:40 ` Patch "drm/ttm: Print the memory decryption status just once" has been added to the 6.1-stable tree gregkh
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.