2023-03-15 23:21:10

by Ira Weiny

[permalink] [raw]
Subject: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
callbacks") removed the calls to memcpy_page_flushcache().

kmap_atomic() is deprecated and used in the x86 version of
memcpy_page_flushcache().

Remove the unnecessary memcpy_page_flushcache() call from all arch's.

Signed-off-by: Ira Weiny <[email protected]>
---
Ira Weiny (3):
x86, uaccess: Remove memcpy_page_flushcache()
powerpc: Remove memcpy_page_flushcache()
arm: uaccess: Remove memcpy_page_flushcache()

arch/arm64/include/asm/uaccess.h | 2 --
arch/arm64/lib/uaccess_flushcache.c | 6 ------
arch/powerpc/include/asm/uaccess.h | 2 --
arch/powerpc/lib/pmem.c | 7 -------
arch/x86/include/asm/uaccess_64.h | 2 --
arch/x86/lib/usercopy_64.c | 9 ---------
6 files changed, 28 deletions(-)
---
base-commit: 6015b1aca1a233379625385feb01dd014aca60b5
change-id: 20221230-kmap-x86-bfda7e1f07ee

Best regards,
--
Ira Weiny <[email protected]>



2023-03-15 23:21:13

by Ira Weiny

[permalink] [raw]
Subject: [PATCH 1/3] x86, uaccess: Remove memcpy_page_flushcache()

Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
callbacks") removed the calls to memcpy_page_flushcache().

kmap_atomic() is deprecated and used in memcpy_page_flushcache().

Remove the unnecessary memcpy_page_flushcache() call.

Cc: Al Viro <[email protected]>
Cc: "Dan Williams" <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
---
arch/x86/include/asm/uaccess_64.h | 2 --
arch/x86/lib/usercopy_64.c | 9 ---------
2 files changed, 11 deletions(-)

diff --git a/arch/x86/include/asm/uaccess_64.h b/arch/x86/include/asm/uaccess_64.h
index d13d71af5cf6..c6b1dcded364 100644
--- a/arch/x86/include/asm/uaccess_64.h
+++ b/arch/x86/include/asm/uaccess_64.h
@@ -62,8 +62,6 @@ extern long __copy_user_nocache(void *dst, const void __user *src,
unsigned size, int zerorest);

extern long __copy_user_flushcache(void *dst, const void __user *src, unsigned size);
-extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
- size_t len);

static inline int
__copy_from_user_inatomic_nocache(void *dst, const void __user *src,
diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
index 6c1f8ac5e721..f515542f017f 100644
--- a/arch/x86/lib/usercopy_64.c
+++ b/arch/x86/lib/usercopy_64.c
@@ -136,13 +136,4 @@ void __memcpy_flushcache(void *_dst, const void *_src, size_t size)
}
}
EXPORT_SYMBOL_GPL(__memcpy_flushcache);
-
-void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
- size_t len)
-{
- char *from = kmap_atomic(page);
-
- memcpy_flushcache(to, from + offset, len);
- kunmap_atomic(from);
-}
#endif

--
2.39.2


2023-03-15 23:21:16

by Ira Weiny

[permalink] [raw]
Subject: [PATCH 2/3] powerpc: Remove memcpy_page_flushcache()

Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
callbacks") removed the calls to memcpy_page_flushcache().

Remove the unnecessary memcpy_page_flushcache() call.

Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: Al Viro <[email protected]>
Cc: "Dan Williams" <[email protected]>
Cc: [email protected]
Signed-off-by: Ira Weiny <[email protected]>
---
arch/powerpc/include/asm/uaccess.h | 2 --
arch/powerpc/lib/pmem.c | 7 -------
2 files changed, 9 deletions(-)

diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
index 3ddc65c63a49..52378e641d38 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -361,8 +361,6 @@ copy_mc_to_user(void __user *to, const void *from, unsigned long n)

extern long __copy_from_user_flushcache(void *dst, const void __user *src,
unsigned size);
-extern void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
- size_t len);

