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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D8BCC433EF for ; Wed, 18 May 2022 20:23:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 284DA6B0072; Wed, 18 May 2022 16:23:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 234A06B0073; Wed, 18 May 2022 16:23:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FEFF6B0074; Wed, 18 May 2022 16:23:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id F2CC86B0072 for ; Wed, 18 May 2022 16:23:12 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id BB4F07B5 for ; Wed, 18 May 2022 20:23:12 +0000 (UTC) X-FDA: 79479988224.10.1DAAEEA Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf10.hostedemail.com (Postfix) with ESMTP id B0FA8C00B2 for ; Wed, 18 May 2022 20:22:41 +0000 (UTC) Received: from zn.tnic (p200300ea974657d0329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:9746:57d0: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 8A6DB1EC03AD; Wed, 18 May 2022 22:23:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1652905385; 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=kiP3CsxtGQt01zP15K1kxQEOaD5Egp8vF87dwKeKYL8=; b=cfQxvj7SaeAWQCQZgNDAuheCGIvEi/o+BwUKpBXlQCx98/tzP4S1cxFICjF3KCwG83r3mO tMgfYDjND/mIZQ0JHd2wD1TBCBrPqUWd4BMCiw0dw8M3Gm2435TeQVnQPiM3tnaj4Ww1+6 C2VzC/gIXuOFBVRrGEMeRkVj1TG1SAw= Date: Wed, 18 May 2022 22:23:01 +0200 From: Borislav Petkov To: Dan Williams Cc: Richard Hughes , Dave Hansen , Martin Fernandez , Linux Kernel Mailing List , linux-efi , platform-driver-x86@vger.kernel.org, Linux MM , "H. Peter Anvin" , daniel.gutson@eclypsium.com, Darren Hart , Andy Shevchenko , Kees Cook , Andrew Morton , Ard Biesheuvel , Ingo Molnar , Thomas Gleixner , Dave Hansen , "Rafael J. Wysocki" , X86 ML , "Schofield, Alison" , alex.bazhaniuk@eclypsium.com, Greg KH , Mike Rapoport , Ben Widawsky , "Huang, Kai" Subject: Re: [PATCH v8 0/8] x86: Show in sysfs if a memory node is able to do encryption Message-ID: References: <6d90c832-af4a-7ed6-4f72-dae08bb69c37@intel.com> <47140A56-D3F8-4292-B355-5F92E3BA9F67@alien8.de> <6abea873-52a2-f506-b21b-4b567bee1874@intel.com> <4bc56567-e2ce-40ec-19ab-349c8de8d969@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: B0FA8C00B2 X-Stat-Signature: pk9ox1bnisc5ub8xsruthxo4bcedpojf X-Rspam-User: Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=alien8.de header.s=dkim header.b=cfQxvj7S; spf=pass (imf10.hostedemail.com: domain of bp@alien8.de designates 5.9.137.197 as permitted sender) smtp.mailfrom=bp@alien8.de; dmarc=pass (policy=none) header.from=alien8.de X-HE-Tag: 1652905361-959736 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, May 18, 2022 at 11:28:49AM -0700, Dan Williams wrote: > On Wed, May 18, 2022 at 12:53 AM Borislav Petkov wrote: > > > > On Mon, May 16, 2022 at 09:39:06AM +0100, Richard Hughes wrote: > > > This is still something consumers need; at the moment users have no > > > idea if data is *actually* being encrypted. > > > > As it was already pointed out - that's in /proc/cpuinfo. > > For TME you still need to compare it against the EFI memory map as > there are exclusion ranges for things like persistent memory. Given > that persistent memory can be forced into volatile "System RAM" > operation by various command line options and driver overrides, you > need to at least trim the assumptions of what is encrypted to the > default "conventional memory" conveyed by platform firmware / BIOS. So SME/SEV also has some exceptions to which memory is encrypted and which not. Doing device IO would be one example where you simply cannot encrypt. But that wasn't the original question - the original question is whether memory encryption is enabled on the system. Now, the nodes way of describing what is encrypted and what not is not enough either when you want to determine whether an arbitrary transaction is being done encrypted or not. You can do silly things as mapping a page decrypted even if the underlying hardware can do encryption and every other page is encrypted and still think that that page is encrypted too. But that would be a lie. So the whole problem space needs to be specified with a lot more detail as to what exact information userspace is going to need and how we can provide it to it. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette