From patchwork Mon Sep 28 21:14:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 263419 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29290C47420 for ; Mon, 28 Sep 2020 21:14:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0E7321BE5 for ; Mon, 28 Sep 2020 21:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601327692; bh=RGKuwByzWRO27E1mOWuhLidwFOHwiMBVWVuRnYbVA64=; h=Date:From:To:Subject:List-ID:From; b=Ni0WhFM+steLt0b2TpoyrIB9JmhSHntWxHC8p4agzB/tmbVmKprK1e4u6iP9IPfIy PDYmYa1O/sx+w3QcdZMEWmWCwHLZIVspgtCydMiFo308Jj4AJ6mWbuhG8+vcevkV2s DPzc/E9Fph9i7h/DWnvCcNOwrllfvXQQCdg5+qww= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726939AbgI1VOw (ORCPT ); Mon, 28 Sep 2020 17:14:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:58556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgI1VOw (ORCPT ); Mon, 28 Sep 2020 17:14:52 -0400 Received: from localhost.localdomain (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) (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 CCBD1208FE; Mon, 28 Sep 2020 21:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601327691; bh=RGKuwByzWRO27E1mOWuhLidwFOHwiMBVWVuRnYbVA64=; h=Date:From:To:Subject:From; b=sRoURuoQ1Oa437QluI23QSToH+n/uezKg74/ntkn1QJcIqZ+DBRb/a2cjVzkZ7qTF tSkDVSjCi/BEgGvZCC5Q2lMCbIM+wPLSsoFN9QFyxa7FUTRM9C7VB+gt6yWGgC0yeI Fr1M+wY0ZOAKN6NQA3mYVQMxqU75MjR2RkIKUtw4= Date: Mon, 28 Sep 2020 14:14:50 -0700 From: akpm@linux-foundation.org To: dan.j.wiilliams@intel.com, hch@lst.de, hpa@zytor.com, jack@suse.cz, jmoyer@redhat.com, mawilcox@microsoft.com, mingo@elte.hu, mingo@redhat.com, mm-commits@vger.kernel.org, mpatocka@redhat.com, ross.zwisler@linux.intel.com, stable@vger.kernel.org, tglx@linutronix.de, toshi.kani@hpe.com, viro@zeniv.linux.org.uk Subject: [merged] arch-x86-lib-usercopy_64c-fix-__copy_user_flushcache-cache-writeback.patch removed from -mm tree Message-ID: <20200928211450.4RVSFVm9R%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch titled Subject: arch/x86/lib/usercopy_64.c: fix __copy_user_flushcache() cache writeback has been removed from the -mm tree. Its filename was arch-x86-lib-usercopy_64c-fix-__copy_user_flushcache-cache-writeback.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Mikulas Patocka Subject: arch/x86/lib/usercopy_64.c: fix __copy_user_flushcache() cache writeback If we copy less than 8 bytes and if the destination crosses a cache line, __copy_user_flushcache would invalidate only the first cache line. This patch makes it invalidate the second cache line as well. Link: https://lkml.kernel.org/r/alpine.LRH.2.02.2009161451140.21915@file01.intranet.prod.int.rdu2.redhat.com Fixes: 0aed55af88345b ("x86, uaccess: introduce copy_from_iter_flushcache for pmem / cache-bypass operations") Signed-off-by: Mikulas Patocka Reviewed-by: Dan Williams Cc: Jan Kara Cc: Jeff Moyer Cc: Ingo Molnar Cc: Christoph Hellwig Cc: Toshi Kani Cc: "H. Peter Anvin" Cc: Al Viro Cc: Thomas Gleixner Cc: Matthew Wilcox Cc: Ross Zwisler Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Signed-off-by: Andrew Morton --- arch/x86/lib/usercopy_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/lib/usercopy_64.c~arch-x86-lib-usercopy_64c-fix-__copy_user_flushcache-cache-writeback +++ a/arch/x86/lib/usercopy_64.c @@ -120,7 +120,7 @@ long __copy_user_flushcache(void *dst, c */ if (size < 8) { if (!IS_ALIGNED(dest, 4) || size != 4) - clean_cache_range(dst, 1); + clean_cache_range(dst, size); } else { if (!IS_ALIGNED(dest, 8)) { dest = ALIGN(dest, boot_cpu_data.x86_clflush_size);