Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3148755iog; Mon, 27 Jun 2022 10:07:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uCWKig+52zxlUWLsEsgeIYovbxZH0Hs66tJu1HNkAI9D3WTyYqDWTes2o9H3eOek+fIDzT X-Received: by 2002:a17:902:ab96:b0:16a:6db6:2715 with SMTP id f22-20020a170902ab9600b0016a6db62715mr16001346plr.141.1656349640253; Mon, 27 Jun 2022 10:07:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656349640; cv=none; d=google.com; s=arc-20160816; b=t9HC6SusgvBdJFUiG0MP5AEH+zVn6b4GAX6IS16TrkVWMM6vL0jKbh8s8jQNirZwXS 5T++hABtpMPAmOS1bdIJig3kouwGONvBhaDGQZw/8Y/TmIbO6VWKYJYm2hwAZdYsXfpK dbnqRVJvECiL0aCGbe/7ydx5J9iWCnwd2pYoALQ5gKer2oP4tjeqrqBUzLNtMFjZrE/Q 4Xx7OejQgArx9jzs2glr6BlDPePaBxRhN/khm6p9nr5KBV9tPtBzRV7bHoHpDaGYX8F4 +LVk2tCf6laOvTRjIjGkC6u1+V+Q/RrvdBw5DeX1ZEQiM3+gm3vOO3UjDkmtVTYiBvhv O+Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=1n5+tTXfxvB7wLEdpHqCm9+HbbRZEAGOiM6JchYLEEA=; b=jObmFTmOkZopbW549jfkg2wz1IVRhy8G+IYCyUzO+VOkW3+ZvawynnsuJALuI8V2YO 7XBewQKJlX+mwYG0bbjE6Sw2NR4VQuzNVVNjDAh5hBniV7Fe4K2lHvCJ/pgRx11fxCvs Yr2lizVhdWelk0qNLS3wf41MbV8l+eax2RUaN7+IOHRfREjwN1GWdVeb8mzZxaGazjBc DTf+HfaIDN7BS0VimjrBcTOmMkLhwN06gpSLFHAprt++OQKSK4hq5xp+jGRSmvMuAHxw bltLB6ZzkxFnfwMfdcUbRQvjGtrlXy/3AV9wBoLtsFm5/0ZmJ1WgOlbwNK8QCFFrp9j1 GSkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=TuIDyDjh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nn9-20020a17090b38c900b001ecbed36a3bsi20261895pjb.40.2022.06.27.10.07.04; Mon, 27 Jun 2022 10:07:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=TuIDyDjh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238091AbiF0RAW (ORCPT + 99 others); Mon, 27 Jun 2022 13:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235496AbiF0RAV (ORCPT ); Mon, 27 Jun 2022 13:00:21 -0400 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B5FBDEC6 for ; Mon, 27 Jun 2022 10:00:20 -0700 (PDT) Received: by mail-io1-xd31.google.com with SMTP id i194so10152671ioa.12 for ; Mon, 27 Jun 2022 10:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1n5+tTXfxvB7wLEdpHqCm9+HbbRZEAGOiM6JchYLEEA=; b=TuIDyDjh+Fh8IvzIgcxLkECsvGgepX8QCxNW5muxgMj4AuxdvJykORfH+B33q2pSUz aCPMMkkphNHOGRuWbIWhyQThYGYG0oAT8QKG8Ii+lgnwRaCSFyvSV15xWdJalgo72ieJ BaaPgTXTMUgSePlhvCeaA9m9fgtz63Wslx2qY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1n5+tTXfxvB7wLEdpHqCm9+HbbRZEAGOiM6JchYLEEA=; b=hBi5Nwo18KZHwDzxk5PMPYgeDItWQBQxg0LJrpFPBDZeRYSYMi8T9aM8M0EuKHdLoU n/bX0tudQP/nUFlnT2TsjBd/4RRPlyJx0fcjmEWgfrJZWajmF7UbzCf9L6P0PiX+NXkx E2PFSKPz33+llKgzUytZ2zLuok61VaGPyHs1lMISWv3Zkf6LkoD4lfKJOXbhaNnP1kJJ EvQFtWxW3QZK05Ot6R0iroVAS/n9XJZn49mvxFnWeQxVzdKid3rLnjy7/XAqdcy3J0Cg H3jLVidGuOnMlVDNs6HpYckL2Y8fjPulqOyqvHLcIJYDx/hcZAkMYTqzLKieyEzE+3H3 u5bA== X-Gm-Message-State: AJIora+cZFG++oZNCOAuExGSR5NPfVCnB83reiBAvPkg4fJvGI7bE9B2 /tOWay7+fLdV+As+UPGL6MMoaA== X-Received: by 2002:a02:c48e:0:b0:33c:25bb:a1b2 with SMTP id t14-20020a02c48e000000b0033c25bba1b2mr6820280jam.180.1656349219772; Mon, 27 Jun 2022 10:00:19 -0700 (PDT) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id f11-20020a02a80b000000b0033c14d2386bsm3090948jaj.75.2022.06.27.10.00.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jun 2022 10:00:19 -0700 (PDT) Subject: Re: [PATCH v4] kselftests/damon: add support for cases where debugfs cannot be read To: SeongJae Park , Gautam Cc: shuah@kernel.org, damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20220625200334.83818-1-sj@kernel.org> From: Shuah Khan Message-ID: <7d6b7de6-4609-e6ca-0a88-1f9799c70769@linuxfoundation.org> Date: Mon, 27 Jun 2022 11:00:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20220625200334.83818-1-sj@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/25/22 2:03 PM, SeongJae Park wrote: > 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?" btw - does this run as a regular user or does it need root privilege? If so add a test for that and skip with a message. >> + exit $ksft_skip >> + fi >> +done >> -- >> 2.36.1 > thanks, -- Shuah