Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp741641ybj; Thu, 7 May 2020 06:40:35 -0700 (PDT) X-Google-Smtp-Source: APiQypLve3Ny2p1Fl34wLomI3xH8plDoNo9oY5bzorRNPNve8QdaZBa39Y6sACiSZzWoFosE93It X-Received: by 2002:a17:906:f0d9:: with SMTP id dk25mr11744152ejb.266.1588858835596; Thu, 07 May 2020 06:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588858835; cv=none; d=google.com; s=arc-20160816; b=iCbcEYR1+kHZevX8tLuh1sdI8p/7fL2ZQzaUSUEuytB+lz2C1uk63ETrHmI8p+E+Gv nfjJm3AABY43Xhg7DT/8c6CCQ0QhxzV9fAN3kJP03yzr7fFsNjVTbpqAzBF69V9XQ51W e2jvBIUx/jW7xurAZWdMuBMNodRASW1bqknpPdlCrV0f86Rn1vUpEFGKESqfMrFt5vgu 0yCtn0mTyAgVIu9IZJUUDObVGg8GAjMjQ1MTJSERY2Bzi52OFDj7oG6Q+HD7iOOSpiLU k+078GZxHAkEpyp6JI9q0iOqvczcwfh9A//BmJqNYGCTja1VEFzxVY8DWkJsOC7VXmNp pc3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=2FHQSfGTaZQuo/z4X+QkXdDhK9QL4+4a9PLITXPSHqI=; b=vUAxOF1nRsItswblO2JOPXqgxU/ks0REjwEm23bUGKgygtcEjcqa48nyeUUtc8XM2x iDbBLqnzLEUsUHgblj2p54+CbuEh11s0ZLl6vScQTTcuCsCmB4SsXU0I6gGlyyBXO+J4 gyaLnHcJCsh+KDkZU+wM9fyy2CCK4p94cbV3x55oXkqwuSp7TDmBwYdUVSQpXe89OLxc yLc9YOyebKJAdo8btMDQp8TIX6EOJUTBB9MXO8hlsV80+wfbXzMBdbH3yYKtaGjPdUYh kAxSqQ6o9ytS35YF1GYn7btgOqbYsH/YwpIZFGoGMV/akwqqUKQNAcos/Ie273f4JuY+ HZNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eStuCrUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si3008847edo.354.2020.05.07.06.40.08; Thu, 07 May 2020 06:40:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eStuCrUm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726491AbgEGNgw (ORCPT + 99 others); Thu, 7 May 2020 09:36:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:49012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725879AbgEGNgw (ORCPT ); Thu, 7 May 2020 09:36:52 -0400 Received: from pobox.suse.cz (nat1.prg.suse.com [195.250.132.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F100B20643; Thu, 7 May 2020 13:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588858611; bh=LzQDOyhUPzaN/QEmH/5Zc/cFyUE1+mfVuXz0rvZ8LqA=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=eStuCrUmYvOzkkb/b4gwo9EssNgSWMvVXNQfMmAmE3/4XYZlvs7S40Q9uCK3FyII/ ZUug+OReaOaXNuqa34GONmSGK97EHYDBrdlFU/G7dNy+eRUj4oFGLGIdAGWICWyr8+ a4mkZ7utRJPgqiGk8/ZqsQ1Uz8FrYTdz2jtWB8y8= Date: Thu, 7 May 2020 15:36:48 +0200 (CEST) From: Jiri Kosina To: Josh Poimboeuf cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Jessica Yu , Joe Lawrence , Miroslav Benes , linux-s390@vger.kernel.org, heiko.carstens@de.ibm.com, Gerald Schaefer Subject: Re: [PATCH v4 05/11] s390: Change s390_kernel_write() return type to match memcpy() In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Acked-by: Joe Lawrence > Acked-by: Miroslav Benes 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