From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3AFFC433ED for ; Fri, 16 Apr 2021 16:46:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9155611AF for ; Fri, 16 Apr 2021 16:46:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236924AbhDPQqz (ORCPT ); Fri, 16 Apr 2021 12:46:55 -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/