Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6223795rwl; Thu, 29 Dec 2022 09:13:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXubESGJuTdxO5x96y9w9pJ9mBhXB3/rej+/xGseBCA+vL4c+i0UKWEeireE6peoz5BFUnN3 X-Received: by 2002:a05:6a20:7f44:b0:a2:43b7:98a6 with SMTP id e4-20020a056a207f4400b000a243b798a6mr29244931pzk.10.1672333992452; Thu, 29 Dec 2022 09:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672333992; cv=none; d=google.com; s=arc-20160816; b=yfmDUXiXfOpPuK9YmWnjVeLCFL6q7M5FUhyZnzmtniTSpxeal6/6Q/11dOzD88zU2D TZmeg5ZjEHmK12ZLnZyce9fkbPuAr5vixyj77REac3e+R6qZx9E3JtBISUQcC8Tkfs9j NYNqgxApD3ayyeGYmHyHAEBkHUlVlUGj3UqZVPqNz8xzl0OVGJJVJjpdLOPYNbND1ZiO KLQqbid/MbQFsDDqEEEREzV8+xFFo0L2PoZZzvSU7cUuLhT+x8hswMlGuIUeNtFGPHkj CL3e5pOVY8X23Gns8Uk1xJQsAjBOfbIFQGtzIcggoNkHDszQebUXUCaiVEIltwKma+4t Brgg== 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=+OOhnZUur7/65XYNN5FmieX2LDevIBg+5FobdbkM0V4=; b=d2addzzdM5A79TsYZ/olVqUcnx5ftJ64x0Hgo6/h1nz52B4TZZjVdA4DZ4Kb5vHh63 iYztPpv3pBqR42y/1OIqbJB1Oj18u9L5HpKrG5+zQP/H0GfwlFltEeEXzPPyMgDSrw/D WicuUQmRwKPKa0+0/hQI6yBVeei0Ddzk3APwqbj2CqaCghkrbK4UdPWLkn6CkFPrF7t+ +waTS6gZADE0tEkgywcEAlHYApVShFpkbuBEQabLE6vBk/AuNMhoEwmW3fpZCrmyoZI4 h13j/Fp1xIAM93Sy75yydGTbMp76gPf24eserIOtfwSCI/eKVJw2i7eOtgO7+oeS/uo+ qyNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ZZ5a6aHw; 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 c4-20020a63ea04000000b0046ff26f21f0si19164793pgi.503.2022.12.29.09.12.49; Thu, 29 Dec 2022 09:13:12 -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=ZZ5a6aHw; 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 S231383AbiL2RJp (ORCPT + 99 others); Thu, 29 Dec 2022 12:09:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229773AbiL2RJo (ORCPT ); Thu, 29 Dec 2022 12:09:44 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEFF365FF; Thu, 29 Dec 2022 09:09:41 -0800 (PST) Received: from zn.tnic (p5de8e9fe.dip0.t-ipconnect.de [93.232.233.254]) (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 36C1E1EC01CE; Thu, 29 Dec 2022 18:09:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1672333780; 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=+OOhnZUur7/65XYNN5FmieX2LDevIBg+5FobdbkM0V4=; b=ZZ5a6aHw8mkatXdcTQjTIBD0qcmeQny18h0PJgtL3SDF/M34eLTxnFU2ln362VqwAnk9cW HmuFwJeKmNCRp8KTd2O86F+ZNQ7Zb2KrYhShQl84Tbw1xAmuPzmUh3VGZhvASwYz38MQrL lWkFhXIbJA9GKPkwwHAxZXMwVNKAGuE= Date: Thu, 29 Dec 2022 18:09:35 +0100 From: Borislav Petkov To: "Kalra, Ashish" Cc: Michael Roth , 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, vbabka@suse.cz, 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 Subject: Re: [PATCH Part2 v6 07/49] x86/sev: Invalid pages from direct map when adding it to RMP table Message-ID: References: <243778c282cd55a554af9c11d2ecd3ff9ea6820f.1655761627.git.ashish.kalra@amd.com> <20221219150026.bltiyk72pmdc2ic3@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Tue, Dec 27, 2022 at 03:49:39PM -0600, Kalra, Ashish wrote: > Milan onward, And before ML there's no SNP, right? > there is H/W support for coherency between mappings of the > same physical page with different encryption keys, so AFAIK, there should be > no need to flush during page state transitions, where we invoke these direct > map interface functions for re-mapping/invalidating pages. Yah, that rings a bell. In any case, the fact that flushing is not needed should be stated somewhere in text so that it is clear why. > I don't know if there is any other reason to flush after modifying > the direct map ? There's /* * No need to flush, when we did not set any of the caching * attributes: */ cache = !!pgprot2cachemode(mask_set); Does the above HW cover this case too? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette