From patchwork Thu Jul 18 05:25:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dev Jain X-Patchwork-Id: 13736042 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 CFD1AC3DA60 for ; Thu, 18 Jul 2024 05:25:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B3F06B0089; Thu, 18 Jul 2024 01:25:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4633B6B008C; Thu, 18 Jul 2024 01:25:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 351AE6B0092; Thu, 18 Jul 2024 01:25:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 183466B0089 for ; Thu, 18 Jul 2024 01:25:23 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 89B241C1DC8 for ; Thu, 18 Jul 2024 05:25:22 +0000 (UTC) X-FDA: 82351735284.09.8B997A8 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf11.hostedemail.com (Postfix) with ESMTP id 1213A40015 for ; Thu, 18 Jul 2024 05:25:19 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf11.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721280275; 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=mbEcztvGPlnGzeXWExxTmVWpQRF2qyZ/YD7itGNcHPM=; b=EOBsfBlPYyqg9gOQV4pAW8Lw9ZQLqICRwTAIwHVSKW8lUCfzncJKuk2QInRvc49JRYlEXD jXTtrhzJasXv57r0Jl2vNmo72JiwLxTsUcGHn6kayq1RccEbE0b3M7CoK/G9zDpC7fCI3q xjZdGgTZdCXW55axB0Xmy5WCOsgwjNE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721280275; a=rsa-sha256; cv=none; b=qem/hq4ng05Aobke0MMRMUZR8PC9cxgQlNzgwACJzoCuu3b6EEtvJB4U6mlODaqjmP6FXI 0yz50PhNNDjFetQs8vo2xszjZOr25rAeJt+q7BfhHIA+l1HFqPKV+6K2BFUpSASc5Mz8Kg pJGi0JRI63ik2ifNldT2TxxOx1MCltk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf11.hostedemail.com: domain of dev.jain@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=dev.jain@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 728E91063; Wed, 17 Jul 2024 22:25:44 -0700 (PDT) Received: from e116581.blr.arm.com (e116581.arm.com [10.162.42.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BE6013F766; Wed, 17 Jul 2024 22:25:15 -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 v2] selftests/mm: Skip test for non-LPA2 and non-LVA systems Date: Thu, 18 Jul 2024 10:55:04 +0530 Message-Id: <20240718052504.356517-1-dev.jain@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 1213A40015 X-Stat-Signature: rdbac9aye3gszhnbjo4x1phodd1pb3rd X-Rspam-User: X-HE-Tag: 1721280319-708434 X-HE-Meta: U2FsdGVkX19wNCzuV2qFrtBuoSgnQm5kRQ3HMnJNDYrv17VVDISq4H/CuwhiTIzObKgVxYIkH57p7pRch8kez5u18cLEha/f0UwMP0u+cAea+sjTvyXuwAc2CQn5/FUV+2y1jcnqQyA5FyWSGeTPQdWQ9Ex0mLw4mG5r9unZLxcbvmMwMPJNHOtsECnffY9IiKh2azrJg4C+wou/mzaIDQL8GV21ERe3rRXa9MffMnQGxoU/bDU1Dt8Y9v/ypcaKNmao1Rh//nzw5Dfw/GdNua+9knuKalA8veyf3ZHbyM8vX9HSbUOMOPFExTbagN+6kwQzapM9ppsvItG0EwApo3l/dF8F5HjGV5cXUFhMkPbyftr/9Ssa2dSu3drkMABlbWyPHJnZM0WwDsR7JCgByn4xPnOwYUz1cJJG9gj/Mvu7+Oasw3a8IIamppt9wSQLnR+6siqHCTy7VSD4ARAdg9gWGY2nVrBAAQ4sSw/MU3apUOaQ4KUCVqgwdlo+h7HQ27NdfvculhTSTfJxxKSculYaTNnltj/HS+CpPjL93ITMs8ziZwuE5ei15jseUbqS1MKmOM+HcwkWeyUvZyG51aeClUmhiiaXuOi83yXxbYCsC96bu0JlfOX6VqD1kcBfiu+0ZLO2icYIFgjrw0mJqhCnH536Rab+A4ng87TCEnDhebYRvQxNHs+814gTel5x1tFbcF4BMlYKuJM62z3jncTiZ33BJdaezd6aBBFg4l63gVAJMUEMU7O0nDRJ3kU1QVGoZiHR8f42rN5O79ZEk2+Ua6B1vXARewRNMpX50aX3koUuxCJryTqIe4Dd6AG37VovSK3qldTq0SMscnU8poLqOsP2Ph0iUmXj4EedlgB0wwo5zy+pdfiCs+jZoi7KKUmY2Ygg6OpDIOaOtKuOJ4s0t6sskE+K39a45yXn5Xf8BeAkHVGesagttzQR0qRZhRB9X2sQD2fOZjOUFmg CQg/BJX7 FyKO52mnwYIv/dzwCEW7FRKtpfnjZ7Xqbo7reChNEPq4dx7/1lZXyKz3YYkDh5xmuTFpfsJfeIc0V3V68WMOYoeOPvySt67LY8nKXqWmLh547AA1BPIwEabU9AfaD2bUVdi7wAPX13zpFDzn3oYOd7TtV/mzRDPmCXciTKtSlwwXFpxTCsmeGkDYQPEI/rgR5ShF0gPH51RjRJB/3lvy+pIsGeQ== 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. v1->v2: - Guard with ifdeffery to prevent compiler warning on other arches Signed-off-by: Dev Jain Reviewed-by: Ryan Roberts --- The patch applies on linux-next. tools/testing/selftests/mm/va_high_addr_switch.c | 16 +++++++++++++++- 1 file changed, 15 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..896b3f73fc53 100644 --- a/tools/testing/selftests/mm/va_high_addr_switch.c +++ b/tools/testing/selftests/mm/va_high_addr_switch.c @@ -293,6 +293,20 @@ static int run_test(struct testcase *test, int count) return ret; } +#ifdef __aarch64__ +/* 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; +} +#endif + static int supported_arch(void) { #if defined(__powerpc64__) @@ -300,7 +314,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