From patchwork Wed Jan 27 23:53:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 12051273 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=-11.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 6A40EC433DB for ; Wed, 27 Jan 2021 23:54:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F339B64DD6 for ; Wed, 27 Jan 2021 23:54:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F339B64DD6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4DDF66B0005; Wed, 27 Jan 2021 18:54:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 466606B006C; Wed, 27 Jan 2021 18:54:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 32EC26B006E; Wed, 27 Jan 2021 18:54:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0034.hostedemail.com [216.40.44.34]) by kanga.kvack.org (Postfix) with ESMTP id 17D3A6B0005 for ; Wed, 27 Jan 2021 18:54:07 -0500 (EST) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C8D841EE6 for ; Wed, 27 Jan 2021 23:54:06 +0000 (UTC) X-FDA: 77753210892.19.ear52_1c17ac92759b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id A37801AD1B7 for ; Wed, 27 Jan 2021 23:54:06 +0000 (UTC) X-HE-Tag: ear52_1c17ac92759b X-Filterd-Recvd-Size: 3940 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 23:54:06 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id C120A64DD3; Wed, 27 Jan 2021 23:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611791645; bh=d4xr17u16cz8shwN/g5Ecr3v4lfFzT6qjsUiTE+aDIU=; h=From:To:Cc:Subject:Date:From; b=U0CQKxxFMolNr/qS6tw32+v/h0IAwsXXCMFyvZ08d26q09AyskmpJfi0uJPHs47QR IruicfOcW/1baNGq2Bc4qhFfryYaHpDYBkN8FR95DXpTNU5XUPFpEkHshO7ziKK1QY 3ZHfw6JDUtXOPXsnYYSmMWAFL4rRpDKG1RCJ9WM5H5Hb/FmBquXroWgNi2zcsN/teP AOCp1S+AQceTpYcuoEUuPYok5zQqfn8ZfD78t2LMkNu+7bFVDfyDKT5/GYD7djRApu zpPxTEH/X0ac5dltTAZG+vUT5QwJ2P0yoeHLUEHqvoxd0wH7SAmDQt5YYdMxE95u5s 8SrH9TqwYot1Q== From: Will Deacon To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, linux-mm@kvack.org, Will Deacon , Yu Zhao , Minchan Kim , Peter Zijlstra , Thomas Gleixner , Linus Torvalds , Vlastimil Babka , Mohamed Alzayat , "Aneesh Kumar K.V" , Nadav Amit , Andrea Arcangeli Subject: [PATCH v3 0/6] tlb: Fix (soft-)dirty bit management & clean up API Date: Wed, 27 Jan 2021 23:53:41 +0000 Message-Id: <20210127235347.1402-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: Hi everyone, This is version three of the patches I previously posted here: v1: https://lore.kernel.org/r/20201120143557.6715-1-will@kernel.org v2: https://lore.kernel.org/r/20201210121110.10094-1-will@kernel.org The objective is to fix the lacklustre TLB invalidation on the clear_refs path and then augment the mmu_gather API to make it more difficult to abuse. Although there are other patch series pending to address related issues, I don't think this relatively straightforward set of fixes should be blocked on them. Will Cc: Yu Zhao Cc: Minchan Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Linus Torvalds Cc: Andrew Morton Cc: Mohamed Alzayat Cc: "Aneesh Kumar K.V" Cc: Nadav Amit Cc: Andrea Arcangeli Cc: linux-mm@kvack.org --->8 Will Deacon (6): mm: proc: Invalidate TLB after clearing soft-dirty page state tlb: mmu_gather: Remove unused start/end arguments from tlb_finish_mmu() tlb: mmu_gather: Introduce tlb_gather_mmu_fullmm() tlb: mmu_gather: Remove start/end arguments from tlb_gather_mmu() tlb: arch: Remove empty __tlb_remove_tlb_entry() stubs x86/ldt: Use tlb_gather_mmu_fullmm() when freeing LDT page-tables arch/ia64/include/asm/tlb.h | 4 ++-- arch/sparc/include/asm/tlb_64.h | 1 - arch/x86/include/asm/tlb.h | 1 - arch/x86/kernel/ldt.c | 10 ++++++++-- fs/exec.c | 4 ++-- fs/proc/task_mmu.c | 9 +++++---- include/asm-generic/tlb.h | 6 ++++-- include/linux/mm_types.h | 7 +++---- mm/hugetlb.c | 18 ++---------------- mm/madvise.c | 12 ++++++------ mm/memory.c | 8 ++++---- mm/mmap.c | 8 ++++---- mm/mmu_gather.c | 31 +++++++++++++++++-------------- mm/oom_kill.c | 6 +++--- 14 files changed, 60 insertions(+), 65 deletions(-) Acked-by: Linus Torvalds