Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp45351rdb; Mon, 22 Jan 2024 11:22:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEZ29MaJWaNBSfnYqpbUsm8QHwTAMIJ3JxTzVQS9JMVo+YyoIuV2nB/331fAySnhK7Ph/D1 X-Received: by 2002:a17:906:b28b:b0:a28:d574:d4cd with SMTP id q11-20020a170906b28b00b00a28d574d4cdmr2376175ejz.68.1705951327030; Mon, 22 Jan 2024 11:22:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705951327; cv=pass; d=google.com; s=arc-20160816; b=vxtg8lmqEys1bRgRgYGfXVP6CP3lR0S49cond3iEtr8qxjGF9pyqx5OTvOPcWFOl6A ByeGIeuO2KGSUShNK/f+8fi6lTLRF5orQK/L4TVkDFQo0r24olgdP4FdTUDN+TqvKwz0 NPShghMYgnt8PahOh9G7uYGKfOBNj6aGP/YlJOLGk5KNfkugAUk3Z0/l0r6YlLqx6c6n Wd1DE1z8HRGPMMlXSlxi13gf1lc/nO375tvQ+tsH7/l7LbuRbDGTpmUq0mtBV+f1kKH0 FNEA5I5EeQEFaMeLblgxlGEmqtwddMWOkBBr0hJQ3Bq2BFQn88oAx2bsBqLo97YofSAr piRg== 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=p5/07kKXOnaBf8cg9EvGoALaywP7buXIkdNvge3xtQs=; fh=Vgrzu9fr1cYGsDqSNq8PcOKm1OcJf2aYsOF+33ACqic=; b=KWt7MaPa8lWwqLaldfXTDOpQFHNAlg/LAylR/cXxN/F/NNID/fOXNNH7um+TKLUjcc Z6ESuW/a356/HvasTfFDKXDXPDaWXkK2A60SI6FTLLfFuNDHQhCoecWfnlRYkWhBxE/Z z1UPBiRzBqyzQ73VjVEEoHA3u5EsN2OLPXxqbNijxxL0mUv+u+DNL0ONLcHfuuAX1bQe aEPUopFMwf4lGh3p/Dvr5qus4TV0V/1WTAwmaG9Lmd3hOSiMAXv+rSrBuDvt2q/AeP5M Nb/zp9/CzzfIDEuEziWLNIN8AZBKdC1G8ts7uiBc5h24diLoljUsEs6+EX3ZThAZYHdN 4B6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mdllTdB9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-33776-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33776-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q14-20020a170906b28e00b00a3065d176d3si914126ejz.538.2024.01.22.11.22.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 11:22:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33776-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mdllTdB9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-33776-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33776-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 am.mirrors.kernel.org (Postfix) with ESMTPS id BA3101F29DB6 for ; Mon, 22 Jan 2024 17:52:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F32014F895; Mon, 22 Jan 2024 17:20:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mdllTdB9" 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 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-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 --- 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 */ -- 2.25.1