Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp513290rwi; Wed, 2 Nov 2022 14:47:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6y12C2dJT813Zqx2uYWUIs7spaoA3WPlVuRFyVhZoR9FI6OIyh6MmZdHiU1Eoe3bOOdx9e X-Received: by 2002:a17:906:7949:b0:7ac:9917:90b9 with SMTP id l9-20020a170906794900b007ac991790b9mr25436352ejo.536.1667425656786; Wed, 02 Nov 2022 14:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667425656; cv=none; d=google.com; s=arc-20160816; b=lYZMaL+H7CJlvisUhsp8TKwJyOaZVYzRz5NlSEL8nACRZvPf0GJQ2xcVCcOyPr6GIC Nkg3+xcjzvhfPtbgFU92ZqD4RjqiXyY6xTXakFy5KzwCpebr1RuIbi0dOIM9ZjFhrfS7 eAkoseHvr+OT6uKBqAcvdmtvmxaA8xAcZvcvoq9CFaywcJB5CPHbXC+yccU0UDhk57RS aud/7QNkXGhS73PP/z+uWFY8rrT+tPkfCMwCT5+R4NYnmvC54xSFfBdCfbvLgWFdIxW/ xfn6acNKQs2Q8Y+jwtkUJtXPJUKKRWxSUYAVpUOobpEec+q2cSeSMszK/O4d1/Z0WW+G Fq0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=yaz7HB+tA0RP33F5tMpk/jLLItyrZaFvVEGA2nFMTHI=; b=DVCHu+YuawRh/XgRXgAq33ECWGPbwboVCxUxoiB6HXxQRMICScUFma+01fFZFxZE4i hmW4+kxPb81wfCXThVzua/Ch3AY1CjKinsw23luzHJyFG7GHxeYJ2AM/ii9R7JPDEIWt Zo7VV7QvoHfik5Q3CtEHieVDN9BwbvvNRGN5cwIAmB2qVnTXmwsZvTyY8Fxa0FoeGuIi io+o2bc5MX0/22A8eTjF8ELxpOzyk7zHdL8dkPD7sF5NeEt5BUZKWLdzWmS/o66YgIZO 6nW8YkbMRsp+wgYmO8ghtTK4QJTCJnAvx0FPB/CjrLbbCfC88fgXJHm/NL+xVvtSkIir AA5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm2 header.b=Ky05TEuW; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=kXuKgSJS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a05640234c300b0043dfc949d31si20294803edc.25.2022.11.02.14.47.10; Wed, 02 Nov 2022 14:47:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shutemov.name header.s=fm2 header.b=Ky05TEuW; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=kXuKgSJS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbiKBVOa (ORCPT + 97 others); Wed, 2 Nov 2022 17:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbiKBVOY (ORCPT ); Wed, 2 Nov 2022 17:14:24 -0400 Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06AABBC8C; Wed, 2 Nov 2022 14:14:14 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id A8C8E2B06827; Wed, 2 Nov 2022 17:14:09 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 02 Nov 2022 17:14:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1667423649; x=1667430849; bh=ya z7HB+tA0RP33F5tMpk/jLLItyrZaFvVEGA2nFMTHI=; b=Ky05TEuWIr83oUh3MP VKNL8ENuHV9gUlhetBL9nyBnWkmhW3b7eJIJQvsEX4i8mrWKj7fAD2YoYyBb89E9 ISKn14UJ31abDLZFWzZCCaQnTLi78oerrmjr+5hmV9sA3hFI3L8ZV1Kiu7AX9QXR PDBaluynehd9n3eiw+gtrXx+RWa959jyR7nphlxGnum8rHgJTzq02ZExi1nIGFid EJO+kCiPv0YbKVpF7c2OrK1fuI/2gu/r+1T0aqwqS9P/ypb1+DPbh35ga9d9WHYp FylKYS+Rg2UR7pBcU7lZ5OPVMq4ERDjJJCu0ll46FiB93Ht82Uh6f5WuN9oIyHug tC5Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1667423649; x=1667430849; bh=yaz7HB+tA0RP33F5tMpk/jLLItyr ZaFvVEGA2nFMTHI=; b=kXuKgSJSeQyH8zkQnQLj2ogT1FjQ404UQUbzOXrHjtoL O5jybhnZTvUTvWSm0JarvjTauAp3ZsZ+r+wmdYPHpVddWzaXL8v+kKFMg4LptKuU za4Nn6AFZHdJ8Ew6kOJjOVtyV+RbvW0VGJP+2xRX3dEy0QIR7itrmJOonvxViJoT AoF3E4PNZiUZ9aaP1YucG7Uv9v8Eqwth9//su3HfO8kpjAFt2r6d9BaJJidv+bKw mNZEQxt0P2yMJj0u53Zl8vkHso9nSQJzXMgYh5xL1AvTD3D0XGhltZ2SmyCHlpRE TQHb95HDxl2N1T/q559g2R0z+nX6Aaenk06fEmM9mA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrudejgddugeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Nov 2022 17:14:06 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id 5751D104449; Thu, 3 Nov 2022 00:14:04 +0300 (+03) Date: Thu, 3 Nov 2022 00:14:04 +0300 From: "Kirill A. Shutemov" To: Michael Roth Cc: Chao Peng , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A . Shutemov" , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , tabba@google.com, mhocko@suse.com, Muchun Song , wei.w.wang@intel.com Subject: Re: [PATCH v9 1/8] mm: Introduce memfd_restricted system call to create restricted user memory Message-ID: <20221102211404.l5whyif3j3k67fv2@box.shutemov.name> References: <20221025151344.3784230-1-chao.p.peng@linux.intel.com> <20221025151344.3784230-2-chao.p.peng@linux.intel.com> <20221031174738.fklhlia5fmaiinpe@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221031174738.fklhlia5fmaiinpe@amd.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 31, 2022 at 12:47:38PM -0500, Michael Roth wrote: > > In v8 there was some discussion about potentially passing the page/folio > and order as part of the invalidation callback, I ended up needing > something similar for SEV-SNP, and think it might make sense for other > platforms. This main reasoning is: > > 1) restoring kernel directmap: > > Currently SNP (and I believe TDX) need to either split or remove kernel > direct mappings for restricted PFNs, since there is no guarantee that > other PFNs within a 2MB range won't be used for non-restricted > (which will cause an RMP #PF in the case of SNP since the 2MB > mapping overlaps with guest-owned pages) That's news to me. Where the restriction for SNP comes from? There's no such limitation on TDX side AFAIK? Could you point me to relevant documentation if there's any? -- Kiryl Shutsemau / Kirill A. Shutemov