All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: define LOADED_MM_SWITCHING with pointer-sized number
@ 2019-03-28 23:09 Jann Horn
  2019-03-29  7:32 ` Mukesh Ojha
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jann Horn @ 2019-03-28 23:09 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	jannh
  Cc: x86, linux-kernel, Andy Lutomirski

sparse complains that LOADED_MM_SWITCHING's definition casts an int to a
pointer:

arch/x86/mm/tlb.c:409:17: warning: non size-preserving integer to pointer
cast

Use a pointer-sized integer constant instead.

Signed-off-by: Jann Horn <jannh@google.com>
---
 arch/x86/include/asm/tlbflush.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
index f4204bf377fc..90926e8dd1f8 100644
--- a/arch/x86/include/asm/tlbflush.h
+++ b/arch/x86/include/asm/tlbflush.h
@@ -167,7 +167,7 @@ struct tlb_state {
 	 */
 	struct mm_struct *loaded_mm;
 
-#define LOADED_MM_SWITCHING ((struct mm_struct *)1)
+#define LOADED_MM_SWITCHING ((struct mm_struct *)1UL)
 
 	/* Last user mm for optimizing IBPB */
 	union {
-- 
2.21.0.392.gf8f6787159e-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-29 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 23:09 [PATCH] x86: define LOADED_MM_SWITCHING with pointer-sized number Jann Horn
2019-03-29  7:32 ` Mukesh Ojha
2019-03-29 13:57 ` Borislav Petkov
2019-03-29 14:47   ` Jann Horn
2019-03-29 14:04 ` [tip:x86/cleanups] x86/mm/tlb: Define " tip-bot for Jann Horn

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.