Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1568123pxb; Thu, 16 Sep 2021 10:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoVoRCXI+t+Nsxb8OleQ5sKszrFp3OMfLLoElMzFCJnqaaETkRz14i83I/vE78S+TXVI9/ X-Received: by 2002:a17:907:760d:: with SMTP id jx13mr5526016ejc.194.1631811893015; Thu, 16 Sep 2021 10:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631811893; cv=none; d=google.com; s=arc-20160816; b=eJ1/l+GX40RiiFl7KIU1B3WPJXQo2mz9/ql0BkbvYriHotHHQRPRsfc8xuS5VSzJvN DxIQ6QM9O0dCBM+/GUqAz6+WkvaxkgIEMXwdl1gS9t6nEcTcNqSS2i8MNCKtb7vFzy+Q Zo5LY80u+HMxpHo2MqAd2Wo5xvN5K11QL+rSNVdKh4WF9v/sN80gl1EhHIDnt7hPGkkM Fy0e3HoFMZH1VvQtz+S+tYgYncqYqoGdQieTtx04gX4rcaRZLD+CNIvyDCGH4If8Ev2M KuPDzioUv1AIaFPUo+JqBU26ZHC2IOTYk/dx4v0G8FYMiavYNEMQ+w/fGOeFZ5SKGpCw fcOg== 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=Htccfy47qy9pkB3S9vnsV0VaYcXI3+yjcp4IbYnEAklg5N48yVKLSXEtX6H35xT/OP zgp+GhEMP3Epgtyqrp4yIzTCiWEo4mSdn8ro8msnyR2B890oE+YqgaVLZX+412t0Mpzh FrMEzY+epAoPJHYyBrx9+toxqzvWMVymBQhkOLcsNnuHKRNahcDoZu3cu9SlITmCLGUO MsrpPEH/IWFLT17S3UrP1CUhMZ5IAjUUeSMp3EAeccmnRltoopYYpUT3us3jRCSTeI4a GHAJt0k4UZsMhvg9XBtKmppe7u+9zuvXuyz2PUkmC5ksDlQn3ruRl8UJjVSKeYuIC83W HGbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sOMth0DV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si4038964ejo.215.2021.09.16.10.04.28; Thu, 16 Sep 2021 10:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=sOMth0DV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1347455AbhIPQ7Y (ORCPT + 99 others); Thu, 16 Sep 2021 12:59:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:51240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346230AbhIPQyb (ORCPT ); Thu, 16 Sep 2021 12:54:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2424861355; Thu, 16 Sep 2021 16:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809804; bh=n94kMwFHUMe+HkJMYWMwz/mNrdLxyfQDhWM2x1S7TPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sOMth0DVLMjbvqIP+AV5FpnQWHp8Z0LDjbBxp+OUbV9YW1rCj35ooBQgzDSu1PiSt BzbNX9hk8lwKpevjRJ7dwCk1a3RZ8CXoi5VlGiQ7a8PT57freY6Wq9zOhoFc1r3SEw TO/mIl1/RB4fD8RkSjUjImKH5C8Ob12Z2VnE1Ym4= 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.13 290/380] kselftest/arm64: pac: Fix skipping of tests on systems without PAC Date: Thu, 16 Sep 2021 18:00:47 +0200 Message-Id: <20210916155813.929919044@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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; -- 2.30.2