Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp542858iof; Mon, 6 Jun 2022 08:12:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSalvcXN1PoRMMlnRNdmpir/URhHIZtPZOs26rBPRCcbAzr7qoUUZwrCRz4J374LmsgnpJ X-Received: by 2002:a17:902:e84b:b0:164:8ba3:9cd9 with SMTP id t11-20020a170902e84b00b001648ba39cd9mr24755314plg.49.1654528353032; Mon, 06 Jun 2022 08:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654528353; cv=none; d=google.com; s=arc-20160816; b=iaO8/7rLh0McCEZoMDflWfWbSymp8Ndge7wIAs+N2RAB21QQ4r/7HMZCdsfXnmR7xP HSHOGuPAiTv2HYRNh+LOHfxa6yndYpkXT1oDdNjd4/SYTpQ34u8rSu+GdRYvj2blw5IZ DQyd12WQTH4RwQ3an3NoyJbF6gQV6gq9HIIlt5y7xzNqkmS9rcQFLw4utSY7+kYkP1dX kdpIcuCQyUzFSed/aMH2xpYlK0SBTQKVb0C5SkqsISXq/mh1BDHNhhAbb1kflRVdhlbZ SyAW/c1ihFpjQZ2o6aRdBKZEk0qL2uUYD1dCrewvvbvKCtkoGyYqoV5Mh4/Gxi9wvbwZ CXXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NJvvvCLGzvC0rmTP8LR5fZicpcH2CWe6fLhVOBrwSQE=; b=F3/OD5hlY/T/xJVhom22e/IMFCu+evxF+x9rUvzs0AKbu4EX9xIA7FGy+pvVyjtUh7 OiZWTm63p+b9bKleGWnKbipuMTafNQ7Z4v5O5ffr0uSJyLfe/WSR6BteMGwrZuqf3p7O CeDLwtAfRy4ZrLAnlU4ufvSPbf5lF035lZiyJC8xh2gSvuMSRdHMYtWqy/zbfQqY75/1 PfuWZtLeoRtis8uyq3fNWEeYfXt5s8fvxHBuI+BCqV1qGsb8PG/QxZ8CY3pRCEKYCM33 JVHt4lA+rTZA64Cydqs9+9iAlrridX1ZJ6th9saq3EvgtK0f3NbpKN6NcE08MozdIU4u 1blw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HfBPmxAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a190-20020a6390c7000000b003fce4535435si17014869pge.483.2022.06.06.08.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:12:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HfBPmxAF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1531A3066BE; Mon, 6 Jun 2022 07:59:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240164AbiFFO6m (ORCPT + 99 others); Mon, 6 Jun 2022 10:58:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240160AbiFFO6j (ORCPT ); Mon, 6 Jun 2022 10:58:39 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9137D30412A for ; Mon, 6 Jun 2022 07:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654527518; x=1686063518; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZNGIvjqpmlDYzUKrh1+1a2On//tfYpryieh9Ca4FwWk=; b=HfBPmxAFFNdH6i+/9jht4FoWX+/73t4jDUcwuSryPA2bSukfuNYlFxqg 9NJ+kO0INSjDqXEPNo9UKHgEkmuJcRao3nxLQoIVvxayw7mkA0FyWN5kL 2vKVP5O5tW1WOWlmIs9CV04T97YtO7ZQmEmsCh31Eq87+0CdekUeURH2T /S0ydxrzMdNk+IZJ403xfqHTDCVmfefNuneKKnq5KJGpbHRVS88PZ+OH7 /3AJEJyv2Fs22EJOHnTZJ+NvrMnqRk69a7NIWLKGFWcxsNVtnS12A+3z9 Wu4c/9CxxHRQxZeyTpE6BjbpgrRPPYDGHICTmnmKFHVMgaYPy0FwtQNlb w==; X-IronPort-AV: E=McAfee;i="6400,9594,10370"; a="276705415" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="276705415" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2022 07:58:38 -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-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >