From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796133283; b=mUixyKkqXxTjtAObKcPrZn2JHNx+xWkb8Ig/3tErVQ6fpiBl+fW2mWOUdOsecMklAbLN KwjrxFzsUefX6qo0G9yFrT7NxQt5nPV8yAP3wFFouloelAcbr964uUjnoObn5Wy64hhx4 CShVJvO06kwo9ajfeysedqokp+jxLk/6CzkqYa9xlMwLAy2LC5yacMv8AAeh0q2QkMrMk 8HI9qXfzJly6Vqfqhy2m0AYcfjF9ZaEGbkadi0MeonvaS2WvSDaHVnBcGfJxRBpmHiIVQ RwLw1m6XrBFbCZL4nK0mfhuQm3cn2n5ZCRcrFeOHdTVY5QH9TLjtSfEp/4QtHXohPYw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796133283; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: MIME-Version:Content-Type:Content-Transfer-Encoding:Subject:From:To: Cc:In-Reply-To:References:Date:Message-Id:X-Mailer; bh=Q76tL/2AaXzotuKPUWO8woY2OJcOaBVsX+sIzjFORwo=; b=5RTp9F4w0N2E7+uBu7oXCHEU9cWAio2wnKqneTtpK6Pj+LKq472Sb/YvXhXK843jCQch HLMhFzk1OApNRIQpc/CjwMMKof+SaOybfeIOakGf4fZZ3i7O3kLJ31Rv7m+NNAMGDIgC5 7J/IVN6qOPKSge30YtLGZFQZtIxIVolAy7U9cXZP3bEOu/InjwBVShnHefQLd8xsmtrfV VsqkB0tOJVmtVjkbMm//SbOQEA8fAPeAsXKz6+JrRfxceUu79lhu2LwVriSgdg3jdSqQc nolj9t2ad7xYu/gIqsvcD//eh46YWmQB8a5Y5z4qTM9luy0EYW48diupPJLNk4rxZjQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass header.d=gourry.net header.i=@gourry.net header.a=rsa-sha256 header.s=google header.b="TqNjC6/s"; arc=none smtp.remote-ip=209.85.222.172 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0790606A325 for ; Tue, 1 Dec 2026 13:54:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E0790606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.a=rsa-sha256 header.s=google header.b=TqNjC6/s Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-93f20c3aaa5so969042085a.2 for ; Tue, 01 Dec 2026 05:54:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1796133282; x=1796738082; darn=vger.kernel.org; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:content-type:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=Q76tL/2AaXzotuKPUWO8woY2OJcOaBVsX+sIzjFORwo=; b=TqNjC6/sCwk/fdihcUL7tbncrX/Xn5hcCphC2g7V5yVKii6ZDxC+aXd5onwnDDLSpS yEwnN56n0gCw+xzzIB4RnderwY+631myHPZDFy3wh83qP1LESSXqDcvhhXQ4xnwn2T63 upmUN7zWhZQqJhiLt/JxjHuyUbMoM/FLlWBulTC3VBduJbneh3d1qyM+w/hXAP7e23UU /aucHaQSwFW2r/K1zM9VF7FhfxSJH52wmB7fA8/oT5pIw1CZ7HWIKI7CF6SKScs+oUq4 Mldxlf9iYUgmV5ri+kzeg+5xb9N86o2uHgeNArQe/zqQcOADXFznoXSelj6/6yxrl5f5 /tUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796133282; x=1796738082; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:content-type:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Q76tL/2AaXzotuKPUWO8woY2OJcOaBVsX+sIzjFORwo=; b=Nn/lR4GaEXWNF5KbKYUePcDYuCRU1CF6KhffDSJVeqvwJdEyAdUiTKkGZi8k9SGKlm 5SS/hx43yXCXC3qwfUErsKT8UpirG2mtRN9kapk3Lxjdv6WXbEcwxD4slS9euPTvTrxp OK7uv5Ki1sNQ8WgpsqaZm1Zu9X0S7T+eU2+4ry7i2CymR2CyMBxkmhAWTJcRUokECdGd 8CzISMLdgmcfXdLh656/AAgH95MhRR7xDGx0/7pdUN7TmSc/dbTv4EcxkxQYVOE6+6G3 tmvPs/yuHR0oCeYVXqE0kA88J5UlUIy2HOdVXN4h+VyvVjQveMfabtkjfr2mbbGoKIZ5 lxGA== X-Forwarded-Encrypted: i=1; AL+hErGHZUq/IHW3wyDHq2HuztR8yScFBz3sDsizKxJsKr1FDrxBKIx+AuDilhzS8mfwEpQkLCBESCfccWB8LVk=@vger.kernel.org X-Gm-Message-State: APuU4Z+llSGt0R1KZCYkhUC8zZ2+cMruoPvW3rwCUJdyjGhCOBpeXMTp t6Y+BaEpCrodb0d3UQukvvSNmfKF5prVPIRp9V2kU0CTz2wxQQxtStae5/Awe/HeKHA= X-Gm-Gg: AZFdTZcKcebZ6CiyHP7K1jnpm77lFZK/1CDM2t9uF9yFryKrdHcUw7TANYMrW4222yE hAFvL6lEerztwJ4PyCknuGtZpFCQz2MzIuvKmaIMNMCAV2GZ8KelA5vo4XmUsXZRaSRqZ6SvWtb +63KQWOb12bHKfnLBMMSWh77v4fjALeEjpOmeuFEF1/ehInZchI3VGeRiRoXfNXB/4QnzK2SkUy kukdw8iYDpnfmLbBe6S2akq0SPuXmYdWFIgoiK+H557JIAo+wsIuY/PJVvs23UTAiiHgvfckXu/ KbZanzPG8EjanjjqxwEWBN/HaI3tCXL2WjqoKN/Du6bRWCIFUkVMgg1qVUZ6YYL29cHQVs62C3G qoAfbWvSGY8/61kRo1/tww9QqDifakGZO0TSrzmFnrq5wGcGgWagWsL1peGtod/I5rGQ9SnmIHC RSN2/woKzxBQ4e+B/7gykQHd+9E1zPJKh0W/uA5NRvyAZn+DaIzH2KRIgKFr1yflYIf+kxbpRoB g4l9l1iKmGOaHUG1uTY9+l3VvI/ZgQJhgpX/2IbUvvkFZkBfuKLLVTzGzvcAWMmBFBEjIEbJJRV miK9B7z/BFz/2BihJ+2AcGGO/eFtusX4Lr68I0arqZ96KkTLmiDOJAilO3Wn92pehQRrKMOe7ux 3KQ94AeE= X-Received: by 2002:a05:620a:4591:b0:93e:5060:f929 with SMTP id af79cd13be357-949ba9b64d9mr6709455385a.19.1796133281824; Tue, 01 Dec 2026 05:54:41 -0800 (PST) Received: from [192.168.50.231] (pool-71-191-145-202.washdc.fios.verizon.net. [71.191.145.202]) by smtp.gmail.com with ESMTPSA id af79cd13be357-949bb4219c4sm2840947585a.41.2026.12.01.05.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 05:54:41 -0800 (PST) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH 20/32] mm/migrate_device: don't collect secretmem pages From: "Gregory Price (Meta)" To: "David Hildenbrand (Arm)" Cc: Hugh Dickins , Baolin Wang , Andrew Morton , Mike Rapoport , Peter Xu , Michal Hocko , Kiryl Shutsemau , Manfred Spraul , Davidlohr Bueso , Cyrill Gorcunov , Zi Yan , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Lorenzo Stoakes , Rik van Riel , Vlastimil Babka , Harry Yoo , Jann Horn , Yang Shi , Zach O'Keefe , Song Liu , David Stevens , Kefeng Wang , Alex Williamson , Suren Baghdasaryan , Dave Jiang , Matthew Wilcox , Miaohe Lin , David Rientjes , Shakeel Butt , Jan Kara , Mel Gorman , Jason Gunthorpe , John Hubbard , Gerd Hoffmann , Vivek Kasireddy , Dave Airlie , Matthew Brost , Joshua Hahn , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Hagen Paul Pfeifer , James Bottomley , Felix Kuehling , Alex Sierra , Balbir Singh , Kairui Song , Qi Zheng , Axel Rasmussen , Yuanchu Xie , Wei Xu , Baoquan He , Oscar Salvador , Muchun Song , Dan Williams , Rakie Kim , Hao Li , Christoph Lameter , Roman Gushchin , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Alexei Starovoitov , Xu Xin , Chengming Zhou , Shivank Garg , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cxl@vger.kernel.org, linux-rt-devel@lists.linux.dev, SJ Park , Chris Mason , stable@vger.kernel.org In-Reply-To: <20261129-fixes_core_3-v1-20-f66094116801@kernel.org> References: <20261129-fixes_core_3-v1-0-f66094116801@kernel.org> <20261129-fixes_core_3-v1-20-f66094116801@kernel.org> Date: Tue, 01 Dec 2026 08:54:39 -0500 Message-Id: <179613327963.412063.14270849401121185844.b4-reply@b4> X-Mailer: b4 0.17-dev On 2026-11-29 11:06 +0100, David Hildenbrand (Arm) wrote: > From: Chris Mason > > secretmem folios are removed from the directmap. GUP refuses secretmem > VMAs for that reason, but migrate_vma_setup() hands out secretmem folios > to drivers. > > Consequently, drivers that are not aware of this might access these > folios through the directmap, resulting in a kernel page fault. For > example, test_hmm copies the folio content using copy_highpage(), and > nouveau and amdkfd use dma_map_page(), where swiotlb bounce buffering > reads the folio through the directmap. > > Note that migrate_vma_pages() refuses to migrate file folios to device > memory, but only after the driver already copied the folio content. > > Let's fix it by not collecting secretmem folios in migrate_vma_setup(), > just like GUP refuses them. > > This has low urgency, as it requires a driver to migrate secretmem to > device memory. > > Fixes: 1507f51255c9 ("mm: introduce memfd_secret system call to create "secret" memory areas") > Cc: stable@vger.kernel.org > Signed-off-by: Chris Mason > [ david: adjust description and comment ] > Signed-off-by: David Hildenbrand (Arm) tested with test_hmm.c and produced an Oops - enoent after the fix Tested-by: Gregory Price (Meta) Reviewed-by: Gregory Price (Meta) -- ~Gregory