Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp453189pxb; Thu, 9 Sep 2021 04:57:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlDuYSO/R8yf6+nWnkidokojObw5R4a9aMU2Id0ceheJOTV5XWJfzFLTLsLz85b03C6hbQ X-Received: by 2002:a05:6602:584:: with SMTP id v4mr2360248iox.85.1631188667231; Thu, 09 Sep 2021 04:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188667; cv=none; d=google.com; s=arc-20160816; b=L+rIt1RSnaj/f7sdhjLshWZuLud6UjY1fhrYLN8FljpZdA8nXKtWem9HV8H85v3Kgx BN5arr0wzo/ASFVtSmdW6K8xpQqftbvLsYeuPUud86shYF6ruZKS4itzsVK9JfPgzI5t nQ47677qQsfwV9OpNCejCpWC6X/xnCB0wdWPu2xzIzeRAQ9fM370qFtddKjht0nKAnO0 R2REHgkbeAAW7prTxM4NvEvq/3GiVFinwVcLkpw+S4j5vQwTsHSrae0QcYJA8gkuZrKv gLcRa9IV1CPvc+kWSMT26OXPUpvHzKr3DB0edGzQAMmUWaPxEjTcJT1aYJLIu/VAW1oi MWCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DnNrzP8j9q8Ik75DL+0b42qCHjdjADkr5+cykFPrHtw=; b=CyY2EfSVQqOxNW3hHhLnRNf4qZz7A2bT4AQNJaN59gbGyuBdJA1kh4mQu1LZg3raxa 9jVo5n2MyjuI/pzCtbRNB9C4yo8XTUM2ZZalwUicA3CBQHVQFZG2p1S2knaiXflYWslF fQGmczJtpkLBGK4SlK9cu3GF/weHwkYnhP068hinP3ooZSCY2OkDXozw6QsZ+PSxXVED xv4NUljKU9yxnQPXjfpZ30ZkoOGdVUt5ITTHZ6179mBCaU6Vz0UordS7iSLdP9kcbuNX D3cB2MxHgUhXyswfqVzsTGRBskB3OvNuBg9/D/kF5h9fkrFTGB9tNoVUOoEOXJ887VrG 8IOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D8zS34zt; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si1712528ilu.98.2021.09.09.04.57.35; Thu, 09 Sep 2021 04:57:47 -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=@kernel.org header.s=k20201202 header.b=D8zS34zt; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242448AbhIIL6D (ORCPT + 99 others); Thu, 9 Sep 2021 07:58:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:34544 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244637AbhIILyj (ORCPT ); Thu, 9 Sep 2021 07:54:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 40797613A4; Thu, 9 Sep 2021 11:44:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187899; bh=n94kMwFHUMe+HkJMYWMwz/mNrdLxyfQDhWM2x1S7TPk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8zS34ztJd1h4RqzJxDNKj5tDRzWMEZvV7+WsvAfGiS7U/VVM0hbVtxRACp87Ccd9 Lg12UmY7VFrzmweHCiYgYkNul0Wbyq1N7riwWAUX8ZIV2Y34cgySBXUz7MNwYdaTZ/ ZrJCSixPX8AzaHR6q2ZxKsSgkNb9g7NmUjmfcS/Up7q/pPBDo1ihiY58H+2dmmkYxs f8Lpw07DQ28r4fk4Nuk+ioB1mBRsk4qhkyM0euD4dYOggOaDc8iBqsHGeo4rty2M2r TY7KL/WNCbUGArEG1Ovr63v/RFh3UxFb0Cg0x/hMdSzRR8hmsuoXo2x5gD7HnmoPrT 5aoyUWk4qBkBw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mark Brown , Catalin Marinas , Sasha Levin , linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 178/252] kselftest/arm64: pac: Fix skipping of tests on systems without PAC Date: Thu, 9 Sep 2021 07:39:52 -0400 Message-Id: <20210909114106.141462-178-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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