static __must_check inline bool user_access_begin(const void __user *ptr, size_t len)
{
diff --git a/arch/powerpc/lib/pmem.c b/arch/powerpc/lib/pmem.c
index eb2919ddf9b9..4e724c4c01ad 100644
--- a/arch/powerpc/lib/pmem.c
+++ b/arch/powerpc/lib/pmem.c
@@ -85,10 +85,3 @@ void memcpy_flushcache(void *dest, const void *src, size_t size)
clean_pmem_range(start, start + size);
}
EXPORT_SYMBOL(memcpy_flushcache);
-
-void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
- size_t len)
-{
- memcpy_flushcache(to, page_to_virt(page) + offset, len);
-}
-EXPORT_SYMBOL(memcpy_page_flushcache);

--
2.39.2


2023-03-15 23:21:18

by Ira Weiny

[permalink] [raw]
Subject: [PATCH 3/3] arm: uaccess: Remove memcpy_page_flushcache()

Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
callbacks") removed the calls to memcpy_page_flushcache().

Remove the unnecessary memcpy_page_flushcache() call.

Cc: Al Viro <[email protected]>
Cc: "Dan Williams" <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Signed-off-by: Ira Weiny <[email protected]>
---
arch/arm64/include/asm/uaccess.h | 2 --
arch/arm64/lib/uaccess_flushcache.c | 6 ------
2 files changed, 8 deletions(-)

diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h
index 5c7b2f9d5913..4bf2c0975a82 100644
--- a/arch/arm64/include/asm/uaccess.h
+++ b/arch/arm64/include/asm/uaccess.h
@@ -449,8 +449,6 @@ extern long strncpy_from_user(char *dest, const char __user *src, long count);
extern __must_check long strnlen_user(const char __user *str, long n);

#ifdef CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE
-struct page;
-void memcpy_page_flushcache(char *to, struct page *page, size_t offset, size_t len);
extern unsigned long __must_check __copy_user_flushcache(void *to, const void __user *from, unsigned long n);

static inline int __copy_from_user_flushcache(void *dst, const void __user *src, unsigned size)
diff --git a/arch/arm64/lib/uaccess_flushcache.c b/arch/arm64/lib/uaccess_flushcache.c
index baee22961bdb..7510d1a23124 100644
--- a/arch/arm64/lib/uaccess_flushcache.c
+++ b/arch/arm64/lib/uaccess_flushcache.c
@@ -19,12 +19,6 @@ void memcpy_flushcache(void *dst, const void *src, size_t cnt)
}
EXPORT_SYMBOL_GPL(memcpy_flushcache);

