From patchwork Wed Jul 17 11:10:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dev Jain X-Patchwork-Id: 13735366 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EDD0C3DA42 for ; Wed, 17 Jul 2024 11:10:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EEB5E6B00A3; Wed, 17 Jul 2024 07:10:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA7E36B00A4; Wed, 17 Jul 2024 07:10:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D89EA6B00A7; Wed, 17 Jul 2024 07:10:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BCC5D6B00A3 for ; Wed, 17 Jul 2024 07:10:35 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5BE27160A1F for ; Wed, 17 Jul 2024 11:10:35 +0000 (UTC) X-FDA: 82348976430.23.BFCE118 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf12.hostedemail.com (Postfix) with ESMTP id 8CF844001F for ; Wed, 17 Jul 2024 11:10:33 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721214593; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=o/wvfFpUHK3KB+nXFVeBNJnvwKAenCZjdZY5+mf8i4Y=; b=bgO6h72xYepZ9017xCcvaE51pYu5ca6OdWnJgEIRTq3grN7QAPpkG96Rh0NPle0eR/cFCJ wZoDSTW8AGOD/9W3hY3YwpOEZlelkon8LLeQc3jJ2ErKTSwu1pTa7CqobHJ5G2vLiEpiB4 tymmaceso90hd9ECvTw8pfaE5BU6jLM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721214593; a=rsa-sha256; cv=none; b=QeaWRxXagRMvfYoNYQRuUEDxwbNG1g0lokh3iwLPXOUoAR6siBmpsYZZ/iJWME+vmzfLCc PgDXB3PWFcksyMjPt61Li5Ki+AkTExikGvsPDNFXTRjpZvEChFi5wtB0bze+6gS5+AoQaj E4P//2/8BDmieeuVohi8EhRJC2MgRaM= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=none; spf=pass (imf12.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 047461063; Wed, 17 Jul 2024 04:10:58 -0700 (PDT) Received: from e116581.blr.arm.com (e116581.arm.com [10.162.43.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 68B0B3F762; Wed, 17 Jul 2024 04:10:29 -0700 (PDT) From: Dev Jain To: akpm@linux-foundation.org, shuah@kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Anshuman.Khandual@arm.com, ryan.roberts@arm.com, broonie@kernel.org, Dev Jain Subject: [PATCH] selftests/mm: Skip test for non-LPA2 and non-LVA systems Date: Wed, 17 Jul 2024 16:40:11 +0530 Message-Id: <20240717111011.316037-1-dev.jain@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Stat-Signature: c3cacj5ck7qtbbfzo3t7z8scpxassjpn X-Rspamd-Queue-Id: 8CF844001F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1721214633-364128 X-HE-Meta: U2FsdGVkX196/Ev4P0kbeunbUVbdY3uGZ0O4AfF/3e8q/zIvQLVMzhIhGyNAoYw3xFrjcen/ZEULFDcWBF9RLCDfRsiSKqabqxZrIDG1uvqXTGpRs/q7bLpYmJz9SlXn5mM2lW1ObGSigmUUSSPAKOJZIf913e4yrWJvPeWqRN3ghdWZ+1jwYwd0LnEVXux+XHtydLdssN7BGhAQ/YauoLRMHRoMZw2MXOAiBBjJJYqDGOh3rvZeoIyWCqPuOAjHqqoPEM6c356jVSYs+kpnJKrzupdXn2KOsbh7dcOvA9B+0TlMQXpyP4/khS2U5N1aji8GyaxguY0ydrQjEbin69VchoR+SXvcVjqnxcjVLb3W6z/nFdmdefYJKX9GoZryWecA+IWFnLVt6dqkim94I6THpQGTpDa1Wj7T/FfgRBf34be6sc6LIDeMkLQjKRtp4MvomxpTye5h9txp49UohG41X12yhRQJ4CpVBg3m+KtmnmGbiZpjURK269APPQMPSHvJCxfkPMfPwLgWuApbA+/d9jpd4LcJPZo9/eNhnYjLvcKhPXoK/6HyhvvhSddFPhOev42exvZdCvSWU97ij5/B2Q5K8KHh6dUhFTvv0bZ4fK3E2rIZnpvXyfVp/30bP+fIo7JyXg6VSx8nBUq+jTV1MXHWoOMJKCvVUOv9cHlIpHukzBFDuREZ2BddVkdmR/GI+fVL6zDKyj+tCfYc4lkHWif4odl6gRLf7P96tUgr5qQFAp30dwwF6IVjpXqAEyGLyiYPa7Wc9WbNE1PqDska1/auqOZa8i0Eqfw6l38sTSchz0JLpVOagBQ2vhHIuVG/7yvfK7EuUtf2pjVzaCUFMMGNZ9xhHfqTypPhWFnomzUJhum+rrjKVyAkukAsBCFuQygNNqw/djewtDRSNhyCl1hk5ywDJfLfqVJlB+d+hiS/p2dozklYYbtkA48iNKt1Z0bCxSSwbth7H7E 3VakvWbm onrHkVvewGRgAIWC/nsdzNDbFzxrcbenEpxDaydP7tPx1lOwMee+VPzB2xpBnZbY/MkmpymODgy7Pdvdcit4j4w3sfl1vcbtMdzjtA2FPijrvfs7WfLXahdVT77IA2mQ4149nhX+nkg0jNvEtJyETshXTsA0g17CHzJNUKgi/2Uc+vyGw7Mla/XCjkLmqvN1iKMQxQniSK2XKH8wBwVeC6HocSQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Post my improvement of the test: https://lore.kernel.org/all/20240522070435.773918-3-dev.jain@arm.com/ The test begins to fail on 4k and 16k pages, on non-LPA2 systems. To reduce noise in the CI systems, let us skip the test when higher address space is not implemented. Signed-off-by: Dev Jain Reviewed-by: Ryan Roberts --- The patch applies on linux-next. tools/testing/selftests/mm/va_high_addr_switch.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/va_high_addr_switch.c b/tools/testing/selftests/mm/va_high_addr_switch.c index fa7eabfaf841..c6040e1d6e53 100644 --- a/tools/testing/selftests/mm/va_high_addr_switch.c +++ b/tools/testing/selftests/mm/va_high_addr_switch.c @@ -293,6 +293,18 @@ static int run_test(struct testcase *test, int count) return ret; } +/* Check if userspace VA > 48 bits */ +static int high_address_present(void) +{ + void *ptr = mmap((void *)(1UL << 50), 1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1, 0); + if (ptr == MAP_FAILED) + return 0; + + munmap(ptr, 1); + return 1; +} + static int supported_arch(void) { #if defined(__powerpc64__) @@ -300,7 +312,7 @@ static int supported_arch(void) #elif defined(__x86_64__) return 1; #elif defined(__aarch64__) - return 1; + return high_address_present(); #else return 0; #endif