From patchwork Thu Aug 19 16:57:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 499755 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp712596jab; Thu, 19 Aug 2021 09:57:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRHVaP6+zJ9GFJhjdA0FAXL/n+ZJEZ1fD5EhvKqF3ykz/mvWDaBJ3TjtwPj0n3I/miGHQl X-Received: by 2002:a5d:8990:: with SMTP id m16mr12278841iol.170.1629392271240; Thu, 19 Aug 2021 09:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629392271; cv=none; d=google.com; s=arc-20160816; b=J/gSz1bUGHEtJ3BVG1myvCXLXGmDX5PlP2JPDkqcoYjig3biLW09ukHtpFZ+9O0J4J GOMSdNNcVwQxTdQ8a2MPCFCYFhJZ43bgzzqmJpJZGj3Tak64ml8VwP8ZpFi1fjiwFMm+ KVJ7r4OSKfTp8t2h/jpYFTt60aYq7pHGZ0u485QxuwCXk1mNPy+2PyN+hy2AQeZZ7Uyc cYIsxJIhwSoPCA68otRch/0iX1EG3ZglbxPCjBV+IGjGfw8EZYolu4hzav4o/uSsMCpD HodAsWDUrY3YmNP01Y5yJAVgmj47Lf7ZrFuofJeJT3IciKCnGY7+JV0blMzuUMoh/UjV xl8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Xupm0KVMXLpaP5eFFj1m+JXG25nBgHkkple8QqUtBcA=; b=iBg4XDJJIJtECbdOnKT07d3s64JZR+H1/WXnSElm25i7FbROmx/Z98184w3pep8ldQ hQt/IzZQK0usFk4XaazYDzvyjjMbmGUPDXScJqrRu6NH3ktSfMLLG7I8UUmmal0IizRP KBUCicwn/sAHI6QoRI9voQIutwqUFMt2N392nP2XSLjeaL1erdPyMChil2SIISUBHwHr EL2YQLKpiz78oL4MBnT+MLDvvtezT6aVmNTuQ/u9dTXjWy97tUHmif5PyES6ipLA8Och Wlt8VO+dGThXN6zJ9lmGa9GUchwXtTQPc2ESZGUJ21UuPCy8WWcwroVxIgNvoxyb0GyF bJkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gg7IYKb/"; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si4318158jas.59.2021.08.19.09.57.51; Thu, 19 Aug 2021 09:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gg7IYKb/"; spf=pass (google.com: domain of linux-kselftest-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kselftest-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbhHSQ60 (ORCPT + 5 others); Thu, 19 Aug 2021 12:58:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:35326 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230447AbhHSQ6Z (ORCPT ); Thu, 19 Aug 2021 12:58:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 460FE601FD; Thu, 19 Aug 2021 16:57:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629392268; bh=4Z1HZ0K086DZLnkbmc0mR7qpEi1HN+RlBAKc4MS6lHI=; h=From:To:Cc:Subject:Date:From; b=gg7IYKb//PtDZrWhmh1oYkdjSYiAPbFh6bzAgwS331SYDj2OyD+7zdiKXipjyL/Gq yd5Myx32TEFNeDRtQfoEnedI/ZA/YXYwIsphFDWzWBasMCnOAXTGjr1RL/lghAyYGa oN4NC5eO991jYlGyEJHXfbPih5CzkX8n9hZn+h8b+idJmWzg+YXsv/yej0/XCLbyUK dOaRwWvjdWZgTLyP/38DGJu2lVtG+JckksGsrP22OoSdD+tKAcXeO8TxdKh1k5XNR+ lwNKCwD4fFJ9Y9HvKyN63eEWyPmVwkYQtWuqZ3qZcVee5vmElbI2YOyBYXez+D+cPY t+s3wjKm4WYgg== From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan Cc: Boyan Karatotev , Amit Daniel Kachhap , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, Mark Brown Subject: [PATCH] kselftest/arm64: pac: Fix skipping of tests on systems without PAC Date: Thu, 19 Aug 2021 17:57:23 +0100 Message-Id: <20210819165723.43903-1-broonie@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2207; h=from:subject; bh=4Z1HZ0K086DZLnkbmc0mR7qpEi1HN+RlBAKc4MS6lHI=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBhHo0e5zwWI5Jb7YrULW3YqzKg05453QjFmhcXdI6L KkKc7nmJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYR6NHgAKCRAk1otyXVSH0JSiB/ wLmJrovhbkeBfjz/scIub4P3eSfyGeLxSNN+yNbWKpDnVw4fl/lC525Kwpz85Yiiv0o1NnFndfyz5R 71sViBOvVZRZec8rfIhkjzs83nlC0ZfTi2lpC1zGe5SWR0Jq6qnh9rqSbsW7BZqr/1iEb4ma8fYmkY m2/quYrZJy1kpQ8cAdtOFfgYTDSOBLYi27yo8qzEgs5a75zPXxx1JYHoJpcRWW14cxEwH2zfxHQkcw WuebSWi3Uo2e0wxhJy49JH9PABm1GnntWU5WrBDI0aLQm7OciBQEsmvSkVOfouhTuIewo551ua6Has quqtq05Tt6jQKoX6C5XOkMuSHpDaen X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org The PAC tests check to see if the system supports the relevant PAC features but instead of skipping the tests if they can't be executed they fail the tests which makes things look like they're not working when they are. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/pauth/pac.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/tools/testing/selftests/arm64/pauth/pac.c b/tools/testing/selftests/arm64/pauth/pac.c index 592fe538506e..b743daa772f5 100644 --- a/tools/testing/selftests/arm64/pauth/pac.c +++ b/tools/testing/selftests/arm64/pauth/pac.c @@ -25,13 +25,15 @@ do { \ unsigned long hwcaps = getauxval(AT_HWCAP); \ /* data key instructions are not in NOP space. This prevents a SIGILL */ \ - ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); \ + if (!(hwcaps & HWCAP_PACA)) \ + SKIP(return, "PAUTH not enabled"); \ } while (0) #define ASSERT_GENERIC_PAUTH_ENABLED() \ do { \ unsigned long hwcaps = getauxval(AT_HWCAP); \ /* generic key instructions are not in NOP space. This prevents a SIGILL */ \ - ASSERT_NE(0, hwcaps & HWCAP_PACG) TH_LOG("Generic PAUTH not enabled"); \ + if (!(hwcaps & HWCAP_PACG)) \ + SKIP(return, "Generic PAUTH not enabled"); \ } while (0) void sign_specific(struct signatures *sign, size_t val) @@ -256,7 +258,7 @@ TEST(single_thread_different_keys) unsigned long hwcaps = getauxval(AT_HWCAP); /* generic and data key instructions are not in NOP space. This prevents a SIGILL */ - ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); + ASSERT_PAUTH_ENABLED(); if (!(hwcaps & HWCAP_PACG)) { TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks"); nkeys = NKEYS - 1; @@ -299,7 +301,7 @@ TEST(exec_changed_keys) unsigned long hwcaps = getauxval(AT_HWCAP); /* generic and data key instructions are not in NOP space. This prevents a SIGILL */ - ASSERT_NE(0, hwcaps & HWCAP_PACA) TH_LOG("PAUTH not enabled"); + ASSERT_PAUTH_ENABLED(); if (!(hwcaps & HWCAP_PACG)) { TH_LOG("WARNING: Generic PAUTH not enabled. Skipping generic key checks"); nkeys = NKEYS - 1;