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 ADADBC433EF for ; Wed, 6 Jul 2022 06:38:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BFFA8E0002; Wed, 6 Jul 2022 02:38:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06F5C8E0001; Wed, 6 Jul 2022 02:38:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E79898E0002; Wed, 6 Jul 2022 02:38:43 -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 D8F1B8E0001 for ; Wed, 6 Jul 2022 02:38:43 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id ADCBA605A1 for ; Wed, 6 Jul 2022 06:38:43 +0000 (UTC) X-FDA: 79655721726.11.306E35F Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf05.hostedemail.com (Postfix) with ESMTP id F2A1410000D for ; Wed, 6 Jul 2022 06:38:42 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1928BB81AEF; Wed, 6 Jul 2022 06:38:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39758C3411C; Wed, 6 Jul 2022 06:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657089519; bh=sIhADMY3Ddiwqu/4zmrMxVcxGylkvp6d6ylGolHrEgY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dv8K6kxrFf7OTnxoy7BJoYTK27INCS/dp6gsLZU+mDz0eG+7Cfsq3vGkwutzzXz77 jOM4u9OlUDKwA1RaRr22Fe34PTWi+7e+iuBGypoSgP3RRd1neORWeqv6u+fz4YMohn QmQwowyzodvSl9o04hklMK59Etq0P85n2f5nOg/4= Date: Wed, 6 Jul 2022 08:38:37 +0200 From: Greg KH To: Martin Fernandez Cc: 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, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, dvhart@infradead.org, andy@infradead.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 9/9] drivers/node: Show in sysfs node's crypto capabilities Message-ID: References: <20220704135833.1496303-1-martin.fernandez@eclypsium.com> <20220704135833.1496303-10-martin.fernandez@eclypsium.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657089523; h=from:from:sender: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:dkim-signature; bh=LcdaYN1Vh++Zc7Smpd+vgkFMTf1gDvpKE4IYvLCsGSs=; b=ZhTFxPIvEhC4x1dk9lrIN6Nw0Vgh3BN0MgaabkzzZd15T4t+d3CED2pAbPsSKopnm6ilRs mZgDdR8/lJSHyeVABYDwVt6XDNs6oIla4LAR7qOC5xewNkcOT89H+Z/pVmNEYhj3UVV01R pSyp23iJSs3ab5HZxzQiwVfVsVkppZQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657089523; a=rsa-sha256; cv=none; b=gbyXh63Kb55IlUZ2nA8AlIqXOoRp3lPpEuluh2HuSEHSOR+v4gZTE6SRMW/n/aMKEb13Di UuZkPgkWl/cwnRPdV40ye8hl0w+6mj9lm7H+X9j1pa7ogA1mRABACZN2uAjGeP90esuMi/ yagmaZkTXWP9zvaI2fFM03AzRGd+sxU= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=dv8K6kxr; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf05.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org X-Stat-Signature: a3yom59hqwwgyy4yuu6bm4qxp1fdhzud X-Rspamd-Queue-Id: F2A1410000D X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=dv8K6kxr; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf05.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org X-Rspamd-Server: rspam10 X-HE-Tag: 1657089522-689495 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 Tue, Jul 05, 2022 at 02:35:18PM -0300, Martin Fernandez wrote: > On 7/4/22, Greg KH wrote: > > On Mon, Jul 04, 2022 at 10:58:33AM -0300, Martin Fernandez wrote: > >> Show in each node in sysfs if its memory is able to do be encrypted by > >> the CPU; on EFI systems: if all its memory is marked with > >> EFI_MEMORY_CPU_CRYPTO in the EFI memory map. > >> > >> Signed-off-by: Martin Fernandez > >> --- > >> Documentation/ABI/testing/sysfs-devices-node | 10 ++++++++++ > >> drivers/base/node.c | 10 ++++++++++ > >> 2 files changed, 20 insertions(+) > >> create mode 100644 Documentation/ABI/testing/sysfs-devices-node > >> > >> diff --git a/Documentation/ABI/testing/sysfs-devices-node > >> b/Documentation/ABI/testing/sysfs-devices-node > >> new file mode 100644 > >> index 000000000000..0e95420bd7c5 > >> --- /dev/null > >> +++ b/Documentation/ABI/testing/sysfs-devices-node > >> @@ -0,0 +1,10 @@ > >> +What: /sys/devices/system/node/nodeX/crypto_capable > >> +Date: April 2022 > >> +Contact: Martin Fernandez > >> +Users: fwupd (https://fwupd.org) > >> +Description: > >> + This value is 1 if all system memory in this node is > >> + capable of being protected with the CPU's memory > >> + cryptographic capabilities. It is 0 otherwise. > >> + On EFI systems the node will be marked with > >> + EFI_MEMORY_CPU_CRYPTO. > > > > Where will such a node be "marked"? I do not understand this last > > sentence, sorry, can you please reword this? > > What I meant is that if all the memory regions in a given node are > flagged with EFI_MEMORY_CPU_CRYPTO then that file will hold a 1. > > Maybe it's a little confusing if you don't know what > EFI_MEMORY_CPU_CRYPTO is. > > > And why is EFI an issue here at all? > > Checking for EFI_MEMORY_CPU_CRYPTO is the way to know if a memory > region is able to be encrypted by the CPU on EFI platforms. It's not > really an issue and it's currently the only implementation for this > file. > > Is it clearer here? > > This value is 1 if the memory in this node is capable of being > protected with the CPU's memory cryptographic capabilities. It is 0 > otherwise. > On EFI systems this means that all the memory regions of the node > have the EFI_MEMORY_CPU_CRYPTO attribute set. Much better, thanks. greg k-h