Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2011898lqz; Tue, 2 Apr 2024 04:59:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVk39glSw1vlZEe77eqxnmc2nzOe5oovr65Uv/WFucbAyhOCLzqRR+EQiaCTY8NHZxYdwPHgGQYs0zRjDOMn3A09KjWcpDfTAhEyCfuTg== X-Google-Smtp-Source: AGHT+IEPe5p/cij37EbbVdOXv7X2UZmrwq+TQCE21YqWsps9KR/oKWCCJLpaeXTQlJevcpMy0Buz X-Received: by 2002:a17:902:f545:b0:1db:7181:c5ba with SMTP id h5-20020a170902f54500b001db7181c5bamr13881996plf.62.1712059177428; Tue, 02 Apr 2024 04:59:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712059177; cv=pass; d=google.com; s=arc-20160816; b=LMDj864lrIgXW19knKp4J1Z6FaP8TO0pqJjgYe1R2IQjI6wXgmS+5hxlRKx8rpEEnf XZemmqbftXGdYjGctASn7XHDZgLBQoDRBcK33lvqyzT7nyOsC5QL5f+8BG1rsx3v8CKD 6sYV4acBTHK4zUhNc8V4I1yb4idg1HzIL9QFI/rk1dltWUAEtU0a0UHhK0CJ1mUcIOHA kUQ0lHaPWhwfXhtWt/dsZ4clPrjEZtSiwRJuf6cmRj7wLVw94PghbVm9ftECO6CnMabU sBk6N9DtCW6d2lSskk+bZ8uyu514ZVgp4ISJkTH+q5iZk0DNmKSJyfytmPmjV8eIaklx UR3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:references:subject:cc:to:from:message-id:date :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=toB3r5yu+/fAWQlVjt8rdcHtoXfRJZjN8VmMvbQB59A=; fh=9fJxmkKophOMqy92IBFBXRG4GxbfgLOj7cPST8S+i7w=; b=xy+2N8u8QVwcTPD/UXeyuNFWUJgdN630GqhAguW3yP/ISdnavt/R+MryjksSGlXV3l xnDr1MOkSat1znNe+YLjj3CFoAatTGljTGPPeXPMgKcaV6xidGwzUwsr6KMkN4Vsu9Ut Lty1JeGf/bPuVrK2/YY32BapPZCOzqWTgdEMUxUv2Sw4HWJtscev3k4IV23vSQjX9HIV /TCaocsC36Z2Q9Ptnnn/w8IDJcfZdJW0Ijg8KDadoecrPrcAaotR5U8EyGZO7So0k3DG +fxHOD0YYiwGfWfkN32armPjrCGGSj0piw6aUlBoHfWOGIJQn3c1DFOLZIdeNVKZAJ9N i6Qw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r7I6yrQd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h12-20020a170902680c00b001e0a14c3b79si10595299plk.609.2024.04.02.04.59.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 04:59:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r7I6yrQd; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-127885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 420902835E0 for ; Tue, 2 Apr 2024 11:58:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D621069D31; Tue, 2 Apr 2024 11:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r7I6yrQd" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EC72D5A4C7; Tue, 2 Apr 2024 11:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712059127; cv=none; b=m4mMh/alJCIg1xdYS46MAuhJn9mWRW53oRFaLjtRno3m5WUUwmUm5XIxrTttTcCrsWC6FBr4pW8pKBdSlFRVry/gAifpH5E148K3yV16FuEk9mQAijYFkaPfnqFpZUAvbgInsoGlWsaXUNvnRP+MLRSgTByKDlTdqa0zYM9KYM4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712059127; c=relaxed/simple; bh=DY/Q/EiQtNhm8+8sgNFGHo2U1UZo69cenu2M0qwUy4E=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=pQPx19Av3CyhEmcOZF216O4ZGA3rq9DVCqBU06QaSbJBtYtKcqYQz4PDcuTcpWbuEJtJCZjpWDf39y41OWV8bb9yWoxkqoh8qYdqrxarOWNeYrAOZcPwcE/vV2c/gkwuZyEwIKqT5pj9yOmlttE89wqnA8Tyg1lLDzbbNa5IgzU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r7I6yrQd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8790FC433C7; Tue, 2 Apr 2024 11:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712059126; bh=DY/Q/EiQtNhm8+8sgNFGHo2U1UZo69cenu2M0qwUy4E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r7I6yrQdxowtdndTnB+j9jV3eTIiBbOcXzK1nyoOfp2DdZQoDCAcwG4h72t+6kCib OrdXSrcFLDAvQ9ipGp3a+/NYka+UxZvk5CLssrqTYYvuxJ6UqKsJzfeu3ftp4HykC7 SdCxFdLw03TYZ42N1NvWc7bsNbCouE+patdQDdKJpVVN+pqFMq77IlXr/5Ru+pFefc U3oVIEv3TzGlRFGcFGh/h5MKOCgqecTjln4Fv3Cqd4ue37u2wVm5jaCoSz05Tho/H1 LeT8g7v/JI3DNByUqaw5NMrzv2kMtAs2+44UgtlfD2K98MsDT96ofwWLU7yl/rNBiA oCX2q8VHpTLLQ== 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 Content-Type: text/plain; charset=UTF-8 Date: Tue, 02 Apr 2024 14:58:40 +0300 Message-Id: From: "Jarkko Sakkinen" To: =?utf-8?q?Michal_Koutn=C3=BD?= Cc: "Haitao Huang" , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v9 15/15] selftests/sgx: Add scripts for EPC cgroup testing X-Mailer: aerc 0.17.0 References: <20240205210638.157741-1-haitao.huang@linux.intel.com> <20240205210638.157741-16-haitao.huang@linux.intel.com> <4be7b291010973c203ed8c7bcd25b626c1290231.camel@kernel.org> In-Reply-To: On Tue Apr 2, 2024 at 2:23 PM EEST, Michal Koutn=C3=BD 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 with= out the =20 > > > > cgroup-tools, esp cgexec. I checked dependency, cgroup-tools only d= epends =20 > > > > 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 complicated > > > 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=20 > > > unfinished in its current form. > > > > > > What is "esp cgexec"? > >=20 > > 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