From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 5EF74251781 for ; Wed, 5 Mar 2025 19:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741202313; cv=none; b=Cc4Dx3HA1u1N/ZgOhPdeoeXKimBki5CIzYXDqgqgn3z9Yn5er2hlxmyWEDmdO0YpqGxB0YtYhy2ShZqQP+gUTU0yb8ZURdTuo66uSjnq1SBhwjM+xREAVmUJqO8K7/YiNPZ+Op33KPGR/c0PDS83w3OvWn1p/hx/G616J/M3FgQ= 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.179 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-f179.google.com with SMTP id af79cd13be357-7c3d591e50aso209956785a.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=Zv9z/2Ye+1KuLqkPSsKLK8ArfBCsDrHVJXvLlLSGZa+f1LCwJXzSs0M38gOPymmZ0f 3WYrkcZG5mMMUqVilYj5Bhud+0OBz+jyG4SsMIIJ0yQ+rDLagSABlEa653HOvV9vojeY tWhPP4bTzU+r8nBJ1NpUI74DOXK0gzvTE/KkIT4nS6WohvxdXXSiiq6o4QKcomFp5v1o 9X14wgmrXG82shp+gWecJgnpnMtBp+zKABHA0e1DSEJ9KZWpEniRTne09vdD8WUeEnOs 8Py3m2cwUSt5m5EITi3JcKA+cj+giDvz6wiEOllestTK0XRmLZj7xMUrwiIFaZrSVedo smpA== X-Forwarded-Encrypted: i=1; AJvYcCUUJIeNQxdD2ULk7hzzYbCNYK0xqs1PHfYV0AEtK8cCQ6rEi3cn4ynT8Itd7nuifE94WD4T8g==@lists.linux.dev X-Gm-Message-State: AOJu0Yy+6W1lHFlq77tHW6pgRkdoV4CoG6Yxdd0M28h5wMptzv6YMK7e VJjmAMdOOYH/O3ta+PsFzwNdv+qUysa8W7qIKH7IJpYYPKR9t1uqJ8wlCMHti34= X-Gm-Gg: ASbGncvHlBAqTEnT0sMUgiJsonL4JitGGccSCWHMOyCJfQvW1gpxO3VbYQBN7PmrZzC YBVCHpjVx+7do491iZPynj8wWvlPU802B1GqWQWnGsqRQS7a7wAvYRbhNihGbj1m2Y3GgDYsVjV RfJyHkPdxW0RuXMXZARj3VpziNzHuoiSjObr5KYt0Bxt9LoVUKweUIBiDj9X+A4Ih2sBHyBGmzG lSR2G3A/kU+O4XUf1RRuXmB5C9JTaXotzwuj7PJE0Kwo5vs2BAvVm8WBQ0F4Bi5iMZndmOS6sBI Uzy7rat7gHZ2L08cbJiJ6PS0c2/g01IDkYcjatngjgDKbYtMEPxZlulXsoR8BKInJuuLhBDou/d Sbhz8ugNglOT3h+fPYw== 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: iommu@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