From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (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 5BD551624F1 for ; Wed, 5 Mar 2025 19:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741202313; cv=none; b=F2yCM4nAKGAIKtU1mWWC99QdIPOjegmMFNCKJqB5VgQ2dDBW4b0v/sflKysbafTKUMUXzKNjL6bh7jPYyCDb2HZ4tRxDM+mwPFL2tb3Xv0uk6mX4QmRWKETN8eHaqmRT2dlVYQKQ1Hx2gIVn0/q5uwYClkklXVnDMUK4myUAkTA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741202313; c=relaxed/simple; bh=3SzijABCo7L0oRCqEvdXZEB88jTL2x7bJ6AOPFFhYh4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=M/D/VXwuoYPGJmi+TrOIyS7e8MeYY/hXSI4ttu7vLIRoGsL68CON5PRoYbFwA5yD3qWgFxAia5tJCUqHNrDhIZQsSFU68JOR5IPrBB4t/Twfc8M7bZ4AFe316X1a9VeYSJvYqoa6yziPhhb93e4HeVHVTEQnakrbDkjCSHVkYEw= 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=bhVz5ZHk; arc=none smtp.client-ip=209.85.222.182 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="bhVz5ZHk" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7c3d591e50aso209956885a.0 for ; Wed, 05 Mar 2025 11:18:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1741202310; x=1741807110; darn=lists.linux.dev; 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=C7y/oLdinpDpvBC2aTZl0N56MEM+KgeXEJqvXNG5yTE=; b=bhVz5ZHklQl2Mx+SMjhi0JY2GAkWtuSk/816mq5BfeBrIOSbVlVtxUw1faZTzbxdc/ ItWocFNCB+s31SU18Rqk4VKaMEEX2OTE6Zjitpq130PXZXghYPG8XTWyaqyc4Q9gd3LL 2aIq8+vIPuiidUOAYM4Dg7XIfskUrZn1ugIe+c/ZMczGMy70wXZlKgcYrcVM3pL3J/6e OK7j+g9r4mOYKx2v8cB2faqtytWhUxiRrsXQhFkZaVBob2bn/1HkjkUBArRwLDNXz13z SqbVz/T5qKxOq60Niu81q4ANJfrvnK5OxsSswpg9UshEuwZJEycROnkxGxbMC63iOqWn u85Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741202310; x=1741807110; 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=C7y/oLdinpDpvBC2aTZl0N56MEM+KgeXEJqvXNG5yTE=; b=DeIFL1//kLnBRXwJJVskQtZcaefZkuEgNk/KQRdoBLx/fzROuHmuHTixZLwXTDe4EN a+bbb6WaoBzEW0ZiY1ZQtnW66zvDpOWN9y6gJ56zW6THd/mayQWzillkvZ37NUvJyKej qBvSzykjjvRIkWoomMbofcgFc5s9gaAbIKFOmKmNAESi/AQ24TX1X1/sh3eW/ruuLWsT Cbx6Ci2itR5G2dJXiW2HxqrYT5HIkFJ3jickY3sgMqhS9U0z1Yyf318mTNgueXOBY+Ha CR5DboaybtEFLegmfVOwQIB0pJGeDRuaJpf765OYMPCXUWOwtjQK5AKNq8M2tN1DbfmI e0eA== X-Forwarded-Encrypted: i=1; AJvYcCV5rdmGcj06Y+y/eHh72lX1qU3pprgs6q5QH/lRR1W5hDbwPIqFRefHRjzDV/naK+exU99fCD+R7FVB@lists.linux.dev X-Gm-Message-State: AOJu0Yx/u8WdHt1XhoCg1MOdk9a0Vc5flhrSuXxQIP4Sblik07SLV4HR dFlOKDHGVnzTXAz3IbZQzJ2pR9+/Mrdurt4NotQaJSXYx38K7UJoi3foN+dezmU= X-Gm-Gg: ASbGncsuiUSXbzz6BznrYvGmWGAkruA7uP856jhjMS+1uqvHw8GMYYDY+NqkfFCHP6E dHPm8KUi8eaRuDSYgC20TT0V4rO2UfmFgpNwyPl5kZAaGQqozyM6i3ISW01Tjv5/QsApF+QalQ2 eLhGHYTJbv6zqSeqGhYmGdiB8yHsx1GlJvxmvQjCJDCZOaXZ+d+T+BdlrAkiwpmhtvTkNDPmTs8 l9uZXZVrvdaMqM1IVJeA5cP2Uhy55dXgeiN4e2Sj9ODwcts7/OSF7i1k9w1+AUgJ6QNznQVpqyw P2gPZ9fMZ4LGeHpk0dWEYLL5BAZMHVQVTSX/YhQoKhEZGQ5auFQGHoLxzrXXAWo3e1yTv8TN/Ev GC7PaITrW0IJvvt2hkA== X-Google-Smtp-Source: AGHT+IFwvrtrBNb8MOcl/UiqO1Z26YCuhB0icUQG2aJEfrzqQ/D1xCWD+/mL64bShsE0pSsh+4l3sg== X-Received: by 2002:a05:620a:6285:b0:7c3:cd78:df38 with SMTP id af79cd13be357-7c3d8e465a9mr663299885a.10.1741202310279; Wed, 05 Mar 2025 11:18:30 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-68-128-5.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.128.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c378d9f917sm915979885a.78.2025.03.05.11.18.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Mar 2025 11:18:29 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1tpuGC-00000001V2T-3xgf; Wed, 05 Mar 2025 15:18:28 -0400 Date: Wed, 5 Mar 2025 15:18:28 -0400 From: Jason Gunthorpe To: Alexey Kardashevskiy Cc: Xu Yilun , x86@kernel.org, kvm@vger.kernel.org, linux-crypto@vger.kernel.org, linux-pci@vger.kernel.org, linux-arch@vger.kernel.org, Sean Christopherson , Paolo Bonzini , Tom Lendacky , Ashish Kalra , Joerg Roedel , Suravee Suthikulpanit , Robin Murphy , Kevin Tian , Bjorn Helgaas , Dan Williams , Christoph Hellwig , Nikunj A Dadhania , Michael Roth , Vasant Hegde , Joao Martins , Nicolin Chen , Lu Baolu , Steve Sistare , Lukas Wunner , Jonathan Cameron , Suzuki K Poulose , Dionna Glaze , Yi Liu , iommu@lists.linux.dev, linux-coco@lists.linux.dev, Zhi Wang , "Aneesh Kumar K . V" Subject: Re: [RFC PATCH v2 14/22] iommufd: Add TIO calls Message-ID: <20250305191828.GD354403@ziepe.ca> References: <20250218111017.491719-1-aik@amd.com> <20250218111017.491719-15-aik@amd.com> <2fe6b3c6-3eed-424d-87f0-34c4e7e1c906@amd.com> <20250226131202.GH5011@ziepe.ca> <433217be-55e3-477b-bc10-cf81f02ab21e@amd.com> <20250301003200.GQ5011@ziepe.ca> <4ae5eda3-824a-4bb5-b763-19083c085575@amd.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ae5eda3-824a-4bb5-b763-19083c085575@amd.com> On Wed, Mar 05, 2025 at 02:09:09PM +1100, Alexey Kardashevskiy wrote: > > > On 1/3/25 11:32, Jason Gunthorpe wrote: > > On Thu, Feb 27, 2025 at 11:33:31AM +1100, Alexey Kardashevskiy wrote: > > > > > > > > > On 27/2/25 00:12, Jason Gunthorpe wrote: > > > > On Wed, Feb 26, 2025 at 06:49:18PM +0800, Xu Yilun wrote: > > > > > > > > > E.g. I don't think VFIO driver would expect its MMIO access suddenly > > > > > failed without knowing what happened. > > > > > > > > What do people expect to happen here anyhow? Do you still intend to > > > > mmap any of the MMIO into the hypervisor? No, right? It is all locked > > > > down? > > > > > > This patchset expects it to be mmap'able as this is how MMIO gets mapped in > > > the NPT and SEV-SNP still works with that (and updates the RMPs on top), the > > > host os is not expected to access these though. TDX will handle this somehow > > > different. Thanks, > > > > I'm expecting you'll wrap that in a FD, > > A KVM memslot from VFIO's fd similar to gmemfd's fd, and skip VMA? Doable > but 1) creates a KVM->VFIO dependency to do gpa->hpa translation 2) is not > necessary in the AMD case (although host-mmap of guest-assigned private BAR > is way too easy way of shooting yourself in the foot). But since it is necessary in other cases, the code will be there and everyone should just use it.. > > since iommufd will not be accessing MMIO through mmaps. > > here I do not follow, why would iommufd care about MMIO? or it is about p2p > DMA? Thanks, Yes, p2p dma Jason