From patchwork Fri Nov 11 18:35:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kristen Carlson Accardi X-Patchwork-Id: 18964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp906535wru; Fri, 11 Nov 2022 10:41:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf6vctFmKcagsgFtRbZ4uCJrv9LuJEZH+3y5q5wpf00zqxAGpMo7Z+X6FZKyLlLerRnryS/d X-Received: by 2002:a17:903:40d2:b0:188:b44b:598 with SMTP id t18-20020a17090340d200b00188b44b0598mr636030pld.54.1668192069955; Fri, 11 Nov 2022 10:41:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668192069; cv=none; d=google.com; s=arc-20160816; b=jQtRmiwBdRHS7ZB53Wmy6ro9+wE95/tdUfvzBrTrC9t283QmFaJdqj/GScN7PKXoHa xDeJRjOjND6KSIix5plYkCIyWP0wqbInOv+DlzWfEfJn2YDhLEh/0Nh8aKbp3skGZjjX 2dFgyVfZ1UZYDqdkYNXmLWqQ2lx3JgKRBj2h5IidHGUzD9jvtR9LIf2XTlLwAiH4xrqb jRLZTdRXz1MPMmrb7VKeyWYYOpreGMcWbjCll5Bmgd2lQJuXVrQBR1SntZ+GyowUgfSd ZvOLqrzq/E8CT3+b4qxot739M8NF6XOoNuNg7aGaKMHLXpzOdu4G1aMpRkEYp1ISs3sN 8YCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jg1EWUbvg49rEr323/tQY7pH/qAanXl44fdU1sRH19Q=; b=Qb64Hy+oLEqo0FzW7o4HhegCdLSk/wAIlx2VMdJYMixcFGnJ6ATBNPt+nHjsNrSzGC OPtR6h8wFa3LxXUJ+Jg2aKRGu13uqzJ87w0H3PTssf4XMd0XxVw4ougPeEzSIdldb+mN 3at7eV496FgJjdNx51TySDJXtltExJyppr1frPsNA/9hF4kdvOYMyO+MbZUwKjg5FnzS pkgzCQFjYr20oEkm3pjA4Pkb0sRX7BytJJjwZ3ERBbwXLfX9CoK4WwJVQMKx64fIXfxF yaqUQ4CPSRkI3SLkGoCAjOI6fkl9wkD6zBTxiigjze2M9ZX0SOGZxdCbOcU40O20/Il2 qg9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=DcdzJGxl; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g5-20020a170902934500b00182a9c27a9csi2796919plp.603.2022.11.11.10.40.54; Fri, 11 Nov 2022 10:41:09 -0800 (PST) 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=@intel.com header.s=Intel header.b=DcdzJGxl; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234616AbiKKSh4 (ORCPT + 99 others); Fri, 11 Nov 2022 13:37:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234387AbiKKSga (ORCPT ); Fri, 11 Nov 2022 13:36:30 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87F4F836A8; Fri, 11 Nov 2022 10:36:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668191782; x=1699727782; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EBcLsiw30eqLl7g1ih7HHqPXoxhQ0Yyb7AgcJd3NM6M=; b=DcdzJGxlzqeMI/lVJgpZqqrS2R/BtbGEaER+UPPX/2sRCSlBUD7UsRBQ iinw8ZfNwf/pMHccT7UNwlg5FXGzc5JjIS2JvaGOiQ9/ZocAEF8cbrArC 1uDU6p+EwBNwHuIhpW5jragpop1al97Xa+tUg/o6A1S7DxsRIYwYNnjsB psk0qIH9OPaj8FXtVonWN2kw1Fk++umdmg5ctHUgPPWhcyx0q3wFX3TQm tHjlLM7lyA9zJ+Vt3DtyzfY2W+aaBhL78/zIFq4m5u3ziAwsiRc2t2Kym FXOKldQlIV+Vj6/TBZwu5YVxa/l/hde1crqPRw2Ey7oyWNiXsWGYDupsf A==; X-IronPort-AV: E=McAfee;i="6500,9779,10528"; a="313447734" X-IronPort-AV: E=Sophos;i="5.96,157,1665471600"; d="scan'208";a="313447734" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 10:36:22 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10528"; a="640089447" X-IronPort-AV: E=Sophos;i="5.96,157,1665471600"; d="scan'208";a="640089447" Received: from hermesli-mobl.amr.corp.intel.com (HELO kcaccard-desk.amr.corp.intel.com) ([10.212.218.5]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 10:36:21 -0800 From: Kristen Carlson Accardi To: jarkko@kernel.org, dave.hansen@linux.kernel.org, tj@kernel.org, linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, cgroups@vger.kernel.org, Zefan Li , Johannes Weiner Cc: zhiquan1.li@intel.com, Kristen Carlson Accardi Subject: [PATCH 24/26] cgroup/misc: Add SGX EPC resource type Date: Fri, 11 Nov 2022 10:35:29 -0800 Message-Id: <20221111183532.3676646-25-kristen@linux.intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221111183532.3676646-1-kristen@linux.intel.com> References: <20221111183532.3676646-1-kristen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749226167645347835?= X-GMAIL-MSGID: =?utf-8?q?1749226167645347835?= Allow SGX EPC memory to be a valid resource type for the misc controller. Signed-off-by: Kristen Carlson Accardi --- include/linux/misc_cgroup.h | 4 ++++ kernel/cgroup/misc.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/linux/misc_cgroup.h b/include/linux/misc_cgroup.h index cee848205715..aeaf4acf22af 100644 --- a/include/linux/misc_cgroup.h +++ b/include/linux/misc_cgroup.h @@ -17,6 +17,10 @@ enum misc_res_type { MISC_CG_RES_SEV, /* AMD SEV-ES ASIDs resource */ MISC_CG_RES_SEV_ES, +#endif +#ifdef CONFIG_CGROUP_SGX_EPC + /* SGX EPC memory resource */ + MISC_CG_RES_SGX_EPC, #endif MISC_CG_RES_TYPES }; diff --git a/kernel/cgroup/misc.c b/kernel/cgroup/misc.c index 642879ad136f..e73a034adca3 100644 --- a/kernel/cgroup/misc.c +++ b/kernel/cgroup/misc.c @@ -25,6 +25,10 @@ static const char *const misc_res_name[] = { /* AMD SEV-ES ASIDs resource */ "sev_es", #endif +#ifdef CONFIG_CGROUP_SGX_EPC + /* Intel SGX EPC memory bytes */ + "sgx_epc", +#endif }; /* Root misc cgroup */