From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (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 3494E217F27 for ; Fri, 27 Feb 2026 13:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772198299; cv=none; b=p8LM3wSuOUk4kpwHo9Wr1ysw2uDa0um856Ow16UmCmTrb3/YVCoM2F5Q81rIjHZQhvkvnknZsoy4JpsgLPhq2jKT4MHFsS395zGi8Tdjdm5JtGtk4Jz1OsI73kaQEb9bKTNvVjnL2LYXbu74Uad9L2kaB44yWWibEPTaryqoX2I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772198299; c=relaxed/simple; bh=L/z+htTQOMeMfJb12gYYUmgCXubeh01T5SyfZ35RqHM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H2RjAA5w5a3yiVmJp/ZwKsh2zLtk99zjwJycOTuFit7kaq+e5I2RUNIjjGwxNYqWmLgAyA8gjKhwHlFjdlKyUYeNdpEwjSNlH6R1AeL4k9G3zDRwSQWheSi6maVNSuqAW5Mbj5AzhtJ/WKzvi7XIJc9sY86c1GJ501P3YrH88p4= 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=TMAwo9wv; arc=none smtp.client-ip=209.85.222.170 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="TMAwo9wv" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8ca01dc7d40so217376585a.1 for ; Fri, 27 Feb 2026 05:18:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1772198297; x=1772803097; 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=L/z+htTQOMeMfJb12gYYUmgCXubeh01T5SyfZ35RqHM=; b=TMAwo9wv+dExDGFp4UwRCJP+rpamtM+oNeploNYGVTHlsakzqWbW7BGsNwH+l+Qjax aT/Ed9EQKKpaPmEt/wOFsEQCXo6sXxPjRmcHduTB+lX9RgoCmaSmsNu3aoG1jDvnTUw7 zoZFK2tl563vYEY+hag0b4PT4MDomONLI9PJUTec86gg35zvXzL/zVP+Budinlt6XYKg SpqaQ3b++uIV8Lxxr8nsHM7WAP3HW8oLGBble3AbwEO2LPDP12pQq01b/0oM5pylQUHi oxVxwRn6HvyboTX1KeZNLYEypahL4anBxmuZ2eOfaX60jhAw6hYeSbsAifiMc6H85d7Q 8J7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772198297; x=1772803097; 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=L/z+htTQOMeMfJb12gYYUmgCXubeh01T5SyfZ35RqHM=; b=bvuCaCyqE6ublg4wb3dqrrOfH5xY2x0tJNUeQ7GYuocoN2VgwgtUe64MHH4xZQxbDd TM0RJVUM1hgeyhc1sgWJOYALeqSDp/dxbOZT1hQzLjgNeOzfIkvb+JKeu+LZjjvfFDWz mLxJ1r7KzMPCmXCYtMzE+clkFATA50805ZzQMZXaeNwjBgs72YwtdDpnJ/W5eeR4Fj6g BojQMxcLiHlvKp+8i1koDNca4XkyjOWFI+2YCstJ86xkKNFUGTki710U3H3zw043/YFG Hyh1T79er9AQIEystbrqgMVBJ1oR6/w9RsYK7TIE0VpRW5+/Tu5qU0P01WwpAIAxcJ8b eT0g== X-Forwarded-Encrypted: i=1; AJvYcCXX/rk9GE6o6c0z2Dbg1sd+IzwPBIglUYLGm3+4N9vco+Y5qt5loNvThJB24rh0dQz0xK6c9UNNf24GjPs=@vger.kernel.org X-Gm-Message-State: AOJu0YzZs9Qdc3do0wmid2jk90iSw+xpY9M+9dFhfvXel5Rsuksncpml 5UlGPWmuW6OjokpU/Q204fgX3AtAZeyC1LihJH7kJ2LYnA7KTlI/YJ3fuixkd2gKOlE= X-Gm-Gg: ATEYQzx6Eq6SU+ohkZtpxeUtx5agY3yq44wOEOso5xjUo/roc+pIs51c9yQz0/3NQtT 2NEhCoeiEAyY+fEpKYJ5DsQSYPtjPM5pBxf/cFFOaLzWCQJKe9P4Z2/5o5MNpnqd5wpmkNct2AQ zaDJSb6bytI+ke2NQ6dyBCLSpmMDuQ0ihECLtHmjs4N4pVspmJU6LqwVaZ0OanS+ypFCnVXiIq9 z3BYktChumoHEt4ysT3pWKNwz6bTCBKgeGS2uUdki1prhz1eE0jQCbYZxJu7sthCDirUuP6OTOq TYX+t9CX29mRK6lsW0JQP7+U4w3P/FY/m3pKh+vPoj3V7vHXaEYnejPwWkDLIK855oIMSDtmHU5 lV4scjDwD66yKEPEmWSJu8vS7IczOwkKXZElVSmi5UmX8GWdgjFPz3HZmbderdGwDOujVA7Pl8t xFQ6HmGhwkriBNd3Zo1JlBinPf8gWBzbcdbd9VkUlq60kx8QwLC+0441uZ/tH31D68ajrS7qUpP RkhaJkVKuz1sPSBBnA= X-Received: by 2002:a05:620a:4891:b0:8ca:2a04:3ff3 with SMTP id af79cd13be357-8cbc8e8096amr324078985a.30.1772198296803; Fri, 27 Feb 2026 05:18:16 -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 6a1803df08f44-899c7193227sm41395436d6.21.2026.02.27.05.18.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Feb 2026 05:18:15 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vvxjT-00000000uvx-0Dij; Fri, 27 Feb 2026 09:18:15 -0400 Date: Fri, 27 Feb 2026 09:18:15 -0400 From: Jason Gunthorpe To: Xu Yilun Cc: Sean Christopherson , Ackerley Tng , Alexey Kardashevskiy , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Paolo Bonzini , Steve Sistare , Nicolin Chen , iommu@lists.linux.dev, linux-coco@lists.linux.dev, Dan Williams , Santosh Shukla , "Pratik R . Sampat" , Fuad Tabba , "Aneesh Kumar K . V" , michael.roth@amd.com, vannapurve@google.com Subject: Re: [RFC PATCH kernel] iommufd: Allow mapping from KVM's guest_memfd Message-ID: <20260227131815.GG44359@ziepe.ca> References: <20260225075211.3353194-1-aik@amd.com> <20260226190757.GA44359@ziepe.ca> <20260227002105.GC44359@ziepe.ca> <20260227010902.GE44359@ziepe.ca> 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: On Fri, Feb 27, 2026 at 06:35:44PM +0800, Xu Yilun wrote: > Will cause host machine check and host restart, same as host CPU > accessing encrypted memory. Intel TDX has no lower level privilege > protection table so the wrong accessing will actually impact the > memory encryption engine. Blah, of course it does. So Intel needs a two step synchronization to wipe the IOPTEs before any shared private conversions and restore the right ones after. AMD needs a nasty HW synchronization with RMP changes, but otherwise wants to map the entire physical space. ARM doesn't care much, I think it could safely do either approach? These are very different behaviors so I would expect that userspace needs to signal which of the two it wants. It feels like we need a fairly complex dedicated synchronization logic in iommufd coupled to the shared/private machinery in guestmemfd Not really sure how to implement the Intel version right now, it is sort of like a nasty version of SVA.. Jason