Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2574853pxb; Thu, 10 Feb 2022 00:12:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJsfAqDh56GwqS5I4arrQ02O/EijXgRWYOYI5Zv51ohyq6xxNs5CohP/x7Ax3tmyNz5az/ X-Received: by 2002:a05:6402:1e91:: with SMTP id f17mr7173427edf.407.1644480764665; Thu, 10 Feb 2022 00:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644480764; cv=none; d=google.com; s=arc-20160816; b=tvhaPs4CZRbxzaGnNrS02KtuWb2xBbaQdWiBiGTv9oN/DX4Q0gsKd9q7iW3bffMgyb YJnxRPWY6GbAO53/qb7j/e7QUiZvD/rJs8mEc9FvBCdnY0i2GdM+ZmhcHphg+0owywtE +NXGmKTGq2dKiDgCIt8Z1zoGlqR0RzRNxD0ziEvB6WowYxD9kDsnC0Bt8MFfbIXT7PgT /TEEpcuSfmaM7SrAplKEy1+wajRRZQIx4plX7FSzFC7S/5SFVzwA8eAE54FEIOWBjSFa +HHS0pPpRjeXoMcsD5pbuZUG8pY4QA3YBztLc1DbuNKcuD4BXHswBzjoV7dCal/RC6RK uIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ZX/WOZsnGI7NHrW3LHW9fWbxuWWXkvq+KrfxlH19WkQ=; b=pSHAP/oV0FMWCDjxnduwr8fgh01hdSs3AcPmwis+MHoOfwzfc45M7kFRCGg+GC+hcS ND10AztMI7Y5kIt7aaBdWTLLojp5/A5/5KdaG+uk9amUljafMAf3RyAtETL//6qRsTmN heHw6SxW6cathbr0GKHfWKLRqEk4PN+VPhSfmJb0Roo2Ah9pDmMxR2axui/GQSoXLkpD s2SCx6VeRKwqysYdn1w9Gxv3KSWhh5skXuovvaG+FTuXCK/1OsUemz1eV22Q88ilDKjr qcdyDAiuZ70Siq45jOE0iqBJ6Pt79q3gxAbYpjvqVRmA0Ywqq0H8MsvQnhgC/j+GYItG FBaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=mnCQTtry; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14si2036943edz.641.2022.02.10.00.12.20; Thu, 10 Feb 2022 00:12:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=mnCQTtry; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235858AbiBJHUe (ORCPT + 99 others); Thu, 10 Feb 2022 02:20:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:38312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230002AbiBJHUd (ORCPT ); Thu, 10 Feb 2022 02:20:33 -0500 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AB8FD6D for ; Wed, 9 Feb 2022 23:20:35 -0800 (PST) Received: by mail-yb1-xb2a.google.com with SMTP id v47so12820546ybi.4 for ; Wed, 09 Feb 2022 23:20:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZX/WOZsnGI7NHrW3LHW9fWbxuWWXkvq+KrfxlH19WkQ=; b=mnCQTtryb0tmtF8+f3k+sVI71drjg1mVtn46FiiiRafv0su+7dnP8kwTMp/ROdO048 fcfOjVYrES+pwRrCHDsb2EFqdXLRXvCOJUML8Byl50JsMjb2ZqqzRvyi27AFULX36V4k e0bSSMnAvdy+UuvKrjJF2Eq/gWCNzHStw1iY8Gd29DOd4pTEqiMb6E4B7Yc8wGmJ1dPg tK05dDTqrH0pimHGgGB5AoLlLnyIFeckKIV8XW2xPI+VISAKUXI633AEmu4XAbQfENd5 +CTvdOtmZZU5UzYXvyu94nambEXkpN3j2sx3dD7w9y9ciuqii1a6zZf1spDvyf1PlvZf h8dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZX/WOZsnGI7NHrW3LHW9fWbxuWWXkvq+KrfxlH19WkQ=; b=5Jk5TIMp4qxhpVGv2l42eEUf7tjtMaB2VbwwVis+Hyi4DAndUEHy4e4CzkBiAYnb7B EEkmzzA0zHTWuioJpvWAOBw8JS7GMa8E7np0OUnjOf8MRRG2E2qwrbMhTU+M/yF9AbTV cafqbQVSK5PlhKSwaQ4T060zIcW/27VSjs2FmAO6PNjis8Ad1GOHYCNEcNhAQxhR30+u CPPTCfcaenlTs7IhBoT6Yfm2FmfxxBRUSnDR0+KwGxRPqHBO6DpxetnhDfotb2yxSO45 Gv2Czzc9hXVs2+PW0dQl9gB12CF502TK0R13lJCKUHUXf6o3oRQDWS0wRRvhDJKRu0Kx XBwQ== X-Gm-Message-State: AOAM530hg+opyAcWZDg4f9Njjkig00gVjjEvj52+lowhtLHq8cJrNWJR 9qy3YEf3pqWosemi4NSXAhuzcFTLMfn596a+5IJ6u0GNXy4GT1pr X-Received: by 2002:a81:4524:: with SMTP id s36mr6060238ywa.331.1644477634424; Wed, 09 Feb 2022 23:20:34 -0800 (PST) MIME-Version: 1.0 References: <20220208073617.70342-1-songmuchun@bytedance.com> <20220208073617.70342-4-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Thu, 10 Feb 2022 15:19:57 +0800 Message-ID: Subject: Re: [PATCH v4 3/5] mm: hugetlb: fix missing cache flush in copy_huge_page_from_user() To: Mike Kravetz Cc: Andrew Morton , zi.yan@cs.rutgers.edu, "Kirill A. Shutemov" , David Rientjes , Lars Persson , Zi Yan , Linux Memory Management List , LKML , Xiongchun duan , Fam Zheng Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, Feb 10, 2022 at 3:07 AM Mike Kravetz wrote: > > On 2/7/22 23:36, Muchun Song wrote: > > The userfaultfd calls copy_huge_page_from_user() which does not do > > any cache flushing for the target page. Then the target page will > > be mapped to the user space with a different address (user address), > > which might have an alias issue with the kernel address used to copy > > the data from the user to. Fix this issue by flushing dcache in > > copy_huge_page_from_user(). > > Quick question. > > Should this also be done for the non-hugetlb case? Take a look at the > routines __mcopy_atomic() and mcopy_atomic_pte(). Or, is that somehow > handled? Actually, you are right. __mcopy_atomic() and mcopy_atomic_pte() should also be fixed. And shmem_mfill_atomic_pte() also should be fixed. I'll fix those places in the next version. Thanks. > > For this change, > Reviewed-by: Mike Kravetz Thanks Mike.