All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/highmem: Align-down to page the address for kunmap_flush_on_unmap()
@ 2023-01-26 14:33 Fabio M. De Francesco
  2023-01-26 19:50 ` Ira Weiny
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Fabio M. De Francesco @ 2023-01-26 14:33 UTC (permalink / raw)
  To: Andrew Morton, Fabio M. De Francesco, Ira Weiny,
	Sebastian Andrzej Siewior, Alexander Potapenko, Andrey Konovalov,
	Tony Luck, Bagas Sanjaya, David Sterba, Kees Cook,
	Matthew Wilcox (Oracle), linux-kernel, linux-mm
  Cc: Thomas Gleixner, Al Viro, Helge Deller

If ARCH_HAS_FLUSH_ON_KUNMAP is defined (PA-RISC case), __kunmap_local()
calls kunmap_flush_on_unmap(). The latter currently flushes the wrong
address (as confirmed by Matthew Wilcox and Helge Deller). Al Viro
proposed to call kunmap_flush_on_unmap() on an aligned-down to page
address in order to fix this issue. Consensus has been reached on this
solution.

Therefore, if ARCH_HAS_FLUSH_ON_KUNMAP is defined, call
kunmap_flush_on_unmap() on an aligned-down to page address computed with
the PTR_ALIGN_DOWN() macro.

Cc: Ira Weiny <ira.weiny@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Confirmed-by: Helge Deller <deller@gmx.de>
Confirmed-by: Matthew Wilcox <willy@infradead.org>
Fixes: f3ba3c710ac5 ("mm/highmem: Provide kmap_local*")
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

I have (at least) two problems with this patch...

1) checkpatch.pl complains about the use of the non-standard
"Confirmed-by" tags. I don't know how else I can give credit to Helge
and Matthew. However, this is not the first time that I see non-standard
tags in patches applied upstream (I too had a non-standard
"Analysed-by" tag in patch which fixes a SAC bug). Any objections?

2) I'm not sure whether or not the "Fixes" tag is appropriate in this
patch. Can someone either confirm or deny it?

 include/linux/highmem-internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h
index 034b1106d022..e247c9ac4583 100644
--- a/include/linux/highmem-internal.h
+++ b/include/linux/highmem-internal.h
@@ -200,7 +200,7 @@ static inline void *kmap_local_pfn(unsigned long pfn)
 static inline void __kunmap_local(const void *addr)
 {
 #ifdef ARCH_HAS_FLUSH_ON_KUNMAP
-	kunmap_flush_on_unmap(addr);
+	kunmap_flush_on_unmap(PTR_ALIGN_DOWN(addr, PAGE_SIZE));
 #endif
 }
 
-- 
2.39.0



^ permalink raw reply related	[flat|nested] 18+ messages in thread
* [PATCH] mm/highmem: Align-down to page the address for kunmap_flush_on_unmap()
@ 2023-01-26 14:11 Fabio M. De Francesco
  2023-01-26 14:26 ` Fabio M. De Francesco
  0 siblings, 1 reply; 18+ messages in thread
From: Fabio M. De Francesco @ 2023-01-26 14:11 UTC (permalink / raw)
  To: Andrew Morton, Fabio M. De Francesco, Ira Weiny,
	Sebastian Andrzej Siewior, Alexander Potapenko, Andrey Konovalov,
	Tony Luck, Bagas Sanjaya, David Sterba, Kees Cook,
	Matthew Wilcox (Oracle), linux-kernel, linux-mm
  Cc: Al Viro, Helge Deller

If ARCH_HAS_FLUSH_ON_KUNMAP is defined (PA-RISC case), __kunmap_local()
calls kunmap_flush_on_unmap(). The latter currently flushes the wrong
address (as confirmed by Matthew Wilcox and Helge Deller). Al Viro
proposed to call kunmap_flush_on_unmap() on an aligned-down to page
address in order to fix this issue. Consensus has been reached on this
solution.

Therefore, if ARCH_HAS_FLUSH_ON_KUNMAP is defined, call
kunmap_flush_on_unmap() on an aligned-down to page address computed with
the PTR_ALIGN_DOWN() macro.

Cc: Ira Weiny <ira.weiny@intel.com>
Suggested-by: Al Viro <viro@zeniv.linux.org.uk>
Confirmed-by: Helge Deller <deller@gmx.de>
Confirmed-by: Matthew Wilcox <willy@infradead.org>
Fixes: f3ba3c710ac5 ("mm/highmem: Provide kmap_local*")
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

I have (at least) two problems with this patch...

1) checkpatch.pl complains about the use of the non-standard
"Confirmed-by" tags. I don't know how else I can give credit to Helge
and Matthew. However, this is not the first time that I see non-standard
tags in patches applied upstream (I too had a non-standard
"Analysed-by" tag in patch which fixes a SAC bug). Any objections?

2) I'm not sure whether or not the "Fixes" tag is appropriate in this
patch. Can someone either confirm or deny it?

 include/linux/highmem-internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/highmem-internal.h b/include/linux/highmem-internal.h
index 034b1106d022..e247c9ac4583 100644
--- a/include/linux/highmem-internal.h
+++ b/include/linux/highmem-internal.h
@@ -200,7 +200,7 @@ static inline void *kmap_local_pfn(unsigned long pfn)
 static inline void __kunmap_local(const void *addr)
 {
 #ifdef ARCH_HAS_FLUSH_ON_KUNMAP
-	kunmap_flush_on_unmap(addr);
+	kunmap_flush_on_unmap(PTR_ALIGN_DOWN(addr, PAGE_SIZE));
 #endif
 }
 
-- 
2.39.0



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

end of thread, other threads:[~2023-01-27 23:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-26 14:33 [PATCH] mm/highmem: Align-down to page the address for kunmap_flush_on_unmap() Fabio M. De Francesco
2023-01-26 19:50 ` Ira Weiny
2023-01-26 20:37   ` Helge Deller
2023-01-26 20:49     ` Matthew Wilcox
2023-01-27 23:07       ` Ira Weiny
2023-01-26 20:53   ` Al Viro
2023-01-27 22:48     ` Ira Weiny
2023-01-26 20:07 ` Matthew Wilcox
2023-01-27 17:58   ` Fabio M. De Francesco
2023-01-27 18:03     ` Matthew Wilcox
2023-01-26 20:38 ` Andrew Morton
2023-01-26 20:48   ` Matthew Wilcox
2023-01-26 21:04     ` Al Viro
2023-01-26 21:56       ` Matthew Wilcox
2023-01-26 22:17         ` Al Viro
2023-01-27 23:13           ` Ira Weiny
  -- strict thread matches above, loose matches on Subject: below --
2023-01-26 14:11 Fabio M. De Francesco
2023-01-26 14:26 ` Fabio M. De Francesco

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.