From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 932CFC433EF for ; Mon, 6 Jun 2022 14:58:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EFD4C6B0071; Mon, 6 Jun 2022 10:58:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAC9A6B0073; Mon, 6 Jun 2022 10:58:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D98686B0074; Mon, 6 Jun 2022 10:58:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id C7A636B0071 for ; Mon, 6 Jun 2022 10:58:40 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 978CB33F0A for ; Mon, 6 Jun 2022 14:58:40 +0000 (UTC) X-FDA: 79548117600.03.9C7DDA0 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf13.hostedemail.com (Postfix) with ESMTP id 9A70320039 for ; Mon, 6 Jun 2022 14:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654527519; x=1686063519; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZNGIvjqpmlDYzUKrh1+1a2On//tfYpryieh9Ca4FwWk=; b=kEikdHGOON+J3OQc+XdoZiXdw44c5k30Bsqqf+HNdNy2VT8Yo+oxpdlU c1PjeqWUTlw5Kw8LOhGFZSfpyfbi7UifXR+Mkk8ApPCElwzMPqrGVcy8A D/eYudPXNZ0z+KvWb5gN7o/BTpi+vUO1d2NXIDRw4ZDzcum8kOJFIiL4d EG7WCJIRpXYAw6BJoG4o3FchYwxnBjDZ71TH0+jjpsZH5HgwjMvTwadvU m+LLegHGdIWZgJAA9N5NfoK38hTe9HITP35/T5l4J0FEYbmjSlnSHtabA Q5NNwstG2HVzD6V2TOzQOihVTJuo9otxw0lfrmirGEu1PAoXiru1pRIrN g==; X-IronPort-AV: E=McAfee;i="6400,9594,10370"; a="302024053" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="302024053" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 07:58:37 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635637630" Received: from ypchen-mobl.amr.corp.intel.com (HELO localhost) ([10.213.189.170]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 07:58:37 -0700 Date: Mon, 6 Jun 2022 07:58:37 -0700 From: Ira Weiny To: "Fabio M. De Francesco" Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sebastian Andrzej Siewior , Matthew Wilcox Subject: Re: [PATCH] mm/highmem: Delete memmove_page() Message-ID: References: <20220606141533.555-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220606141533.555-1-fmdefrancesco@gmail.com> X-Rspamd-Queue-Id: 9A70320039 X-Stat-Signature: gqt4b9zp5qfho5aa3yhs9xtsz553x7we X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kEikdHGO; spf=none (imf13.hostedemail.com: domain of ira.weiny@intel.com has no SPF policy when checking 192.55.52.88) smtp.mailfrom=ira.weiny@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam08 X-HE-Tag: 1654527482-603561 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 06, 2022 at 04:15:33PM +0200, Fabio M. De Francesco wrote: > Matthew Wilcox reported that, while he was looking at memmove_page(), he > realized that it can't actually work. > > The reasons are hidden in its implementation, which makes use of > memmove() on logical addresses provided by kmap_local_page(). memmove() > does the wrong thing when it tests "if (dest <= src)". > > Therefore, delete memmove_page(). > > No need to change any other code because we have no call sites of > memmove_page() across the whole kernel. > > Reported-by: Matthew Wilcox > Cc: Ira Weiny Reviewed-by: Ira Weiny > Signed-off-by: Fabio M. De Francesco > --- > include/linux/highmem.h | 13 ------------- > 1 file changed, 13 deletions(-) > > diff --git a/include/linux/highmem.h b/include/linux/highmem.h > index 3af34de54330..fee9835e3793 100644 > --- a/include/linux/highmem.h > +++ b/include/linux/highmem.h > @@ -336,19 +336,6 @@ static inline void memcpy_page(struct page *dst_page, size_t dst_off, > kunmap_local(dst); > } > > -static inline void memmove_page(struct page *dst_page, size_t dst_off, > - struct page *src_page, size_t src_off, > - size_t len) > -{ > - char *dst = kmap_local_page(dst_page); > - char *src = kmap_local_page(src_page); > - > - VM_BUG_ON(dst_off + len > PAGE_SIZE || src_off + len > PAGE_SIZE); > - memmove(dst + dst_off, src + src_off, len); > - kunmap_local(src); > - kunmap_local(dst); > -} > - > static inline void memset_page(struct page *page, size_t offset, int val, > size_t len) > { > -- > 2.36.1 >