Patch "sh: pgtable-3level: Fix cast to pointer from integer of different size" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sh: pgtable-3level: Fix cast to pointer from integer of different size

to the 5.10-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:
     sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 8518e694203d0bfd202ea4a80356785b6992322e Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Date: Wed, 15 Sep 2021 15:50:04 +0200
Subject: sh: pgtable-3level: Fix cast to pointer from integer of different size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

commit 8518e694203d0bfd202ea4a80356785b6992322e upstream.

If X2TLB=y (CPU_SHX2=y or CPU_SHX3=y, e.g. migor_defconfig), pgd_t.pgd
is "unsigned long long", causing:

    In file included from arch/sh/include/asm/pgtable.h:13,
		     from include/linux/pgtable.h:6,
		     from include/linux/mm.h:33,
		     from arch/sh/kernel/asm-offsets.c:14:
    arch/sh/include/asm/pgtable-3level.h: In function ‘pud_pgtable’:
    arch/sh/include/asm/pgtable-3level.h:37:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       37 |  return (pmd_t *)pud_val(pud);
	  |         ^

Fix this by adding an intermediate cast to "unsigned long", which is
basically what the old code did before.

Fixes: 9cf6fa2458443118 ("mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *")
Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Tested-by: Daniel Palmer <daniel@xxxxxxxxx>
Acked-by: Rob Landley <rob@xxxxxxxxxxx>
Tested-by: John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Rich Felker <dalias@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/sh/include/asm/pgtable-3level.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/sh/include/asm/pgtable-3level.h
+++ b/arch/sh/include/asm/pgtable-3level.h
@@ -34,7 +34,7 @@ typedef struct { unsigned long long pmd;
 
 static inline pmd_t *pud_pgtable(pud_t pud)
 {
-	return (pmd_t *)pud_val(pud);
+	return (pmd_t *)(unsigned long)pud_val(pud);
 }
 
 /* only used by the stubbed out hugetlb gup code, should never be called */


Patches currently in stable-queue which might be from geert+renesas@xxxxxxxxx are

queue-5.10/sh-dma-fix-dma-channel-offset-calculation.patch
queue-5.10/regulator-core-fix-more-error-checking-for-debugfs_c.patch
queue-5.10/sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch
queue-5.10/regulator-core-streamline-debugfs-operations.patch
queue-5.10/arm-dts-iwg20d-q7-common-fix-backlight-pwm-specifier.patch
queue-5.10/sh-j2-use-ioremap-to-translate-device-tree-address-i.patch
queue-5.10/arm64-dts-renesas-ulcb-kf-remove-flow-control-for-sc.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux