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 0CDFDC43334 for ; Mon, 27 Jun 2022 17:00:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 628768E0002; Mon, 27 Jun 2022 13:00:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5D7A78E0001; Mon, 27 Jun 2022 13:00:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49FE58E0002; Mon, 27 Jun 2022 13:00:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3A55E8E0001 for ; Mon, 27 Jun 2022 13:00:24 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1771C206A7 for ; Mon, 27 Jun 2022 17:00:24 +0000 (UTC) X-FDA: 79624629168.09.DC11D7D Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by imf16.hostedemail.com (Postfix) with ESMTP id 9B2E81800AE for ; Mon, 27 Jun 2022 17:00:20 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id s17so10200591iob.7 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=RfJph4s/lSDCj9ZvJGQzOM/s5KwJ8VIVYGOjeR1L1p5uw1AoeF7PjTe2VCHjBklQ8L LYjtRn6NcDlUv0TaIoQ13eKymkWagaEkOLgSt3PM2CliQUIh/n2ZBJwj1mSHRY1XOyZo x//p/r8XYwJ+7Emy5bw1MSMmIHaxK33IFeP8MQrk8V00f1DKeR106JJ2OzA5swD5VIaJ DIx55SStQHjbFQ1vibjT9v8Oa+71pqmEgUGfPTdKnlzvJQkqtSWjKktHdg5UuPWI2qvm ZLFo7PRvAjtgMMTRjYsAoUtHv2CXouduYotA/Q326XaNhP8ne1PKfs4RgxvK25c5JUD0 g8tw== X-Gm-Message-State: AJIora8BHUo0BEYHctm4D+lfCTVRgh6cRkcsVBcNht0PXtt7TXM3ymuE gCiX+Tz+NatCr+T9dw+LlIm5Iw== X-Google-Smtp-Source: AGRyM1vka6RjReMyIAyXcFVuxqCEEEXnk7tcE9JyWX3Aza/OqWoGpuS3GK/cWr9ft69qR0A9bFPljQ== 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 ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=TuIDyDjh; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf16.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.54 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656349223; a=rsa-sha256; cv=none; b=Tq7D8FeugkBf0Q0fN2GH677DBuOpg07jOya0Ag9auTp7uOsN2iQ0uQkKf3EKRrZ0sDMROy Gf5SSyvJm1u4EHdpeg/dobyDOmEsFiPjJ9IYqCKKbhfUBCmjQgIq4oOXIhoAxeAR9iBICL giySrN22fEowsYzC5ojViOwJcCBfCFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656349223; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1n5+tTXfxvB7wLEdpHqCm9+HbbRZEAGOiM6JchYLEEA=; b=Ko8Cg2ZDCFxfd9TYSpzpuzwCzgXhgscOnKdCGxGuuRPsILnk2b8vMxlGN4YpimBwLIdSjU 0m8t31wqXL/NpfJa4wWS1yG2fhdyrhEnJRNkW9Lp/a3t4zneBYp9P19H8KZquMLOsmGvoZ 0qLt/P5hF1h1U4LAO7E5uVJniRzzzfE= X-Stat-Signature: ukxu4zrha8pris9953x5mhnf6tmcusze X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: 9B2E81800AE Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=google header.b=TuIDyDjh; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf16.hostedemail.com: domain of skhan@linuxfoundation.org designates 209.85.166.54 as permitted sender) smtp.mailfrom=skhan@linuxfoundation.org X-HE-Tag: 1656349220-641362 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: 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