Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1021530rwb; Wed, 16 Nov 2022 10:48:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fN6dDQrlcT7fxIyTmTQqmZrUzA6TLPoYtTasEgE/eDVNrbB2cNXpIjeI+05HTgekW7hSP X-Received: by 2002:aa7:df95:0:b0:467:6035:285c with SMTP id b21-20020aa7df95000000b004676035285cmr20037723edy.386.1668624495077; Wed, 16 Nov 2022 10:48:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668624495; cv=none; d=google.com; s=arc-20160816; b=Ta8kYbVMWBGvLWsIOP6izmK5xX2ddrUsk12BhNTSMXWLs43i+g/ROzlpsPnbmk3VUj fVj9joj05oZqrkchgqSKUwaUMZwPptQdjitc6HJY37iwX/dl6b3HX3vSix5KE5cKvZSw /ORkmJiX7hQZOe3fsc4lxf1r2nWMHG64eWXISu3omTpuCje0oqRmKf4qUYPuC18dr9gV BmkD6WSzTo0AcDpXF/wxvPtZeNEte+yYtBMW0FNNToOGFUshm6ljJfK67oPkwmL0+MxY 8P9t37Nw5os+BtfQsqeiu56TJ25+6Bqb/syaf+J1qOCfoodMvIHjaM3OKNhmzlqMEST7 gT5w== 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=Ms5H47kTpr48KRWEJSYgNO3SJlSnLGzl1g2kZ6eGJmc=; b=ZFxk8wfalvZHIzczq0pH+0LaQvOP+KN9GPk59tQ9G7M/TuNcrnAfaqoeYTbT2yROiw 9TSCYhcEhlykS617nAlgj/pqumEgNA8s6GXZi+R6X/NoBW+xfDoKnrL4jmHuWBMVZd2b fq4XyfxoDF09oLrS+HhjLEDFe7nSLh8hGYAXNMr++u1IKCyl7J8HslZANE9Yp3Mwqe6y ICF/qxpOrfdZJKT3P9DDDYV8L98NCOt+Z2N19xsbmBinxV+4/83n9/ljaAqQF8oCLewu pskg6jkxrZZCJDuC+5tTf9QenpruCk3N+Dq65XTWHK8tPjjRLQP1ztvh3wFGw9G6chTz 0VUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ZvkX+n9j; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq34-20020a1709073f2200b007adaedb2f14si15918250ejc.866.2022.11.16.10.47.40; Wed, 16 Nov 2022 10:48:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=@alien8.de header.s=dkim header.b=ZvkX+n9j; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239217AbiKPSdj (ORCPT + 99 others); Wed, 16 Nov 2022 13:33:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbiKPSdh (ORCPT ); Wed, 16 Nov 2022 13:33:37 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E0D115F; Wed, 16 Nov 2022 10:33:34 -0800 (PST) Received: from zn.tnic (p200300ea9733e74b329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e74b:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 22CA91EC0138; Wed, 16 Nov 2022 19:33:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1668623613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Ms5H47kTpr48KRWEJSYgNO3SJlSnLGzl1g2kZ6eGJmc=; b=ZvkX+n9jOMsxQsBufShjvTUDKX6y1XF7McZHTcsLjyFgqo04Ix83CRkbmiA3mCbdMiOAGt 0wuDhCO9kMb8aXQkzWvWJtgBz0O1pvo4l3RRkziC4O6DSODhtg9ae9GGVcTY4fxs3IJLiQ EmRuHlwmOO7hZDcZ/p5j+28F3Pv3bas= Date: Wed, 16 Nov 2022 19:33:27 +0100 From: Borislav Petkov To: "Kalra, Ashish" Cc: Vlastimil Babka , x86@kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, dovmurik@linux.ibm.com, tobin@ibm.com, michael.roth@amd.com, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, jarkko@kernel.org, "Kaplan, David" , Naoya Horiguchi , Miaohe Lin , Oscar Salvador Subject: Re: [PATCH Part2 v6 14/49] crypto: ccp: Handle the legacy TMR allocation when SNP is enabled Message-ID: References: <7882353e-2b13-d35a-b462-cef35ee56f51@suse.cz> <5b27a05e-09ad-9139-67b1-77b90731419f@amd.com> <9d9f1afe-c981-4df9-f012-89c4cb783cc3@amd.com> <973c6f79-38ad-aa30-bfec-c2a1c7db5d70@suse.cz> <8692e736-7518-d6d2-ae83-720e42e7a059@amd.com> <41b8c83e-2a1a-1dda-945e-99329ca8e7e9@suse.cz> <711e6027-1b4f-4aed-47a6-305396d05893@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <711e6027-1b4f-4aed-47a6-305396d05893@amd.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,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-crypto@vger.kernel.org On Wed, Nov 16, 2022 at 12:01:11PM -0600, Kalra, Ashish wrote: > Ok, so i will work on implementing this leaked pages list and put it on a > sev/snp associated structure. See __sgx_sanitize_pages() and the poison list there, for an example. > Also to add here, we will actually get a not-present #PF instead of the RMP > violation #PF on writing to these leaked pages, as these pages would have > been removed from the kernel direct map. So if you do the list and still have the kernel raise a RMP fault for those pages, traversing that list in the RMP handler to check whether the page is there on it, should be a lot faster operation than doing the #PF thing and removing them from the direct map. And sorry for misleading you about UPM - we were thinking wrong yesterday. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette