From: Jiri Kosina <jikos@kernel.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Jessica Yu <jeyu@kernel.org>,
Joe Lawrence <joe.lawrence@redhat.com>,
Miroslav Benes <mbenes@suse.cz>,
linux-s390@vger.kernel.org, heiko.carstens@de.ibm.com,
Gerald Schaefer <gerald.schaefer@de.ibm.com>
Subject: Re: [PATCH v4 05/11] s390: Change s390_kernel_write() return type to match memcpy()
Date: Thu, 7 May 2020 15:36:48 +0200 (CEST) [thread overview]
Message-ID: <nycvar.YFH.7.76.2005071534170.25812@cbobk.fhfr.pm> (raw)
In-Reply-To: <be5119b30920d2da6fca3f6d2b1aca5712a2fd30.1588173720.git.jpoimboe@redhat.com>
On Wed, 29 Apr 2020, Josh Poimboeuf wrote:
> s390_kernel_write()'s function type is almost identical to memcpy().
> Change its return type to "void *" so they can be used interchangeably.
>
> Cc: linux-s390@vger.kernel.org
> Cc: heiko.carstens@de.ibm.com
> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> Acked-by: Miroslav Benes <mbenes@suse.cz>
Also for this one -- s390 folks, could you please provide your Ack for
taking things through livepatching.git as part of this series?
Thanks.
> ---
> arch/s390/include/asm/uaccess.h | 2 +-
> arch/s390/mm/maccess.c | 9 ++++++---
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
> index a470f1fa9f2a..324438889fe1 100644
> --- a/arch/s390/include/asm/uaccess.h
> +++ b/arch/s390/include/asm/uaccess.h
> @@ -276,6 +276,6 @@ static inline unsigned long __must_check clear_user(void __user *to, unsigned lo
> }
>
> int copy_to_user_real(void __user *dest, void *src, unsigned long count);
> -void s390_kernel_write(void *dst, const void *src, size_t size);
> +void *s390_kernel_write(void *dst, const void *src, size_t size);
>
> #endif /* __S390_UACCESS_H */
> diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c
> index de7ca4b6718f..22a0be655f27 100644
> --- a/arch/s390/mm/maccess.c
> +++ b/arch/s390/mm/maccess.c
> @@ -55,19 +55,22 @@ static notrace long s390_kernel_write_odd(void *dst, const void *src, size_t siz
> */
> static DEFINE_SPINLOCK(s390_kernel_write_lock);
>
> -void notrace s390_kernel_write(void *dst, const void *src, size_t size)
> +notrace void *s390_kernel_write(void *dst, const void *src, size_t size)
> {
> + void *tmp = dst;
> unsigned long flags;
> long copied;
>
> spin_lock_irqsave(&s390_kernel_write_lock, flags);
> while (size) {
> - copied = s390_kernel_write_odd(dst, src, size);
> - dst += copied;
> + copied = s390_kernel_write_odd(tmp, src, size);
> + tmp += copied;
> src += copied;
> size -= copied;
> }
> spin_unlock_irqrestore(&s390_kernel_write_lock, flags);
> +
> + return dst;
> }
>
> static int __no_sanitize_address __memcpy_real(void *dest, void *src, size_t count)
> --
> 2.21.1
>
--
Jiri Kosina
SUSE Labs
next prev parent reply other threads:[~2020-05-07 13:36 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 15:24 [PATCH v4 00/11] livepatch,module: Remove .klp.arch and module_disable_ro() Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 01/11] livepatch: Disallow vmlinux.ko Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 02/11] livepatch: Apply vmlinux-specific KLP relocations early Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 03/11] livepatch: Remove .klp.arch Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 04/11] livepatch: Prevent module-specific KLP rela sections from referencing vmlinux symbols Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 05/11] s390: Change s390_kernel_write() return type to match memcpy() Josh Poimboeuf
2020-05-07 13:36 ` Jiri Kosina [this message]
2020-05-07 16:01 ` Gerald Schaefer
2020-04-29 15:24 ` [PATCH v4 06/11] s390/module: Use s390_kernel_write() for late relocations Josh Poimboeuf
2020-05-07 10:00 ` Jiri Kosina
2020-05-07 12:27 ` Gerald Schaefer
2020-04-29 15:24 ` [PATCH v4 07/11] x86/module: Use text_poke() " Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 08/11] livepatch: Remove module_disable_ro() usage Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 09/11] module: Remove module_disable_ro() Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 10/11] x86/module: Use text_mutex in apply_relocate_add() Josh Poimboeuf
2020-04-29 15:24 ` [PATCH v4 11/11] module: Make module_enable_ro() static again Josh Poimboeuf
2020-04-30 11:10 ` Jessica Yu
2020-04-30 11:35 ` Miroslav Benes
2020-04-30 11:40 ` Jessica Yu
2020-04-30 12:23 ` Jessica Yu
2020-06-05 13:24 ` Guenter Roeck
2020-06-05 14:20 ` Jessica Yu
2020-06-05 14:39 ` Josh Poimboeuf
2020-04-30 11:33 ` [PATCH v4 00/11] livepatch,module: Remove .klp.arch and module_disable_ro() Jessica Yu
2020-05-04 22:20 ` Jiri Kosina
2020-05-07 22:17 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=nycvar.YFH.7.76.2005071534170.25812@cbobk.fhfr.pm \
--to=jikos@kernel.org \
--cc=gerald.schaefer@de.ibm.com \
--cc=heiko.carstens@de.ibm.com \
--cc=jeyu@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).