From patchwork Tue Jan 7 14:47:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Roberts X-Patchwork-Id: 13929105 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF854433AD; Tue, 7 Jan 2025 14:48:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261292; cv=none; b=ZYp6YM8ZQoVbpTCTEGIViS2saWu7eDdE7VDBi6MVps4QH22NyBZqMDJOWtBGI49EVXehBCxlFp8wFUHfgBC3jUAPNckmPzSBwvKOYA333zpCWlKEykFIhjJyfk4yDC8clsjO7plhIXBcxHnhr2gY5cb3yH+LllY9OBjyVJlaNYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736261292; c=relaxed/simple; bh=xSOx6i53FWdlp27JIwKc3r3t3SNpSzR+p180bKvX7SE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=J1XIjmTSfytMHJ/xqkBG38Nx6OZxBsA/gtHQoDkW0rlK5O+MUhNKfwl1O5DJPJCEjnrXCjaSfY3zJ+yOdiUyTjssSpjFF0JnkRSb5j5xkJ+IVw0AWdBXoSG/iDFxxfNEsggpql8bp7tKXYf8VkmO0KSTBAy8YUvNKhzH/IRzwY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CBC301424; Tue, 7 Jan 2025 06:48:35 -0800 (PST) Received: from e125769.cambridge.arm.com (e125769.cambridge.arm.com [10.1.196.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 20D563F59E; Tue, 7 Jan 2025 06:48:04 -0800 (PST) From: Ryan Roberts To: Andrew Morton , Muchun Song , "Liam R. Howlett" , Lorenzo Stoakes , Vlastimil Babka , Jann Horn , Shuah Khan , Peter Xu , David Hildenbrand , =?utf-8?q?Miko=C5=82aj_Lenczewski?= , Mark Rutland Cc: Ryan Roberts , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: [PATCH v1 0/2] mm: Clear uffd-wp PTE/PMD state on mremap() Date: Tue, 7 Jan 2025 14:47:51 +0000 Message-ID: <20250107144755.1871363-1-ryan.roberts@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi All, This series contains a fix for a warning emitted when a uffd-registered region, which doesn't have UFFD_FEATURE_EVENT_REMAP, is mremap()ed. patch 1 describes the problem and fixes it, and patch 2 adds a selftest to verify the fix. Thanks to MikoĊ‚aj Lenczewski who originally created the patch, which I have subsequently extended. Applies on top of mm-unstable (f349e79bfbf3) Thanks, Ryan Ryan Roberts (2): mm: Clear uffd-wp PTE/PMD state on mremap() selftests/mm: Introduce uffd-wp-mremap regression test include/linux/userfaultfd_k.h | 12 + mm/huge_memory.c | 12 + mm/hugetlb.c | 14 +- mm/mremap.c | 32 +- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 2 + tools/testing/selftests/mm/run_vmtests.sh | 1 + tools/testing/selftests/mm/uffd-wp-mremap.c | 380 ++++++++++++++++++++ 8 files changed, 452 insertions(+), 2 deletions(-) create mode 100644 tools/testing/selftests/mm/uffd-wp-mremap.c --- 2.43.0