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 20603C433F5 for ; Tue, 11 Oct 2022 15:28:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 987B56B0071; Tue, 11 Oct 2022 11:28:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 90F126B0073; Tue, 11 Oct 2022 11:28:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 787AB6B0074; Tue, 11 Oct 2022 11:28:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 609CA6B0071 for ; Tue, 11 Oct 2022 11:28:06 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 2B7B01212F5 for ; Tue, 11 Oct 2022 15:28:06 +0000 (UTC) X-FDA: 80009049372.06.B8CDC4F Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) by imf09.hostedemail.com (Postfix) with ESMTP id 726E7140023 for ; Tue, 11 Oct 2022 15:28:05 +0000 (UTC) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.west.internal (Postfix) with ESMTP id 0E0A62B06723; Tue, 11 Oct 2022 11:28:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 11 Oct 2022 11:28:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1665502081; x=1665509281; bh=Ro iYjXc5zpBqmqtGTly0dJ5h4knOXCOxvOzprpvvicY=; b=rOqBqfQIR1pyIo2y+Q qXCNvR9q1gL4jfix8sxrOkGqGqROiSHyOvWNHIqbLpM5CyKJiTrw9hPly16jMeox rCt2x8gcTitVSTlm5hdVJPA2xCT16jAt6cCxOG1KMbwGUcaPcXyFcIU55t18+ek7 B1riDrIGEzMQqyoNSDOBbpluYItZUW2OpkHp/uLMQKiWM/67u3uiyYw1v4Q7wBg4 b/69CmAXTR92H1cdjbIYsz9oC6jcyU/+pAgKTaM8hCy+lCsdJ7PY6GoXKMAlC5ES ih3OxqqrlFdorAUJMS3+NnphnyXRXwbvsEob/47+qMbONRy9d9cnSLCEtDc3FSlX aHvA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1665502081; x=1665509281; bh=RoiYjXc5zpBqmqtGTly0dJ5h4knO XCOxvOzprpvvicY=; b=D7xRYdn00TuXovu4EGPnJfmJV5jcNV/fRMwo9uBTiOHI QI/UGUeuHztUjAPISjmnhM60ZbLAVNuFKUhn62xhJeC8AMyO5u5TrjbezEp/ko+2 Ol2JmAM6dx+n7A3NmNFNzBacE2rMuu7bz+dkGdv5m17HRkHvMkkiuzwlLU3hvKun GJwdAKaUXGmigGQPFV8trjtO9IvcNZCQoSaUzm8CHNh/xuHOPSG5ZfbylR42i/Fu yamnMsEUW69QlLy7RRw4JnpPlqaGsns3xIidA0z8aUmuvBhS6lozmNnx+VHDKdJe iCnhsALrTfAAMfNLGfwzhflmmWhjqN+oqP6Pg2hOgw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejiedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdttddttddtvdenucfhrhhomhepfdfmihhr ihhllhcutedrucfuhhhuthgvmhhovhdfuceokhhirhhilhhlsehshhhuthgvmhhovhdrnh grmhgvqeenucggtffrrghtthgvrhhnpefhieeghfdtfeehtdeftdehgfehuddtvdeuheet tddtheejueekjeegueeivdektdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehkihhrihhllhesshhhuhhtvghmohhvrdhnrghmvg X-ME-Proxy: Feedback-ID: ie3994620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Oct 2022 11:28:00 -0400 (EDT) Received: by box.shutemov.name (Postfix, from userid 1000) id E4CEC103938; Tue, 11 Oct 2022 18:27:56 +0300 (+03) Date: Tue, 11 Oct 2022 18:27:56 +0300 From: "Kirill A. Shutemov" 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, 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 2/9] mm/mmzone: Tag pg_data_t with crypto capabilities Message-ID: <20221011152756.swms64so5q6s4f3j@box.shutemov.name> References: <20220704135833.1496303-1-martin.fernandez@eclypsium.com> <20220704135833.1496303-3-martin.fernandez@eclypsium.com> <20221007155323.ue4cdthkilfy4lbd@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665502085; a=rsa-sha256; cv=none; b=gQeKsi7SnyWmC7VvRQxS+YDgFJLxMRxblCICS8ApS6rcJaqaSMp2l2S2Tz8QArtMxprb0a 57j8FDrWVee+0bt3rOcUhre52BqocyuJmZXW5mFLrH75Zp0DCU8zJlNEHtVDAFNrtfZhbU iY1eZLDWLtmUikFvGyNgdogsKib2fmk= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm1 header.b=rOqBqfQI; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=D7xRYdn0; dmarc=none; spf=pass (imf09.hostedemail.com: domain of kirill@shutemov.name designates 64.147.123.27 as permitted sender) smtp.mailfrom=kirill@shutemov.name ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665502085; 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=RoiYjXc5zpBqmqtGTly0dJ5h4knOXCOxvOzprpvvicY=; b=NjY3u7/kYe/5PEhfmcsuH+kes9X0mrioB2wcNZbtJH5Pk3bGesoeU6mpY1LCsH6bOvmR0r VZUI/kDPQdMD52kkqNvZZfnIOz2mJHcv5d45s95sveQadVJejMXjjisN0VU193wMVbX/B4 vvenz8qvm4mQEXdC+EY/QFixGEmfDxc= X-Rspam-User: X-Stat-Signature: 7gouh8i3ykbikqfj4b1henzi6c9hyjrs X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 726E7140023 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=shutemov.name header.s=fm1 header.b=rOqBqfQI; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=D7xRYdn0; dmarc=none; spf=pass (imf09.hostedemail.com: domain of kirill@shutemov.name designates 64.147.123.27 as permitted sender) smtp.mailfrom=kirill@shutemov.name X-HE-Tag: 1665502085-163938 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, Oct 11, 2022 at 10:28:44AM -0300, Martin Fernandez wrote: > On 10/7/22, Kirill A. Shutemov wrote: > > On Mon, Jul 04, 2022 at 10:58:26AM -0300, Martin Fernandez wrote: > >> Add a new member in the pg_data_t struct to tell whether the node > >> corresponding to that pg_data_t is able to do hardware memory > >> encryption. > >> > >> This will be read from sysfs. > >> > >> Signed-off-by: Martin Fernandez > >> --- > >> include/linux/mmzone.h | 3 +++ > >> mm/page_alloc.c | 1 + > >> 2 files changed, 4 insertions(+) > >> > >> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > >> index aab70355d64f..6fd4785f1d05 100644 > >> --- a/include/linux/mmzone.h > >> +++ b/include/linux/mmzone.h > >> @@ -883,6 +883,9 @@ typedef struct pglist_data { > >> struct task_struct *kcompactd; > >> bool proactive_compact_trigger; > >> #endif > >> + > >> + bool crypto_capable; > >> + > > > > There's already pgdat->flags. Any reason we cannot encode it there? > > Not really a reason, I'll considerate when I send then next version. I > tried to quickly find for references of what kind of flags does it > have, I didn't find any. Do you suggest it should work? Maybe. Or maybe introduce capabilities bitfield and make crypto as one of them. We consider to re-use the approach for other cases. Like if the memory in the node is TDX-compatible (there's more requirements for it than just encryption). -- Kiryl Shutsemau / Kirill A. Shutemov