Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2259303rwi; Tue, 11 Oct 2022 06:50:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4lB3QUgEyuJLtnLz1zxT+YnfpulsWooyU2kGrqdeXLZ9TKX+Msu7I7k3/A5TpzOuX0BZUv X-Received: by 2002:a17:907:6088:b0:78d:8e24:40d0 with SMTP id ht8-20020a170907608800b0078d8e2440d0mr15347021ejc.590.1665496217720; Tue, 11 Oct 2022 06:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665496217; cv=none; d=google.com; s=arc-20160816; b=0j8IadWJq68QUc3DTRM7kMPzt9RuMy+xtrA8GGOPxGclSJ+49kvw90iEax8NiO74CC czbwkxJ7TX7DXGzVXmVrcmdRrrUU4nnf5ligbTowZPepClM5YLZMbn4++iVg3nQde207 ZT3MpUZyckvPjuTcZAnH38H0IX7HyiP+NjUzHDWr6oREQAEIIAeRnbx86k144z9CitxH /dAMDRZuDrRvi8Xq7RulOpsw8Pv8LgaBz6P+w0YwnzcuZOI9nRbOEix8ChoDpdJxPsq0 5Z4/BhXIGCdXtycZYJ6lnn3Y+c92OOQZY1Wdx9Ketew9GSvBvrNXDLw0QcnSVs3rWIgW hkbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=raH7WVDSsvCPKQIhYgmZFVAAGSUF5nc09Zedq+rsMAU=; b=qhj0gKcAXkYbgJ4It2zrO6FgwW2+vxVFWOqsQ7Um4jzzfshFrqtMXL4qnIQzDICJAV S/DDFSfvdjPbsqyYM36UWGr254cc8NhwXLxw+sNJF7McThBs2U+xzY0DsI7OQIAXV99V jLGg7h6TO+NiSmku6axuGy8LTUu6NFqNActmSn2eQ4ayE52vQv1aSWEgfWdhhxADgqZK AjfXEzShkFIl+B+rRekJmEMrxyOhQvbwcUVd2BvEO/BhUwgPoHitaXS9Qap+lCxaAU1T 3eB6l3uyhhigOrhTnUS7Ozd0JqBPoGdwNiCyMeWMZlSQwdBZuAXFnKkSYbFoY4ycGDGr xIBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@eclypsium.com header.s=google header.b=RIe4dBR0; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=eclypsium.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020aa7d30f000000b00459039258b2si7801086edq.289.2022.10.11.06.49.33; Tue, 11 Oct 2022 06:50:17 -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=@eclypsium.com header.s=google header.b=RIe4dBR0; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=eclypsium.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230058AbiJKN2u (ORCPT + 99 others); Tue, 11 Oct 2022 09:28:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbiJKN2r (ORCPT ); Tue, 11 Oct 2022 09:28:47 -0400 Received: from mail-vs1-xe32.google.com (mail-vs1-xe32.google.com [IPv6:2607:f8b0:4864:20::e32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BA8F46D8D for ; Tue, 11 Oct 2022 06:28:45 -0700 (PDT) Received: by mail-vs1-xe32.google.com with SMTP id k6so12124556vsp.0 for ; Tue, 11 Oct 2022 06:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eclypsium.com; s=google; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=raH7WVDSsvCPKQIhYgmZFVAAGSUF5nc09Zedq+rsMAU=; b=RIe4dBR0aMf5OdrqYm/Utd+N0OJj8M7yVRnxQt0SWrAE+Icqli8dm198FiWu1zyE4K ThFkWDgg/9Td5d2IRDtyLEfSPwokGQrcFSl+ZlD2K4af69I3g3EB9B1emQIrMWvScJHw r+I3aZYKyOKoXo9+c2guSFePs38N6mNAHs3VoFJnnpA5I08Jok+DXwlLOgxNK3KgfAUZ XdH4LxlWpNY4uzGhO4Af+xDw0bOM1Vadya5Rtbe4apuRaNOzWyL2aYvjt49BUK4JI6Dw lHsf8fQMu1jQgOb7cxH8q3pAtHNmlqi/rQWzUKfzGN0Ycw4ppIGnoOMf/vkNLy9aLTOC /peA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=raH7WVDSsvCPKQIhYgmZFVAAGSUF5nc09Zedq+rsMAU=; b=ZebRJge5dJz6jAjUmV+HxGKp8FD6buIxRIYqlAdBIFpLc2QXI93JsXoxxU2oDi4ZIU oWVVmG+vrHxzVqsaTTCSQPeJJOl7nAMvvR8FRE2zPzKj0RjNiKQ/C1dY86pGUBtNbxAk O8lT7liwkWoV/4TlcXGWhNYqj2wgar5HeilqWn/2Cxfz6jOBESRXYYuOOt6y8h90J5HI l4b9O0bRFcVK+iZhi0YXtqfRO8QcIk8vXqEGyKYY/l8TNpTkpP8WoyPrgq2dODBdk7Bw LW6d9m84o7l0T4+8QsXcCD2gVKwcgNmig7e2X+KHmiyFxXSnEDQmyzuI0pC+pCxZycBf 1d9w== X-Gm-Message-State: ACrzQf1wv3fi8t4gs7vyJdTf3FXYUKSQmbsjndirw6ub2PjyaI/u3h9D 0hNFPX5NaQB8yT1nGJ9nqtKGOANdocJKd0p/cvi4fA== X-Received: by 2002:a05:6102:301a:b0:3a7:8755:2b7e with SMTP id s26-20020a056102301a00b003a787552b7emr4741009vsa.32.1665494924704; Tue, 11 Oct 2022 06:28:44 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:136f:0:b0:3d2:4916:f286 with HTTP; Tue, 11 Oct 2022 06:28:44 -0700 (PDT) In-Reply-To: <20221007155323.ue4cdthkilfy4lbd@box.shutemov.name> References: <20220704135833.1496303-1-martin.fernandez@eclypsium.com> <20220704135833.1496303-3-martin.fernandez@eclypsium.com> <20221007155323.ue4cdthkilfy4lbd@box.shutemov.name> From: Martin Fernandez Date: Tue, 11 Oct 2022 10:28:44 -0300 Message-ID: Subject: Re: [PATCH v9 2/9] mm/mmzone: Tag pg_data_t with crypto capabilities To: "Kirill A. Shutemov" 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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? >> /* >> * This is a per-node reserve of pages that are not available >> * to userspace allocations. >> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >> index e008a3df0485..147437329ac7 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -7729,6 +7729,7 @@ static void __init free_area_init_node(int nid) >> pgdat->node_id = nid; >> pgdat->node_start_pfn = start_pfn; >> pgdat->per_cpu_nodestats = NULL; >> + pgdat->crypto_capable = memblock_node_is_crypto_capable(nid); >> >> if (start_pfn != end_pfn) { >> pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid, >> -- >> 2.30.2 >> > > -- > Kiryl Shutsemau / Kirill A. Shutemov >