-void memcpy_page_flushcache(char *to, struct page *page, size_t offset,
- size_t len)
-{
- memcpy_flushcache(to, page_address(page) + offset, len);
-}
-
unsigned long __copy_user_flushcache(void *to, const void __user *from,
unsigned long n)
{

--
2.39.2


2023-03-15 23:37:28

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

On 3/15/23 16:20, Ira Weiny wrote:
> Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
> callbacks") removed the calls to memcpy_page_flushcache().
>
> kmap_atomic() is deprecated and used in the x86 version of
> memcpy_page_flushcache().
>
> Remove the unnecessary memcpy_page_flushcache() call from all arch's.

Hi Ira,

Since the common code user is already gone these three patches seem
quite independent. It seems like the right thing to do is have
individual arch maintainers cherry pick their arch patch and carry it
independently.

Is there a compelling reason to have someone pick up and carry these all
together that I'm missing?

2023-03-16 01:13:01

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

Dave Hansen wrote:
> On 3/15/23 16:20, Ira Weiny wrote:
> > Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
> > callbacks") removed the calls to memcpy_page_flushcache().
> >
> > kmap_atomic() is deprecated and used in the x86 version of
> > memcpy_page_flushcache().
> >
> > Remove the unnecessary memcpy_page_flushcache() call from all arch's.
>
> Hi Ira,
>
> Since the common code user is already gone these three patches seem
> quite independent. It seems like the right thing to do is have
> individual arch maintainers cherry pick their arch patch and carry it
> independently.

Yes.

>
> Is there a compelling reason to have someone pick up and carry these all
> together that I'm missing?

No reason. Would you like me to submit them individually?

Sorry, submitting them separately crossed my mind when I wrote them but I
kind of forgot as they were all on the same branch and I was waiting for
after the merge window to submit them.

Ira

2023-03-16 07:07:48

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

Ira Weiny <[email protected]> writes:
> Dave Hansen wrote:
>> On 3/15/23 16:20, Ira Weiny wrote:
>> > Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
>> > callbacks") removed the calls to memcpy_page_flushcache().
>> >
>> > kmap_atomic() is deprecated and used in the x86 version of
>> > memcpy_page_flushcache().
>> >
>> > Remove the unnecessary memcpy_page_flushcache() call from all arch's.
>>
>> Hi Ira,
>>
>> Since the common code user is already gone these three patches seem
>> quite independent. It seems like the right thing to do is have
>> individual arch maintainers cherry pick their arch patch and carry it
>> independently.
>
> Yes.
>
>>
>> Is there a compelling reason to have someone pick up and carry these all
>> together that I'm missing?
>
> No reason. Would you like me to submit them individually?

I'll just grab the powerpc one from the thread, no need to resend.

> Sorry, submitting them separately crossed my mind when I wrote them but I
> kind of forgot as they were all on the same branch and I was waiting for
> after the merge window to submit them.

It's also much easier to run git-send-email HEAD^^^, rather than running
it three separate times, let alone if it's a 20 patch series.

I wonder if we could come up with some convention to indicate that a
series is made up of independent patches, and maintainers are free to
pick them individually - but still sent as a single series.

cheers

2023-03-16 16:18:20

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

+ Konstantin

Michael Ellerman wrote:
> Ira Weiny <[email protected]> writes:
> > Dave Hansen wrote:
> >> On 3/15/23 16:20, Ira Weiny wrote:
> >> > Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
> >> > callbacks") removed the calls to memcpy_page_flushcache().
> >> >
> >> > kmap_atomic() is deprecated and used in the x86 version of
> >> > memcpy_page_flushcache().
> >> >
> >> > Remove the unnecessary memcpy_page_flushcache() call from all arch's.
> >>
> >> Hi Ira,
> >>
> >> Since the common code user is already gone these three patches seem
> >> quite independent. It seems like the right thing to do is have
> >> individual arch maintainers cherry pick their arch patch and carry it
> >> independently.
> >
> > Yes.
> >
> >>
> >> Is there a compelling reason to have someone pick up and carry these all
> >> together that I'm missing?
> >
> > No reason. Would you like me to submit them individually?
>
> I'll just grab the powerpc one from the thread, no need to resend.

Thanks.

>
> > Sorry, submitting them separately crossed my mind when I wrote them but I
> > kind of forgot as they were all on the same branch and I was waiting for
> > after the merge window to submit them.
>
> It's also much easier to run git-send-email HEAD^^^, rather than running
> it three separate times, let alone if it's a 20 patch series.

Exactly. And I'm using b4 which would have forced me to create a separate
branch for each of the patches to track. So I was keeping them around in
a single branch to let 0day run after the merge window. Then I forgot
about the idea of splitting them because b4 had it all packaged up nice!

>
> I wonder if we could come up with some convention to indicate that a
> series is made up of independent patches, and maintainers are free to
> pick them individually - but still sent as a single series.

Maybe. But perhaps b4 could have a send option which would split them
out? I'll see about adding an option to b4 but I've Cc'ed Konstantin as
well for the idea.

Thanks for picking this up!
Ira

>
> cheers

2023-03-17 00:07:03

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

Ira Weiny <[email protected]> writes:
> + Konstantin
>
> Michael Ellerman wrote:
>> Ira Weiny <[email protected]> writes:
>> > Dave Hansen wrote:
>> >> On 3/15/23 16:20, Ira Weiny wrote:
>> >> > Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
>> >> > callbacks") removed the calls to memcpy_page_flushcache().
>> >> >
>> >> > kmap_atomic() is deprecated and used in the x86 version of
>> >> > memcpy_page_flushcache().
>> >> >
>> >> > Remove the unnecessary memcpy_page_flushcache() call from all arch's.
>> >>
>> >> Hi Ira,
>> >>
>> >> Since the common code user is already gone these three patches seem
>> >> quite independent. It seems like the right thing to do is have
>> >> individual arch maintainers cherry pick their arch patch and carry it
>> >> independently.
>> >
>> > Yes.
>> >
>> >>
>> >> Is there a compelling reason to have someone pick up and carry these all
>> >> together that I'm missing?
>> >
>> > No reason. Would you like me to submit them individually?
>>
>> I'll just grab the powerpc one from the thread, no need to resend.
>
> Thanks.
>
>>
>> > Sorry, submitting them separately crossed my mind when I wrote them but I
>> > kind of forgot as they were all on the same branch and I was waiting for
>> > after the merge window to submit them.
>>
>> It's also much easier to run git-send-email HEAD^^^, rather than running
>> it three separate times, let alone if it's a 20 patch series.
>
> Exactly. And I'm using b4 which would have forced me to create a separate
> branch for each of the patches to track. So I was keeping them around in
> a single branch to let 0day run after the merge window. Then I forgot
> about the idea of splitting them because b4 had it all packaged up nice!
>
>>
>> I wonder if we could come up with some convention to indicate that a
>> series is made up of independent patches, and maintainers are free to
>> pick them individually - but still sent as a single series.
>
> Maybe. But perhaps b4 could have a send option which would split them
> out? I'll see about adding an option to b4 but I've Cc'ed Konstantin as
> well for the idea.

Yes you're right that's probably a better idea. b4 to the rescue!

cheers

2023-03-17 14:48:13

by Konstantin Ryabitsev

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

On Thu, Mar 16, 2023 at 09:16:34AM -0700, Ira Weiny wrote:
> > It's also much easier to run git-send-email HEAD^^^, rather than running
> > it three separate times, let alone if it's a 20 patch series.
>
> Exactly. And I'm using b4 which would have forced me to create a separate
> branch for each of the patches to track. So I was keeping them around in
> a single branch to let 0day run after the merge window. Then I forgot
> about the idea of splitting them because b4 had it all packaged up nice!
>
> >
> > I wonder if we could come up with some convention to indicate that a
> > series is made up of independent patches, and maintainers are free to
> > pick them individually - but still sent as a single series.
>
> Maybe. But perhaps b4 could have a send option which would split them
> out? I'll see about adding an option to b4 but I've Cc'ed Konstantin as
> well for the idea.

Yes, I plan to introduce the concept of "bundles" in addition to "series". The
distinction is that when you send a bundle, each patch is sent as individual
submission and we generate the change-id for each patch. It's a bit more work
to send a v2 of some patch (you have to do a "prep -n --from-thread <msgid>"),
but it's not insurmountable and should help with queuing up individual patches
for sending post merge-window, like in your case.

-K

2023-03-27 16:34:58

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

On Wed, 15 Mar 2023 16:20:53 -0700, Ira Weiny wrote:
> Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
> callbacks") removed the calls to memcpy_page_flushcache().
>
> kmap_atomic() is deprecated and used in the x86 version of
> memcpy_page_flushcache().
>
> Remove the unnecessary memcpy_page_flushcache() call from all arch's.
>
> [...]

Applied arm64 patch to arm64 (for-next/mm), thanks!

[3/3] arm: uaccess: Remove memcpy_page_flushcache()
https://git.kernel.org/arm64/c/7cae569e6209

Cheers,
--
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

2023-04-06 01:12:02

by Michael Ellerman

[permalink] [raw]
Subject: Re: (subset) [PATCH 0/3] COVER: Remove memcpy_page_flushcache()

On Wed, 15 Mar 2023 16:20:53 -0700, Ira Weiny wrote:
> Commit 21b56c847753 ("iov_iter: get rid of separate bvec and xarray
> callbacks") removed the calls to memcpy_page_flushcache().
>
> kmap_atomic() is deprecated and used in the x86 version of
> memcpy_page_flushcache().
>
> Remove the unnecessary memcpy_page_flushcache() call from all arch's.
>
> [...]

Patch 2 applied to powerpc/next.

[2/3] powerpc: Remove memcpy_page_flushcache()
https://git.kernel.org/powerpc/c/0398abca61482ae47a41ae8f2401338aea366327

cheers