From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 5BEE4250BFB for ; Wed, 5 Mar 2025 19:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741202313; cv=none; b=fg0n7zJLkTE6fW8nCJhrWVntoyOgHXr6LJgjRlpC+azpUWSuBp53wNAYAGAYJFq6RZPNGFupRHo8KDvOYoeEACUVTLrE34n/KSiQ8/i5PbZENJENBjNakz1YiJT5gVUjaAW2inxoC2i+N5hrnX5aOmuSfyhotnQhg2d6LOfRYXY= 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=Ri5MkLza; arc=none smtp.client-ip=209.85.222.180 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="Ri5MkLza" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-7c07cd527e4so635351685a.3 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=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=C7y/oLdinpDpvBC2aTZl0N56MEM+KgeXEJqvXNG5yTE=; b=Ri5MkLzaGreAbObP73Bg0DUXzSzTK6q/AiY/Qa6v6PeP7iAXQpiD8TsWAceA6vex1W ZBne8M5S7QeyS1lAJrLeL/NHUiLL2cbx2ytZc02wOOxFm5jtxDwmpNXnjMEw5RTBAYwH HU7E6CDaRtRYNyEJI2naFRsz0LoDyP3H37eS+JFqTcjNbBrYcyyl5CbnakIT/l/oyZwQ bbYNBDepJcuWmmx6z06u4SrMjCXnZUHqIsw21E/W+YRUHy3IR8aXhbE4Vr9pXf+NEHO7 6rTGw9W3SpnjoO5kIhkjo6sAWEWCzWU5Nbvy5iKrLHt8blHyqJ6NPT/96U81+MqS8I5B Rnag== 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=BpXlyaG8cFECiKjePmDjiP3nee7iNTDQhKMtcg+PLbpCKE73JGMbp3PQAXXD81UmOm FKXXynArYybUJKmwi5ut2123q0o8CSPsN8RiLoEvuSWdGKsilJitij9+0i45ZuirXEBz 3tl9/FCl3XtkNPwWMBRRrpz6My+6dAnU7d0XIYnQIEmFuKsHr6NlKqGcT2LnM1ggpl/f CBY+TZyCcC4EmE1SK7VcRTusT8OiYxhI1UydPfkzjaf2jGp9qG/+ir4M8P3IJTC/GPNA XJKr15R6hMx+xfCRJSWtjvDcBQ84MzE/RaMMkQ39aBQ3OK13ATpRokfT656ZGbDXIeDh mLNw== X-Forwarded-Encrypted: i=1; AJvYcCUsHLfJWn792AUr5UV1CfEkcYQ4vn5bATz72CLCWlrAu8+zinxe453niZ3YtlCGf1U+/jMSWmx8zQ+dJB8=@vger.kernel.org X-Gm-Message-State: AOJu0Ywz13p1/+4ixVnnYMBeye13w+B16GFThjS9s8tWsNohSzdPFIva uw2gy8N/O5a+CUxS2utpmo5rWmrrUC4kB608GrH/JYr2D1kqGGbqzx2Wi509fVM= X-Gm-Gg: ASbGncv3oZVn9wnJQBs5d4e6XAAfAKydoGdPxqDT/xAssIkgbkIlcn+DX4tJ4u/cOOT kQTq0ffS9uLpp3G8Oc0dBeVsNU5cLl4kvuWSBOrQGTw/jAXYviVJ+1w1heyLPaK1LUV23yvmucp kPWGqiwv757Z+YtQLDbWVV+t9hAV9PsWgaTN4vdY5Otm1Bt9lA6xgFGWlJAM+2A897HjOIR0IOh IM0pkYOM0doCaNB3b0xODbd5z4VSveVidw1wJaQqxdHTu3trd2LP847Iy54ADxxoH/xleA8FfxS ms5VPu6tPJDAFWUrwEQMIwiWRjaBkB/REg/VLzj34icyPQ15/6DVAU+15wWLwC0ZskcB2v2JArf e44zp0xupgrCcd2woww== 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-crypto@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: <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