Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp468216pxb; Fri, 16 Apr 2021 09:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzMihLxDOgox2vTPbjgjGJdzPFoMk0uFYekYCwy/3BC1Te7A6auDFcbsCDtp1/yZyRv72V X-Received: by 2002:a17:906:f210:: with SMTP id gt16mr9236032ejb.22.1618591818873; Fri, 16 Apr 2021 09:50:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618591818; cv=none; d=google.com; s=arc-20160816; b=zVoWng84w5MgZC0SgOatvvItY3ecCgfySsvH4c5GrDriiQSaqAGltxmhPrc+to7461 UiIJlMtEYX/2YEqEYiBzkjpP868XzVMxDZu/YhcwtxsvSIppvPycvcLE9AMvffWpf00x Tn7vo/k/nhJT1xiS5iHq5IwubaeIhwsP+MPt1TGCsDw7vsOdukMZUneagHJYlyCGMXcu VudKuqIs6OtKv/7LWc5AiMr4rv0mUrsgvuR6WxJdJyRP5en7PbvMstiLU6nwxMeo0DQl SM15e3Sah3r++mX9O9xXA5pmP9E0F/FOokU5r7nTDoI5+25kKt4dber2fkW0L50bKrK7 pHbQ== 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:dkim-signature; bh=BxSXtPsAmxUFlWPdD98J/97elcMLJtVAfMQiYC0wrec=; b=cC+iQ4wkHRyR++DWKzKnRRmEzCdZNYML9fWE+6U3wc1n6JPKf3q0gqi5t9qn45d/Cl WMxOcF9Jn4X0Q5xAj9ABCuPR2Bs/dfjJQtSgYIUBUQT9JY7TSl9iHdl5lUyJ0IY3kOyb Q//ig1j6hhddQfgqjCbg+/znD5jkaaWYWplZm+kYTwYrU5bQSC3VJ4W4G7+ArASGGsfQ vJe3EVWd1AYhwmi9d/5yaDszAKSE4TN7DMnlRXoAhbxveEs+g2lomu7vD6re01pLrMss oPxVQiqcnpk7+S22TyZb7OFl3EiKyJlqmbzZkSt+AwDEN9Yh6h9l5ZbFQRVSsoEzLDle wv6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nS9gVgOC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si4938768eja.117.2021.04.16.09.49.54; Fri, 16 Apr 2021 09:50:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nS9gVgOC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236487AbhDPQqy (ORCPT + 99 others); Fri, 16 Apr 2021 12:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235595AbhDPQqx (ORCPT ); Fri, 16 Apr 2021 12:46:53 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 947DBC061574; Fri, 16 Apr 2021 09:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=BxSXtPsAmxUFlWPdD98J/97elcMLJtVAfMQiYC0wrec=; b=nS9gVgOCNBVzeS3pqL5W4rnkMr aJPl02WUaeZA81Upi/OJP409n6KoLw5d8mcWR1zbyR3sRlv3hWbP5IATF7arA4qjeE2dYjUz7jtk2 hkT9rqZA5KXsM3f1MBCDH6wckYcadrBJOeTcSh8a5k8zp1u40wZMEEl9OGDBA8wtTBBeKEz4IcJTO IDPmCDeLvJRDctFn+NglDOY+rpPbvZODAksJGozKVR0R1K36mHGFor4GcQtHcTvdAmP0oR8h7+DxW aNZcG/TM1aoyO6aSzAv0HEmqXT426M26Ii64sQNZv6AB8/hqbY68PvJKE2sTrzV7PK7iDrulkxgsg WC+0UejQ==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lXRbW-00ACjP-BC; Fri, 16 Apr 2021 16:46:04 +0000 Date: Fri, 16 Apr 2021 17:46:02 +0100 From: Matthew Wilcox To: "Kirill A. Shutemov" Cc: Dave Hansen , Andy Lutomirski , Peter Zijlstra , Sean Christopherson , Jim Mattson , David Rientjes , "Edgecombe, Rick P" , "Kleen, Andi" , "Yamahata, Isaku" , Erdem Aktas , Steve Rutherford , Peter Gonda , David Hildenbrand , x86@kernel.org, kvm@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFCv2 00/13] TDX and guest memory unmapping Message-ID: <20210416164602.GN2531743@casper.infradead.org> References: <20210416154106.23721-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416154106.23721-1-kirill.shutemov@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 06:40:53PM +0300, Kirill A. Shutemov wrote: > TDX integrity check failures may lead to system shutdown host kernel must > not allow any writes to TD-private memory. This requirment clashes with > KVM design: KVM expects the guest memory to be mapped into host userspace > (e.g. QEMU). > > This patchset aims to start discussion on how we can approach the issue. > > The core of the change is in the last patch. Please see more detailed > description of the issue and proposoal of the solution there. This seems to have some parallels with s390's arch_make_page_accessible(). Is there any chance to combine the two, so we don't end up with duplicated hooks all over the MM for this kind of thing? https://patchwork.kernel.org/project/kvm/cover/20200214222658.12946-1-borntraeger@de.ibm.com/ and recent THP/Folio-related discussion: https://lore.kernel.org/linux-mm/20210409194059.GW2531743@casper.infradead.org/