Received: by 2002:a05:7208:3003:b0:81:def:69cd with SMTP id f3csp4174443rba; Tue, 2 Apr 2024 09:20:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsjg8WM0s0xlLkikIkAAOYkLTogoiRiupIBXmOTe4y0kDsBPM8/SCaSOM5McMzyvFSIQjlS6D3q7rpW83BYelszXqGDdZAj914B00QmA== X-Google-Smtp-Source: AGHT+IGhPc1PYAK0YjF+uNc9b8VXYSd/iqB1W10FblAV03cTAJLW/VrS1E5uxvIkCoYZPgGOkqC1 X-Received: by 2002:a17:906:f346:b0:a4e:109a:fc1b with SMTP id hg6-20020a170906f34600b00a4e109afc1bmr8079606ejb.11.1712074848304; Tue, 02 Apr 2024 09:20:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712074848; cv=pass; d=google.com; s=arc-20160816; b=DILnoH9AVx6VekIbwFE35pyO5x3TUHStrtmPu+NISrZpSfeJjxT81YZKtJo52rd7nU mGanE8um+SRZgMJwYPfRbfF+Am/O5lXO2h+6qj1CJO8WROvvpGypR5/36C9GiLIVezpV Agpiz9IKfGoAuuzc2XRRnBqwP/LHo4j3/XkpyqjxQG5Yy87E4iusJkqshnhAWrsjyfDN I8e7tUINVBRG5LQjFNfnGduK9RDFou4RhwZx0nAZ2brvyoz0VUUsVvCtFGKrxmXZVgGQ I0o5fB8sKTAxo/yIm2U317SLsmF4omf7MkmaC8rE2tb5UcVwTzryCsb0zWyPKTO8UFl6 i73A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:message-id:organization:from :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:references:subject:cc:to :dkim-signature; bh=ei1kH4+Ybp4Ay4TEX3cSoDHmwX1oSPrwiRF995GgkpI=; fh=CvVC8+c1rsJ2UNLfZzy4HJwzlTwXsTLDsOupORH3uy4=; b=NUEc064sVDzla3mV8sei5a6LdkTkrAt/tLJFfnhYvp8TtBO72GtcxepFbhgI7lSqrq hezV6f/Zw/BMUL1LokymgXSPJTfNrADhkStqDHlhdLGtHhaI/sMkM+rdNg6vdPZCBDAM GD7TZh/byiTWZrSdMthqUZqDvvrMlhzHS8y1QI2hjx7+LSXlh/KkHMTZTds9a4d9Rghk s61kJsqqae9oY73t+AiZun8ap6zpnn6k1OsDfj5flywYoT6D7mLKByu/P0TSsCUeTWq7 oA+bdJGBw67bHkUdxUy8cT0TnZUbKxi5gPxXpD18RXYQGmLvrncMGtl7q5l3IR7XEHyp kZ9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Sh2FIqYZ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-128344-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128344-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 l24-20020a17090612d800b00a47779661f3si5441084ejb.916.2024.04.02.09.20.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 09:20:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128344-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=Sh2FIqYZ; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-128344-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128344-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 153881F23FD9 for ; Tue, 2 Apr 2024 16:20:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 07D3714B08F; Tue, 2 Apr 2024 16:20:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Sh2FIqYZ" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 111D614AD1D; Tue, 2 Apr 2024 16:20:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712074830; cv=none; b=C0OOxB4le9KWFBxD6fa1pglMGwxea2IPXUJsIz8QnW3mrX1aLR3w7VCcXFv9EQd8hxCqI4GxSQMN9Ykz/QeaceFEBaxoR19wUluU6ei0MTPwQWx7c5pegh1c4Pd3vngAlzp5mEO+Xy/F8wk+PjqrwJvndj6G7ofmJu9POxGaklg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712074830; c=relaxed/simple; bh=YBovMqze5iU2OuiwBk7yaV5ROH0m1Xil3sSKdX5tHCI=; h=Content-Type:To:Cc:Subject:References:Date:MIME-Version:From: Message-ID:In-Reply-To; b=rhE0gv+rxTQpLon6l/i0Uz0l8hbXZd29z30WWgAxB9yicv7t7mGsKXtufNr7CPvQfJqJDqn+dQp6hg6+/tAfbetapIqvWWjO0ZRLda8UthS/0hB8VUrO+CLbEz7NE6JrvGfkUM6tlPN4xaxH9HoWpOGMBbcm9JoH9VIZ2kRQjEE= 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=Sh2FIqYZ; arc=none smtp.client-ip=192.198.163.11 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=1712074828; x=1743610828; h=to:cc:subject:references:date:mime-version: content-transfer-encoding:from:message-id:in-reply-to; bh=YBovMqze5iU2OuiwBk7yaV5ROH0m1Xil3sSKdX5tHCI=; b=Sh2FIqYZoRXzTE9FxUMvYrhQJGq1NUw4zwS9fWWeYug3/rDNPy1y6c/r YFEEqe1rVMOi/NzW6b9pR+NVJ/2osVFXfktsaGmAvsB4M1dUle7MlJVit Q7nRLUhzml+oP4oGYTCpH0zeBQ7EpB371xTgmgGaKG0NIf558grZHRQ2s zayt/83jsU4BXcPBYIPBOIXURboVBxXL27I17+Hx1ljZd9aVhA7Q9kA/c 4/rwbnfCS70lNXsNgw8d8uCJj5DVUiVk1dA0xOGki6PHYSoOUm/D8Tbq6 p34uhtBPuGSEvL06jr10M+7TyyQozXAfwv55B/IkPWdyAUpo63paaCrx7 g==; X-CSE-ConnectionGUID: zRtNVA8wQiud9WGfKly3sQ== X-CSE-MsgGUID: yYW49mC8SjqQcwSVOtMN+A== X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="17879022" X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="17879022" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2024 09:20:27 -0700 X-CSE-ConnectionGUID: vxxT3scQSXOl1xwOYNfuTQ== X-CSE-MsgGUID: ldColvJnTb23d8ewg0JsSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,175,1708416000"; d="scan'208";a="22577715" Received: from hhuan26-mobl.amr.corp.intel.com ([10.92.17.168]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/AES256-SHA; 02 Apr 2024 09:20:25 -0700 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: =?iso-8859-15?Q?Michal_Koutn=FD?= , "Jarkko Sakkinen" Cc: dave.hansen@linux.intel.com, tj@kernel.org, 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, 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: Re: [PATCH v9 15/15] selftests/sgx: Add scripts for EPC cgroup testing References: <20240205210638.157741-1-haitao.huang@linux.intel.com> <20240205210638.157741-16-haitao.huang@linux.intel.com> <4be7b291010973c203ed8c7bcd25b626c1290231.camel@kernel.org> Date: Tue, 02 Apr 2024 11:20:21 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Haitao Huang" Organization: Intel Message-ID: In-Reply-To: User-Agent: Opera Mail/1.0 (Win32) On Tue, 02 Apr 2024 06:58:40 -0500, Jarkko Sakkinen = = wrote: > On Tue Apr 2, 2024 at 2:23 PM EEST, Michal Koutn=FD wrote: >> Hello. >> >> On Sat, Mar 30, 2024 at 01:26:08PM +0200, Jarkko Sakkinen = >> wrote: >> > > > It'd be more complicated and less readable to do all the stuff = = >> without the >> > > > cgroup-tools, esp cgexec. I checked dependency, cgroup-tools on= ly = >> depends >> > > > on libc so I hope this would not cause too much inconvenience. >> > > >> > > As per cgroup-tools, please prove this. It makes the job for more= >> > > complicated *for you* and you are making the job more complicate= d >> > > to every possible person in the planet running any kernel QA. >> > > >> > > I weight the latter more than the former. And it is exactly the >> > > reason why we did custom user space kselftest in the first place.= >> > > Let's keep the tradition. All I can say is that kselftest is >> > > unfinished in its current form. >> > > >> > > What is "esp cgexec"? >> > >> > Also in kselftest we don't drive ultimate simplicity, we drive >> > efficient CI/QA. By open coding something like subset of >> > cgroup-tools needed to run the test you also help us later >> > on to backtrack the kernel changes. With cgroups-tools you >> > would have to use strace to get the same info. >> >> FWIW, see also functions in >> tools/testing/selftests/cgroup/cgroup_util.{h,c}. >> They likely cover what you need already -- if the tests are in C. >> >> (I admit that stuff in tools/testing/selftests/cgroup/ is best >> understood with strace.) > > Thanks! > > My conclusions are that: > > 1. We probably cannot move the test part of cgroup test itself > given the enclave payload dependency. > 2. I think it makes sense to still follow the same pattern as > other cgroups test and re-use cgroup_util.[ch] functionaltiy. > > So yeah I guess we need two test programs instead of one. > > Something along the lines: > > 1. main.[ch] -> test_sgx.[ch] > 2. introduce test_sgx_cgroup.c > > And test_sgx_cgroup.c would be implement similar test as the shell > script and would follow the structure of existing cgroups tests. > >> >> HTH, >> Michal > > BR, Jarkko > Do we really want to have it implemented in c? There are much fewer line= s = of code in shell scripts. Note we are not really testing basic cgroup = stuff. All we needed were creating/deleting cgroups and set limits which= I = think have been demonstrated feasible in the ash scripts now. Given Dave's comments, and test scripts being working and cover the case= s = needed IMHO, I don't see much need to move to c code. I can add more cas= es = if needed and fall back a c implementation later if any case can't be = implemented in scripts. How about that? Haitao