Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp981709rwi; Thu, 27 Oct 2022 09:41:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6paNhO6CMm9k5p4hEPbGbJvDo5UOSWBhseSoboRobL7ikXxv7apEeY9DkEA1y9NTyL2+R+ X-Received: by 2002:a05:6402:26c5:b0:45d:21fc:19e4 with SMTP id x5-20020a05640226c500b0045d21fc19e4mr46888032edd.117.1666888896165; Thu, 27 Oct 2022 09:41:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666888896; cv=none; d=google.com; s=arc-20160816; b=Wx2c0ENYJK4mXmAtid7CbpXLnItdMdvAVeS4VZ+TaBruiBq4IJ+pzDtePlBAwm6kFY rq3wtGjAsLrHKQU7sR5+CjOzpcJtX+CgYJiIcyxRVv1+pPw3xxd4mazgxJBp1QvYRaUE LOyRsrkpihEzPCjQsr4aH27+xwTCigzmERJfMTxPSg595UzC9ZzhO1kVd9AurSyKlRwF 2xLqPJogLlvBOM4h7x8N/jj/veSOE0Lo4A6qRYt4O3ELPtw3uJqmgRi/FAAZk127UP12 BhZJTOIpAKnaGgL3JlSgnwk1CaaDuJjxWkM/RqBMTCyRdm/W8ijpppFf6Dei41C4fCVA B1XQ== 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=o5hkvVaAtguyvk+k1KB1ZUt++tlUO5KVc3yFFqeqwX8=; b=p8APnifxgd6JN2QkJL9sOWWyF1GMbAyt6gZKAjhYPwsKC9pSMLK779mwQTdXyKu6GQ UQTgXIfGxsYQ9/R0uFXA++pIcHIRC2cR+gIdAewrcVzxIfLADaPmf6Acqzq4oZgbfYMj k3Ew1LGL3YTT0u9cuSKVn22qHodAbwam6nE7l600hq/9XRh1de2tiNgh+LO7kHwqbn6o EGZ+VE38GgKF3ReBk20r/NwP1q45UDOEGQEJfgINqFBP7RwAP8DOkBWEC4f5jXbK1z/s kWThiNEGAooGWFBMK2ubfSsMPBGzQJMkAi1P5i+5U0bOmOUXQmdL6yEU3dptvjdJ0kzR EaTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=jqoWyf9q; 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; 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 q1-20020a50aa81000000b00453a0393deasi2084467edc.368.2022.10.27.09.41.02; Thu, 27 Oct 2022 09:41: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=@alien8.de header.s=dkim header.b=jqoWyf9q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235865AbiJ0PeK (ORCPT + 99 others); Thu, 27 Oct 2022 11:34:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234879AbiJ0PeG (ORCPT ); Thu, 27 Oct 2022 11:34:06 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DEE188590; Thu, 27 Oct 2022 08:34:05 -0700 (PDT) Received: from zn.tnic (p200300ea9733e7cb329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9733:e7cb: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 9004B1EC02FE; Thu, 27 Oct 2022 17:34:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1666884843; 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=o5hkvVaAtguyvk+k1KB1ZUt++tlUO5KVc3yFFqeqwX8=; b=jqoWyf9qttnPb1+ejaXSkAQOCfFzrggbp28/nlN8EkIbUOPw29RsgsiZ/z2ZG3u7VebuUn MU6EhhvMZF3MT30dMrQuwvBB4su92pEFWDht57T07pN0s+yx1x8dRH6ocnyL7EltL/BRbd UR76zX2oet+PZlDCIfKHc5VatyLLel8= Date: Thu, 27 Oct 2022 17:33:59 +0200 From: Borislav Petkov To: Dave Hansen Cc: Martin Fernandez , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-mm@kvack.org, kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, dvhart@infradead.org, andy@infradead.org, gregkh@linuxfoundation.org, rafael@kernel.org, rppt@kernel.org, akpm@linux-foundation.org, daniel.gutson@eclypsium.com, hughsient@gmail.com, alex.bazhaniuk@eclypsium.com, alison.schofield@intel.com, keescook@chromium.org Subject: Re: [PATCH v9 0/9] x86: Show in sysfs if a memory node is able to do encryption Message-ID: References: <20220704135833.1496303-1-martin.fernandez@eclypsium.com> <6758af9b-1110-ad5a-3961-e256d5c8d576@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6758af9b-1110-ad5a-3961-e256d5c8d576@intel.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-kernel@vger.kernel.org On Thu, Oct 27, 2022 at 08:21:02AM -0700, Dave Hansen wrote: > On 10/27/22 01:57, Borislav Petkov wrote: > > Well, I still think this is not going to work in all cases. SME/TME can > > be enabled but the kernel can go - and for whatever reason - map a bunch > > of memory unencrypted. > > For TME on Intel systems, there's no way to make it unencrypted. The > memory controller is doing all the encryption behind the back of the OS > and even devices that are doing DMA. Nothing outside of the memory > controller really knows or cares that encryption is happening. Ok, Tom just confirmed that AMD's TSME thing also encrypts all memory. So I guess the code should check for TME or TSME. If those are set, then you can assume that all memory is encrypted. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette