Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp199879lqh; Wed, 27 Mar 2024 21:32:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUHFZZU/oRnbsMs3L58d5FALpsRFPQ4XT8bPG+Z4qhzUIS0X0VFYB6aPDZ207PXA4KtO+CIx5y9Ig3vmmGZKLTgJQo8pHBfdLTEgnpmA== X-Google-Smtp-Source: AGHT+IFxyb3C3WJeBt2WtGFFcvF9huroGHPQShrWMogrZOTpO7Al2DSPIjK+08Bt0LRxzXao9CEp X-Received: by 2002:a17:906:b848:b0:a47:34b5:fa6e with SMTP id ga8-20020a170906b84800b00a4734b5fa6emr1099842ejb.2.1711600350088; Wed, 27 Mar 2024 21:32:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711600350; cv=pass; d=google.com; s=arc-20160816; b=vtHCnyYbAdd6ovEkZ/gL8pt7ATmFmPOImdGitVVAVCMxJJY9KSSEjR6zXuOM6EhXdi 0oIuTiXDUKgIrCV4d9A/XFb1TYiIIjmjJvpuVMIfhR1Q05EEKInCqM5r325TBHV7SHNU kI4bVj0NCGwl4mT9pQx/icc0yW5KyJpi7NIssaCY6yHNrEaMVl2yzEZcnlWfQCp9Fwhn 7OmeGzCFued/2dMDcQVXlYB/ivyyYk2gEKxQtT7tYwW9QCiF7uHzcX+MAabSn012p7SO ONMNEq0yqBG3tq9AuZLs0tsVYTo3kk2AFdTp0NkJAAnT4ZfvcoNjQ9Q0om4CIwZ6w9iB EW8g== 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=G1r0sJ0F/0v82zumykPUwC7a5Du5vVkWNEWao5ifD3o=; b=D4W1IeYfxdEnnSy5wfGR/ZFPpz7YP3RZlwA+9qQa9Q3pIV2DlgQgc/foBtLSfmHbod 7ZRK9/flKMeL4O8yv8OWM0J+NC+5JL8AaHjvh1v/po8lSE0/GtNwFLNYsI7O5vScCDrn Go4S9f510WUmWcq0c7hLGPY1RiwxiZcfdGkQTdpBacXLy4f3DSnTvoRUgG8GyFDBA6Sq TXTdbMKpRNRbUa/WFPAhm6p7JvufeMrV5r4AScFYJ8MeSmFTJY3z5Juz0xXJBL4zDHfJ l3V2zTkE8uK5K+Rkj+nNhBY5phSebE8JVATm3W4bobuAHS6LSDUfAGlgdDNj2FONDXSK aq5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TmuAuIBQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-122218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122218-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dv17-20020a170906b81100b00a46660508cdsi290793ejb.274.2024.03.27.21.32.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 21:32:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-122218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TmuAuIBQ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-122218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-122218-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 569CF1F3024E for ; Thu, 28 Mar 2024 00:23:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F131F22339; Thu, 28 Mar 2024 00:22:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TmuAuIBQ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 5C099C120; Thu, 28 Mar 2024 00:22:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711585367; cv=none; b=b21Iuvyr8F8di45c6Zy5M8ycmcgrVowxoyokwHyQpeWXtFKfdy7PJV8iw7NmcnNf+/MqaQOyvb0jVUj+CbGnvKoccqa8VKtUO3ST57eYQByFgHnYAG1L4IZC6mF9JEpeWP98oWGs+p2JFH/uffjNcRBOlC78prs1GLARv1LLBUg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711585367; c=relaxed/simple; bh=YDWZ+/RuZjq5pI5dUr4mOk8isI80rU+KIyGmgA2cvBo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V4IFAip0cO9ogGc7KBmuIDtpSGEF2Fnx+UHIFL1JjyrE1DnVojclH3jZLilfsNZerqJCuJe5PDTSow7FwJwJEr/L9j8hk2KiqT+Ej2jQtaXO0DcjEt1Cli4MKs9Dmt9OlrIxoHkrSFDGADePh3xNUs4LgZDM1YczFYOZ2UG1Lqc= 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=TmuAuIBQ; arc=none smtp.client-ip=192.198.163.19 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=1711585365; x=1743121365; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YDWZ+/RuZjq5pI5dUr4mOk8isI80rU+KIyGmgA2cvBo=; b=TmuAuIBQtYL1NCwlhZT20XNu1Rs/4Jwh19euHgw00Sq/kUz5yWuZrOn6 yFcTn4Qpd0rxL9evngLUx+A75ly5ls/bQz1Fu0DL6vd9cztg59hu5dXQm Q3goJeQ9Tl45CnI+rtT44wvbVPlKUdcHbSjE+cWUtRBYVd2sXi87zCMSQ Y5/8dG/weDTyZLo9tx/ygsAOhXG7VhmDumI1/L98QqkogiOGHFc/BSJmt urTxWilzoRzrTIugPK9UxemTtXYsXXZhjTN8vzqTfLM5OYtXEDeb163f3 OFahv0lcoK24qpo+EFbG3MU/+ebLyYwcYMVf6l214CuNdllAYBBtETk35 g==; X-CSE-ConnectionGUID: 27wBRPozS9SqV+ZvhLMcGA== X-CSE-MsgGUID: 2cOqoXQ9SfO5s11196c5yw== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="6580663" X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="6580663" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 17:22:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,160,1708416000"; d="scan'208";a="16411790" Received: from b4969161e530.jf.intel.com ([10.165.56.46]) by orviesa009.jf.intel.com with ESMTP; 27 Mar 2024 17:22:30 -0700 From: Haitao Huang To: jarkko@kernel.org, dave.hansen@linux.intel.com, kai.huang@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 v10 04/14] cgroup/misc: Add SGX EPC resource type Date: Wed, 27 Mar 2024 17:22:19 -0700 Message-Id: <20240328002229.30264-5-haitao.huang@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240328002229.30264-1-haitao.huang@linux.intel.com> References: <20240328002229.30264-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