From patchwork Wed Apr 5 16:02:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13202129 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 0F5EFC7619A for ; Wed, 5 Apr 2023 16:02:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8F74F6B0074; Wed, 5 Apr 2023 12:02:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A7D96B0075; Wed, 5 Apr 2023 12:02:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 747F16B0078; Wed, 5 Apr 2023 12:02:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 6886D6B0074 for ; Wed, 5 Apr 2023 12:02:46 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 22601C1085 for ; Wed, 5 Apr 2023 16:02:46 +0000 (UTC) X-FDA: 80647805532.21.0666F78 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id 8D5221A002C for ; Wed, 5 Apr 2023 16:02:43 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P+otiMlB; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680710563; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=cYaKGp+t2zLM3SXwrmYC1WhmJ28+tinYlXREE/5gPFI=; b=KgxGrI0mWD+7grPMN2xGWkOgFX1i7AaeTQ/kLjtDfbx3W3P9CFym+GcpDGFoRL1x0796i4 eIQTaa05q1yZu0Zc3beTQQsZVg+vovYgdEO6S8hVuNHAIe2fzQzjBsk3LYMwIi32cPs5dy K/K1zDS252pzykqFdiGLtELg9OeOr98= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P+otiMlB; spf=pass (imf19.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680710563; a=rsa-sha256; cv=none; b=Il8zCkN0dJcmBHN8Cd3rhtKtNXSdhymKaG7A0WAzWIRF5EMoHgC7WPkf5kbFkiflZmocXC no2hooeBc4Ustu0rgzveXMOxMLXmyfIKQRmzxuX4agPevgPcY8/yPpTjb1OPm6BAbFQzSd PfJBXozYaqZEWVJEvVAYwQxR7y/6POg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680710562; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=cYaKGp+t2zLM3SXwrmYC1WhmJ28+tinYlXREE/5gPFI=; b=P+otiMlBKhg4n6qcdJY8KKV5xghdnXXgh7yJAdpcArKsEmd39ZgVl7akMvqEBufGcC8Adl CghZ/bQKgzJzHKLdtBxqZgYt3V2sSaGUYE2Vn/XHw7XaD3WXSVdMWHkSwvDzaDd7WN6pm0 5tIdy3i/InUkQ2VcS2NkomOdPvaFtuE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-67cLjWAMPhe2Q8XOKifa8A-1; Wed, 05 Apr 2023 12:02:40 -0400 X-MC-Unique: 67cLjWAMPhe2Q8XOKifa8A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A4530280A321; Wed, 5 Apr 2023 16:02:38 +0000 (UTC) Received: from t480s.fritz.box (unknown [10.39.195.71]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53276492C14; Wed, 5 Apr 2023 16:02:37 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, David Hildenbrand , Andrew Morton , Peter Xu , Muhammad Usama Anjum Subject: [PATCH v2 0/2] mm/userfaultfd: fix and cleanup for migration entries with uffd-wp Date: Wed, 5 Apr 2023 18:02:34 +0200 Message-Id: <20230405160236.587705-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: azx7znd9hp9jtoqh8d55o8y8hngn89oj X-Rspamd-Queue-Id: 8D5221A002C X-HE-Tag: 1680710563-436260 X-HE-Meta: U2FsdGVkX19rBhU0xg9dElXmK24RYiOYpoW4M1td7jrjPG48d9fYeT7wiPdSQQFkaF9aViZaJhxum36zYr3EPk4K5Ynog7Y5XmAmn6p1hIIRSF/AwAvtAoZTZAhGULKMCC93m2EHBjsb1rS/j+MkLOpEcY6EMNJFiB1mpZAOywoQ+q97HUjQBO0Z+zDt8ImTCQQbWETFbKwJZYLCDtzLLEHBvDg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iyUsqatXqWRo5yUUd4DA5aqFGZ0w== 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: One fix and one cleanup. uffd-wp migration entry handling for PTE/PMDs should now be fairly similar code-wise. v1 -> v2: - Add RB's - "mm/userfaultfd: fix uffd-wp handling for THP migration entries" -> pmd_swp_uffd_wp(*pvmw->pmd) -> pmd_uffd_wp(pmdval) Cc: Andrew Morton Cc: Peter Xu Cc: Muhammad Usama Anjum David Hildenbrand (2): mm/userfaultfd: fix uffd-wp handling for THP migration entries mm/userfaultfd: don't consider uffd-wp bit of writable migration entries mm/huge_memory.c | 16 ++++++++++++---- mm/mprotect.c | 2 -- 2 files changed, 12 insertions(+), 6 deletions(-)