This is a note to let you know that I've just added the patch titled drm/imagination: Ensure PVR_MIPS_PT_PAGE_COUNT is never zero to the 6.8-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-imagination-ensure-pvr_mips_pt_page_count-is-never-zero.patch and it can be found in the queue-6.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e4236b14fe32a8d92686ec656c870a6bb1d6f50a Mon Sep 17 00:00:00 2001 From: Matt Coster <matt.coster@xxxxxxxxxx> Date: Tue, 5 Mar 2024 10:28:33 +0000 Subject: drm/imagination: Ensure PVR_MIPS_PT_PAGE_COUNT is never zero From: Matt Coster <matt.coster@xxxxxxxxxx> commit e4236b14fe32a8d92686ec656c870a6bb1d6f50a upstream. When the host page size was more than 4 times larger than the FW page size, this macro evaluated to zero resulting in zero-sized arrays. Use DIV_ROUND_UP() to ensure the correct behavior. Reported-by: 20240228012313.5934-1-yaolu@xxxxxxxxxx Closes: https://lore.kernel.org/dri-devel/20240228012313.5934-1-yaolu@xxxxxxxxxx Link: https://lore.kernel.org/dri-devel/20240228012313.5934-1-yaolu@xxxxxxxxxx Fixes: 927f3e0253c1 ("drm/imagination: Implement MIPS firmware processor and MMU support") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Matt Coster <matt.coster@xxxxxxxxxx> Reviewed-by: Frank Binns <frank.binns@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/gpu/drm/imagination/pvr_fw_mips.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/imagination/pvr_fw_mips.h +++ b/drivers/gpu/drm/imagination/pvr_fw_mips.h @@ -7,13 +7,14 @@ #include "pvr_rogue_mips.h" #include <asm/page.h> +#include <linux/math.h> #include <linux/types.h> /* Forward declaration from pvr_gem.h. */ struct pvr_gem_object; -#define PVR_MIPS_PT_PAGE_COUNT ((ROGUE_MIPSFW_MAX_NUM_PAGETABLE_PAGES * ROGUE_MIPSFW_PAGE_SIZE_4K) \ - >> PAGE_SHIFT) +#define PVR_MIPS_PT_PAGE_COUNT DIV_ROUND_UP(ROGUE_MIPSFW_MAX_NUM_PAGETABLE_PAGES * ROGUE_MIPSFW_PAGE_SIZE_4K, PAGE_SIZE) + /** * struct pvr_fw_mips_data - MIPS-specific data */ Patches currently in stable-queue which might be from matt.coster@xxxxxxxxxx are queue-6.8/drm-imagination-ensure-pvr_mips_pt_page_count-is-never-zero.patch