From patchwork Thu Sep 16 15:59:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 512984 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp1365249jao; Thu, 16 Sep 2021 09:19:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1B5rw2xSvTxwSHyZ+PrLOVJKcN5dNrulfOROGQudrTcYJYTjyLFm3LacPAdqi+9IrWCLG X-Received: by 2002:a17:907:784b:: with SMTP id lb11mr7371426ejc.307.1631809171877; Thu, 16 Sep 2021 09:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631809171; cv=none; d=google.com; s=arc-20160816; b=y4USgWf8dIxrGKv401jM5D0ehitv6uo7/2nANFn+60MYAorrBSPreDf7QlFLKBEsSD 6mU6SYUcD05bepaj1gljUNNsTecu9JVTeC3wUCOQrq2D6Eydn4E/xs4cbBBKFr013Axw 96t/xTTPUBSzA3LGdWLlxzDP2ZRDTg2rOMSc769tp3rTlPGFCOf1kZpKumIva+MNCMYs w568meJexwqldeZbGAy4bGb3pHMUlf+8WdBbrE9FBbJMUTDZhQ2Ep5f7Oomc2bsMlrqC uaREJzdZi8+XSTClwfT14rtA+aPz7yPgg+1DrZ08pT0D6eW5bZgblDq1HFUBBNy+3rSj +VMw== 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=xJwqqaZgtN5JPv7FmjllWXKq0gEX6H+Xrosu6Vk0AiFHzEWY4pqJq5DoUQrIaNmNkj rPPou593ZJNVYUuIaXVOwE5tQdatnnCX8zfW4jvvwBX+0jtVqAiqE///etok5q4AxVTg E4w0x7s2AJ4o8I1KmUfgZnn549F/zlN/qHxCt+hUXGvk7/hpjb8V6UStjDIBeBsTFE2C XNYUXx6OqcJsnudbAetR4zxfO4A0UYRlFrf1i1bG8Vt698xEbS9CT/k/ejAVg8rbxVKV rLyw5BcYuT+evWq6thTHwhC0WTZrby+b4gI2lSHiOMzPSwpQePF3+x1jW6sHxMStjb+h pJMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HaGZ1ZUL; 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 c16si3996871eds.14.2021.09.16.09.19.31; Thu, 16 Sep 2021 09:19:31 -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=HaGZ1ZUL; 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 S240776AbhIPQUu (ORCPT + 11 others); Thu, 16 Sep 2021 12:20:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241346AbhIPQTW (ORCPT ); Thu, 16 Sep 2021 12:19:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D14206138F; Thu, 16 Sep 2021 16:13:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808812; bh=n94kMwFHUMe+HkJMYWMwz/mNrdLxyfQDhWM2x1S7TPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HaGZ1ZULNu3wVcXRgaN35T59SDg1f2j+L1FlJIGwqKknMKIS/Zs/NzrUsoUBZVj25 +JUadB4efwTa6aa1Rw+uWuh+wFyoZbJOrVPHKuoD8q5bcBg2Aps2X5w+0DttnSJyDz ZATFA4Cz+DB7IWI4aieHzB8vTS5U+mZnwxpX7umo= 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.10 231/306] kselftest/arm64: pac: Fix skipping of tests on systems without PAC Date: Thu, 16 Sep 2021 17:59:36 +0200 Message-Id: <20210916155801.928625102@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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;