From patchwork Thu Sep 16 16:01:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 513039 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1438896jao; Thu, 16 Sep 2021 10:36:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKi2DEr2GjHw9In3UkfP8uzXtloNsDhxcPCLwm/tW79CcQU+ehAE2E4dhGIqmCe0NDBnv+ X-Received: by 2002:a5d:9047:: with SMTP id v7mr2386683ioq.214.1631813818685; Thu, 16 Sep 2021 10:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631813818; cv=none; d=google.com; s=arc-20160816; b=k3m4nEqsdtHV3RH4c3s5RqZNjcgvORwVt+YZxTRcgLD+IbYbLkc1KXbjAHYLQmqSuB ERzQEIAYDTxl1I5KKjgRF+BhAilZHKSCWHzhgu/y+hlKH3RdPOpChdBWW9pNBNGJrb6W WqwH8E8GNLxhaMTHa5ELTpg27txgcGGsm3OTLfy6Bv4z77wsVcIlflof+E4tgwagiQbX VQpldCTRWjpLFgPe079byBMwQWmbZLOua1VX83cer8GyYKaKjmULBCAtGHuGDMdPGGew uXcZx3Kg3jjNODtDdCN4WRvTjHPyRRYI8sYyrkCTF/XcMeGBdz2Bq7EmTmk6ksNt05Qp tLHA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DnNrzP8j9q8Ik75DL+0b42qCHjdjADkr5+cykFPrHtw=; b=sx7FAg90butffJxHCUN2CSa7XZi6dRG5NEtmc+a5pdhhYDISmJUnAa+rywEimBf3ge AiLHUTSxhKTn4a07VccNwMDc2eGUt+3nV6SkoNUVjCxmj8rPFXwL138F+ZE0dSWTHsQG JuODoSn8Fq/DghmOYJpTxS0+DlrkR3ANjBf75IjkXCYE593Y6NUgjWBuQNUjcYM+0fnp 0dsjJLdJqANBIr3qU0NdCucy/OH6f8EGdWXExQ5rvMFCPJ/z0BP6lVV1cFIf+p3tKDby QGSTaWtBccQz3FfP4bNoqwUPrICFRJz6cUsE0HHyeDUN+ubkUVXeBdQIC7mbzKiQukGx CQ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ce35D9SM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si2888854ilk.74.2021.09.16.10.36.56; Thu, 16 Sep 2021 10:36:58 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=@linuxfoundation.org header.s=korg header.b=Ce35D9SM; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1344557AbhIPRiO (ORCPT + 11 others); Thu, 16 Sep 2021 13:38:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:51274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344610AbhIPRf5 (ORCPT ); Thu, 16 Sep 2021 13:35:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 88CEE6322F; Thu, 16 Sep 2021 16:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631810941; bh=n94kMwFHUMe+HkJMYWMwz/mNrdLxyfQDhWM2x1S7TPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ce35D9SMnhrWKYHcybyjBWrCwb3i0NXBEvDHOL99IJXH4VFWS1cyEx6t+3juqw57S SyV+39RHfkWPj9AJhMe1PCWB1vzY6x0rOjivFyd4UAzKW07do4WTtJkLOzUXbZp/73 Aw8j48OXmIaVUxjX1zyUPy6ipT5gVjnkFFG02rNQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Catalin Marinas , Sasha Levin Subject: [PATCH 5.14 324/432] kselftest/arm64: pac: Fix skipping of tests on systems without PAC Date: Thu, 16 Sep 2021 18:01:13 +0200 Message-Id: <20210916155821.818467461@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155810.813340753@linuxfoundation.org> References: <20210916155810.813340753@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Brown [ Upstream commit 0c69bd2ca6ee20064dde7853cd749284e053a874 ] 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 Link: https://lore.kernel.org/r/20210819165723.43903-1-broonie@kernel.org Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- tools/testing/selftests/arm64/pauth/pac.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.30.2 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;