From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9CC7C43334 for ; Sat, 25 Jun 2022 20:03:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08A0F6B0071; Sat, 25 Jun 2022 16:03:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 03A1D6B0072; Sat, 25 Jun 2022 16:03:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E444D6B0073; Sat, 25 Jun 2022 16:03:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D21756B0071 for ; Sat, 25 Jun 2022 16:03:39 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 989BE33C41 for ; Sat, 25 Jun 2022 20:03:39 +0000 (UTC) X-FDA: 79617833358.20.F7AA51A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id A75F51A000A for ; Sat, 25 Jun 2022 20:03:38 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C503760AB2; Sat, 25 Jun 2022 20:03:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70B63C3411C; Sat, 25 Jun 2022 20:03:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656187417; bh=BWeR0SUqiVtogg11CTKEDR7vQjoaisWfSZKgU4PshMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aGtXbY+/cvxOUWVl1/9H6NVBmQQy88ag5fLvY7IyuHs5Mh6hNa3I8FnzxrRPNcUoE pF+99qRLy+ZuZLIWEnW++pJ2nayl4ywHcKXTjLVCXWoddXV4PFy0ZpaWnikrZS3ypO InQ6JR6Vl+TKqZRwCFhCp3MLpotakpU1TrkuCgSmE8Zs5miJ526CKeiVMYoXZnyuBx K4jJl18oJ+vCYsE1c1BbtgJovjNraG00X8U1OvIkxhHkb/xdBg3xTKY3mZoZxypgWm P3MaecMfx6zC/MaortF4U/UAvlsi2ZM83GP5q/ULb3qaGV0QpzW4r4WIt8u1hEtNyE En58Hnv1ZBagQ== From: SeongJae Park To: Gautam Cc: sj@kernel.org, shuah@kernel.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] kselftests/damon: add support for cases where debugfs cannot be read Date: Sat, 25 Jun 2022 20:03:34 +0000 Message-Id: <20220625200334.83818-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220625195245.4368-1-gautammenghani201@gmail.com> References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656187418; a=rsa-sha256; cv=none; b=l9oLh1bX01sd27s1uhceuqeaXoiM+zKXSt4mYYK/YgzETim560cqfOVUj8errSJfPrItBe Okz+RCJ3yJwZQqAavBdPSEjLY2DB047UJB8xiPE8wjZz0vl4cTlOO2jN/299lmAb8J9jPA iQA2ovRYM9lB4oCDVtVAf+a9Bnt1d1A= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="aGtXbY+/"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656187418; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=lovFUd7B0TyvJjmljwcdoNbS2/YuefyO62F5DCL9/3c=; b=F/KXkThvdJAPdNYnWHfoLkzzG7pQQiHrs9KGt8uHpCQNBl2hSJsgEeWck2Q3puhZnKMOIu +Bxg8AxjprbGCtS5hhqIvOyDqAgVz38n/PjJRRinh1FFv+P6NordH+++nL0tXWbx2Uvlwp 4LMeU7Pej8uBaNdhhJlKMfdn0zm6ARc= X-Stat-Signature: mcneccnuo3dsu3akgwbzfgistqcehu73 X-Rspam-User: X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A75F51A000A Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="aGtXbY+/"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org X-HE-Tag: 1656187418-938914 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Gautam, On Sun, 26 Jun 2022 01:22:45 +0530 Gautam wrote: > The kernel is in lockdown mode when secureboot is enabled and hence > debugfs cannot be used. Add support for this and other general cases > where debugfs cannot be read and communicate the same to the user before > running tests. > > Signed-off-by: Gautam Reviewed-by: SeongJae Park Thanks, SJ > --- > Changes in v2: > 1. Modify the error message to account for general cases. > 2. Change the return code so that the test is skipped. > > Changes in v3: > 1. Change the name of variable holding the error message. > > Changes in v4: > 1. Correct the mode of the source file. > > tools/testing/selftests/damon/_chk_dependency.sh | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/tools/testing/selftests/damon/_chk_dependency.sh b/tools/testing/selftests/damon/_chk_dependency.sh > index 0189db81550b..0328ac0b5a5e 100644 > --- a/tools/testing/selftests/damon/_chk_dependency.sh > +++ b/tools/testing/selftests/damon/_chk_dependency.sh > @@ -26,3 +26,13 @@ do > exit 1 > fi > done > + > +permission_error="Operation not permitted" > +for f in attrs target_ids monitor_on > +do > + status=$( cat "$DBGFS/$f" 2>&1 ) > + if [ "${status#*$permission_error}" != "$status" ]; then > + echo "Permission for reading $DBGFS/$f denied; maybe secureboot enabled?" > + exit $ksft_skip > + fi > +done > -- > 2.36.1