Patch "x86/percpu: Use __force to cast from __percpu address space" has been added to the 6.9-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

    x86/percpu: Use __force to cast from __percpu address space

to the 6.9-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:
     x86-percpu-use-__force-to-cast-from-__percpu-address.patch
and it can be found in the queue-6.9 subdirectory.

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



commit 630d104c20f3075b584bc06fbe66b71c0b94877e
Author: Uros Bizjak <ubizjak@xxxxxxxxx>
Date:   Tue Apr 2 19:50:38 2024 +0200

    x86/percpu: Use __force to cast from __percpu address space
    
    [ Upstream commit a55c1fdad5f61b4bfe42319694b23671a758cb28 ]
    
    Fix Sparse warning when casting from __percpu address space by using
    __force in the cast. x86 named address spaces are not considered to
    be subspaces of the generic (flat) address space, so explicit casts
    are required to convert pointers between these address spaces and the
    generic address space (the application should cast to uintptr_t and
    apply the segment base offset). The cast to uintptr_t removes
    __percpu address space tag and Sparse reports:
    
      warning: cast removes address space '__percpu' of expression
    
    Use __force to inform Sparse that the cast is intentional.
    
    Fixes: 9a462b9eafa6 ("x86/percpu: Use compiler segment prefix qualifier")
    Reported-by: Charlemagne Lasse <charlemagnelasse@xxxxxxxxx>
    Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>
    Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
    Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240402175058.52649-1-ubizjak@xxxxxxxxx
    
    Closes: https://lore.kernel.org/lkml/CAFGhKbzev7W4aHwhFPWwMZQEHenVgZUj7=aunFieVqZg3mt14A@xxxxxxxxxxxxxx/
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index dbfde44d88a31..ce5111cec36e2 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -77,7 +77,7 @@
 #define arch_raw_cpu_ptr(_ptr)					\
 ({								\
 	unsigned long tcp_ptr__ = __raw_my_cpu_offset;		\
-	tcp_ptr__ += (unsigned long)(_ptr);			\
+	tcp_ptr__ += (__force unsigned long)(_ptr);		\
 	(typeof(*(_ptr)) __kernel __force *)tcp_ptr__;		\
 })
 #else




[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