From patchwork Mon Jan 22 17:20:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haitao Huang X-Patchwork-Id: 13525855 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 D08EE3FE3C; Mon, 22 Jan 2024 17:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944053; cv=none; b=eAUny6LWtAHz4uEecWOED3Met0TtOERLPOr4CUXSO5xR+Lo78nNDTdVRIxMXxWNdXxTMYcTcpeBHwzifs9RRhrB4Vb4gK4By8gJN+i1CjCZk5+aWixRdjwH4ggeGvV39n4vaKP4gtm7kSbU7Ict35bmYgTKWTApneQF0BQ50IeU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705944053; c=relaxed/simple; bh=RGIroSgVGIrhpvmE/7mpo3HSWBMwlLP6KKFtOGYR/aQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jSmnolA/XLlFWqDslYSjlT1PMewOygGOTs9Iuz/tJzwoEUPb5FNAgDGU+wCMm4FlybnJ1TW2KTV8jaOIoVTqsngKhC+THHV0opLBpwQP6zoSnoSO+jCtde0YObMqcTJoG8xH8rVOpMZzVNtaPw+7jUwo+qj+6TL9lRqJDZ8QC6o= 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=mdllTdB9; arc=none smtp.client-ip=198.175.65.15 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mdllTdB9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705944052; x=1737480052; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RGIroSgVGIrhpvmE/7mpo3HSWBMwlLP6KKFtOGYR/aQ=; b=mdllTdB9I0zOXTO+Ae4eVUPLlSBkVyiiuf4yTZRV2v15bnSDdkJaljdS F5gEfeBQU/OMuCLGhpxSdtImU8wF11Gm5SXiCNTLiECK8XVJqzbHQr5dC J7UFisxkfKUAvmYw3a/3MhP54bCXn3ECeDMXoPgyTCTPgWSQTsuxjK4ES Kfh9/wKv3IAh1dJhIahjbtaAQJXQHSfiPqBKeNvd9C4cNrRLTHE8HQYX1 TVSrm1s9gJc2PR1qWD0NksEpaeq4wjyukCwtLHFVUdxfbwJLlMC0vkD63 IwXAsrnqvwtpoq8yGkfcaMrL8xU13wU1PC3RnPUDmybkVjBe8F50Udwm5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="1150125" X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="1150125" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 09:20:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,211,1701158400"; d="scan'208";a="1262863" Received: from b4969161e530.jf.intel.com ([10.165.56.46]) by orviesa005.jf.intel.com with ESMTP; 22 Jan 2024 09:20:48 -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 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 Subject: [PATCH v7 03/15] cgroup/misc: Add SGX EPC resource type Date: Mon, 22 Jan 2024 09:20:36 -0800 Message-Id: <20240122172048.11953-4-haitao.huang@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240122172048.11953-1-haitao.huang@linux.intel.com> References: <20240122172048.11953-1-haitao.huang@linux.intel.com> Precedence: bulk X-Mailing-List: linux-sgx@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 99d971ecc842..4c519423b071 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 */