From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 5BABC267B90 for ; Tue, 3 Feb 2026 18:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770142406; cv=none; b=eSf+mm2Ma07FUTfEQ1gTRl7UDjE0o4ixenSggwH0CxQ0BopJ/OKzbZsRSr9ATpeSl3gkT89DtGhePvluL6k6yWqAIIeR4Mzdc2QOQqbAczfllggYcsZXAAjZ6Uh6+w9B+x7LZfAtHgSlzd5Q7e2t7CI6whVxfPASvjuObV41jaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770142406; c=relaxed/simple; bh=RgOdFHuomUx5cdPp0JGsemA2d5RVP7tNLyg3IMDaEeM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oJrMFKKTS+z6bqIe2mKiIxvLN7AujuTtmQqigEDqf7PZ0dpkLjxapB30OjgvU65PqPrD3V2zztbOT8aJ21zMUfdFGgXiqyVFlwNh44Irw3Chj3x27YrlIujaZMMwCK+gnGbF7UDXC7AhXKLXd9bUP0ccX+qr+31trgrzozKlRzM= 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=RfGWfGcA; arc=none smtp.client-ip=209.85.160.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="RfGWfGcA" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-5014e1312c6so38940501cf.2 for ; Tue, 03 Feb 2026 10:13:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1770142404; x=1770747204; 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=6rLJUepMBePw2/6rYXVBVUlKVexPKPCi+MRpKxp95Xc=; b=RfGWfGcAQFFX2r+JUzS+o8R0z45yOowAvwtiDV6kAkAvQUky3M+qVn3YUYZ/6ojk9q SXbE5hRP7I9yGJXTy7qCLBIiRF3k49e8p35hNU8msOfIu+E8lKS0ofHlLSf1NhHXYFV0 FUlVXLYAkJU9rjA9rViFoS004TjLd7AubTQ0NoAgr211m8H+LJjciGellkOftkLDYzoP iG4obd5Qyf5iRrQ0dNSwofywsaDKpHbvH06qUllVbwxisrNanjhXv48TXXNZnkOx1fti WkVc8F2bBixnQAn8eMBW/BVTpRlFhNR0ABDUx+kU/4Sce+/wLJwlsf8dmWfmw7s9GsQq S2vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770142404; x=1770747204; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6rLJUepMBePw2/6rYXVBVUlKVexPKPCi+MRpKxp95Xc=; b=xJqYLxpmoa1Uczi1f1OtElUMMwsA1PK8FSf1P4CSXa6FCpj3ziPk/GCWa2c1rUPj+F 2HQ7KOnus3L1pol73H0WrNJmZqkpazs+E66llRMNDWWhyt6NsbjbwT1CkpRFddrg7w1R cNTpj0V8vVCPQL1c2ZL2LHbCQxvw0Gvx7zKqbQm4iPOWVRSExiHrBaf9eJVSLEmAmt1t bSew+dxIzaUgn1d57WVX4mpOzw3rq9UH4eixJmi4RwgXl4WBOfC5j7V7OcTcFMgHqaXP tsD03O3PDDrQefyRrGnI5//KpS6NKyHGgn6OKTmXOfbYU7o4GNAeg9GvOMlFq5qPv/Dm Kkkw== X-Forwarded-Encrypted: i=1; AJvYcCVaPF3HQpdwYE+Yf+67/GXRP1O8uH6vd/OljF1XmRkYpTerk+g/skfey2I3/h9gPgNS5vE=@vger.kernel.org X-Gm-Message-State: AOJu0YxOxRx07+2B9XtbCOdvFX7uW9Ae2pTb7YBeOJrwa+pQG7DXJODK GUvPzx5ggyuPERIa55weWj1kYz93iS8RDvp8/cClF0nc3OnZ3elNBntIwcktuyChsgY= X-Gm-Gg: AZuq6aLSeIn9y45tZlSIH9lwl+2eaAYWHYydHjGkPi0N6wQoill/I6h73vD5uMarZMT H5DOzXiFYPbjxU+diabHxX96XrH3Z9da5oKw+021AMxiP4LlBjq7nwcwwt8jokKAMh20Tt4FUbt dJE1qwQlR3zCYZ0XiMEmRj6Fw0j6bzPsveVWw2MsElZ5DJgMK30Yh3zFwvO92wL5K920x/C8nXv fGO+UK/JSR0XwqhXlnuopawiAb1HKTMiaOwOVxJ/EoSl3LwyfpCDCWeddVagxQxYUHzCGASNKB3 XEtn/TH/N8EFdWuRwzXYxzXv+BF6lQEnd7FzcPW8PrzEjsGznZ5url3rqsQlVzkJ2w0GS9fK1ro GrX1yuH0I2YvHva+P85SED7jhEESe/zFlh+PMkgL1etOQl1vNWyHzul4yG/tTl+RB+RNVijklZN oChCpHMpEKLJT6nXpPP8GzzDj2H/uNZ87p4qiiGnffBEyy1xwphn1dQhymQNXhTszFZVQ= X-Received: by 2002:ac8:1402:0:b0:4ee:42e6:a5 with SMTP id d75a77b69052e-5061c1ae28dmr1930741cf.57.1770142403217; Tue, 03 Feb 2026 10:13:23 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8ca2fa55983sm22226185a.10.2026.02.03.10.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Feb 2026 10:13:22 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vnKtt-0000000Gaft-0KdL; Tue, 03 Feb 2026 14:13:21 -0400 Date: Tue, 3 Feb 2026 14:13:21 -0400 From: Jason Gunthorpe To: Alexey Kardashevskiy Cc: Sean Christopherson , Ackerley Tng , cgroups@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, akpm@linux-foundation.org, binbin.wu@linux.intel.com, bp@alien8.de, brauner@kernel.org, chao.p.peng@intel.com, chenhuacai@kernel.org, corbet@lwn.net, dave.hansen@intel.com, dave.hansen@linux.intel.com, david@redhat.com, dmatlack@google.com, erdemaktas@google.com, fan.du@intel.com, fvdl@google.com, haibo1.xu@intel.com, hannes@cmpxchg.org, hch@infradead.org, hpa@zytor.com, hughd@google.com, ira.weiny@intel.com, isaku.yamahata@intel.com, jack@suse.cz, james.morse@arm.com, jarkko@kernel.org, jgowans@amazon.com, jhubbard@nvidia.com, jroedel@suse.de, jthoughton@google.com, jun.miao@intel.com, kai.huang@intel.com, keirf@google.com, kent.overstreet@linux.dev, liam.merwick@oracle.com, maciej.wieczor-retman@intel.com, mail@maciej.szmigiero.name, maobibo@loongson.cn, mathieu.desnoyers@efficios.com, maz@kernel.org, mhiramat@kernel.org, mhocko@kernel.org, mic@digikod.net, michael.roth@amd.com, mingo@redhat.com, mlevitsk@redhat.com, mpe@ellerman.id.au, muchun.song@linux.dev, nikunj@amd.com, nsaenz@amazon.es, oliver.upton@linux.dev, palmer@dabbelt.com, pankaj.gupta@amd.com, paul.walmsley@sifive.com, pbonzini@redhat.com, peterx@redhat.com, pgonda@google.com, prsampat@amd.com, pvorel@suse.cz, qperret@google.com, richard.weiyang@gmail.com, rick.p.edgecombe@intel.com, rientjes@google.com, rostedt@goodmis.org, roypat@amazon.co.uk, rppt@kernel.org, shakeel.butt@linux.dev, shuah@kernel.org, steven.price@arm.com, steven.sistare@oracle.com, suzuki.poulose@arm.com, tabba@google.com, tglx@linutronix.de, thomas.lendacky@amd.com, vannapurve@google.com, vbabka@suse.cz, viro@zeniv.linux.org.uk, vkuznets@redhat.com, wei.w.wang@intel.com, will@kernel.org, willy@infradead.org, wyihan@google.com, xiaoyao.li@intel.com, yan.y.zhao@intel.com, yilun.xu@intel.com, yuzenghui@huawei.com, zhiquan1.li@intel.com Subject: Re: [RFC PATCH v1 05/37] KVM: guest_memfd: Wire up kvm_get_memory_attributes() to per-gmem attributes Message-ID: <20260203181321.GX2328995@ziepe.ca> References: <071a3c6603809186e914fe5fed939edee4e11988.1760731772.git.ackerleytng@google.com> <07836b1d-d0d8-40f2-8f7b-7805beca31d0@amd.com> <20260129003753.GZ1641016@ziepe.ca> <20260129011618.GA2307128@ziepe.ca> <586121cf-eb31-468c-9300-e670671653e1@amd.com> Precedence: bulk X-Mailing-List: kvm@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: <586121cf-eb31-468c-9300-e670671653e1@amd.com> On Tue, Feb 03, 2026 at 12:07:46PM +1100, Alexey Kardashevskiy wrote: > On 29/1/26 12:16, Jason Gunthorpe wrote: > > On Wed, Jan 28, 2026 at 05:03:27PM -0800, Sean Christopherson wrote: > > > > > For a dmabuf fd, the story is the same as guest_memfd. Unless private vs. shared > > > is all or nothing, and can never change, then the only entity that can track that > > > info is the owner of the dmabuf. And even if the private vs. shared attributes > > > are constant, tracking it external to KVM makes sense, because then the provider > > > can simply hardcode %true/%false. > > > > Oh my I had not given that bit any thought. My remarks were just about > > normal non-CC systems. > > > > So MMIO starts out shared, and then converts to private when the guest > > triggers it. It is not all or nothing, there are permanent shared > > holes in the MMIO ranges too. > > > > Beyond that I don't know what people are thinking. > > > > Clearly VFIO has to revoke and disable the DMABUF once any of it > > becomes private. > > huh? Private MMIO still has to be mapped in the NPT (well, on > AMD). It is the userspace mapping which we do not want^wneed and we > do not by using dmabuf. Well, we don't know what the DMABUF got imported into, so the non-KVM importers using the shared mapping certainly have to drop it. How exactly to make that happen is going to be interesting.. Jason