Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2671140rdb; Mon, 5 Feb 2024 13:59:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGDiza0jFCa7E81qIw4R5C8wXHYgMbKuksfeyv2MO3OsqhlpjOsnrAlLUTrjN8gP6UuJe1 X-Received: by 2002:ad4:4525:0:b0:68c:72e3:5612 with SMTP id l5-20020ad44525000000b0068c72e35612mr13471167qvu.25.1707170381379; Mon, 05 Feb 2024 13:59:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707170381; cv=pass; d=google.com; s=arc-20160816; b=kXmkNGcZbm30tom4NQLNs4KhxvMiVm+qZkPZqpCJSyRT8yj/Q4Jb19/yND+NpSbUZ8 wWh+E94px4NnFbFNn3XvRqC7hafkKiAIGBMIGd8n+LALUw/ufMMs5hjBKx/3vPiIKISx DW4cFhDxbrdf0j+A7Pr3PF53HnZscA0X1EyjlZDw1cjx/gKyqyMEzFdQlN+IAEjnmMQ3 oDEUahvO6xdYbDWiIbOHGeAREyPN3niE5F6rtcpVtK3Hr2d6u7XCEU4UJiboLrV7xe6u puQeZ/fwKPaGlHHM7WuYx5Fl4WkD4iOMctl5wTpEz9Ml4cTjkOmrhZRQoYTfBUm0vl2+ cZCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=AqWWI/Gh7z2z8mZ5OI3FsyusrHgJwzTCkVq/3hcyohU=; fh=NWw1bRHk/tQ6ZTMQ9WxwhHU/VHMu7xfOQhdyTfXSIsM=; b=PuD1eV2PASrmwY0m0z4UJIDg936TymIvw2tXyeyjVclF2zsXfyw0wWzjyleBtheSeo gys6sJTWZHMSsBrolvwMb4eC/QKBE1AoAKpKbZ+XBHGHncLVIwcxKsPtq9ukG1MFGajR 4hd4PBEV+S8+bZf8V51OkO7f4+XWQLMTToWh+RxF12Vn6kL+I/PKzlOlYkSDCGGAIE78 +1Z2a/bVWlGLiy187FTpEBKnxFBLVw+F+jOfnuj1jAqBa19R+U/tnBISFu0QvQ3Qst6I RtTpkyJYPRmD1iM4I7+unu1FJNLze/Mo0YrnYgwOeq1uZeZ90Qh5A+iVxrLz/X88Vpvx 9hyA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MNC68eIB; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-53944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUajaGXx7BeDweXI3kXtjkshoCoClubfUwA8mSZH0fJaByuPJBqN4fR7aUh4XyBXBum06aLmqPZjI4sGA3tN2euQ98MU4dNOkuwdfkF2Q== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cz3-20020a056214088300b0068c71925cadsi916708qvb.432.2024.02.05.13.59.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 13:59:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=MNC68eIB; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-53944-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 256311C28399 for ; Mon, 5 Feb 2024 21:59:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EC4F1420C5; Mon, 5 Feb 2024 21:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="MNC68eIB" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7C9D141990; Mon, 5 Feb 2024 21:06:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707167204; cv=none; b=WO33mp9Fi4KZzDcHCgAEPHZNHyGEYkQQRoZT3avM8MTXZCFfAwiQDL97XPFXxSXv8bN2WQguPMQQBRE0ZPPJH9h1Kr2z1g5jyGSRbcBqmKZSyMgzP7osSUqRfmyA41SyaB/XhlUkXyKtcPTnCKkT7/GAeMQW4JLXmcjPznzHzNc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707167204; c=relaxed/simple; bh=YDWZ+/RuZjq5pI5dUr4mOk8isI80rU+KIyGmgA2cvBo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pmPqtzsetHHO2IYxIL6Ioa3fJ+QFqNb7P+wuxqdMjCzIkcT4vuEAOWfruI/UIOSwKTIUKzxNMzH8EOOi0INijCgMQ7mOVE98cjWvtp67FwbC8euzr0Jg7Mz7iy77EzoocRnPNBDGAbIP1AFCwSE50J+9HSJNggI9/VMFY+EObmk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=MNC68eIB; arc=none smtp.client-ip=198.175.65.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707167203; x=1738703203; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YDWZ+/RuZjq5pI5dUr4mOk8isI80rU+KIyGmgA2cvBo=; b=MNC68eIBNj2Q/gvBZTVemLJHZ8SNi+seZh+m/hVsbiZfWy2bGPNrXAgw yEPJiI4OegEHNBgw1xnm02j9XYb6GZszLz88m+CcqA9Jv2tpYWb7xNUcW vmM+0M6aTwxru9Rs4SHiwP/77RPrCh4ClVH3Rp/HWW8I+w/duo0mLikHt 2WuXKrFsvazlrUnkgUUoK1T7dnnKyTfU4Gsz8xAwBeHO6hheQPEjYPxN/ T04o7XS4YwMWKZnYRN+EZ/bRsMJcr0qCawVqJMJ84lyY33stUp46TMYaY led2qlcRnkpk35anGWfJzVHbR4T9f5S4GaI5esyHF6xL0ReTPlsdSJw8s Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="11960358" X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="11960358" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2024 13:06:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,245,1701158400"; d="scan'208";a="38245614" Received: from b4969161e530.jf.intel.com ([10.165.56.46]) by orviesa001.jf.intel.com with ESMTP; 05 Feb 2024 13:06:40 -0800 From: Haitao Huang To: jarkko@kernel.org, dave.hansen@linux.intel.com, tj@kernel.org, mkoutny@suse.com, linux-kernel@vger.kernel.org, linux-sgx@vger.kernel.org, x86@kernel.org, cgroups@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, sohil.mehta@intel.com, tim.c.chen@linux.intel.com Cc: zhiquan1.li@intel.com, kristen@linux.intel.com, seanjc@google.com, zhanb@microsoft.com, anakrish@microsoft.com, mikko.ylinen@linux.intel.com, yangjie@microsoft.com, chrisyan@microsoft.com Subject: [PATCH v9 03/15] cgroup/misc: Add SGX EPC resource type Date: Mon, 5 Feb 2024 13:06:26 -0800 Message-Id: <20240205210638.157741-4-haitao.huang@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240205210638.157741-1-haitao.huang@linux.intel.com> References: <20240205210638.157741-1-haitao.huang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Kristen Carlson Accardi Add SGX EPC memory, MISC_CG_RES_SGX_EPC, to be a valid resource type for the misc controller. Signed-off-by: Kristen Carlson Accardi Co-developed-by: Haitao Huang Signed-off-by: Haitao Huang Reviewed-by: Jarkko Sakkinen --- V6: - Split the original patch into this and the preceding one (Kai) --- 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 541a5611c597..2f6cc3a0ad23 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 1f0d8e05b36c..e51d6a45007f 100644 --- a/kernel/cgroup/misc.c +++ b/kernel/cgroup/misc.c @@ -24,6 +24,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 */ -- 2.25.1