Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2535134rdb; Mon, 5 Feb 2024 09:22:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHblmr1GbCcBvyXp8B9OQG750l156o/QSQCQf0bs0E6p+vo3MDEL8LQq7ND/1ZrVMVGS57F X-Received: by 2002:a17:90b:23c1:b0:296:1da3:c9e5 with SMTP id md1-20020a17090b23c100b002961da3c9e5mr86004pjb.4.1707153726794; Mon, 05 Feb 2024 09:22:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707153726; cv=pass; d=google.com; s=arc-20160816; b=ZsHX0QfuJ5AR/uAhZ468lExs6NhSHpgbopcqdpMjjDElXrSLrUmasnmBTrZXmkKByt 9NIfT8cD7Q2FYghmZdievWn9lLSXfbN8Qv61PQCqDC3QLsoSBv0KBNhXWYByDhramgEU 6a0UA+2bs99gQw0vJPF6uZWglep8Q//gRhe75AgvjXPBHeSiQcczPjURGWjoelTRQL5h dMRXt3B8f+vHL4wG0oY+yov38YtF0HJ5+D3TrJOsHIsFjf0Zy5T63rU6XZ1nqxkd2IYn 9XFg6g5MrRS4KCAuPa+JI6WGK1A7SBb93dvcoqByuMWBylLpqAhRZFD5ym/D0EoHIqrV XMCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5qDbIp2yNtXU1RzQ539qXvN5xu3jf0vrl0xdf7V68t0=; fh=GqZSnCNbFed2zZKn2Ou4453gBKy5oXWxnl6ySmulqTY=; b=x6pKClX8cwShO4RiYHOd4sTZN4B8GY6LwtsS/82WRneLMWYAS1xs5VGPOx6YTNOL1l 6mV3dNzsFWveVG5gVteov658huHBsDN17zfCmSDuIHT9EMfc+bs9mbkiXA3ihDdzBoAr BjAqW27c75YP3Ku6qbM3i/Nv9RoU21URJ7D4bLlCJk+QAYeRTKoxHk4mJYMztYnB/WeW o+E+vm61I4JNyy/T1aN8zQZyy4dhItrZCDS0yfRw3V/UAlyP+aTTMI4MB4vGvc6UrCJm 5AR8lXmptM0LcfdWmh+oErvqCpu5Ffkp812CHDe5ktoSbPULtG5d2YuX2Br05aGR7PaI u7hA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="POl5+JL/"; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-53072-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53072-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCWNJo1wJsea4HFTy7ic8axCdgJGy9BggY7KihFIOsYZeIQVlOzsLzYOuED7dQ5nQOMcOHcUaoN9VHSc15569nksxXv9GiHx9MuFI6Uvcw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id il4-20020a17090b164400b00296207f1f4esi204080pjb.176.2024.02.05.09.22.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 09:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53072-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b="POl5+JL/"; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-53072-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53072-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 35CAFB26431 for ; Mon, 5 Feb 2024 17:12:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A750446BD; Mon, 5 Feb 2024 17:12:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="POl5+JL/" Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A2B04503C for ; Mon, 5 Feb 2024 17:12:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707153154; cv=none; b=gi2riL4iG3qLyxlp1GAIDUnssXr5RkRaiOtartBBb+xMLDEkaIrkWsb2n+MONuVMJHp/m4Nb/39scqYRrzpVKaUvuotaxbSXdVzGRKkIBn/5koXyDRGnQw+03GyGzPjVaKqHD/MEBTULx6/6N1oc6U4aZcKQ5N/47EHygFQjjpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707153154; c=relaxed/simple; bh=m1QtL3ans36Yguk2A+1LNtWPxgFl5Ch0CUDhoxI8cj4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bbBlJXJEsIABSL55If7F2uTHBNZpUOGNEApyAlDKGEXz7oWrwSZ0MpPTnwaSI6UvPXqwmP9B2mmK7WDQ5X8cCYAHqmjRfbIS+OwnmuvbPfpyNpfQUADorcUKkQWWsp56AkBOfld/1tJ6uWPHMvzjaCTPNFpFwBCetqL9LNXdKQI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=POl5+JL/; arc=none smtp.client-ip=209.85.210.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6e1352dd653so3036943a34.2 for ; Mon, 05 Feb 2024 09:12:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1707153151; x=1707757951; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5qDbIp2yNtXU1RzQ539qXvN5xu3jf0vrl0xdf7V68t0=; b=POl5+JL/hyS2mGa/py8JOz+c5qhrPsPBGkTGsNKOH6+qWyODZZT51zx3RE3b+810AD X9v12YqGRt002pb/YlBadKtMmmhn0wzZFBhcqculFPjxFfD5lUH7NiwIm/tmXibh+5aV 1FVuEW7akqo8pKQXwZtSpLfuy/FnIfU6t4ZzljYpIqLqfZDopeEVaiA0MC4m3/hnz00C D/UWE5M1hQwvWCVu8lCWk2iQBdZLji3F6T0VHQg+pwVaQrMGEdlRQOstRxR4GEoBj03S l7lXn61Y++SZh+xqo2HrOBgTr0ITUETCYl3H4KGGFIaTU3t7X6G/Bi/XQqAbGhH5/1e/ WOAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707153151; x=1707757951; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5qDbIp2yNtXU1RzQ539qXvN5xu3jf0vrl0xdf7V68t0=; b=ZRcbuJ6j9YjKRXzoHViMXxNydTI8g2KgNEBVpsYXp3Zq7BcUj3mXwB6dyDkVI5EO/m wiaMpy11zuTStQSel1QAjsgPQtcZ8NJ8VdkfKfDfrijWnC/iS+pH/fOn+vaLAmzHqlAT r0jqcuuv7xNAw3XNgI0Z/mBT8pPpMmyB1txStda6WUE4JHhFtbEatvasDQLaLnjBGA0S AzppMYYL0gItLXwbjp0tWns34dG2IuWXDDxVCro0xgs4B9qXt510vcxtU50BVw8j2Bjc vJ+Ur/vCoAeQmua/YoO3q05osFTtnWsEkQsiSyKYf0J7mMkkMZkKku6bQcVP5Ecx19yU 3DVA== X-Gm-Message-State: AOJu0YydKtDSHZqOxHy14ZHjjQ9qqHO6hB/trJJ5fHAVbLG/cVWYydxT FJz+NJFxKhJ6WuYzTkKekxlDvkhEDGc+cqHap4R1vDlliinIGb/7/yshBKgzpIo= X-Received: by 2002:a05:6871:5813:b0:215:68d7:461b with SMTP id oj19-20020a056871581300b0021568d7461bmr322778oac.23.1707153151179; Mon, 05 Feb 2024 09:12:31 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCV/rPy91arwpYIwAojARklp6ZMF9K+LQVXtUZZ6YGhWdbSR41RR9S8S8caNOyg5Xw541tmu/KUnL1bRkwrLAWUFUQvIxBuAH86HrvajT0/XV7ievA8flm9zmbktlvTgPRA0yJDD3YeqEMbTqxaPHx78ygvrA/LdsiY6hjFAYx3hveMP1d6W/6K3k1EeoEzo90VzeDX4LNG2UcoIuzn8m6WZRZawwUNd+8QLX9XNbvyX+fxR3fyR2KkUPftZmPdowvRIAvlRhyHwjG1bgBeEvc7d3Im4bHyZ5LgWimpfq0AnUsJa49hcgqa18SGKfIDO357HXXSckB3H4VdxbBTR9I45dNsvSz2iUqZTjHAbpAgsGcljcsJXIYKsrhGG9FxLtW5p590R06d0vW4BCLwzh5MlbNqk4LSt2GTNcJcpmFo55Yyj1G/hlxQypUbHBJCZVzbbo7/FoWYMlsuz7iMv5EBzmfwGjNEvyEkU4+HAjiu9R7nOQl62M73DoGf/9IBMJILTI4CKJkoWgyKcr9LlTDO16Riw0X0a2+S/yupU46js8efVoG04val7Yb6gYBHIStR6H11fRi9OhWk0YB5VN6N5KYXugRjyOAxpVLg0Rtt8AvhK8Dykw3m3tmG3Yi6bseB6dR4OYaw0dXa8GiZ/u1/G7p4k8O6NLeS+iE8ypk+u0M5hspJ7wNhWTvsjpjHNt1xovNvCg/o0wX4tLIgyKy9BQQf8jiFAkcp8+tFunLmk7sxu Received: from ziepe.ca (hlfxns017vw-142-68-80-239.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.80.239]) by smtp.gmail.com with ESMTPSA id ej8-20020ad45a48000000b0068c6789ce9csm162580qvb.6.2024.02.05.09.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 09:12:30 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1rX2WE-000dJX-5F; Mon, 05 Feb 2024 13:12:30 -0400 Date: Mon, 5 Feb 2024 13:12:30 -0400 From: Jason Gunthorpe To: James Gowans Cc: linux-kernel@vger.kernel.org, Eric Biederman , kexec@lists.infradead.org, Joerg Roedel , Will Deacon , iommu@lists.linux.dev, Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, Paolo Bonzini , Sean Christopherson , kvm@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Alexander Graf , David Woodhouse , "Jan H . Schoenherr" , Usama Arif , Anthony Yznaga , Stanislav Kinsburskii , madvenka@linux.microsoft.com, steven.sistare@oracle.com, yuleixzhang@tencent.com Subject: Re: [RFC 14/18] intel-iommu: Allocate domain pgtable pages from pkernfs Message-ID: <20240205171230.GB31743@ziepe.ca> References: <20240205120203.60312-1-jgowans@amazon.com> <20240205120203.60312-15-jgowans@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240205120203.60312-15-jgowans@amazon.com> On Mon, Feb 05, 2024 at 12:01:59PM +0000, James Gowans wrote: > @@ -946,7 +946,13 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, > if (!dma_pte_present(pte)) { > uint64_t pteval; > > - tmp_page = alloc_pgtable_page(domain->nid, gfp); > + if (domain->pgtables_allocator.vaddr) > + iommu_alloc_page_from_region( > + &domain->pgtables_allocator, > + &tmp_page, > + NULL); I'm really worried about this change - I plan to redo all of this page table handling code so it makes use of struct page members for things like RCU free and more. Does this end up making the entire struct page owned by the filesystem? Jason